diff options
author | Pavel Pisa <ppisa@pikron.com> | 2007-11-18 16:54:24 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-11-26 14:43:37 -0500 |
commit | 1c016b2c728b2ecbdd4088bd42e556fd29065cc5 (patch) | |
tree | ff1a6e2f7b2df8c2076a0df999d0d0645989bdf2 /arch/arm/mach-imx/irq.c | |
parent | 2ffbb8377c7a0713baf6644e285adc27a5654582 (diff) |
[ARM] 4648/1: i.MX/MX1 ensure more complete AITC initialization
The AITC code did not allow to start kernel, if bootloader
manipulates with interrupt level mask. The change ensures,
that NIMASK is initialized into correct state and that
interrupts enable registers are cleared.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-imx/irq.c')
-rw-r--r-- | arch/arm/mach-imx/irq.c | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c index 0791b56caecc..a7465db84893 100644 --- a/arch/arm/mach-imx/irq.c +++ b/arch/arm/mach-imx/irq.c | |||
@@ -43,12 +43,46 @@ | |||
43 | * | 43 | * |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #define INTENNUM_OFF 0x8 | 46 | #define INTCNTL_OFF 0x00 |
47 | #define INTDISNUM_OFF 0xC | 47 | #define NIMASK_OFF 0x04 |
48 | #define INTENNUM_OFF 0x08 | ||
49 | #define INTDISNUM_OFF 0x0C | ||
50 | #define INTENABLEH_OFF 0x10 | ||
51 | #define INTENABLEL_OFF 0x14 | ||
52 | #define INTTYPEH_OFF 0x18 | ||
53 | #define INTTYPEL_OFF 0x1C | ||
54 | #define NIPRIORITY_OFF(x) (0x20+4*(7-(x))) | ||
55 | #define NIVECSR_OFF 0x40 | ||
56 | #define FIVECSR_OFF 0x44 | ||
57 | #define INTSRCH_OFF 0x48 | ||
58 | #define INTSRCL_OFF 0x4C | ||
59 | #define INTFRCH_OFF 0x50 | ||
60 | #define INTFRCL_OFF 0x54 | ||
61 | #define NIPNDH_OFF 0x58 | ||
62 | #define NIPNDL_OFF 0x5C | ||
63 | #define FIPNDH_OFF 0x60 | ||
64 | #define FIPNDL_OFF 0x64 | ||
48 | 65 | ||
49 | #define VA_AITC_BASE IO_ADDRESS(IMX_AITC_BASE) | 66 | #define VA_AITC_BASE IO_ADDRESS(IMX_AITC_BASE) |
50 | #define IMX_AITC_INTDISNUM (VA_AITC_BASE + INTDISNUM_OFF) | 67 | #define IMX_AITC_INTCNTL (VA_AITC_BASE + INTCNTL_OFF) |
68 | #define IMX_AITC_NIMASK (VA_AITC_BASE + NIMASK_OFF) | ||
51 | #define IMX_AITC_INTENNUM (VA_AITC_BASE + INTENNUM_OFF) | 69 | #define IMX_AITC_INTENNUM (VA_AITC_BASE + INTENNUM_OFF) |
70 | #define IMX_AITC_INTDISNUM (VA_AITC_BASE + INTDISNUM_OFF) | ||
71 | #define IMX_AITC_INTENABLEH (VA_AITC_BASE + INTENABLEH_OFF) | ||
72 | #define IMX_AITC_INTENABLEL (VA_AITC_BASE + INTENABLEL_OFF) | ||
73 | #define IMX_AITC_INTTYPEH (VA_AITC_BASE + INTTYPEH_OFF) | ||
74 | #define IMX_AITC_INTTYPEL (VA_AITC_BASE + INTTYPEL_OFF) | ||
75 | #define IMX_AITC_NIPRIORITY(x) (VA_AITC_BASE + NIPRIORITY_OFF(x)) | ||
76 | #define IMX_AITC_NIVECSR (VA_AITC_BASE + NIVECSR_OFF) | ||
77 | #define IMX_AITC_FIVECSR (VA_AITC_BASE + FIVECSR_OFF) | ||
78 | #define IMX_AITC_INTSRCH (VA_AITC_BASE + INTSRCH_OFF) | ||
79 | #define IMX_AITC_INTSRCL (VA_AITC_BASE + INTSRCL_OFF) | ||
80 | #define IMX_AITC_INTFRCH (VA_AITC_BASE + INTFRCH_OFF) | ||
81 | #define IMX_AITC_INTFRCL (VA_AITC_BASE + INTFRCL_OFF) | ||
82 | #define IMX_AITC_NIPNDH (VA_AITC_BASE + NIPNDH_OFF) | ||
83 | #define IMX_AITC_NIPNDL (VA_AITC_BASE + NIPNDL_OFF) | ||
84 | #define IMX_AITC_FIPNDH (VA_AITC_BASE + FIPNDH_OFF) | ||
85 | #define IMX_AITC_FIPNDL (VA_AITC_BASE + FIPNDL_OFF) | ||
52 | 86 | ||
53 | #if 0 | 87 | #if 0 |
54 | #define DEBUG_IRQ(fmt...) printk(fmt) | 88 | #define DEBUG_IRQ(fmt...) printk(fmt) |
@@ -222,7 +256,12 @@ imx_init_irq(void) | |||
222 | 256 | ||
223 | DEBUG_IRQ("Initializing imx interrupts\n"); | 257 | DEBUG_IRQ("Initializing imx interrupts\n"); |
224 | 258 | ||
225 | /* Mask all interrupts initially */ | 259 | /* Disable all interrupts initially. */ |
260 | /* Do not rely on the bootloader. */ | ||
261 | __raw_writel(0, IMX_AITC_INTENABLEH); | ||
262 | __raw_writel(0, IMX_AITC_INTENABLEL); | ||
263 | |||
264 | /* Mask all GPIO interrupts as well */ | ||
226 | IMR(0) = 0; | 265 | IMR(0) = 0; |
227 | IMR(1) = 0; | 266 | IMR(1) = 0; |
228 | IMR(2) = 0; | 267 | IMR(2) = 0; |
@@ -245,6 +284,6 @@ imx_init_irq(void) | |||
245 | set_irq_chained_handler(GPIO_INT_PORTC, imx_gpioc_demux_handler); | 284 | set_irq_chained_handler(GPIO_INT_PORTC, imx_gpioc_demux_handler); |
246 | set_irq_chained_handler(GPIO_INT_PORTD, imx_gpiod_demux_handler); | 285 | set_irq_chained_handler(GPIO_INT_PORTD, imx_gpiod_demux_handler); |
247 | 286 | ||
248 | /* Disable all interrupts initially. */ | 287 | /* Release masking of interrupts according to priority */ |
249 | /* In IMX this is done in the bootloader. */ | 288 | __raw_writel(-1, IMX_AITC_NIMASK); |
250 | } | 289 | } |