[Cbe-oss-dev] [PATCH] powerpc: New DCR access methods

Benjamin Herrenschmidt benh at kernel.crashing.org
Mon Oct 16 18:21:52 EST 2006


> > +#ifdef CONFIG_PPC_DCR_NATIVE
> > +#include <asm/dcr-native.h>
> > +#else
> > +#include <asm/dcr-mmio.h>
> > +#endif
> 
> Having this as a compile-time switch seems broken.  I thought the plan was
> to support all different 64bit kernels with a single kernel binary?

"native" DCRs only exist in 32 bits 4xx / BookE processors as of today.

Basically, those processors have mtdcr and mfdcr instructions to access
those special "registers". They are in fact connected to a bus to
control various IOs. On AXON (and possibly other future chips), since
the host processor doesn't have those instructions, they are memory
mapped.

There is currently no way you can have both in the same kernel. If that
ever happens, then the "mmio" version could easily be tweaked to deal
with both. However, the "native only" implementation is useful for
embedded 4xx etc... as it resolves directly to mfdcr/mtdcr instructions,
dcr_map is an empty macro, etc... thus there is 0 overhead of switching
4xx code to the new dcr accessors.

Ben.





More information about the cbe-oss-dev mailing list