ARM: pxa: avoid accessing interrupt registers directly
Subsystems (3)
PATCH 1/2 ARM: pxa: avoid accessing interrupt registers directly
Signed-off-by Eric Miao <[email protected]>
--- arch/arm/mach-pxa/include/mach/irqs.h | 7 ++++++ arch/arm/mach-pxa/include/mach/regs-intc.h | 30 ---------------------------- arch/arm/mach-pxa/irq.c | 4 +- arch/arm/mach-pxa/pxa3xx.c | 5 +-- arch/arm/mach-pxa/pxa95x.c | 1 - 5 files changed, 11 insertions(+), 36 deletions(-) delete mode 100644 arch/arm/mach-pxa/include/mach/regs-intc.h
arch/arm/mach-pxa/include/mach/irqs.h +7 -0
@@ -104,4 +104,11 @@#define NR_IRQS (IRQ_BOARD_START) +#ifndef __ASSEMBLY__ +struct irq_data ; + +void pxa_mask_irq (struct irq_data *); +void pxa_unmask_irq (struct irq_data *); +#endif +#endif /* __ASM_MACH_IRQS_H */
arch/arm/mach-pxa/include/mach/regs-intc.h deleted +0 -30
@@ -1,30 +0,0 @@ -#ifndef __ASM_MACH_REGS_INTC_H -#define __ASM_MACH_REGS_INTC_H - -#include <mach/hardware.h> - -/* -* Interrupt Controller -*/ - -#define ICIP __REG(0x40D00000)/* Interrupt Controller IRQ Pending Register */ -#define ICMR __REG(0x40D00004)/* Interrupt Controller Mask Register */ -#define ICLR __REG(0x40D00008)/* Interrupt Controller Level Register */ -#define ICFP __REG(0x40D0000C)/* Interrupt Controller FIQ Pending Register */ -#define ICPR __REG(0x40D00010)/* Interrupt Controller Pending Register */ -#define ICCR __REG(0x40D00014)/* Interrupt Controller Control Register */ -#define ICHP __REG(0x40D00018)/* Interrupt Controller Highest Priority Register */ - -#define ICIP2 __REG(0x40D0009C)/* Interrupt Controller IRQ Pending Register 2 */ -#define ICMR2 __REG(0x40D000A0)/* Interrupt Controller Mask Register 2 */ -#define ICLR2 __REG(0x40D000A4)/* Interrupt Controller Level Register 2 */ -#define ICFP2 __REG(0x40D000A8)/* Interrupt Controller FIQ Pending Register 2 */ -#define ICPR2 __REG(0x40D000AC)/* Interrupt Controller Pending Register 2 */ - -#define ICIP3 __REG(0x40D00130)/* Interrupt Controller IRQ Pending Register 3 */ -#define ICMR3 __REG(0x40D00134)/* Interrupt Controller Mask Register 3 */ -#define ICLR3 __REG(0x40D00138)/* Interrupt Controller Level Register 3 */ -#define ICFP3 __REG(0x40D0013C)/* Interrupt Controller FIQ Pending Register 3 */ -#define ICPR3 __REG(0x40D00140)/* Interrupt Controller Pending Register 3 */ - -#endif /* __ASM_MACH_REGS_INTC_H */
arch/arm/mach-pxa/irq.c +2 -2
@@ -64,7 +64,7 @@ static inline void __iomem *irq_base(int i)return (void __iomem *)io_p2v (phys_base[i]); } -static void pxa_mask_irq (struct irq_data *d) +void pxa_mask_irq (struct irq_data *d) {void __iomem *base =irq_data_get_irq_chip_data (d);uint32_t icmr =__raw_readl (base +ICMR );
@@ -73,7 +73,7 @@ static void pxa_mask_irq(struct irq_data *d)__raw_writel (icmr, base +ICMR ); } -static void pxa_unmask_irq (struct irq_data *d) +void pxa_unmask_irq (struct irq_data *d) {void __iomem *base =irq_data_get_irq_chip_data (d);uint32_t icmr =__raw_readl (base +ICMR );
arch/arm/mach-pxa/pxa3xx.c +2 -3
@@ -31,7 +31,6 @@#include <mach/ohci.h> #include <mach/pm.h> #include <mach/dma.h> -#include <mach/regs-intc.h> #include <mach/smemc.h> #include "generic.h"
@@ -328,13 +327,13 @@ static void pxa_ack_ext_wakeup(struct irq_data *d)static void pxa_mask_ext_wakeup (struct irq_data *d) { -ICMR2 &= ~(1 << ((d->irq -PXA_IRQ (0 )) &0x1f )); +pxa_mask_irq (d);PECR &= ~PECR_IE (d->irq -IRQ_WAKEUP0 ); }static void pxa_unmask_ext_wakeup (struct irq_data *d) { -ICMR2 |=1 << ((d->irq -PXA_IRQ (0 )) &0x1f ); +pxa_unmask_irq (d);PECR |=PECR_IE (d->irq -IRQ_WAKEUP0 ); }
arch/arm/mach-pxa/pxa95x.c +0 -1
@@ -27,7 +27,6 @@#include <mach/reset.h> #include <mach/pm.h> #include <mach/dma.h> -#include <mach/regs-intc.h> #include "generic.h" #include "devices.h"
Signature · 1 line
1.7.1
PATCH 2/2 ARM: pxa: introduce {icip, ichp}_handle_irq() to prepare MULTI_IRQ_HANDLER
Signed-off-by Eric Miao <[email protected]>
--- arch/arm/mach-pxa/include/mach/irqs.h | 3 +++ arch/arm/mach-pxa/irq.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 0 deletions(-)
arch/arm/mach-pxa/include/mach/irqs.h +3 -0
@@ -106,9 +106,12 @@#ifndef __ASSEMBLY__struct irq_data ; +struct pt_regs ;void pxa_mask_irq (struct irq_data *);void pxa_unmask_irq (struct irq_data *); +void icip_handle_irq (struct pt_regs *); +void ichp_handle_irq (struct pt_regs *);#endif #endif /* __ASM_MACH_IRQS_H */
arch/arm/mach-pxa/irq.c +32 -0
@@ -37,6 +37,8 @@#define IPR (i) (((i) < 32) ? (0x01c + ((i) << 2)) : \ ((i) < 64) ? (0x0b0 + (((i) - 32) << 2)) : \ (0x144 + (((i) - 64) << 2))) +#define ICHP_VAL_IRQ (1 << 31) +#define ICHP_IRQ (i) (((i) >> 16) & 0x7fff)#define IPR_VALID (1 << 31)#define IRQ_BIT (n) (((n) - PXA_IRQ(0)) & 0x1f)
@@ -127,6 +129,36 @@ static struct irq_chip pxa_low_gpio_chip = { .irq_set_type = pxa_set_low_gpio_type, }; +asmlinkage void __exception_irq_entry icip_handle_irq(struct pt_regs *regs) +{ +uint32_t icip, icmr, mask; + +do { + icip =__raw_readl (IRQ_BASE +ICIP ); + icmr =__raw_readl (IRQ_BASE +ICMR ); + mask = icip & icmr; + +if (mask ==0 ) +break ; + +asm_do_IRQ (fls (mask) -1 , regs); + }while (1 ); +} + +asmlinkage void __exception_irq_entry ichp_handle_irq(struct pt_regs *regs) +{ +uint32_t ichp; + +do { + __asm__ __volatile__("mrc p6, 0, %0, c5, c0, 0\n" :"=r" (ichp)); + +if ((ichp &ICHP_VAL_IRQ ) ==0 ) +break ; + +asm_do_IRQ (PXA_IRQ (ICHP_IRQ (ichp)), regs); + }while (1 ); +} +static void __init pxa_init_low_gpio_irq (set_wake_t fn) {int irq;
Signature · 1 line
1.7.1