Accessing the CPM2 on an MPC82xx : CPM_MAP_ADDR or cpm2_immr ?

Dan Malek dan at embeddededge.com
Fri Feb 3 05:55:36 EST 2006


On Feb 2, 2006, at 10:42 AM, Laurent Pinchart wrote:

> The new fs_enet driver internally maps CPM_MAP_ADDR. Should every 
> driver
> create an internal CPM mapping ?

Yes, they should.  All drivers should do the ioremap() and stash the
pointer internally.

> .... Why was the old fec_enet driver able to
> access the CPM through CPM_MAP_ADDR without ioremap()ing it first ?

Because that's a long left over "performance hack" from many
years ago when I first implemented the 8xx software.  The IMMR used
to be mapped to a well known virtual address, the board initialization
did this early, and everyone (ab)used it.  This was way back in the 
2.0/2.1
days when it was acceptable to do such things :-)  Due to the CPM2 now
being used on may different Freescale parts, and mapped in various
ways, the internal mapping should be done by every driver.

Thanks.

	-- Dan




More information about the Linuxppc-embedded mailing list