aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-common/ints-priority.c
diff options
context:
space:
mode:
authorGraf Yang <graf.yang@analog.com>2009-01-07 10:14:39 -0500
committerBryan Wu <cooloney@kernel.org>2009-01-07 10:14:39 -0500
commit6b3087c64a92a36ae20d33479b4df6d7afc910d4 (patch)
tree95984fc623658ebf150d0d912a7f6c5a0301a5a9 /arch/blackfin/mach-common/ints-priority.c
parentc51b4488cd5bff08ed5690a8f303ff7f0894da2a (diff)
Blackfin arch: SMP supporting patchset: Blackfin header files and machine common code
Blackfin dual core BF561 processor can support SMP like features. https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:smp-like In this patch, we provide SMP extend to Blackfin header files and machine common code Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/mach-common/ints-priority.c')
-rw-r--r--arch/blackfin/mach-common/ints-priority.c41
1 files changed, 37 insertions, 4 deletions
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c
index d45d0c59fac7..eb8dfcfc3544 100644
--- a/arch/blackfin/mach-common/ints-priority.c
+++ b/arch/blackfin/mach-common/ints-priority.c
@@ -55,6 +55,7 @@
55 * - 55 * -
56 */ 56 */
57 57
58#ifndef CONFIG_SMP
58/* Initialize this to an actual value to force it into the .data 59/* Initialize this to an actual value to force it into the .data
59 * section so that we know it is properly initialized at entry into 60 * section so that we know it is properly initialized at entry into
60 * the kernel but before bss is initialized to zero (which is where 61 * the kernel but before bss is initialized to zero (which is where
@@ -63,6 +64,7 @@
63 */ 64 */
64unsigned long irq_flags = 0x1f; 65unsigned long irq_flags = 0x1f;
65EXPORT_SYMBOL(irq_flags); 66EXPORT_SYMBOL(irq_flags);
67#endif
66 68
67/* The number of spurious interrupts */ 69/* The number of spurious interrupts */
68atomic_t num_spurious; 70atomic_t num_spurious;
@@ -163,6 +165,10 @@ static void bfin_internal_mask_irq(unsigned int irq)
163 mask_bit = SIC_SYSIRQ(irq) % 32; 165 mask_bit = SIC_SYSIRQ(irq) % 32;
164 bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) & 166 bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) &
165 ~(1 << mask_bit)); 167 ~(1 << mask_bit));
168#ifdef CONFIG_SMP
169 bfin_write_SICB_IMASK(mask_bank, bfin_read_SICB_IMASK(mask_bank) &
170 ~(1 << mask_bit));
171#endif
166#endif 172#endif
167} 173}
168 174
@@ -177,6 +183,10 @@ static void bfin_internal_unmask_irq(unsigned int irq)
177 mask_bit = SIC_SYSIRQ(irq) % 32; 183 mask_bit = SIC_SYSIRQ(irq) % 32;
178 bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) | 184 bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) |
179 (1 << mask_bit)); 185 (1 << mask_bit));
186#ifdef CONFIG_SMP
187 bfin_write_SICB_IMASK(mask_bank, bfin_read_SICB_IMASK(mask_bank) |
188 (1 << mask_bit));
189#endif
180#endif 190#endif
181} 191}
182 192
@@ -896,7 +906,7 @@ static struct irq_chip bfin_gpio_irqchip = {
896#endif 906#endif
897}; 907};
898 908
899void __init init_exception_vectors(void) 909void __cpuinit init_exception_vectors(void)
900{ 910{
901 /* cannot program in software: 911 /* cannot program in software:
902 * evt0 - emulation (jtag) 912 * evt0 - emulation (jtag)
@@ -935,6 +945,10 @@ int __init init_arch_irq(void)
935# ifdef CONFIG_BF54x 945# ifdef CONFIG_BF54x
936 bfin_write_SIC_IMASK2(SIC_UNMASK_ALL); 946 bfin_write_SIC_IMASK2(SIC_UNMASK_ALL);
937# endif 947# endif
948# ifdef CONFIG_SMP
949 bfin_write_SICB_IMASK0(SIC_UNMASK_ALL);
950 bfin_write_SICB_IMASK1(SIC_UNMASK_ALL);
951# endif
938#else 952#else
939 bfin_write_SIC_IMASK(SIC_UNMASK_ALL); 953 bfin_write_SIC_IMASK(SIC_UNMASK_ALL);
940#endif 954#endif
@@ -995,6 +1009,17 @@ int __init init_arch_irq(void)
995 1009
996 break; 1010 break;
997#endif 1011#endif
1012#ifdef CONFIG_TICK_SOURCE_SYSTMR0
1013 case IRQ_TIMER0:
1014 set_irq_handler(irq, handle_percpu_irq);
1015 break;
1016#endif
1017#ifdef CONFIG_SMP
1018 case IRQ_SUPPLE_0:
1019 case IRQ_SUPPLE_1:
1020 set_irq_handler(irq, handle_percpu_irq);
1021 break;
1022#endif
998 default: 1023 default:
999 set_irq_handler(irq, handle_simple_irq); 1024 set_irq_handler(irq, handle_simple_irq);
1000 break; 1025 break;
@@ -1029,7 +1054,7 @@ int __init init_arch_irq(void)
1029 search_IAR(); 1054 search_IAR();
1030 1055
1031 /* Enable interrupts IVG7-15 */ 1056 /* Enable interrupts IVG7-15 */
1032 irq_flags = irq_flags | IMASK_IVG15 | 1057 irq_flags |= IMASK_IVG15 |
1033 IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 | 1058 IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 |
1034 IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW; 1059 IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW;
1035 1060
@@ -1070,8 +1095,16 @@ void do_irq(int vec, struct pt_regs *fp)
1070 || defined(BF538_FAMILY) || defined(CONFIG_BF51x) 1095 || defined(BF538_FAMILY) || defined(CONFIG_BF51x)
1071 unsigned long sic_status[3]; 1096 unsigned long sic_status[3];
1072 1097
1073 sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0(); 1098 if (smp_processor_id()) {
1074 sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1(); 1099#ifdef CONFIG_SMP
1100 /* This will be optimized out in UP mode. */
1101 sic_status[0] = bfin_read_SICB_ISR0() & bfin_read_SICB_IMASK0();
1102 sic_status[1] = bfin_read_SICB_ISR1() & bfin_read_SICB_IMASK1();
1103#endif
1104 } else {
1105 sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0();
1106 sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1();
1107 }
1075#ifdef CONFIG_BF54x 1108#ifdef CONFIG_BF54x
1076 sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2(); 1109 sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2();
1077#endif 1110#endif