Subject: Re: removing get_immrbase()??

From: Scott Wood <[email-masked]>
Date: Wed, 22 Apr 2009 14:44:20 -0500

Kumar Gala wrote:
> I'm not sure if we can actually get away with completely removing 
> get_immrbase() but I figured I'd give everyone something to flame me 
> about.  The current users are:

I think we want to keep it for an eventual re-introduction of a large 
TLB entry to cover IMMR (but no longer at a fixed virtual address, of 
course).

> CPM/QE related users.
> 
> arch/powerpc/include/asm/cpm1.h:#define IMAP_ADDR        (get_immrbase())
> 
>     only used drivers/net/fs_enet/fs_enet-main.c which seems evil.

That driver *is* evil. :-)

It looks like the only remaining user of fs_enet_immap (which is what 
IMAP_ADDR is used to initialize) is in mac-fec.c, under CONFIG_DUET -- 
which hasn't been touched since 2005 and appears to have died with arch/ppc.

I'm fine with removing it -- it probably no longer compiles anyway.

> arch/powerpc/sysdev/cpm1.c:    mpc8xx_immr = ioremap(get_immrbase(), 
> 0x4000);
>     not sure? ideas?

This is used for accessing a variety of registers, not all of which are 
currently expressed in the device tree.

> arch/powerpc/include/asm/cpm2.h:#define CPM_MAP_ADDR (get_immrbase() + 
> 0x80000)
> arch/powerpc/sysdev/cpm2.c:    cpm2_immr = ioremap(get_immrbase(), 
> CPM_MAP_SIZE);
>     these two are related and seem like we could look for "fsl,cpm2"

And do what with it that wouldn't be a reimplementation of get_immrbase()?

> arch/powerpc/platforms/83xx/suspend.c:    rcw_regs = 
> ioremap(get_immrbase() + IMMR_RCW_OFFSET,
> arch/powerpc/platforms/83xx/suspend.c:    immrbase = get_immrbase();

The suspend code touches a variety of SOC registers in various blocks -- 
likely including some which are not described by any device node at present.

-Scott