[ORLinux] Linux device access

Stefan Kristiansson stefan.kristiansson at saunalahti.fi
Sun Jul 3 22:39:05 CEST 2011


On 3.7.2011 9:19, Jonas Bonn wrote:
> Here's a heads up about a change in the master branch that might break
> things for you...!
>

Thanks for the heads up!

> The Linux device IO accessors (ioreadX/iowriteX) imply a little-endian
> bus.  Using them for access to big-endian devices is _wrong_.  We've
> hacked around this earlier in the OpenRISC port, but now that we're
> pushing for upstream this has to be fixed.
>
> So, if you have a big-endian bus, like we currently always do for
> OpenRISC, you will need to use the big-endian IO accessors if the device
> in question sits on a bus wider than 8 bits.
>
> See the following commit for an example of how to best resolve this at
> this time:
>
> http://git.openrisc.net/cgit.cgi/jonas/linux/commit/?id=93b4493f3f6cc18ef8ce2ebd0bb88f51be32d92f
>

Is there any particular reason for not using the wishbone wrappers instead of having the ifdefs in
the driver code?
I guess it's a matter of taste and I'm fine with having them in the drivers code, but I kind of liked the
wishbone wrappers approach better.

> This change is effective as of _now_ on the master branch.
>
> Just looking quickly, I can see that this is an issue for the AC97 and
> OCFB drivers... there are possibly others.
>

I think you covered all there.
I will look over those.

Stefan




More information about the Linux mailing list