[PATCH 1/3] POWERPC] cpm2: CPM2 interrupt controller fix

Kumar Gala galak at kernel.crashing.org
Thu Jan 25 08:56:42 EST 2007


On Jan 24, 2007, at 1:19 PM, Vitaly Bordug wrote:

>
> This contains important fixes for the CPM2 PIC code. Eliminated
> CPM_IRQ_OFFSET, pulling the respective interrupt numbers from the  
> interrupt
> mapping. Updated devicetree files to reflect that. Changed direct
> IC-related IO accesses to the IO accessors. Fixed all the sense  
> values to
> keep coherency with ipic. In the current code, CPM2 stuff will have  
> no IRQs
> and hence could be hardly usable.
>
> Signed-off-by: Vitaly Bordug <vbordug at ru.mvista.com>
> ---
>
>  arch/powerpc/boot/dts/mpc8272ads.dts |   47 +++++++-----
>  arch/powerpc/boot/dts/mpc8560ads.dts |   10 +-
>  arch/powerpc/sysdev/cpm2_pic.c       |  138 ++++++++++++++++++ 
> +---------------
>  arch/powerpc/sysdev/cpm2_pic.h       |    9 ++
>  include/asm-powerpc/mpc8260.h        |   24 ++++++
>  5 files changed, 142 insertions(+), 86 deletions(-)

[snip]

> diff --git a/arch/powerpc/sysdev/cpm2_pic.h b/arch/powerpc/sysdev/ 
> cpm2_pic.h
> index 2840616..643a857 100644
> --- a/arch/powerpc/sysdev/cpm2_pic.h
> +++ b/arch/powerpc/sysdev/cpm2_pic.h
> @@ -1,6 +1,15 @@
>  #ifndef _PPC_KERNEL_CPM2_H
>  #define _PPC_KERNEL_CPM2_H
>
> +
> +/* External IRQS */
> +#define CPM2_IRQ_EXT1		19
> +#define CPM2_IRQ_EXT7		25
> +
> +/* Port C IRQS */
> +#define CPM2_IRQ_PORTC15	48
> +#define CPM2_IRQ_PORTC0		63
> +

Let's just add these defines in the .c since they aren't needed by  
anyone else.

>  extern intctl_cpm2_t *cpm2_intctl;

Can you explain the logic here with cpm2_intctl?  It seems like  
cpm2_reset sets this pointer and that's it.  Would it make more sense  
to just have cpm2_pic_init use cpm2_immr and keep cpm2_intctl static  
to cpm2_pic.c?

>  extern unsigned int cpm2_get_irq(void);

Also, we should think about moving cpm2_cascade() from 85xx into  
cpm2_pic.c/h

- kumar





More information about the Linuxppc-dev mailing list