[PATCH v2 2/2] Fix IDE commands issued, fix endian issues, fix non MMIO

Reinoud Zandijk reinoud at NetBSD.org
Tue Feb 23 16:07:03 CET 2021


On Mon, Feb 22, 2021 at 10:48:42PM +0100, Heinrich Schuchardt wrote:
> On 2/22/21 10:20 PM, Reinoud Zandijk wrote:
> > 2) direct pointer access was used to read and write the registers instead
> > of the inb/inw/outb/outw functions/macros. Registers don't have to be
> > memory mapped and ATA_CURR_BASE() does not have to return an offset from
> > address zero.
...
> > ---
> >   drivers/block/ide.c | 149 +++++++++++++-------------------------------
> >   include/ata.h       |   2 +-
> >   2 files changed, 44 insertions(+), 107 deletions(-)
> > 
> > diff --git a/drivers/block/ide.c b/drivers/block/ide.c
> > index 43a0776099..0d1ad33125 100644
> > --- a/drivers/block/ide.c
> > +++ b/drivers/block/ide.c
> > @@ -130,56 +130,40 @@ OUT:
> >    * ATAPI Support
> >    */
> > 
> > -#if defined(CONFIG_IDE_SWAP_IO)
> 
> edminiv2_defconfig does not build with this change.

Now thats odd! The inw() and outw() macro's seem to have different definitions
depending on what architecture you're compiling for!

For at least MIPS and m68k , inw() is defined as inw(long unsigned int) but
for ARM its defined as inw(short *) !

Now what should it be?

Also I could use in_le16() and out_le16() but will they be defined for all
architectures? Or should not supporting it be considered a bug on their side?

Using uintptr_t seems to satisfy both as its guaranteed to be representing a
ptr and an int and GCC isn't even complaining anymore on either platforms.
I'll use this one in my next patch version

Thanks for the feedback,
Reinoud



More information about the U-Boot mailing list