diff options
author | Gabe Black <gabeblack@chromium.org> | 2012-03-13 16:08:37 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-03-14 16:34:02 -0700 |
commit | 79b44667b53f8dd03714c361c347d2355fe5d4f1 (patch) | |
tree | 0260c88811cce9bfa685f1dc00fcce6df02164e9 /board/manroland | |
parent | 1bd4fbf1cd120275c3f05425ac7273e7d0cb4a0a (diff) |
gen: Make the AHCI code find the capacity of disks > 128 GB properly
In the structure returned by the ATA identify device command, there are two
fields which describe the device capacity. One is a 32 bit data type which
reports the number of sectors as a 28 bit LBA, and the other is a 64 bit data
type which is for a 48 bit LBA. If the device doesn't support 48 bit LBAs,
the small value is the only value with the correct size. If it supports more,
if the number of sectors is small enough to fit into 28 bits, both fields
reflect the correct value. If it's too large, the smaller field has 28 bits of
1s, 0xfffffff, and the other field has the correct value.
The AHCI driver is implemented by attaching to the generic SCSI code and
translating on the fly between SCSI binary data structures and AHCI data
structures. It responds to requests to execute specific SCSI commands by
executing the equivalent AHCI commands and then crafting a response which
matches what a SCSI disk would send.
The AHCI driver now considers both fields and chooses the correct one when
implementing both the SCSI READ CAPACITY (10) and READ CAPACITY (16) commands.
BUG=chrome-os-partner:8180
TEST=Built and booted to ChromeOS with this code on a CRB with a 250 GB drive
and a Stumpy with a 16 GB drive. Checked the serial output to make sure U-Boot
reported the correct size. Forced the READ CAPACITY (10) command to saturate
so that the READ CAPACITY (16) command would be used and verified that that
also booted correctly on a CRB.
Change-Id: I31b662498f4c9657d70bb90400032c83e9d9c8da
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/18061
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/manroland')
0 files changed, 0 insertions, 0 deletions