From: Marc Singer Date: Thu, 14 Aug 2003 09:26:00 -0700 Subject: [U-Boot-Users] IDE and x86 port In-Reply-To: <200308141822.43831.jbeisert@eurodsn.de> References: <200308140926.54274.jbeisert@eurodsn.de> <20030814090441.28A5AC59E4@atlas.denx.de> <20030814154333.GD1468@buici.com> <200308141822.43831.jbeisert@eurodsn.de> Message-ID: <20030814162600.GB10743@buici.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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.