[U-Boot-Users] IDE and x86 port
Marc Singer
elf at buici.com
Thu Aug 14 18:26:00 CEST 2003
On Thu, Aug 14, 2003 at 06:22:43PM +0200, Juergen Beisert wrote:
> Hello Marc,
>
> Am Donnerstag, 14. August 2003 17:43 schrieb Marc Singer:
> > /* swap shorts */
> > +#if !defined (__ARM__)
> > dev_desc->lba = (iop->lba_capacity << 16) | (iop->lba_capacity >>
> > 16); +#else
> > + /* elf: it isn't clear why this code swaps the words. There's
> > nothing i n the spec about it. */
> > + dev_desc->lba = iop->lba_capacity;
> > +#endif
> > /* assuming HD */
> > dev_desc->type=DEV_TYPE_HARDDISK;
> > dev_desc->blksz=ATA_BLOCKSIZE;
>
> Perhaps
>
> dev_desc->lba = __le32_to_cpu(iop->lba_capacity);
>
> would be easier?
It is the MSB CPU's that do the swap, not the LE ones.
More information about the U-Boot
mailing list