diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-23 14:28:04 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-23 14:28:04 -0400 |
commit | 9a55d9752d8abfc62f1ab05ccc790d22a0c8e7c0 (patch) | |
tree | 894bb6a3fb409c6ac5f0374f5a1f656918bc35cd /arch/arm/mach-davinci | |
parent | ec19628d72cff8f80220b7cedba089074ac6a599 (diff) | |
parent | dc7ad3b3d5f1cd0a0d16c05dd3ad3898979d261e (diff) |
Merge branch 'devel-stable' into for-linus
Conflicts:
arch/arm/Kconfig
arch/arm/mach-ns9xxx/include/mach/uncompress.h
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r-- | arch/arm/mach-davinci/include/mach/uncompress.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-davinci/irq.c | 93 |
2 files changed, 23 insertions, 75 deletions
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h index 47723e8d75a4..78d80683cdc2 100644 --- a/arch/arm/mach-davinci/include/mach/uncompress.h +++ b/arch/arm/mach-davinci/include/mach/uncompress.h | |||
@@ -25,8 +25,7 @@ | |||
25 | 25 | ||
26 | #include <mach/serial.h> | 26 | #include <mach/serial.h> |
27 | 27 | ||
28 | static u32 *uart; | 28 | u32 *uart; |
29 | static u32 *uart_info = (u32 *)(DAVINCI_UART_INFO); | ||
30 | 29 | ||
31 | /* PORT_16C550A, in polled non-fifo mode */ | 30 | /* PORT_16C550A, in polled non-fifo mode */ |
32 | static void putc(char c) | 31 | static void putc(char c) |
@@ -44,6 +43,8 @@ static inline void flush(void) | |||
44 | 43 | ||
45 | static inline void set_uart_info(u32 phys, void * __iomem virt) | 44 | static inline void set_uart_info(u32 phys, void * __iomem virt) |
46 | { | 45 | { |
46 | u32 *uart_info = (u32 *)(DAVINCI_UART_INFO); | ||
47 | |||
47 | uart = (u32 *)phys; | 48 | uart = (u32 *)phys; |
48 | uart_info[0] = phys; | 49 | uart_info[0] = phys; |
49 | uart_info[1] = (u32)virt; | 50 | uart_info[1] = (u32)virt; |
diff --git a/arch/arm/mach-davinci/irq.c b/arch/arm/mach-davinci/irq.c index e6269a6e0014..bfe68ec4e1a6 100644 --- a/arch/arm/mach-davinci/irq.c +++ b/arch/arm/mach-davinci/irq.c | |||
@@ -29,8 +29,6 @@ | |||
29 | #include <mach/common.h> | 29 | #include <mach/common.h> |
30 | #include <asm/mach/irq.h> | 30 | #include <asm/mach/irq.h> |
31 | 31 | ||
32 | #define IRQ_BIT(irq) ((irq) & 0x1f) | ||
33 | |||
34 | #define FIQ_REG0_OFFSET 0x0000 | 32 | #define FIQ_REG0_OFFSET 0x0000 |
35 | #define FIQ_REG1_OFFSET 0x0004 | 33 | #define FIQ_REG1_OFFSET 0x0004 |
36 | #define IRQ_REG0_OFFSET 0x0008 | 34 | #define IRQ_REG0_OFFSET 0x0008 |
@@ -42,78 +40,33 @@ | |||
42 | #define IRQ_INTPRI0_REG_OFFSET 0x0030 | 40 | #define IRQ_INTPRI0_REG_OFFSET 0x0030 |
43 | #define IRQ_INTPRI7_REG_OFFSET 0x004C | 41 | #define IRQ_INTPRI7_REG_OFFSET 0x004C |
44 | 42 | ||
45 | static inline unsigned int davinci_irq_readl(int offset) | ||
46 | { | ||
47 | return __raw_readl(davinci_intc_base + offset); | ||
48 | } | ||
49 | |||
50 | static inline void davinci_irq_writel(unsigned long value, int offset) | 43 | static inline void davinci_irq_writel(unsigned long value, int offset) |
51 | { | 44 | { |
52 | __raw_writel(value, davinci_intc_base + offset); | 45 | __raw_writel(value, davinci_intc_base + offset); |
53 | } | 46 | } |
54 | 47 | ||
55 | /* Disable interrupt */ | 48 | static __init void |
56 | static void davinci_mask_irq(struct irq_data *d) | 49 | davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) |
57 | { | 50 | { |
58 | unsigned int mask; | 51 | struct irq_chip_generic *gc; |
59 | u32 l; | 52 | struct irq_chip_type *ct; |
60 | 53 | ||
61 | mask = 1 << IRQ_BIT(d->irq); | 54 | gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq); |
62 | 55 | ct = gc->chip_types; | |
63 | if (d->irq > 31) { | 56 | ct->chip.irq_ack = irq_gc_ack; |
64 | l = davinci_irq_readl(IRQ_ENT_REG1_OFFSET); | 57 | ct->chip.irq_mask = irq_gc_mask_clr_bit; |
65 | l &= ~mask; | 58 | ct->chip.irq_unmask = irq_gc_mask_set_bit; |
66 | davinci_irq_writel(l, IRQ_ENT_REG1_OFFSET); | 59 | |
67 | } else { | 60 | ct->regs.ack = IRQ_REG0_OFFSET; |
68 | l = davinci_irq_readl(IRQ_ENT_REG0_OFFSET); | 61 | ct->regs.mask = IRQ_ENT_REG0_OFFSET; |
69 | l &= ~mask; | 62 | irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE, |
70 | davinci_irq_writel(l, IRQ_ENT_REG0_OFFSET); | 63 | IRQ_NOREQUEST | IRQ_NOPROBE, 0); |
71 | } | ||
72 | } | ||
73 | |||
74 | /* Enable interrupt */ | ||
75 | static void davinci_unmask_irq(struct irq_data *d) | ||
76 | { | ||
77 | unsigned int mask; | ||
78 | u32 l; | ||
79 | |||
80 | mask = 1 << IRQ_BIT(d->irq); | ||
81 | |||
82 | if (d->irq > 31) { | ||
83 | l = davinci_irq_readl(IRQ_ENT_REG1_OFFSET); | ||
84 | l |= mask; | ||
85 | davinci_irq_writel(l, IRQ_ENT_REG1_OFFSET); | ||
86 | } else { | ||
87 | l = davinci_irq_readl(IRQ_ENT_REG0_OFFSET); | ||
88 | l |= mask; | ||
89 | davinci_irq_writel(l, IRQ_ENT_REG0_OFFSET); | ||
90 | } | ||
91 | } | 64 | } |
92 | 65 | ||
93 | /* EOI interrupt */ | ||
94 | static void davinci_ack_irq(struct irq_data *d) | ||
95 | { | ||
96 | unsigned int mask; | ||
97 | |||
98 | mask = 1 << IRQ_BIT(d->irq); | ||
99 | |||
100 | if (d->irq > 31) | ||
101 | davinci_irq_writel(mask, IRQ_REG1_OFFSET); | ||
102 | else | ||
103 | davinci_irq_writel(mask, IRQ_REG0_OFFSET); | ||
104 | } | ||
105 | |||
106 | static struct irq_chip davinci_irq_chip_0 = { | ||
107 | .name = "AINTC", | ||
108 | .irq_ack = davinci_ack_irq, | ||
109 | .irq_mask = davinci_mask_irq, | ||
110 | .irq_unmask = davinci_unmask_irq, | ||
111 | }; | ||
112 | |||
113 | /* ARM Interrupt Controller Initialization */ | 66 | /* ARM Interrupt Controller Initialization */ |
114 | void __init davinci_irq_init(void) | 67 | void __init davinci_irq_init(void) |
115 | { | 68 | { |
116 | unsigned i; | 69 | unsigned i, j; |
117 | const u8 *davinci_def_priorities = davinci_soc_info.intc_irq_prios; | 70 | const u8 *davinci_def_priorities = davinci_soc_info.intc_irq_prios; |
118 | 71 | ||
119 | davinci_intc_type = DAVINCI_INTC_TYPE_AINTC; | 72 | davinci_intc_type = DAVINCI_INTC_TYPE_AINTC; |
@@ -144,7 +97,6 @@ void __init davinci_irq_init(void) | |||
144 | davinci_irq_writel(~0x0, IRQ_REG1_OFFSET); | 97 | davinci_irq_writel(~0x0, IRQ_REG1_OFFSET); |
145 | 98 | ||
146 | for (i = IRQ_INTPRI0_REG_OFFSET; i <= IRQ_INTPRI7_REG_OFFSET; i += 4) { | 99 | for (i = IRQ_INTPRI0_REG_OFFSET; i <= IRQ_INTPRI7_REG_OFFSET; i += 4) { |
147 | unsigned j; | ||
148 | u32 pri; | 100 | u32 pri; |
149 | 101 | ||
150 | for (j = 0, pri = 0; j < 32; j += 4, davinci_def_priorities++) | 102 | for (j = 0, pri = 0; j < 32; j += 4, davinci_def_priorities++) |
@@ -152,13 +104,8 @@ void __init davinci_irq_init(void) | |||
152 | davinci_irq_writel(pri, i); | 104 | davinci_irq_writel(pri, i); |
153 | } | 105 | } |
154 | 106 | ||
155 | /* set up genirq dispatch for ARM INTC */ | 107 | for (i = 0, j = 0; i < davinci_soc_info.intc_irq_num; i += 32, j += 0x04) |
156 | for (i = 0; i < davinci_soc_info.intc_irq_num; i++) { | 108 | davinci_alloc_gc(davinci_intc_base + j, i, 32); |
157 | irq_set_chip(i, &davinci_irq_chip_0); | 109 | |
158 | set_irq_flags(i, IRQF_VALID | IRQF_PROBE); | 110 | irq_set_handler(IRQ_TINT1_TINT34, handle_level_irq); |
159 | if (i != IRQ_TINT1_TINT34) | ||
160 | irq_set_handler(i, handle_edge_irq); | ||
161 | else | ||
162 | irq_set_handler(i, handle_level_irq); | ||
163 | } | ||
164 | } | 111 | } |