8260 fcc_enet driver newbie question
I was going through the fcc_enet driver
(linux-2.6.12.2/arch/ppc/8260_io/fcc_enet.c).
The driver accesses the CPM memory map using
immap = (cpm2_map_t *)CPM_MAP_ADDR;
There is also a global variable cpm2_immr defined in arch/ppc/syslib/cpm2_common.c
If I were to write a new driver which one should I use to access the CPM memory map?
Vijay
Quoted 2 lines · Vijay Kumar
I was going through the
fcc_enetdriver
(linux-2.6.12.2/arch/ppc/8260_io/fcc_enet.c).
This has been replaced by the new net/fs_enet, right?
Quoted 2 lines
The driver accesses the CPM memory map using
immap = (cpm2_map_t*)CPM_MAP_ADDR;
Yes, and that's wrong. You should at least use ioremap(), and we recently had discussions about whether to create some properly named functions
or macros to return common addresses like the
CPM space.
Quoted 2 lines
There is also a global variable
cpm2_immrdefined inarch/ppc/syslib/cpm2_common.c
I know, but we shouldn't be doing that any longer.
Quoted 2 lines
If I were to write a new driver which one should I use to access the CPM memory map?
For now, at least ioremap() the space in your driver and cache the pointer. I'd like to quickly get a couple of these other supporting functions done to use, though.
Thanks.
-- Dan