diff options
author | Vitaly Bordug <vbordug@ru.mvista.com> | 2006-09-21 20:37:58 +0200 |
---|---|---|
committer | Vitaly Bordug <vbordug@ru.mvista.com> | 2006-09-21 20:37:58 +0200 |
commit | fc8e50e349aa722d9f97ed9ba30e324ede8fa408 (patch) | |
tree | 8ed14947a5c448f697240006efab77aac60281b7 /arch/powerpc/sysdev/cpm2_pic.c | |
parent | POWERPC: Add support for the mpc8560 eval board (diff) | |
download | linux-fc8e50e349aa722d9f97ed9ba30e324ede8fa408.tar.xz linux-fc8e50e349aa722d9f97ed9ba30e324ede8fa408.zip |
POWERPC: Get rid of remapping the whole immr
The stuff below cleans up the code attempting to remap the whole cpm2_immr
early, as well as places happily assuming that fact. This is more like the 2.4
legacy stuff, and is at least confusing and unclear now.
To keep the world comfortable, a new mechanism is introduced: before accessing
specific immr register/register set, one needs to map it, using cpm2_map(<reg>),
for instance, access to CPM command register will look like
volatile cpm_cpm2_t *cp = cpm2_map(im_cpm);
keeping the code clear, yet without "already defined somewhere" cpm2_immr.
So far, unmapping code is not implemented, but it's not a big deal to add it,
if the whole idea makes sense.
Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
Diffstat (limited to 'arch/powerpc/sysdev/cpm2_pic.c')
-rw-r--r-- | arch/powerpc/sysdev/cpm2_pic.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c index c804475c07d3..51752990f7b9 100644 --- a/arch/powerpc/sysdev/cpm2_pic.c +++ b/arch/powerpc/sysdev/cpm2_pic.c @@ -78,7 +78,7 @@ static void cpm2_mask_irq(unsigned int irq_nr) bit = irq_to_siubit[irq_nr]; word = irq_to_siureg[irq_nr]; - simr = &(cpm2_immr->im_intctl.ic_simrh); + simr = &(cpm2_intctl->ic_simrh); ppc_cached_irq_mask[word] &= ~(1 << bit); simr[word] = ppc_cached_irq_mask[word]; } @@ -93,7 +93,7 @@ static void cpm2_unmask_irq(unsigned int irq_nr) bit = irq_to_siubit[irq_nr]; word = irq_to_siureg[irq_nr]; - simr = &(cpm2_immr->im_intctl.ic_simrh); + simr = &(cpm2_intctl->ic_simrh); ppc_cached_irq_mask[word] |= 1 << bit; simr[word] = ppc_cached_irq_mask[word]; } @@ -108,8 +108,8 @@ static void cpm2_mask_and_ack(unsigned int irq_nr) bit = irq_to_siubit[irq_nr]; word = irq_to_siureg[irq_nr]; - simr = &(cpm2_immr->im_intctl.ic_simrh); - sipnr = &(cpm2_immr->im_intctl.ic_sipnrh); + simr = &(cpm2_intctl->ic_simrh); + sipnr = &(cpm2_intctl->ic_sipnrh); ppc_cached_irq_mask[word] &= ~(1 << bit); simr[word] = ppc_cached_irq_mask[word]; sipnr[word] = 1 << bit; @@ -127,7 +127,7 @@ static void cpm2_end_irq(unsigned int irq_nr) bit = irq_to_siubit[irq_nr]; word = irq_to_siureg[irq_nr]; - simr = &(cpm2_immr->im_intctl.ic_simrh); + simr = &(cpm2_intctl->ic_simrh); ppc_cached_irq_mask[word] |= 1 << bit; simr[word] = ppc_cached_irq_mask[word]; /* @@ -152,10 +152,10 @@ int cpm2_get_irq(struct pt_regs *regs) int irq; unsigned long bits; - /* For CPM2, read the SIVEC register and shift the bits down - * to get the irq number.*/ - bits = cpm2_immr->im_intctl.ic_sivec; - irq = bits >> 26; + /* For CPM2, read the SIVEC register and shift the bits down + * to get the irq number. */ + bits = cpm2_intctl->ic_sivec; + irq = bits >> 26; if (irq == 0) return(-1); @@ -223,26 +223,26 @@ void cpm2_pic_init(struct device_node *node) /* Mask out everything */ - cpm2_immr->im_intctl.ic_simrh = 0x00000000; - cpm2_immr->im_intctl.ic_simrl = 0x00000000; + cpm2_intctl->ic_simrh = 0x00000000; + cpm2_intctl->ic_simrl = 0x00000000; wmb(); /* Ack everything */ - cpm2_immr->im_intctl.ic_sipnrh = 0xffffffff; - cpm2_immr->im_intctl.ic_sipnrl = 0xffffffff; + cpm2_intctl->ic_sipnrh = 0xffffffff; + cpm2_intctl->ic_sipnrl = 0xffffffff; wmb(); /* Dummy read of the vector */ - i = cpm2_immr->im_intctl.ic_sivec; + i = cpm2_intctl->ic_sivec; rmb(); /* Initialize the default interrupt mapping priorities, * in case the boot rom changed something on us. */ - cpm2_immr->im_intctl.ic_sicr = 0; - cpm2_immr->im_intctl.ic_scprrh = 0x05309770; - cpm2_immr->im_intctl.ic_scprrl = 0x05309770; + cpm2_intctl->ic_sicr = 0; + cpm2_intctl->ic_scprrh = 0x05309770; + cpm2_intctl->ic_scprrl = 0x05309770; /* create a legacy host */ if (node) |