diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 18:15:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 18:15:27 -0400 |
commit | 42cd71bf1e3a081b3150018bbf448cb6c8a844a5 (patch) | |
tree | 4a5d2eb0444255e4ad827a76dbd1417dd3876db6 /arch/arm/mach-omap2 | |
parent | f5039935ac685b3b9b8c13fbc33cac8643dee32e (diff) | |
parent | 9a55d9752d8abfc62f1ab05ccc790d22a0c8e7c0 (diff) |
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (137 commits)
ARM: bcmring: convert to use sp804 clockevents
ARM: bcmring: convert to sp804 clocksource
ARM: 6912/1: bcmring: Add clkdev table in init_early
clockevents: ARM sp804: obtain sp804 timer rate via clks
clockevents: ARM sp804: allow clockevent name to be specified
clocksource: ARM sp804: obtain sp804 timer rate via clks
clocksource: ARM sp804: allow clocksource name to be specified
clocksource: convert OMAP1 to 32-bit down counting clocksource
clocksource: convert MXS timrotv2 to 32-bit down counting clocksource
clocksource: convert SPEAr platforms 16-bit up counting clocksource
clocksource: convert Integrator/AP 16-bit down counting clocksource
clocksource: convert W90x900 24-bit down counting clocksource
clocksource: convert ARM 32-bit down counting clocksources
clocksource: convert ARM 32-bit up counting clocksources
clocksource: add common mmio clocksource
ARM: update sa1100 to reflect PXA updates
ARM: omap1: convert to using readl/writel instead of volatile struct
ARM: omap1: delete useless interrupt handler
ARM: s5p: consolidate selection of timer register
ARM: 6939/1: fix missing 'cpu_relax()' declaration
...
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/include/mach/omap4-common.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-omap2/irq.c | 97 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap-smp.c | 5 |
3 files changed, 36 insertions, 73 deletions
diff --git a/arch/arm/mach-omap2/include/mach/omap4-common.h b/arch/arm/mach-omap2/include/mach/omap4-common.h index de441c05a6a6..e4bd87619734 100644 --- a/arch/arm/mach-omap2/include/mach/omap4-common.h +++ b/arch/arm/mach-omap2/include/mach/omap4-common.h | |||
@@ -33,4 +33,11 @@ extern void __iomem *gic_dist_base_addr; | |||
33 | extern void __init gic_init_irq(void); | 33 | extern void __init gic_init_irq(void); |
34 | extern void omap_smc1(u32 fn, u32 arg); | 34 | extern void omap_smc1(u32 fn, u32 arg); |
35 | 35 | ||
36 | #ifdef CONFIG_SMP | ||
37 | /* Needed for secondary core boot */ | ||
38 | extern void omap_secondary_startup(void); | ||
39 | extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask); | ||
40 | extern void omap_auxcoreboot_addr(u32 cpu_addr); | ||
41 | extern u32 omap_read_auxcoreboot0(void); | ||
42 | #endif | ||
36 | #endif | 43 | #endif |
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c index 237e4530abf2..3af2b7a1045e 100644 --- a/arch/arm/mach-omap2/irq.c +++ b/arch/arm/mach-omap2/irq.c | |||
@@ -73,83 +73,18 @@ static u32 intc_bank_read_reg(struct omap_irq_bank *bank, u16 reg) | |||
73 | return __raw_readl(bank->base_reg + reg); | 73 | return __raw_readl(bank->base_reg + reg); |
74 | } | 74 | } |
75 | 75 | ||
76 | static int previous_irq; | ||
77 | |||
78 | /* | ||
79 | * On 34xx we can get occasional spurious interrupts if the ack from | ||
80 | * an interrupt handler does not get posted before we unmask. Warn about | ||
81 | * the interrupt handlers that need to flush posted writes. | ||
82 | */ | ||
83 | static int omap_check_spurious(unsigned int irq) | ||
84 | { | ||
85 | u32 sir, spurious; | ||
86 | |||
87 | sir = intc_bank_read_reg(&irq_banks[0], INTC_SIR); | ||
88 | spurious = sir >> 7; | ||
89 | |||
90 | if (spurious) { | ||
91 | printk(KERN_WARNING "Spurious irq %i: 0x%08x, please flush " | ||
92 | "posted write for irq %i\n", | ||
93 | irq, sir, previous_irq); | ||
94 | return spurious; | ||
95 | } | ||
96 | |||
97 | return 0; | ||
98 | } | ||
99 | |||
100 | /* XXX: FIQ and additional INTC support (only MPU at the moment) */ | 76 | /* XXX: FIQ and additional INTC support (only MPU at the moment) */ |
101 | static void omap_ack_irq(struct irq_data *d) | 77 | static void omap_ack_irq(struct irq_data *d) |
102 | { | 78 | { |
103 | intc_bank_write_reg(0x1, &irq_banks[0], INTC_CONTROL); | 79 | intc_bank_write_reg(0x1, &irq_banks[0], INTC_CONTROL); |
104 | } | 80 | } |
105 | 81 | ||
106 | static void omap_mask_irq(struct irq_data *d) | ||
107 | { | ||
108 | unsigned int irq = d->irq; | ||
109 | int offset = irq & (~(IRQ_BITS_PER_REG - 1)); | ||
110 | |||
111 | if (cpu_is_omap34xx() && !cpu_is_ti816x()) { | ||
112 | int spurious = 0; | ||
113 | |||
114 | /* | ||
115 | * INT_34XX_GPT12_IRQ is also the spurious irq. Maybe because | ||
116 | * it is the highest irq number? | ||
117 | */ | ||
118 | if (irq == INT_34XX_GPT12_IRQ) | ||
119 | spurious = omap_check_spurious(irq); | ||
120 | |||
121 | if (!spurious) | ||
122 | previous_irq = irq; | ||
123 | } | ||
124 | |||
125 | irq &= (IRQ_BITS_PER_REG - 1); | ||
126 | |||
127 | intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset); | ||
128 | } | ||
129 | |||
130 | static void omap_unmask_irq(struct irq_data *d) | ||
131 | { | ||
132 | unsigned int irq = d->irq; | ||
133 | int offset = irq & (~(IRQ_BITS_PER_REG - 1)); | ||
134 | |||
135 | irq &= (IRQ_BITS_PER_REG - 1); | ||
136 | |||
137 | intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_CLEAR0 + offset); | ||
138 | } | ||
139 | |||
140 | static void omap_mask_ack_irq(struct irq_data *d) | 82 | static void omap_mask_ack_irq(struct irq_data *d) |
141 | { | 83 | { |
142 | omap_mask_irq(d); | 84 | irq_gc_mask_disable_reg(d); |
143 | omap_ack_irq(d); | 85 | omap_ack_irq(d); |
144 | } | 86 | } |
145 | 87 | ||
146 | static struct irq_chip omap_irq_chip = { | ||
147 | .name = "INTC", | ||
148 | .irq_ack = omap_mask_ack_irq, | ||
149 | .irq_mask = omap_mask_irq, | ||
150 | .irq_unmask = omap_unmask_irq, | ||
151 | }; | ||
152 | |||
153 | static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank) | 88 | static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank) |
154 | { | 89 | { |
155 | unsigned long tmp; | 90 | unsigned long tmp; |
@@ -186,11 +121,31 @@ int omap_irq_pending(void) | |||
186 | return 0; | 121 | return 0; |
187 | } | 122 | } |
188 | 123 | ||
124 | static __init void | ||
125 | omap_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) | ||
126 | { | ||
127 | struct irq_chip_generic *gc; | ||
128 | struct irq_chip_type *ct; | ||
129 | |||
130 | gc = irq_alloc_generic_chip("INTC", 1, irq_start, base, | ||
131 | handle_level_irq); | ||
132 | ct = gc->chip_types; | ||
133 | ct->chip.irq_ack = omap_mask_ack_irq; | ||
134 | ct->chip.irq_mask = irq_gc_mask_disable_reg; | ||
135 | ct->chip.irq_unmask = irq_gc_unmask_enable_reg; | ||
136 | |||
137 | ct->regs.ack = INTC_CONTROL; | ||
138 | ct->regs.enable = INTC_MIR_CLEAR0; | ||
139 | ct->regs.disable = INTC_MIR_SET0; | ||
140 | irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE, | ||
141 | IRQ_NOREQUEST | IRQ_NOPROBE, 0); | ||
142 | } | ||
143 | |||
189 | void __init omap_init_irq(void) | 144 | void __init omap_init_irq(void) |
190 | { | 145 | { |
191 | unsigned long nr_of_irqs = 0; | 146 | unsigned long nr_of_irqs = 0; |
192 | unsigned int nr_banks = 0; | 147 | unsigned int nr_banks = 0; |
193 | int i; | 148 | int i, j; |
194 | 149 | ||
195 | for (i = 0; i < ARRAY_SIZE(irq_banks); i++) { | 150 | for (i = 0; i < ARRAY_SIZE(irq_banks); i++) { |
196 | unsigned long base = 0; | 151 | unsigned long base = 0; |
@@ -215,17 +170,15 @@ void __init omap_init_irq(void) | |||
215 | 170 | ||
216 | omap_irq_bank_init_one(bank); | 171 | omap_irq_bank_init_one(bank); |
217 | 172 | ||
173 | for (i = 0, j = 0; i < bank->nr_irqs; i += 32, j += 0x20) | ||
174 | omap_alloc_gc(bank->base_reg + j, i, 32); | ||
175 | |||
218 | nr_of_irqs += bank->nr_irqs; | 176 | nr_of_irqs += bank->nr_irqs; |
219 | nr_banks++; | 177 | nr_banks++; |
220 | } | 178 | } |
221 | 179 | ||
222 | printk(KERN_INFO "Total of %ld interrupts on %d active controller%s\n", | 180 | printk(KERN_INFO "Total of %ld interrupts on %d active controller%s\n", |
223 | nr_of_irqs, nr_banks, nr_banks > 1 ? "s" : ""); | 181 | nr_of_irqs, nr_banks, nr_banks > 1 ? "s" : ""); |
224 | |||
225 | for (i = 0; i < nr_of_irqs; i++) { | ||
226 | irq_set_chip_and_handler(i, &omap_irq_chip, handle_level_irq); | ||
227 | set_irq_flags(i, IRQF_VALID); | ||
228 | } | ||
229 | } | 182 | } |
230 | 183 | ||
231 | #ifdef CONFIG_ARCH_OMAP3 | 184 | #ifdef CONFIG_ARCH_OMAP3 |
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index b66cfe8bc464..ecfe93c4b585 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | 22 | ||
23 | #include <asm/cacheflush.h> | 23 | #include <asm/cacheflush.h> |
24 | #include <asm/hardware/gic.h> | ||
24 | #include <asm/smp_scu.h> | 25 | #include <asm/smp_scu.h> |
25 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
26 | #include <mach/omap4-common.h> | 27 | #include <mach/omap4-common.h> |
@@ -63,7 +64,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
63 | omap_modify_auxcoreboot0(0x200, 0xfffffdff); | 64 | omap_modify_auxcoreboot0(0x200, 0xfffffdff); |
64 | flush_cache_all(); | 65 | flush_cache_all(); |
65 | smp_wmb(); | 66 | smp_wmb(); |
66 | smp_cross_call(cpumask_of(cpu), 1); | 67 | gic_raise_softirq(cpumask_of(cpu), 1); |
67 | 68 | ||
68 | /* | 69 | /* |
69 | * Now the secondary core is starting up let it run its | 70 | * Now the secondary core is starting up let it run its |
@@ -118,6 +119,8 @@ void __init smp_init_cpus(void) | |||
118 | 119 | ||
119 | for (i = 0; i < ncores; i++) | 120 | for (i = 0; i < ncores; i++) |
120 | set_cpu_possible(i, true); | 121 | set_cpu_possible(i, true); |
122 | |||
123 | set_smp_cross_call(gic_raise_softirq); | ||
121 | } | 124 | } |
122 | 125 | ||
123 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) | 126 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |