[U-Boot] [U-Boot, 3/3] ahci: support LBA48 data reads for 2+TB drives

Tom Rini trini at ti.com
Fri Nov 8 21:12:17 CET 2013


On Tue, Sep 10, 2013 at 03:19:17PM -0500, Mark Langsdorf wrote:

> Enable full 48-bit LBA48 data reads by passing the upper word of the
> LBA block pointer in bytes 9 and 10 of the FIS.
> 
> This allows uboot to load data from any arbitrary sector on a drive
> with 2 or more TB of available data connected to an AHCI controller.
> 
> Signed-off-by: Mark Langsdorf <mark.langsdorf at calxeda.com>

OK, so a few things in here:

[snip]
> +void scsi_setup_read16(ccb * pccb, lbaint_t start, unsigned long blocks)
> +{
> +	pccb->cmd[0] = SCSI_READ16;
> +	pccb->cmd[1] = pccb->lun<<5;
> +	pccb->cmd[2] = ((unsigned char) (start >> 56)) & 0xff;

This isn't protected with CONFIG_LBA48, so on non-LBA48 enabled boards
(P2020DS_36BIT is the example I found here) we get warnings here and on

[snip]
> @@ -721,6 +731,11 @@ static int ata_scsiop_read_write(ccb *pccb, u8 is_write)
>  		fis[6] = (lba >> 16) & 0xff;
>  		fis[7] = 1 << 6; /* device reg: set LBA mode */
>  		fis[8] = ((lba >> 24) & 0xff);
> +		if (pccb->cmd[0] == SCSI_READ16) {
> +			fis[9] = ((lba >> 32) & 0xff);
> +			fis[10] = ((lba >> 40) & 0xff);
> +		}
> +

This hunk.

It's easy enough to guard both of these cases with #ifdef CONFIG_LBA48,
and I've done so now.

But, highbank isn't setting CONFIG_LBA48 and probably really wants to,
yes?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131108/ebb05d7f/attachment.pgp>


More information about the U-Boot mailing list