* Accessing the CPM2 on an MPC82xx : CPM_MAP_ADDR or cpm2_immr ?
@ 2006-02-02 13:58 Laurent Pinchart
2006-02-02 14:07 ` Vitaly Bordug
0 siblings, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2006-02-02 13:58 UTC (permalink / raw)
To: linuxppc-embedded
Hi everybody,
I noticed that the CPM2 module is accessed both through CPM_MAP_ADDR (physical
address) and cpm2_immr (ioremap()ed address). For instance, the fec_enet
driver configures the IO ports using (cpm2_map_t*)CPM_MAP_ADDR.
What's the correct way to access the CPM2 module ? Does ioremap() map
CPM_MAP_ADDR to itself so that both ways are correct ?
Laurent Pinchart
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Accessing the CPM2 on an MPC82xx : CPM_MAP_ADDR or cpm2_immr ?
2006-02-02 13:58 Accessing the CPM2 on an MPC82xx : CPM_MAP_ADDR or cpm2_immr ? Laurent Pinchart
@ 2006-02-02 14:07 ` Vitaly Bordug
2006-02-02 15:42 ` Laurent Pinchart
0 siblings, 1 reply; 4+ messages in thread
From: Vitaly Bordug @ 2006-02-02 14:07 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linuxppc-embedded
On Thu, 2 Feb 2006 14:58:26 +0100
Laurent Pinchart <laurent.pinchart@tbox.biz> wrote:
> Hi everybody,
>
> I noticed that the CPM2 module is accessed both through CPM_MAP_ADDR (physical
> address) and cpm2_immr (ioremap()ed address). For instance, the fec_enet
> driver configures the IO ports using (cpm2_map_t*)CPM_MAP_ADDR.
>
Mentioned driver is deprecated.
> What's the correct way to access the CPM2 module ? Does ioremap() map
> CPM_MAP_ADDR to itself so that both ways are correct ?
>
Even direct cpm2_immr usage is not a good thing, but I cannot tell more without knowing your concerns. Can you please describe what you are planning to implement, prolly we can advice how to do that proper way.
> Laurent Pinchart
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
--
Sincerely,
Vitaly
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Accessing the CPM2 on an MPC82xx : CPM_MAP_ADDR or cpm2_immr ?
2006-02-02 14:07 ` Vitaly Bordug
@ 2006-02-02 15:42 ` Laurent Pinchart
2006-02-02 18:55 ` Dan Malek
0 siblings, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2006-02-02 15:42 UTC (permalink / raw)
To: Vitaly Bordug; +Cc: linuxppc-embedded
> > I noticed that the CPM2 module is accessed both through CPM_MAP_ADDR
> > (physical address) and cpm2_immr (ioremap()ed address). For instance, the
> > fec_enet driver configures the IO ports using (cpm2_map_t*)CPM_MAP_ADDR.
>
> Mentioned driver is deprecated.
It has been replaced by drivers/net/fs_enet, right ? The new driver doesn't
support the LXT971/LXT971A PHY chipsets yet, so I'm still using the old one.
> > What's the correct way to access the CPM2 module ? Does ioremap() map
> > CPM_MAP_ADDR to itself so that both ways are correct ?
>
> Even direct cpm2_immr usage is not a good thing, but I cannot tell more
> without knowing your concerns. Can you please describe what you are
> planning to implement, prolly we can advice how to do that proper way.
I'm currently just hacking IDMA transfers to make sure the signals we plan to
use on a custom design work as expected. I will later work on the USB host
controller driver.
The new fs_enet driver internally maps CPM_MAP_ADDR. Should every driver
create an internal CPM mapping ? Why was the old fec_enet driver able to
access the CPM through CPM_MAP_ADDR without ioremap()ing it first ?
Laurent Pinchart
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Accessing the CPM2 on an MPC82xx : CPM_MAP_ADDR or cpm2_immr ?
2006-02-02 15:42 ` Laurent Pinchart
@ 2006-02-02 18:55 ` Dan Malek
0 siblings, 0 replies; 4+ messages in thread
From: Dan Malek @ 2006-02-02 18:55 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linuxppc-embedded
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-02-02 18:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-02 13:58 Accessing the CPM2 on an MPC82xx : CPM_MAP_ADDR or cpm2_immr ? Laurent Pinchart
2006-02-02 14:07 ` Vitaly Bordug
2006-02-02 15:42 ` Laurent Pinchart
2006-02-02 18:55 ` Dan Malek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).