Add files

This commit is contained in:
Mario Fetka 2017-04-22 12:53:48 +02:00
parent 0c8af0ce51
commit 9c418678f6
50 changed files with 69477 additions and 0 deletions

BIN
binary/Linux/lsiutil.x86_64 Normal file

Binary file not shown.

BIN
binary/Solaris/lsiutil.i386 Normal file

Binary file not shown.

Binary file not shown.

BIN
binary/dos/lsiutil.exe Normal file

Binary file not shown.

BIN
binary/efi/lsiutil.efi Normal file

Binary file not shown.

BIN
binary/efi/lsiutil32.efi Normal file

Binary file not shown.

BIN
binary/efi/lsiutil64.efi Normal file

Binary file not shown.

BIN
binary/windows/LSIUtil.exe Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

861
changes.txt Normal file
View File

@ -0,0 +1,861 @@
Changes for 1.70:
Enhancement Request:
- SCGCQ00440706 LSIUTIL Utility modification for New Gen3 Product name labels and fixing for incorrect Gen3 SAS uEFI version reporting.
- SCGCQ00438328 lsiutil - add support for inband expander CLI
- SCGCQ00468538 NetApp functionality to limit LUN Scan
- SCGCQ00467946 LSIUTIL on SPARC support
Defects :
- SCGCQ00425049 LSIUTIL: EFI BIOS Erase Hang
- SCGCQ00438322 lsiutil 1.69 does not report the correct Device ID information for Gen 3 adapters
-----------------------------------------------------------------------------
Changes for 1.69:
- Added Support for SAS3 Linux Drivers
- Fixed bug were OS names for drives > sdz were not displayed (on Linux)
-----------------------------------------------------------------------------
Changes for 1.68:
- Fix in option 16 output. Added device type decode of STP target and added
fix to make sure undecoded device types will print nothing in the 'type'
field rather than the value from the last successfully decoded device.
- Added support for creating raid volumes on drives greater than 2TB
Modified method docreatevolume2()
- Added support for creating raid volumes with 4k drives on MPI2 and MPI2.5
controllers. StripSize will be set to zero to let firmware calculate it.
- Modified source file copyright information
-----------------------------------------------------------------------------
Changes for 1.67:
- Updated to MPI2 2.00.XX header files (MPI2.5 rev B). Includes support
for identifying SAS3XXXX devices. MPI2.5 support for DOS and EFI are not
supported at this time.
- Added option 25 for Power Management settings to contain the MPI control
message, get IOUnitPage7, and get/set SasIoUnitPage8.
- Added sub-option 60 (change RAID rate) to the RAID actions menu (option 21)
- Added option 71 to decode Flags and DeviceInfo for SASDevicePage0
for each device attached to the adapter.
- Modified the Alta programming/display algorithm (Option 58, sub-option 1 & 2)
to allow for 16 character serial number and part numbers (per the spec).
Also added the global flag option to prompt for errors created by a
non-existent SAS Address in the parameter file. (use lsiutil -g to turn it on).
- Fixed SAS Address programming in option 44 to program a sequential address
for each PHY (as opposed to only programming PHY[0]).
- Add support for the LSI SAS3 expander in the following areas:
- Support for resetting the expander (main menu option 20 (diagnostic menu)
-> option 98 (Reset Expander))
- Support for firmware image signature checking to help validate a firmware
download image matches the correct expander type (main menu option 20
(diagnostic menu) -> option 20 (Expander firmware download))
- Support for the SAS3 expander when specifying 'all' as the expander to
update in the expander firmware download option (allows update of all
expanders (of the same type) in a domain at once).
- Support when doing a manufacturing image update via the expander firmware
download option or when using the option to modify expander mfg image
fields (main menu option 20 (diagnostic menu) -> option 27 (Change
SAS2/SAS3 Expander Manufacturing Data Fields)).
- Added WarpDrive recognition
- Added support for new Windows XP driver name.
- Added option 72 to store SC information (MPI2.0-only)
-----------------------------------------------------------------------------
Changes for 1.66:
- Updated to MPI2 2.00.18 header files (MPI2 rev Q). Includes support in
option 67 and 100 for newly refined config pages as well as device ID
recognition updates.
- Added the ability to decode the raw timestamps in option 35 (display HBA
firmware logs) into a readable format. The default behavior is unchanged
from previous releases. Invoke lsiutil with the '-g' flag to enable a
prompt in option 35 for doing the decoding.
- Modified command line argument checking to return appropriate error codes
(EINVAL, ENODEV) for incorrect parameters rather than success.
- Modified doIndentify() for SAS to upload the firmware from the backup region
rather than active. This allows for image verification after firmware
download without first resetting adapter.
- For read/write tests replaced the NCR pattern with a random one.
- added some improvements to SCSI error handling, especially check conditions
to be more generic and catch more errors.
- Updated option 20, sub-option 16 (Issue product-specific SAS IO Unit Control)
to work with SAS GEN2 HBAS.
- For DOS/EFI, fixed the startup error message seen with recent SAS GEN2 HBA
HBA firmware (mpt_receive_data failed, IOCStatus = 0020 (Invalid Action))
- Improved HBA detection under EFI for some platforms without PCI dual
address cycle support.
- For option 65 (SAS UART Debug Console), changed the default buffer size to
1MB (on Windows default is now calculated based on the MaxSGList driver
registry parameter). The user is no longer prompted for a buffer size to
allocate by default. To enable the prompt for buffer size invoke lsiutil
with the '-g' flag.
- fixed an issue with displaying hidden RAID devices (in option 8 output)
for inactive volumes
- In option 43 (Diagnostic Buffer actions), updated the ProductSpecific
parameters (debug masks) in the Register option to support 64-bit values
for MPI2.
- In option 21, sub-option 1 (Show Volumes in the RAID actions menu) fixed
interpretation of data scrub to properly indicate whether it is allowed
rather than to mean that it is "in progress".
- Under Linux resolved the warnings to the system log indicating lsiutil
'tainting' the system due to mmap() slowpath on kernels 2.6.27 and later.
- Fixed an issue with a SAS2308 HBA being reported as a SAS2208.
- For option 20, sub-option 30 (Inject media error in the Diagnostics menu),
improved the error handling and added support for sending WRITE LONG(10)
with WR_UNCOR set which will get translated to ATA WRITE UNCORRECTABLE EXT
for SATA drives.
- Removed menu item 6 (Download SEEPROM) and menu item 7 (Upload SEEPROM) for
SAS products since they were not applicable.
-----------------------------------------------------------------------------
Changes for 1.65:
- For SAS2 HBAs, add support for target IDs greater than 255. Also optimized
option 8 (scan for devices) under Linux and Windows to only scan for devices
in the range of targets the firmware indicates exists based on devhandles.
- Added a -8 command line argument to limit the number of LUNs scanned to 8
instead of the default of 256.
- Fixed option 42 (Display OS device names) for both Linux and Solaris for
SAS2 HBAs.
- Fixed option 42 (Display OS device names) under Linux when using kernels
2.6.31 and later.
- Fixed option 42 (Display OS device names) for IR RAID Volumes under Linux.
- Fixed a display bug in the output of 'Show physical disks' (RAID Action menu
item 2). The devhandles for the disk paths should now be output correctly.
- Increased the chip reset delay under DOS and EFI to 50ms (up from 20ms).
- Changed the DOS/EFI driver to correctly use the default descriptor rather
than SCSI IO descriptor for RAID passthrough requests.
- Fixed the NVDATA "wrong board" warning for SAS2 HBAs when downloading
firmware.
-----------------------------------------------------------------------------
Changes for 1.64:
- Updated to MPI2 2.00.13 header files. Includes support in option 67 and
100 to print the newly defined config pages. Also includes the 2208
device ID recognition.
- Updated to MPI1 01.05.20 header files. Minor changes only, this has no
functional impact.
- Added a new expert main menu option 65 ("SAS UART Debug Console") which is
available for SAS2 HBAs. Running this option prompts the user for how
large a buffer to reserve for command responses as well as whether they
would like to log the output to a file. After this, the user is given a
'%' prompt to enter commands, mimic'ing the UART console. The user can
type 'exit' to return to the normal lsiutil menu.
Standard '-a' scripting of this console feature is available as well. For
example, the following command line will start lsiutil using the second
HBA port found, start the UART console, and execute the "iop show diag"
and "exit" commands before quitting:
# lsiutil -p 2 -a 65,,,"iop show diag","exit",0
- Added a few improvements for working with LSI SAS2 expanders (Bobcat):
o Recognize the buffer IDs for bobcat firmware images and manufacturing
data so a warning is no longer printed when updating.
o Enhanced the expander firmware download (diagnostic menu option 20) to
distinguish between LSI SAS1 and SAS2 expanders if the 'all' option
is used to update all expanders in the domain and there is a mix of SAS1
and SAS2 expanders. In this case, the user is given the option of which
type of expander to perform the update on. NOTE: that there is no
support to differentiate between different platforms within the SAS1 or
SAS2 space. So, for example, if there is a mix of SAS1 expanders that
require different firmware images, the 'all' option will provide no
protection against putting the same firmware image in all the expanders.
o When using expander firmware download (diagnostic menu option 20) to
update the manufacturing image for an LSI SAS2 expander, lsiutil will
fetch the current SAS address, Enclosure Logical ID, and Ethernet MAC
Address from the expander as well as from the image file provided by the
user and then for each field, prompt the user on whether they would like
to use the value in the supplied manufacturing image (the default),
preserve the existing value already in the expander, or override the value
on the spot.
o Added a new expert level menu option 27 under the diagnostic menu
(option 20 from the main menu) called "Change SAS2 Expander Manufacturing
Data Fields". This option will retrieve the current manufacturing data
from the selected LSI SAS2 expander and then display to the user the
current SAS Address, Enclosure Logical ID, and Ethernet MAC Address and
allow the user to enter new values for any of these fields. The new
values are then written back to the expander, to take effect after the
expander is reset.
- updated the chip recognition for all current LSI MPT chips/revisions.
- Fixed event reporting (option 43) for SAS1 HBAs under SPARC Solaris.
- updated the vi settings to reflect use of spaces rather than tabs.
- minor change to the max target calcuation to make it more accurate.
- For option 17 (show expander route tables) added a check for whether
PHY_VACANT was returned and if so print a 'V' instead of a routing
attribute since the actual routing attribute is not available.
- For option 67/100 (Dump all port state) added a check for config pages
returning more than 255 DWORDs. For such config pages, truncate the output
and print a message indicating that the output was truncated.
- miscellaneous formatting and minor display bug fixes
- changed the DOS/EFI MPT driver to register as a BIOS rather than HOST
driver for SAS2 HBAs. This causes the HBA firmware to handle device
registration and events without help from the driver. This change allows
for things like RAID volume re-sync to restart after a drive hotplug.
-----------------------------------------------------------------------------
Changes for 1.63:
- All tabs in the source code have been changed to spaces. For this release
only, *_tabified.c variants of the source code are provided which include
all of the changes since 1.62 except for the tab->space conversion.
- Moved the Solaris binaries to a single directory. lsiutil.sparc is the
SPARC binary and lsiutil.i386 is the X86 binary.
- updated MPI headers to 2.00.11.
- Added support for the magic number change in the SAS gen2 Linux driver.
This means that version mpt2sas-01.255.01.00 or later is required to
work with this release of lsiutil.
- Fixed display current events (option 40) for gen2 SAS HBAs.
- Added new menu option 58 (SAS only) for Alta diagnostics.
- Added support for the lsi_gen2 Windows XP driver.
- Added support for the mpt_sas Solaris gen2 SAS driver.
- Added support in the expander firmware download option to accept 'all' as
a valid value when prompted for the expander to operate on. This will
cause the image to be sent and verified for all expanders in the list.
- Added support in the expander firmware download option to poll for interim
completion statuses when download microcode used as well as include
the additional status if the update fails.
- Added two new expert mode options to the diagnostics menu,
'Display expander log entries' (option 25), and 'Clear (erase) expander
log entries' (option 26). Currently only gen1 (Yeti) expanders are supported.
- For all SMP requests, now setting 'Allocated Response Length' to 0xFF.
- Added support for the 'Show Volumes' and 'Get Volume State' options for SAS
gen2 IR to display inactive volume reason.
- Fixed a bug when printing Incompatible and Offline Reasons for gen2 SAS IR
phys disks.
- Made changes to routines that use RaidConfigPage0. Fixes segmentation fault
when activating a foreign volume with gen2 SAS HBAs.
- Added a retry mechanism when config page requests return MPI_IOCSTATUS_BUSY.
- Fixed a bug in displaying log entries (option 35) in which one DWORD was
not being displayed.
- In diagnostic menu option 2 (WriteBuffer/ReadBuffer/Compare Test) added
support for all the same patterns that the Write/Read/Compare test (option 4)
supports and added expected/actual printing when miscompares found.
- Fix handling of devices with T10 DIF (EEDP) enabled.
- In doIdentify, don't use the "actual image length" returned by the SCSI
firmware since it is not trustworthy.
- In doDisplayLoggedInDevices, if the port device is not returned when reading
device pages, use the port page to provide the missing information.
- When displaying OS device names under Linux, add use of O_NONBLOCK to the
opens() to avoids hanging in some situations.
- For option 56 (Read/write expander memory), added support for the x12
expander via support for the ring format LSI SMP.
-----------------------------------------------------------------------------
Changes for 1.62:
- Updated to use MPI2 header files 2.0.0.10. This means the minimum
requirements for using this version of lsiutil with gen2 SAS HBAs is
firmware version 00.250.16.00, Windows driver 2.00.00.17 and Linux driver
00.255.05.00.
- Added support for diagnostic trace buffers (option 43) for gen2 SAS HBAs.
- Fixed a bug with displaying log entries (option 35) for gen2 SAS HBAs.
- Added three new RAID actions (option 21) for gen2 HBAs. Volume consistency
check, Stop volume consistency check, and Online Capacity Expansion. These
are RAID Action menu options 34, 35, and 36 respectively.
- Added support for in-band resetting of bobcat (gen2 SAS) expanders (menu
option 20, sub-option 98).
- For gen2 IR changed coerced size to come from firmware.
- For gen2 changed port->maxTargets to be based on MaxDevhandle+MaxVolumes
rather than MaxTargets.
- Fixed a bug with processing VPD files under EFI. The sscanf() routine in
helper.c was missing support for %c.
-----------------------------------------------------------------------------
Changes for 1.61:
- Update the data structures for bus/target to devhandle mapping to use 32-bit
target and bus IDs. This affects SAS gen2 driver interaction. This release
requires at least version 2.0.0.16 of the LSI_SAS2 Windows driver and version
00.00.02.19 of the Linux mpt2sas driver.
- Increase timeout for task management requests from 30 to 60 seconds
- Fix a bug that could lead to attempting to double close the log file and
cause a call to free() to fail.
- Fix option 18 for SAS gen2 HBAS (changing the wwn).
- Fix link speed detection for SAS gen2.
- Fixed bug for SAS gen2 that could cause lsiutil to send requests with a
devhandle of 0xffff.
-----------------------------------------------------------------------------
Changes for 1.60:
- fix bug in doDeleteVolume2 for setting the volume dev handle in the RAID
action request.
- Add option to use default settings on volume creation.
- Changed default stripe size to 128K
- fixed a build error that occurred if REGISTER_ACCESS was set to 0 at
compile time.
-----------------------------------------------------------------------------
Changes for 1.59:
- Add code that determines BIOS/FCode compatibility for first MPI 2.0 chips.
- Add "Dump PCI config space".
- Modify code that allows changing SAS persistent entries, to handle changing
a set of mappings from one EnclosureId to another EnclosureId.
- Enhance display of expander routing tables to accommodate the SAS 2.0
committee changing the opcode for REPORT EXPANDER ROUTE TABLE LIST from
17h to 22h.
- After displaying diagnostic pages, don't ask about making changes except for
page numbers that are known to be writable.
- Make modifications to the RAID volume creation code to take drive minimums
from config pages, rather than hard-coding them. Also, allow selecting a
stripe size for any volume type except for mirrored (RAID1) volumes.
- Add ability to send QUERY TASK and ABORT TASK to the "Reset target" routine;
this is not the ideal place to put them, but it's the best of the current
alternatives. No allowance is made for specifying the identity of the task
to be queried or aborted; the intent is that these will be used merely to
verify that such requests can be issued (not that they'll be successful).
- Add some missing config pages to "Dump all port state".
- After resetting the chip (DOS/EFI), wait 20 milliseconds before making any
chip accesses, per the MPT specification.
-----------------------------------------------------------------------------
Changes for 1.58:
- Add option 66, "Show SAS discovery errors".
- Fix bug introduced in 1.57 that broke option 13 for SAS.
- Fix bug introduced in 1.56 that made diagnostic buffer actions appear to
fail for Windows, when in fact they had actually succeeded.
- Fix options 8, 13, 16, 18, 33, 35, 44, 68, 80, and 81, to accommodate
differences between MPI 1.x and MPI 2.0 (the new link speed of 6.0 Gbps
being the most prominent one).
- Modify expander firmware download to allow boot records (BufferID 10) to
be headerless. If a header is needed (mode 2), but is not present, add it.
If a header is not needed (mode 6), but is present, remove it. Also fix
verification code to be more robust.
- Fix MPI 2.0 bug that caused duplicate devices to be shown on Windows during
a device scan.
-----------------------------------------------------------------------------
Changes for 1.57:
- Implement RAID actions for MPI 2.0, and implement "Delete hot spare".
- Add Linux support for MPI 2.0.
- Modify NVDATA concatenation code for latest MPI 2.0 firmware changes.
- When downloading expander firmware, if mode is 2, use Write Buffer, but if
mode is 6 or 7, use SES Download Microcode. Before downloading, verify the
image for Buffer IDs 0, 2, and 10.
- For SAS, add "Force full discovery".
- Add "Identify FLASH device".
- Fix more endian problems, by adding code that allows the compiler to detect
them automatically.
- Skip verification after firmware download when the special bridge firmware
(1.18.99) is being used.
- Fix the multi-path detection code (used when creating volumes), which was
reading enclosure pages incorrectly.
- Fix the code that handles metadata size, to use ManufacturingPage4 instead
of IOCPage6 (the former can be modified, while the latter cannot).
- After reading diagnostic pages, allow the data to be modified and the page
written back.
-----------------------------------------------------------------------------
Changes for 1.56:
- Implement -k flag to suppress the "select a device" mechanism for many
diagnostic functions, and instead allow directly entering bus and target
numbers.
- Fix the -h (help) display, which got broken when paging was implemented.
- Add some routines to help debug expanders (read/write expander memory,
read/write expander ISTWI devices, expander firmware download, expander
reset).
- Implement all of the diagnostic buffer actions for Solaris (a new driver is
required). Also, when any diagnostic buffer action fails, display detailed
information if it's available.
- Don't try to verify a firmware download for SAS if only a bootloader image
is active; the required "firmware upload" support is not implemented.
- Fix endian issues in various places.
- Fix the code that was trying to detect multi-pathed disks when creating RAID
volumes; it was not correctly determining whether two enclosures were in fact
the same enclosure.
- In the "Log Sense" and "Diagnostic Page" tests, make the buffer larger, and
check for the device returning more data than requested.
- When working with RAID physical disks, consistently use the physical disk
count that is in IOCPage3, vs. the one in IOCPage2.
- Add path information to the display of RAID physical disks, whenever there
is more than one path.
- Enhance "Scan for devices" to also show (hidden) RAID physical disks.
- Fix the Solaris code that determines device names, to handle SCSI Enclosure
Services (SES) devices, and to handle SAS disks with long GUID-based names.
- For "Send SMP request", if the handle entered is 0, prompt for SAS WWID and
physical port to be entered manually.
- Fix bug in "Send SCSI CDB" that caused loss of detailed failure information
(including SCSI status and, if there was a Check Condition, any sense data).
- More MPI 2.0 work: add a real list of supported devices, fix the expander
routing table display code, fix the SATA Clear Affiliation code, fix SCSI I/O
reply handling to correctly obtain sense data.
- Fix a bug in the EFI implementation of scanf(): %n did not work correctly.
-----------------------------------------------------------------------------
Changes for 1.55:
- Extend paged output in menus to cover all output in all circumstances.
- Make the maximum number of devices shown in menus compile-time configurable,
with the default remaining at 99.
- Add the ability to turn off MPT register access at compile time, since this
causes crashes on some Linux standalone platforms.
- Accommodate more differences between MPI 1.5 and MPI 2.0 (in SCSI I/O replies
and event handling). Also, for MPI 2.0, use the BTDH IOCTL to get the driver
mapping between bus/target and device handle.
- When the -g flag is used, ask if the fwdiagtool header should be added when
doing diagnostic buffer reads.
- Have options 15, 17, and 20 automatically bring the port online under DOS and
EFI.
- Expand the PCI information printed to include the segment number.
- Add verification after firmware downloads (read the image back, and compare
with what was written).
- When creating RAID volumes, correctly enforce rules about mixing SAS and
SATA drives, and SSD and non-SSD drives. Also, use the metadata size that
is specified in IOC Page 6.
- Fix code that implements setting the volume name (string length check was
wrong, and volume addressing was wrong).
- When deleting a the last volume, delete any hot spares that remain; otherwise
those physical disks are left stranded.
- For Solaris, use an IOCTL to get the driver name and version. Use that same
IOCTL to get PCI information; only if that fails should the "reg" property be
used to get PCI information.
- When dumping config pages, dump SAS Expander Page 1 correctly (there is one
page per expander phy), and fix its name (it was called "SASDevicePage1"!).
- Implement the new changes for MPI 2.0 NVDATA concatenation. Add IOC Page 8,
BIOS Page 4, and Driver Mapping Page 0.
- Add MPI 2.0 support to the DOS/EFI driver.
- Add "Read Buffer (for firmware upload)" to allow reading back device or
expander firmware and saving into a file.
-----------------------------------------------------------------------------
Changes for 1.54:
- Fix concatenation bug that caused invalid SAS firmware files to be generated
- Catch error if no file name is entered for option 15, suboption 8
- Add ability to issue product-specific SAS IO Unit Control and Diag Data
Upload requests
- When modifying SAS IO Unit settings, if "all phys" is selected, the default
should be to preserve existing settings per phy, rather than overwrite with
new settings
- Handle self-configuring expanders when displaying expander route tables
- When setting a volume name, use the new RAID action
- Change the display of PCI location information to include the segment number
- Allow SMP requests and responses to be up to 1024 bytes (per the SAS spec)
- Fix problem where the maximum target allowed is less than expected, so some
targets can be missed in a scan
- Add preliminary parsing of MPI 2.0 NVDATA
-----------------------------------------------------------------------------
Changes for 1.53:
- Add initial support for MPI 2.0
- Add -q switch, to query files for version information
- Add -g switch, to guarantee asking of questions that otherwise would be
suppressed (such as the bus number, when there's only one bus); this makes
it easier to script lsiutil from Perl
- Rework the way that ports are found under Solaris, to eliminate what are
sometimes lengthy delays waiting for prtconf to run -- the new code uses
the devinfo library to directly walk the device tree
- Fix memory leaks when using the -j switch (ports not selected were not
being closed), and when using options 18 or 44
- Add "Set SAS phy offline/online"
- Add ability to save persistent mappings to a file, then later restore them
- Add "Diagnostic Page Test", which reads any SCSI diagnostic pages
- Add code to enable or disable the read or write caches in SCSI devices
- Fix incomplete implementation of "Force firmware to fault (with C0FFEE)"
- Add verification of internal FCode checksum
- Add verification of PCIR image length
- Extend "Inject/Repair media error" test so that it works for SATA devices
- When downloading drive firmware, set default mode to 5 for SATA devices
- Fix bug in "Show physical disks" that assumed physdisk numbers were dense
- Detect multi-pathed disks when creating RAID volumes, and suppress their
inclusion in the device list
- Add code to allow binary files to be written when dumping chip locations
(the -g switch must be used for force the question)
- Fix an endian bug when dumping chip locations below 0x10000000
- Modified SAS phy/link reset code to ask for a device handle, so that remote
phys or links (i.e., on expanders) can be reset
- For DOS/EFI, avoid issuing Port Enable if possible, since that request can
take a long time to complete
- Change method of checking for "context reply" after SCSI request passthrough
under Windows, from looking for a specific MsgContext value, to looking for
the reply's MsgLength being zero
- Add retries under Linux if an IOCTL fails with EAGAIN
- Increase size of DOS/EFI scratch buffer to 1 MB (from 64 KB) to accommodate
large drive firmware downloads
- When exiting on DOS/EFI, don't reset a port that was not brought online
-----------------------------------------------------------------------------
Changes for 1.52:
- Make changes required to allow an EBC version for EFI
- Make changes required to allow native 64-bit IA64 and AMD64 versions
for Windows
- Modify Linux workarounds for IOC_INIT (needed to write Manufacturing
config pages)
- For Solaris, modify findPorts() to first use "prtconf -D", and then as
a fallback, use /etc/path_to_inst, so that working ports can be more
accurately identified
- Fix several big-endian bugs in the RAID-related options
- Don't print a stripe size for IM volumes (it's not valid like it is for
IME and IS volumes)
- Add support for a few new FC Management toolbox functions
- Rewrite getOsDeviceName() for Solaris, so that FCA devices are handled
as well as SCSA devices
- Fix an off-by-one message when complaining about incorrect VPD end tags
- Enhance SAS NVDATA parser to handle version 2D
- Support NPIV for FC by adding a -v switch (to identify which virtual
port to masquerade as)
-----------------------------------------------------------------------------
Changes for 1.51:
- Add date/time stamp when logging to lsiutil.log
- Add "SEP (SCSI Enclosure Processor) Test"
- Add "FC management tools"
- Add "Force firmware to fault (with C0FFEE)" for SAS
- Add "Report LUNs Test"
- Fix dumping of memory regions to work with FC919/FC929
- Increase chunk size for firmware download/upload, for DOS only
- Allow Sun's mpt driver to work (for Solaris)
- Fix endian bugs in firmware download when checking for 1MB/2MB issues
- Dump enclosure pages when displaying attached devices for SAS
- Add checks for maximum physical disks in a volume
- When creating a volume, allow user to specify "no initial sync"
- Display FC WWNs and SAS WWID as part of -i (aka option 68)
- Add FC949E A2, 53C1030T A2, SAS1064E B3, SAS1068E B3, and 1078 C2 chips
-----------------------------------------------------------------------------
Changes for 1.50:
- Rearrange some source files to allow easier building on Windows
and Solaris
- Add ability to set individual bits, bytes, words, when modifying config
pages (e.g., when prompted for a value, type "bit3=1", or "bits7:4=2",
or "byte2=17")
- Add "Show expander routing tables"
- Add "Disable/Enable drive firmware update mode" to RAID actions
- Add "Display Log entries" and "Clear (erase) Log entries"
- Add "Upload FLASH section"
- Add "Display version information"
- Add "Display/Program chip VPD information"
- Add back deleting of persistent entries for SAS, and add "Change
Bus/Target of a existing mapping"
- Add code to firmware download that handles the SAS phase 8 to phase 8
bridge firmware image (version 1.18.99)
- When erasing the BIOS, fill with FF rather than 00 to match the FLASH
erase pattern
- Add ability to control booting under EFI for "Change FC Port settings"
- Modify "Change WWID" code to allow for variable-sized config page
- Under DOS or EFI, after any RAID action, sleep for 5 seconds to allow
drive metadata to be updated (if necessary)
- Use the Memory Move toolbox tool to allow "Dump chip memory regions" to
be able to dump tightly-couple memory for SAS and FC
- Beef up the display of SAS control settings in "Dump all port state"
- Display IOCLogInfo value for any RAID action request that fails
- Enhance concatenation to handle NVDATA versions 25, 28, 29, and 2B
- Properly return Check Condition Sense Data under DOS and EFI
- Switch DOS code to use memory space instead of I/O space, whenever
possible
-----------------------------------------------------------------------------
Changes for 1.49:
- Fix build issues with latest SLES10/RHEL5 drivers
- Add -j <type> to allow selecting just FC, SCSI or SAS ports
- Add doWaitForResync (RAID action)
- Add doRemoveSasDevice
- Fix -b and -r to obey -p, -0, and -1
- Fix port and driver naming under Windows StorPort drivers
- Add 1 MB to 2 MB migration code for SAS (phase 9), DOS and EFI only
- Fix doCreateVolume to obey volume member limits
- Remove all tabs from output, replace with spaces
- Add parsing of NVDATA version 28
-----------------------------------------------------------------------------
Changes for 1.48:
- Add -w, -ww, and -www flags to capture debug output
- Add -x flag to concatenate SAS firmware and NVDATA files
- Switch from using PortType as a selector, to ProductIdType
- For DOS and EFI, make sure port is ready for each new option
- For ports stuck in reset, don't prompt for a firmware file unless and
until the port is selected
- For EFI, do a firmware upload to handle FWDLB cases (no FLASH)
- Add paged menu mode
- Move "Beacon on/off" to be FC-specific
- Add "Erase non-volatile adapter storage"
- Add "Diagnostic Buffer actions"
- Add "Program manufacturing information" for FC and SAS
- Add "Set personal WWNN/WWPN" for FC
- Add "Send SCSI CDB"
- Remove most persistence actions for SAS, as they no longer are supported
by firmware
- Add "Inject/Repair media error"
- Add "Set/Clear write protect"
- When downloading SAS firmware, make sure the attached NVDATA is correct
for the port's board type
- Fix SAS firmware validity checking to correctly detect wrong chip type
and wrong chip revision
- Allow setting/clearing Native Command Queue Disable and SATA Write Cache
Disable for SAS
- Allow "Read/Write/Verify Logical Blocks" to touch individual volume
members, just like "Inject/Repair media error"
- Fix incorrect ordering of LBA High/Middle/Low parts in "Send SATA
request"
- Add dumping of VPD data (Manufacturing Page 1), if non-zero, to board
info display
- Fix incorrect defaulting of FC's HostSCSIID (15 is no longer correct)
- Fix EFI code to truncate files properly
- Fix EFI code to use I/O space properly, if required (1030/1030T)
- Fix DOS code to not enable chip interrupts (caused a hang while exiting
on some platforms)
-----------------------------------------------------------------------------
Changes for 1.47:
- Add support for EFI
- Add a workaround for older Linux mptbase drivers (fix IOC_INIT failing)
- Add doWriteLogicalBlocks and doVerifyLogicalBlocks
- Add generic SATA passthrough
- Allow -b (showBoardInfo) in combination with any other arguments
- Increase range of Initiator Device Timeout value, by using the
supported scale factor (x16) if necessary
- Allow setting the Device Missing Report Delay and Device Missing
I/O Delay values
- Fix a bug in configuring wide ports
- Add support for RAID Volumes of size > 2 TB
- Add missing config pages to doPortStateDump (-d)
-----------------------------------------------------------------------------
Changes for 1.46:
- Add -0 and -1 options, to skip IOC numbers 0 and 1, for certain
operations (so, lsiutil -1 99 would only reset each chip once)
- Enhance display to show IOC number (same as PCI function number)
- Check to see if the firmware is in Operational state before trying the
first MPT command, to avoid causing a chip reset if the firmware is in
Fault state (if so, option 99 will perform a chip reset, if desired)
- Fix code that obtains MPT register addresses for Linux (was broken for
some systems with 2.6 kernels)
- Fix code that displays operating system device names for Linux (was
displaying incorrect names for some SAS and FC devices whose SCSI
bus/target numbers were not equal to their MPT bus/target numbers)
- Move code that enables MPT register access inside the loops for options
51 and 52, so that access continues to work even if the chip is reset
- Add display of IOCFactsReply and PortFactsReply to port state that is
dumped by -d, and only display FC Port Page 3 pages that are valid
-----------------------------------------------------------------------------
Changes for 1.45:
- Fixed get2bytes/get3bytes/get4bytes macros to properly truncate
- Fixed formats for 64-bit integers when printed (Windows is different)
- Added doDriveFirmwareDownload
- Added doDisplaySfpPages
- Added doDefaultPhyRegsSettings
- Extended event displaying to Linux and Solaris
- Added some control over port configuration in doSasIoUnitSettings
- Reworked getOsDeviceName slightly for Linux and Solaris
- Fixed bug in doPortStateSummary which reversed Yes and No for
SSP Initiator Enabled and SSP Target Enabled displays
- Added support for FC949E A1
- Fixed Linux version of doMptCommand to correctly gather Sense Data
-----------------------------------------------------------------------------
Changes for 1.44:
- Upgrade to 1.05.13 MPI headers
- Add doReadLogicalBlocks and doDisplayOsDeviceNames
- Add EEDP support
- Add an optional duration to the monitor frequency (-m f,d)
- Add "reset port" option to all submenus too
- Don't send quiesce/unquiesce RAID actions to SAS IR (not supported)
- Don't coerce RAID volume size if it's small (less than 1 GB)
- Add SAS1068E B1 as a known device
-----------------------------------------------------------------------------
Changes for 1.43:
- Add Clear ACA (option 24)
- Fix a Linux buffer overrun that caused only the first port to be
discovered for some architectures
- Fix ManufacturingPage2 checksum offset for FC949E
- Guard against divide-by-zero when displaying volume resync percent
- Prevent a target from being chosen twice when creating a volume
- Add the flag that deletes PhysDisks when deleting a Volume
- Fix a DOS bug (internal buffer corruption) by rearranging the order
of operations when starting a new command -- bring the chip online
first, before loading the scratch buffers
- Correctly set RequestDataLength to NOT include the CRC bytes, when
sending hand-built SMP Passthrough commands
- Add a hardware workaround for the FC949E to the Firmware Download Boot
code for DOS
- Fix Adapter Reset for SAS1078 (DOS only)
-----------------------------------------------------------------------------
Changes for 1.42:
- Add Log Sense Test
- Add SATA SMART Read Test
- Add Create Hot Spare
- Add Send SMP Request
- Add support for the 1078
- Change number of LUNs probed to 64 for FC and SAS (leave SCSI alone)
- In doFcPortSettings, preserve original HardALPA setting if user quits
- Fix endian issue when creating volumes (default settings were incorrect
for SPARC and PowerPC)
- Fix typo in doPhysDiskSettings that used the wrong Action value
- Ignore IOC Page 3 in doShowNonDefaultSettings
- Ignore LOG pages in doRestoreDefaultSettings
- Fix DOS MPT driver to not poll the Doorbell while DMA is active
-----------------------------------------------------------------------------
Changes for 1.41:
- Fix build errors on some Linux systems
- Filter out bad "what" strings (any of the first 4 characters are bogus)
- Fix missing 50/51/52/53 from main menu on Linux systems
- Add checking for 1064 A3 SAS firmware images
- Use current config page data if non-volatile data is invalid
- Add "Read Default Write NVRAM" to "Test configuration page actions"
- Resolve SAS firmware hang by not reading LOG page types
- Remove IO Unit Page 3 from "Restore default settings"
-----------------------------------------------------------------------------
Changes for 1.40:
- Added MPT and chip register access for Linux
- Added doShowNonDefaultSettings and doRestoreDefaultSettings
- Fixed commands to consistently check for errors
- Added check for overflow of volume size when creating a volume
- Fixed "free" calls in doDisplayCurrentEvents
- Added retries around Windows IOCTL calls, to handle BUSY status
- Added warning message if any Linux IOCTL call is rejected
- Added speed/width negotiation to DOS driver for SCSI
- Added a watchdog timer routine to DOS driver to catch faults
- Fixed firmware download boot for 929X in DOS driver
-----------------------------------------------------------------------------
Changes for 1.39:
- Add DOS support
- Add 949E support
- Add MPT register access and chip register access
- Move diag_targets[99] from stack storage to global storage
- Add Read Block Limits (like Read Capacity but for tapes)
- Initialize memory after allocation, always
- When menu options are picked from -a, don't print the menu itself
- When showing current firmware version, print both hex and decimal
- Fix bug in displaying phy error counters that nearly always hid errors
- Allow 2-member IS volumes (previously, 2-member volumes were always IM)
- Zero errno (the last error that occurred) prior to each syscall
- Fixed bug that made "lsiutil -e" (or "lsiutil -u") just exit
-----------------------------------------------------------------------------
Changes for 1.38:
- Update to latest header files, 1.05.10
- Display chip rev as well as chip name
- Add Display Phy Counters and Clear Phy Counters
- Make display of firmware version be accurate, always
- Add Trigger Analyzer with Echo
-----------------------------------------------------------------------------
Changes for 1.37:
- Fixed all mallocs that did not have frees
- Added Read Capacity and Mode Page tests
- Added -n (companion to -y) to answer questions automatically
- In Identify, print current running firmware version as well as FLASH
versions
- If mptscsih is not loaded, quit (from Scan for Devices) early
- Increase metadata size for SAS IR volumes
-----------------------------------------------------------------------------
Changes for 1.36:
- Simplify menus using "expert mode", which is enabled with -e on the
command line, or by typing "e" at any menu prompt
- Add display of transfer statistics for FC (-m, for "monitor")
- Allow -h to print help even if no ports found
- Fix firmware download and config page reads for old versions of MPT (1.00)
- Allow easier erasing of BIOS/FCode images
- Add an explicit error message for Linux if a SCSI I/O fails due to the
mptscsih driver not being loaded
-----------------------------------------------------------------------------
Changes for 1.35:
- Check for new Windows split-driver names (lsi_fc, lsi_scsi, lsi_sas)
- Display all "what" strings that are found
- Add SATA Clear Affiliation test
- Add ability to monitor current events (Linux only so far)
-----------------------------------------------------------------------------
Changes for 1.34:
- Add -b option, which gets board info (from manufacturing config pages)
- Add SATA Identify Drive test
- Fix bug in -p where ranges didn't quite work right
- Add routine to get the length of a variable config page, and use it
- Add warning for trying to use an old FC929X firmware image on an FC929XL
- When setting FC devices persistent, set SCAN_ID and SCAN_LUNS flags too
- Add display of what phys are connected to what, in Display Attached Devices
- Remove all knowledge of EEDP for now
-----------------------------------------------------------------------------
Changes for 1.33:
- On Linux, try "modprobe mptctl" and "mknod /dev/mptctl c 10 220" if
IOCTLs don't work
- Fix bug when manually setting SAS persistence
- Add additional checking to distinguish 929X from 929XL
-----------------------------------------------------------------------------
Changes for 1.32:
- Added coercion of disk size when making an IR volume
-----------------------------------------------------------------------------
Changes for 1.31:
- Added -a to allow arguments to be entered on the command line
- Added Beacon on/off
- Detected Sun FCode for 1030 (and hopefully for 1064 too)
- Fixed bug when manually entering more than one SAS persistent address
- Fixed bug when underrun occurs but some data is transferred (NOT an error!)

3
source/Makefile_Linux Executable file
View File

@ -0,0 +1,3 @@
lsiutil: lsiutil.c
gcc -Wall -O lsiutil.c -o lsiutil
cp -p lsiutil /usr/bin

3
source/Makefile_Solaris Executable file
View File

@ -0,0 +1,3 @@
lsiutil: lsiutil.c
gcc -Wall -O lsiutil.c -o lsiutil -D__sparc__ -ldevinfo
cp -p lsiutil /usr/bin

2
source/Makefile_Windows Executable file
View File

@ -0,0 +1,2 @@
lsiutil: lsiutil.c
gcc -Wall -O lsiutil.c -o lsiutil.exe -DWIN32

108
source/getopt.c Executable file
View File

@ -0,0 +1,108 @@
/***************************************************************************
* *
* Copyright 2012 LSI Corporation. All rights reserved. *
* *
* This file is confidential and a trade secret of LSI Corporation. The *
* receipt of or possession of this file does not convey any rights to *
* reproduce or disclose its contents or to manufacture, use, or sell *
* anything it may describe, in whole, or in part, without the specific *
* written consent of LSI Corporation. *
* *
***************************************************************************
*/
#include "inc/getopt.h"
/* This function gets the next option letter from the console input.
It is supposed to be equivalent to the UNIX getopt function.
Options are preceeded by a dash, currently a slash is not allowed.
Multiple options after one dash are valid, and arguments after
the option with a colon between are supported.*/
/* Common varibles. */
int opterr = 1, /* error messages printed? default: yes */
optind = 1, /* index into parent argv vector */
optopt; /* character checked for validity */
char *optarg; /* argument associated with option */
#define EMSG ""
char *progname; /* may also be defined elsewhere */
static void
error(char *pch) /* error message routine */
{
if (!opterr)
return; /* without printing */
fprintf(stderr, "%s: %s: %c\n",
((NULL != progname) ? progname : "getopt"), pch, optopt);
}
int
getopt(int argc, char *argv[], char *ostr)
{
static char *place = EMSG; /* option letter processing */
char *oli; /* option letter list index */
progname = argv[0];
if (!*place)
{ /* update scanning pointer */
if (optind >= argc ||
(*(place = argv[optind]) != '-' &&
*(place = argv[optind]) != '/') ||
!*++place)
{
return EOF;
}
if (*place == '-')
{ /* found "--"; ignore; (end of options) */
++optind;
return EOF;
}
}
/* option letter okay? */
optopt = (int)*place;
++place;
oli = strchr(ostr, optopt);
if ((optopt == (int)':') ||
!(oli = strchr(ostr, optopt)))
{
if (!*place)
++optind;
error("illegal option");
return BADCH;
}
if (*++oli != ':') /* Check for argument after option */
{ /* don't need argument */
optarg = NULL;
if (!*place)
++optind;
}
else
{ /* need an argument */
if (*place)
optarg = place; /* no white space */
else
if (argc <= ++optind)
{ /* no arg */
place = EMSG;
error("option requires an argument");
return BADCH;
}
else
optarg = argv[optind]; /* white space */
place = EMSG;
++optind;
}
return optopt; /* return option letter */
}
/* vi: set sw=4 ts=4 sts=4 et :iv */

1241
source/helper.c Executable file

File diff suppressed because it is too large Load Diff

869
source/inc/ata.h Executable file
View File

@ -0,0 +1,869 @@
/***************************************************************************
* *
* Copyright 2003 LSI Logic Corporation. All rights reserved. *
* *
* This file is confidential and a trade secret of LSI Logic. The *
* receipt of or possession of this file does not convey any rights to *
* reproduce or disclose its contents or to manufacture, use, or sell *
* anything it may describe, in whole, or in part, without the specific *
* written consent of LSI Logic Corporation. *
* *
***************************************************************************
*
* Name: ATA.H
* Title: ATA and SATA Device structures and definitions
* Programmer: ----------------
* Creation Date: February 26, 2002
*
* Version History
* ---------------
*
* Last Updated
* -------------
* Version %version: 24 %
* Date Updated %date_modified: %
* Programmer %created_by: mfry %
*
* Date Who Description
* -------- --- -------------------------------------------------------
* 02/26/02 GWK Initial version
* 01/24/03 GWK Updated for SAS 1064
* 08/20/08 KAM updated for SDM big endian platform and gcc bitfields
*
*
* Description
* ------------
* This include file contains generic ATA and SATA structures and definitions.
*
*-------------------------------------------------------------------------
*/
/* If this header file has not been included yet */
#ifndef ATA_H_SOURCE
#define ATA_H_SOURCE
/* Status Register Bit Definitions */
#define ATA_STATUS_ERR (0x01)
#define ATA_STATUS_DRQ (0x08)
#define ATA_STATUS_CMD_DEP (0x10)
#define ATA_STATUS_DF (0x20)
#define ATA_STATUS_DRDY (0x40)
#define ATA_STATUS_BSY (0x80)
#define ATA_STATUS_ERR_DF (ATA_STATUS_ERR | ATA_STATUS_DF)
/* Atapi Status Register Bit Definitions */
#define ATAPI_STATUS_CHK (0x01)
#define ATAPI_STATUS_DRQ (0x08)
#define ATAPI_STATUS_SERV (0x10)
#define ATAPI_STATUS_DMRD (0x20)
#define ATAPI_STATUS_DRDY (0x40)
#define ATAPI_STATUS_BSY (0x80)
/* Atapi Interrupt Reason Register Bit Definitions */
#define ATAPI_INTERRUPT_REASON_CD (0x01)
#define ATAPI_INTERRUPT_REASON_IO (0x02)
#define ATAPI_INTERRUPT_REASON_REL (0x04)
#define ATAPI_INTERRUPT_REASON_TAG_SHIFT (3)
#define ATAPI_INTERRUPT_REASON_TAG_MASK (0xF8)
/* Error Register Bit Definitions */
#define ATA_ERR_ICRC (0x80) /* ultra DMA CRC */
#define ATA_ERR_UNC (0x40) /* uncorrectable error */
#define ATA_ERR_WP (0x40) /* write-protect bit */
#define ATA_ERR_MC (0x20) /* media changed */
#define ATA_ERR_IDNF (0x10) /* id not found */
#define ATA_ERR_MCR (0x08) /* media change requested */
#define ATA_ERR_ABRT (0x04) /* aborted command */
#define ATA_ERR_NM (0x02) /* no media present */
/* Atapi Error Register Bit Definitions */
#define ATAPI_ERR_ILI (0x01)
#define ATAPI_ERR_EOM (0x02)
#define ATAPI_ERR_ABRT (0x04)
#define ATAPI_ERR_SENSE_KEY_SHIFT (3)
#define ATAPI_ERR_SENSE_KEY_TAG_MASK (0xF8)
/* Device & Device/Head Register Bit Definitions */
#define ATA_DEVICE_LBA (0x40)
/* Device Control Register Bit Definitions */
#define ATA_DEVICE_CONTROL_SRST (0x04)
#define ATA_DEVICE_CONTROL_NIEN (0x02)
/*
* define the ATA command set
*/
#define ATA_CMD_CHECK_POWER_MODE 0xE5
#define ATA_CMD_DEVICE_CONFIGURATION 0xB1
#define ATA_CMD_DOWNLOAD_MICROCODE 0x92
#define ATA_CMD_EXECUTE_DEVICE_DIAGNOSTIC 0x90
#define ATA_CMD_FLUSH_CACHE 0xE7
#define ATA_CMD_FLUSH_CACHE_EXT 0xEA
#define ATA_CMD_GET_MEDIA_STATUS 0xDA
#define ATA_CMD_IDENTIFY_DEVICE 0xEC
#define ATA_CMD_IDENTIFY_PACKET_DEVICE 0xA1
#define ATA_CMD_IDLE 0xE3
#define ATA_CMD_IDLE_IMMEDIATE 0xE1
#define ATA_CMD_INITIALIZE_DEVICE_PARAMETERS 0x91
#define ATA_CMD_MEDIA_EJECT 0xED
#define ATA_CMD_MEDIA_LOCK 0xDE
#define ATA_CMD_MEDIA_UNLOCK 0xDF
#define ATA_CMD_NATIVE_MAX_ADDRESS 0xF8
#define ATA_CMD_NATIVE_MAX_ADDRESS_EXT 0x27
#define ATA_CMD_NOP 0x00
#define ATA_CMD_PACKET 0xA0
#define ATA_CMD_READ_BUFFER 0xE4
#define ATA_CMD_READ_DMA 0xC8
#define ATA_CMD_READ_DMA_EXT 0x25
#define ATA_CMD_READ_DMA_QUEUED 0xC7
#define ATA_CMD_READ_DMA_QUEUED_EXT 0x26
#define ATA_CMD_READ_FPDMA_QUEUED 0x60
#define ATA_CMD_READ_MULTIPLE 0xC4
#define ATA_CMD_READ_MULTIPLE_EXT 0x29
#define ATA_CMD_READ_LOG_EXT 0x2F
#define ATA_CMD_READ_SECTORS 0x20
#define ATA_CMD_READ_SECTORS_EXT 0x24
#define ATA_CMD_READ_LONG 0x22 /* Obsoleted in ATA-4 */
#define ATA_CMD_READ_VERIFY_SECTORS 0x40
#define ATA_CMD_READ_VERIFY_SECTORS_EXT 0x42
#define ATA_CMD_SECURITY_DISABLE_PASSWORD 0xF6
#define ATA_CMD_SECURITY_ERASE_PREPARE 0xF3
#define ATA_CMD_SECURITY_ERASE_UNIT 0xF4
#define ATA_CMD_SECURITY_FREEZE_LOCK 0xF5
#define ATA_CMD_SECURITY_SET_PASSWORD 0xF1
#define ATA_CMD_SECURITY_UNLOCK 0xF2
#define ATA_CMD_SEEK 0x70
#define ATA_CMD_SET_FEATURES 0xEF
#define ATA_CMD_SET_MAX 0xF9
#define ATA_CMD_SET_MAX_EXT 0x37
#define ATA_CMD_SET_MULTIPLE_MODE 0xC6
#define ATA_CMD_SLEEP 0xE6
#define ATA_CMD_SMART 0xB0
#define ATA_CMD_SMART_READ_DATA 0xD0
#define ATA_CMD_SMART_ENABLE_DISABLE_AUTOSAVE 0xD2
#define ATA_CMD_SMART_SAVE_ATTRIBUTE_VALUES 0xD3
#define ATA_CMD_SMART_EXECUTE_OFFLINE_IMMEDIATE 0xD4
#define ATA_CMD_SMART_READ_LOG 0xD5
#define ATA_CMD_SMART_WRITE_LOG 0xD6
#define ATA_CMD_SMART_ENABLE_OPERATIONS 0xD8
#define ATA_CMD_SMART_DISABLE_OPERATIONS 0xD9
#define ATA_CMD_SMART_RETURN_STATUS 0xDA
#define ATA_CMD_STANDBY 0xE2
#define ATA_CMD_STANDBY_IMMEDIATE 0xE0
#define ATA_CMD_WRITE_BUFFER 0xE8
#define ATA_CMD_WRITE_DMA 0xCA
#define ATA_CMD_WRITE_DMA_EXT 0x35
#define ATA_CMD_WRITE_DMA_QUEUED 0xCC
#define ATA_CMD_WRITE_DMA_QUEUED_EXT 0x36
#define ATA_CMD_WRITE_FPDMA_QUEUED 0x61
#define ATA_CMD_WRITE_MULTIPLE 0xC5
#define ATA_CMD_WRITE_MULTIPLE_EXT 0x39
#define ATA_CMD_WRITE_SECTORS 0x30
#define ATA_CMD_WRITE_SECTORS_EXT 0x34
#define ATA_CMD_WRITE_LONG 0x32 /* Obsoleted in ATA-4 */
/*
* define SET_FEATURES sub-commands
*/
#define ATA_CMD_SF_SET_TRANSFER_MODE 0x03
#define ATA_CMD_SF_WRITE_CACHE_ENABLE 0x02
#define ATA_CMD_SF_WRITE_CACHE_DISABLE 0x82
#define ATA_CMD_SF_ENABLE_READ_LOOK_AHEAD 0xAA
#define ATA_CMD_SF_DISABLE_READ_LOOK_AHEAD 0x55
#define ATA_CMD_SF_ENABLE_REVERT_PWR_ON_DFLTS 0xCC
#define ATA_CMD_SF_DISABLE_REVERT_PWR_ON_DFLTS 0x66
#define ATA_CMD_SF_ENABLE_SATA_FEATURE 0x10
#define ATA_CMD_SF_DISABLE_SATA_FEATURE 0x90
#define SATA_CMD_SF_NON_ZERO_BUFF_OFST_IN_DMA_SETUP_FIS 0x01
#define SATA_CMD_SF_DMA_SETUP_FIS_AUTO_ACTV_OPTIMIZATION 0x02
#define SATA_CMD_SF_GUARANTEED_IN_ORDER_DATA_DELIVERY 0x04
#define SATA_CMD_SF_ASYNC_NOTIFICATION 0x05
#define SATA_CMD_SF_SOFTWARE_SETTINGS_PRESERVATION 0x06
/* Transfer mode settings for SET_FEATURES command */
#define PIO_DEFAULT 0x0
#define PIO_MODE3 0xB
#define PIO_MODE4 0xC
#define MDMA_MODE0 0x20
#define MDMA_MODE1 0x21
#define MDMA_MODE2 0x22
#define UDMA_MODE0 0x40
#define UDMA_MODE1 0x41
#define UDMA_MODE2 0x42
#define UDMA_MODE3 0x43
#define UDMA_MODE4 0x44
#define UDMA_MODE5 0x45
#define UDMA_MODE6 0x46
/* Error register definitions for the EXECUTE DEVICE DIAGNOSTIC command */
#define ATA_ERROR_DIAGNOSTIC_CODE_DEVICE0_PASSED 0x01
/* These signatures are left in the task file registers after an
* EXECUTE DEVICE DIAGNOSTIC command, and at a few other times
*/
#define COMMAND_BLOCK_SIGNATURE_ATAPI (0x00EB1401)
#define SECTOR_COUNT_SIGNATURE_ATAPI (0x01)
#define COMMAND_BLOCK_SIGNATURE_ATA (0x00000001)
#define SECTOR_COUNT_SIGNATURE_ATA (0x01)
/* CHECK POWER MODE results in Sector Count register */
#define ATA_CHECK_POWER_MODE_STANDBY (0x00)
#define ATA_CHECK_POWER_MODE_IDLE (0x80)
#define ATA_CHECK_POWER_MODE_ACTIVE_OR_IDLE (0xFF)
/* DOWNLOAD MICROCODE SUB COMMANDS */
#define ATA_DNLD_MIC_CODE_IMMED_TEMP (0x01)
#define ATA_DNLD_MIC_CODE_IMMED_FUTURE (0x07)
/*
* define typical IDE timeout values
*
* GES 02/09/01: These values will need some tweaking!!
*/
#define ATA_TIMEOUT_GEN 30 /* generic timeout is 30 seconds */
#define ATA_TIMEOUT_IDENTIFY 2 /* timeout for IDENTIFY commands */
#define ATA_TIMEOUT_READ_BUFFER 2 /* timeout for read buffer */
#define ATA_TIMEOUT_DIAG 5 /* timeout for diagnostics command */
#define ATA_TIMEOUT_STANDBY_IDLE 30 /* timeout for start/stop unit commands */
#define ATA_TIMEOUT_FLUSH_CACHE 30 /* cache flush timeout */
#define ATA_TIMEOUT_CHECK_POWER 2 /* timeout for CHECK POWER MODE */
#define ATA_TIMEOUT_DOWNLOAD_MICROCODE 120 /* wait up to 2 minute */
/*
* define the IDENTIFY DEVICE structure
*/
typedef struct _ATA_IDENTIFY_DEVICE_DATA
{
U16 GeneralConfiguration; /* 0 */
U16 LogicalCylinders; /* 1 */
U16 SpecificConfiguration; /* 2 */
U16 LogicalHeads; /* 3 */
U16 Retired4to5[2]; /* 4-5 */
U16 LogicalSectorsPerLogicalTrack; /* 6 */
U16 Reserved7to8[2]; /* 7-8 */
U16 Retired3; /* 9 */
U16 SerialNumber[10]; /* 10-19 */
U16 Retired20to21[2]; /* 20-21 */
U16 Obsolete22; /* 22 */
U16 FirmwareRevision[4]; /* 23-26 */
U16 ModelNumber[20]; /* 27-46*/
U16 MaxMultipleSize; /* 47 */
U16 Reserved48; /* 48 */
U16 Capabilities[2]; /* 49-50 */
U16 Obsolete51to52[2]; /* 51-52 */
U16 ValidWords; /* 53 */
U16 CurrentLogicalCylinders; /* 54 */
U16 CurrentLogicalHeads; /* 55 */
U16 CurrentLogicalSectorsPerTrack; /* 56 */
U16 CurrentCapacityInSectors[2]; /* 57-58 */
U16 CurrentMultipleSize; /* 59 */
U16 TotalUserSectors[2]; /* 60-61 */
U16 Obsolete62; /* 62 */
U16 MultiwordDmaMode; /* 63 */
U16 PioModesSupported; /* 64 */
U16 MinimumMultiwordDmaTransferCycleTime; /* 65 */
U16 ManufacturerRecommendedMultiwordDmaTransferCycleTime; /* 66 */
U16 MinumumPioTransferCycleTimeWithoutFlowControl; /* 67 */
U16 MinumumPioTransferCycleTimeWithFlowControl; /* 68 */
U16 Reserved69to70[2]; /* 69-70 */
U16 Reserved71to74[4]; /* 71-74 */
U16 QueueDepth; /* 75 */
U16 SerialATACapabilities; /* 76 */
U16 Reserved77; /* 77 */
U16 SerialFeaturesSupported[2]; /* 78-79 */
U16 MajorVersionNumber; /* 80 */
U16 MinorVersionNumber; /* 81 */
U16 CommandSetsSupported[3]; /* 82-84 */
U16 CommandSetsEnabled[2]; /* 85-86 */
U16 CommandSetDefaults; /* 87 */
U16 UltraDmaModes; /* 88 */
U16 TimeForSecurityErase; /* 89 */
U16 TimeForEnahncedSecurityErase; /* 90 */
U16 CurrentAdvancedPowerManagementValue; /* 91 */
U16 MasterPasswordRevisionCode; /* 92 */
U16 HardwareResetResult; /* 93 */
U16 AcousticManagement; /* 94 */ /* GWK Reserved in ATA-5 */
U16 Reserved95to99[5]; /* 95-99 */
U16 MaximumLBAfor48bitAddressing[4]; /* 100-103 */ /* GWK Reserved in ATA-5 */
U16 Reserved104to107[4]; /* 104-107 */
U16 WorldWideName[4]; /* 108-111 */
U16 Reserved112to126[15]; /* 112-126 */
U16 RemovableMediaStatusNotification; /* 127 */
U16 SecurityStatus; /* 128 */
U16 VendorSpecific[31]; /* 129-159 */
U16 CFApowerMode; /* 160 */
U16 Reserved161to175[15]; /* 161-175 */
U16 Reserves176to254[79]; /* 176-254 */
U16 IntegrityWord; /* 255 */
} ATA_IDENTIFY_DEVICE_DATA, *PTR_ATA_IDENTIFY_DEVICE_DATA;
#define ATA_IDENTIFY_DATA_FIRMWARE_REVISION_LENGTH_IN_BYTES 8
#define ATA_IDENTIFY_DATA_MODEL_NUMBER_LENGTH_IN_BYTES 40
#define ATA_IDENTIFY_DATA_SERIAL_NUMBER_LENGTH_IN_BYTES 20
#define ATA_IDENTIFY_DATA_MAJOR_VERSION_ATA_ATAPI_7 (0x0080)
#define ATA_IDENTIFY_DATA_MAJOR_VERSION_ATA_ATAPI_8 (0x0100)
#define ATA_IDENTIFY_DATA_COMMAND_SET_DEFAULT_WWN (0x0100)
#define ATA_IDENTIFY_DATA_WRITE_CACHE_ENABLED (0x0020)
#define ATA_IDENTIFY_DATA_LOOK_AHEAD_ENABLED (0x0040)
#define ATA_IDENTIFY_DATA_SMART_FEATURE_ENABLED (0x0001)
#define ATA_IDENTIFY_DATA_SATA_SUP_FEAT_SFT_SET_PRES (0x0040)
/*
* define the IDENTIFY PACKET DEVICE structure for ATAPI
*/
typedef struct _ATA_IDENTIFY_PACKET_DEVICE_DATA
{
U16 GeneralConfiguration; /* 0 */
U16 Reserved01; /* 1 */
U16 UniqueConfiguration; /* 2 */
U16 Reserved03to09[7]; /* 3-9 */
U16 SerialNumber[10]; /* 10-19 */
U16 Retired20to22[3]; /* 20-22 */
U16 FirmwareRevision[4]; /* 23-26 */
U16 ModelNumber[20]; /* 27-46*/
U16 Reserved47to48[2]; /* 47-48 */
U16 Capabilities[2]; /* 49-50 */
U16 Obsolete51to52[2]; /* 51-52 */
U16 ValidWords; /* 53 */
U16 Reserved54to62[9]; /* 54-62 */
U16 MultiwordDmaMode; /* 63 */
U16 PioModesSupported; /* 64 */
U16 MinimumMultiwordDmaTransferCycleTime; /* 65 */
U16 ManufacturerRecommendedMultiwordDmaTransferCycleTime; /* 66 */
U16 MinumumPioTransferCycleTimeWithoutFlowControl; /* 67 */
U16 MinumumPioTransferCycleTimeWithFlowControl; /* 68 */
U16 Reserved69to70[2]; /* 69-70 */
U16 TypicalTimePacketCmdToBusRelease; /* 71 */
U16 TypicalTimeServiceToBSYCleared; /* 72 */
U16 Reserved73to74[2]; /* 73-74 */
U16 QueueDepth; /* 75 */
U16 SerialATACapabilities; /* 76 */
U16 Reserved77to79[3]; /* 77-79 */
U16 MajorVersionNumber; /* 80 */
U16 MinorVersionNumber; /* 81 */
U16 CommandSetsSupported[3]; /* 82-84 */
U16 CommandSetsEnabled[2]; /* 85-86 */
U16 CommandSetDefaults; /* 87 */
U16 UltraDmaModes; /* 88 */
U16 Reserved89to92[4]; /* 89-92 */
U16 HardwareResetResult; /* 93 */
U16 AcousticManagement; /* 94 */ /* GWK Reserved in ATA-5 */
U16 Reserved95to124[30]; /* 95-124 */
U16 AtapeByteCount0Behavior; /* 125 */
U16 Obsolete126; /* 126 */
U16 RemovableMediaStatusNotification; /* 127 */
U16 SecurityStatus; /* 128 */
U16 VendorSpecific129to159[31]; /* 129-159 */
U16 ReservedForCFA160to175[16]; /* 160-175 */
U16 Reserved176to254[79]; /* 176-254 */
U16 IntegrityWord; /* 255 */
} ATA_IDENTIFY_PACKET_DEVICE_DATA, *PTR_ATA_IDENTIFY_PACKET_DEVICE_DATA;
#define ATA_IDENTIFY_PACKET_DATA_FIRMWARE_REVISION_LENGTH_IN_BYTES 8
#define ATA_IDENTIFY_PACKET_DATA_MODEL_NUMBER_LENGTH_IN_BYTES 40
#define ATA_IDENTIFY_PACKET_DATA_SERIAL_NUMBER_LENGTH_IN_BYTES 20
/******************************************************************************/
/* */
/* S A T A S P E C I F I C D E F I N I T I O N S */
/* */
/******************************************************************************/
/* FIS Types */
#define FIS_TYPE_REGISTER_HOST_TO_DEVICE 0x27
#define FIS_TYPE_REGISTER_DEVICE_TO_HOST 0x34
#define FIS_TYPE_SET_DEVICE_BITS_DEVICE_TO_HOST 0xA1
#define FIS_TYPE_DMA_ACTIVATE_DEVICE_TO_HOST 0x39
#define FIS_TYPE_DMA_SETUP_BIDIRECTIONAL 0x41
#define FIS_TYPE_BIST_ACTIVATE_BIDIRECTIONAL 0x58
#define FIS_TYPE_PIO_SETUP_DEVICE_TO_HOST 0x5F
#define FIS_TYPE_DATA_BIDIRECTIONAL 0x46
/* FIS Command/Control Bit Definitions */
#define FIS_COMMAND_CONTROL_COMMAND 0x1
#define FIS_COMMAND_CONTROL_CONTROL 0x0
/* FIS Interrupt Bit Definitions */
#define FIS_INTERRUPT_TRUE 0x1
#define FIS_INTERRUPT_FALSE 0x0
/* FIS Direction Bit Definitions */
#define FIS_DIRECTION_TRANSMITTER_TO_RECEIVER 0x1
#define FIS_DIRECTION_RECEIVER_TO_TRANSMITTER 0x0
/*
* This is the mapping of how the various fields in the host to device FIS are used
* for CHS, LBA28-bit,and LBA48-bit modes. Use the union on the register FIS
* types to select.
*
*
* CHS LBA28 LBAEXP48
* --- ----- --------
* 0x00 U8 FISType; U8 FISType; U8 FISType;
* 0x01 U32 Reserved01Bits0to6 :7; U32 Reserved01Bits0to6 :7; U32 Reserved01Bits0to6 :7;
* U32 CommandBit :1; U32 CommandBit :1; U32 CommandBit :1;
* 0x02 U8 Command; U8 Command; U8 Command;
* 0x03 U8 Features; U8 Features; U8 Features;
* 0x04 U8 SectorNumber; U8 LBALow_0_7; U8 LBALow_0_7;
* 0x05 U8 CylLow; U8 LBAMid_8_15; U8 LBAMid_8_15;
* 0x06 U8 CylHigh; U8 LBAHigh_16_23; U8 LBAHigh_16_23;
* 0x07 U8 DeviceHead; U8 DeviceAndLBA24_27; U8 Device;
* 0x08 U8 SectorNumberExp; U8 SectorNumberExp; U8 LBALowExp_24_31;
* 0x09 U8 CylLowExp; U8 CylLowExp; U8 LBAMidExp_32_39;
* 0x0A U8 CylHighExp; U8 CylHighExp; U8 LBAHighExp_40_47;
* 0x0B U8 FeaturesExp; U8 FeaturesExp; U8 FeaturesExp;
* 0x0C U8 SectorCount; U8 SectorCount; U8 SectorCount0_7;
* 0x0D U8 SectorCountExp; U8 SectorCountExp; U8 SectorCountExp8_15;
* 0x0E U8 Reserved0E; U8 Reserved0E; U8 Reserved0E;
* 0x0F U8 Control; U8 Control; U8 Control;
* 0x10 U32 Reserved10to14; U32 Reserved10to14; U32 Reserved10to14;
*/
/*
* SATA Register - Host To Device FIS for CHS addressing
*/
typedef struct _REGISTER_HOST_TO_DEVICE_FIS_CHS
{
U8 FISType; /* 0x00 */
#if defined( __LSIUTIL_BIG_ENDIAN__ )
U8 CommandBit :1; /* 0x01 */
U8 Reserved01Bits0to6 :7;
#else /* little endian */
U8 Reserved01Bits0to6 :7; /* 0x01 */
U8 CommandBit :1;
#endif
U8 Command; /* 0x02 */
U8 Features; /* 0x03 */
U8 SectorNumber; /* 0x04 */
U8 CylLow; /* 0x05 */
U8 CylHigh; /* 0x06 */
U8 DeviceHead; /* 0x07 */
U8 SectorNumberExp; /* 0x08 */
U8 CylLowExp; /* 0x09 */
U8 CylHighExp; /* 0x0A */
U8 FeaturesExp; /* 0x0B */
U8 SectorCount; /* 0x0C */
U8 SectorCountExp; /* 0x0D */
U8 Reserved0E; /* 0x0E */
U8 Control; /* 0x0F */
U32 Reserved10to14; /* 0x10 */
} REGISTER_HOST_TO_DEVICE_FIS_CHS, *PTR_REGISTER_HOST_TO_DEVICE_FIS_CHS;
/*
* SATA Register - Host To Device FIS for LBA 28-bit addressing
*/
typedef struct _REGISTER_HOST_TO_DEVICE_FIS_LBA28
{
U8 FISType; /* 0x00 */
#if defined( __LSIUTIL_BIG_ENDIAN__ )
U8 CommandBit :1; /* 0x01 */
U8 Reserved01Bits0to6 :7;
#else /* little endian */
U8 Reserved01Bits0to6 :7; /* 0x01 */
U8 CommandBit :1;
#endif
U8 Command; /* 0x02 */
U8 Features; /* 0x03 */
U8 LBALow_0_7; /* 0x04 */
U8 LBAMid_8_15; /* 0x05 */
U8 LBAHigh_16_23; /* 0x06 */
U8 DeviceAndLBA24_27; /* 0x07 */
U8 SectorNumberExp; /* 0x08 */
U8 CylLowExp; /* 0x09 */
U8 CylHighExp; /* 0x0A */
U8 FeaturesExp; /* 0x0B */
U8 SectorCount; /* 0x0C */
U8 SectorCountExp; /* 0x0D */
U8 Reserved0E; /* 0x0E */
U8 Control; /* 0x0F */
U32 Reserved10to14; /* 0x10 */
} REGISTER_HOST_TO_DEVICE_FIS_LBA28, *PTR_REGISTER_HOST_TO_DEVICE_FIS_LBA28;
/*
* SATA Register - Host To Device FIS for LBA 48-bit addressing
*/
typedef struct _REGISTER_HOST_TO_DEVICE_FIS_LBA48
{
U8 FISType; /* 0x00 */
#if defined( __LSIUTIL_BIG_ENDIAN__ )
U8 CommandBit :1; /* 0x01 */
U8 Reserved01Bits0to6 :7;
#else /* little endian */
U8 Reserved01Bits0to6 :7; /* 0x01 */
U8 CommandBit :1;
#endif
U8 Command; /* 0x02 */
U8 Features; /* 0x03 */
U8 LBALow_0_7; /* 0x04 */
U8 LBAMid_8_15; /* 0x05 */
U8 LBAHigh_16_23; /* 0x06 */
U8 Device; /* 0x07 */
U8 LBALowExp_24_31; /* 0x08 */
U8 LBAMidExp_32_39; /* 0x09 */
U8 LBAHighExp_40_47; /* 0x0A */
U8 FeaturesExp; /* 0x0B */
U8 SectorCount0_7; /* 0x0C */
U8 SectorCountExp8_15; /* 0x0D */
U8 Reserved0E; /* 0x0E */
U8 Control; /* 0x0F */
U32 Reserved10to14; /* 0x10 */
} REGISTER_HOST_TO_DEVICE_FIS_LBA48, *PTR_REGISTER_HOST_TO_DEVICE_FIS_LBA48;
/*
* SATA Register - Host To Device FIS for Packet (ATAPI) Commands
*/
typedef struct REGISTER_HOST_TO_DEVICE_FIS_PACKET
{
U8 FISType; /* 0x00 */
#if defined( __LSIUTIL_BIG_ENDIAN__ )
U8 CommandBit :1; /* 0x01 */
U8 Reserved01Bits0to6 :7;
#else /* little endian */
U8 Reserved01Bits0to6 :7; /* 0x01 */
U8 CommandBit :1;
#endif
U8 Command; /* 0x02 */
U8 Features; /* 0x03 */
U8 LBALow_0_7; /* 0x04 */
U8 ByteCountLow; /* 0x05 */
U8 ByteCountHigh; /* 0x06 */
U8 DeviceSelect; /* 0x07 */
U8 LBALowExp_24_31; /* 0x08 */
U8 LBAMidExp_32_39; /* 0x09 */
U8 LBAHighExp_40_47; /* 0x0A */
U8 FeaturesExp; /* 0x0B */
U8 SectorCount0_7; /* 0x0C */
U8 SectorCountExp8_15; /* 0x0D */
U8 Reserved0E; /* 0x0E */
U8 Control; /* 0x0F */
U32 Reserved10to14; /* 0x10 */
} REGISTER_HOST_TO_DEVICE_FIS_PACKET, *PTR_REGISTER_HOST_TO_DEVICE_FIS_PACKET;
/*
* SATA Register - Host To Device FIS
*/
typedef union _REGISTER_HOST_TO_DEVICE_FIS
{
REGISTER_HOST_TO_DEVICE_FIS_CHS Chs;
REGISTER_HOST_TO_DEVICE_FIS_LBA28 Lba28;
REGISTER_HOST_TO_DEVICE_FIS_LBA48 Lba48;
REGISTER_HOST_TO_DEVICE_FIS_PACKET Packet;
} REGISTER_HOST_TO_DEVICE_FIS, *PTR_REGISTER_HOST_TO_DEVICE_FIS;
/*
* SATA Register - Device To Host FIS for Chs addressing
*/
typedef struct _REGISTER_DEVICE_TO_HOST_FIS_CHS
{
U8 FISType; /* 0x00 */
#if defined( __LSIUTIL_BIG_ENDIAN__ )
U8 Reserved01Bit7 :1; /* 0x01 */
U8 Interrupt :1;
U8 Reserved01Bits0to5 :6;
#else /* little endian */
U8 Reserved01Bits0to5 :6; /* 0x01 */
U8 Interrupt :1;
U8 Reserved01Bit7 :1;
#endif
U8 Status; /* 0x02 */
U8 Error; /* 0x03 */
U8 SectorNumber; /* 0x04 */
U8 CylLow; /* 0x05 */
U8 CylHigh; /* 0x06 */
U8 DeviceHead; /* 0x07 */
U8 SectorNumberExp; /* 0x08 */
U8 CylLowExp; /* 0x09 */
U8 CylHighExp; /* 0x0A */
U8 Reserved0B; /* 0x0B */
U8 SectorCount; /* 0x0C */
U8 SectorCountExp; /* 0x0D */
U8 Reserved0E; /* 0x0E */
U8 Reseved0F; /* 0x0F */
U32 Reserved10to14; /* 0x10 */
} REGISTER_DEVICE_TO_HOST_FIS_CHS, *PTR_REGISTER_DEVICE_TO_HOST_FIS_CHS;
/*
* SATA Register - Device To Host FIS for LBA 28-bit
*/
typedef struct _REGISTER_DEVICE_TO_HOST_FIS_LBA28
{
U8 FISType; /* 0x00 */
#if defined( __LSIUTIL_BIG_ENDIAN__ )
U8 Reserved01Bit7 :1; /* 0x01 */
U8 Interrupt :1;
U8 Reserved01Bits0to5 :6;
#else /* little endian */
U8 Reserved01Bits0to5 :6; /* 0x01 */
U8 Interrupt :1;