inw/outw on PowerPC in rtems

gregory.menke at gsfc.nasa.gov gregory.menke at gsfc.nasa.gov
Tue Mar 25 14:29:21 UTC 2003


Till Straumann writes:
 > gregory.menke at gsfc.nasa.gov wrote:
 > 
 > >I'm putting together a 3c59x PCI driver for RTEMS, its at a point
 > >where I'm testing it now- but I'm having trouble accessing the card.
 > >I have the PCI side under control, but the chipset exists in io space,
 > >and the inw/outw functions don't seem to be doing the right things.
 > >
 >  inw accesses ISA I/O space. Unless your
 > BSP uses the same base address for ISA and PCI I/O space (plus: the 
 > firmware/BSP
 > has to configure your card's base address consistently - PreP and CHRP 
 > should
 > probably work), you'll have a problem.
 > 
 > I usually prefer in_le32() which gives you more control over the base 
 > address.
 > Using in_le32() with a BSP defined base address makes your driver easier to
 > use on different BSPs.
 > 
 > The respective macros and inlines are defined in 
 > libcpu/powerpc/shared/include/io.h
 > 

As expected, the problem was located between keyboard and chair- I
wasn't masking off the low bits coming from the base address register.
On PCI IO spaces, bit 0 is set, so it was skewing the address.  All is
fine now...

Gregm




More information about the users mailing list