[Cbe-oss-dev] Cell internal registers access

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri May 5 15:46:44 EST 2006


Hi Arnd !

While playing around with the RAS stuff and other bits, I've come
accross an annoying thing. We have those gazillion of MMIO registers in
the BE. They are grouped more/less into logical blocks, but there are
some cross-overs (for example, the IOC_FIR is in the IIC block...). We
have a bunch of files/drivers (pervasive, interrupts,...) who
re-implement their own way of getting a list of BE's and mapping per-BE
instance of these, doing it in different ways. We have various
definitions of these, essentially as C structures, either in local .c
files or .h files. It's a bit messy.

I'm tempted to create a common "module" (be_regs.c/h) to centralise that
a bit more. I talked to Paulus a bit and he seems to agree with the
approach. That is, put all the register block definitions and
appropriate constants in the .h file, along with an enum of the various
blocks. Then have the .c file, at boot, implement once and only once the
algorithm of going through all BE's and mapping in all these things, and
provide accessors for handing over a given mapped register block.

As the Cell platform maintainer, do you agree with this approach ? If
yes, then I'll send a patch for doing it and adapting the existing
modules in the upcoming couple of days that I'd like to have in 2.6.18
and the RAS stuff will depend on it. (Typically, the RAS stuff need to
peek at registers in a variety of different blocks, so the current
approach of having the various register blocks defined and mapped
locally doesn't work very well).

Note: I'm thinking about leaving the SPUs out of that since they are
fairly separate and have already their own .h and exported accessors.
It's more for IIC, BIU, IOC, PMD, etc...
 
Cheers,
Ben.





More information about the cbe-oss-dev mailing list