ATA ident command

Thomas Doerfler Thomas.Doerfler at embedded-brains.de
Thu Aug 27 10:41:24 UTC 2009


Hi Chris,

I have no access to the ATA spec, but the CF cards use the same
interface. In the identify response, some multi-word fields exist e.g.:

7-8 XXXXh 4 Number of sectors per card (Word 7 = MSW, Word 8 = LSW)

...

57-58 XXXXh 4 Current capacity in sectors (LBAs)(Word 57 = LSW, Word 58
= MSW)

...

60-61 XXXXh 4 Total number of sectors addressable in LBA Mode

In U-Boot, this field is read with LSW at address 60 and MSW at address
61, so this conforms to YOUR change.

So I think you are correct.

wkr,
Thomas.

Chris Johns wrote:
> Hi all,
> 
> I have found the ATA driver's handling of the ident command seems a 
> little suspect but I did not want to change the driver without some 
> feedback.
> 
> If you look around line 1470 in the ata.c driver the LBA sectors is 
> passed to the rtems_disk_create_phys call. This value comes from the 
> handling of the ident table returned from the drive (line 1419). I found 
> the value returned by qemu for its drive was word reversed. I now have this:
> 
>       ATA_DEV_INFO(ctrl_minor, dev).lba_sectors =
>           (CF_LE_W(buffer[ATA_IDENT_WORD_NUM_OF_USR_SECS1]) << 16) +
>            CF_LE_W(buffer[ATA_IDENT_WORD_NUM_OF_USR_SECS0]);
> 
> and it is working with qemu.
> 
> If any one has an ATA standard handy could they please check if this 
> change is ok ?
> 
> Regards
> Chris
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users


-- 

--------------------------------------------
embedded brains GmbH
Thomas Doerfler        Obere Lagerstrasse 30
D-82178 Puchheim       Germany
email: Thomas.Doerfler at embedded-brains.de
Phone: +49-89-18908079-2
Fax:   +49-89-18908079-9
PGP:   Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list