diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2005-03-21 13:59:38 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2005-10-29 14:30:59 -0400 |
commit | 4f12bfe5a498747a9a66f135a67aa8e1caa819dc (patch) | |
tree | f358bd77f56b4014c1e5a9b5804995fd521c7853 /arch/mips/sgi-ip27/ip27-init.c | |
parent | 6cbe0631591ca45177d52364dec81cdfba19fec0 (diff) |
HUB interrupts are allocated per node, not per slice. Make manipulation
of the interrupt mask register atomic by disabling interrupts.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/sgi-ip27/ip27-init.c')
-rw-r--r-- | arch/mips/sgi-ip27/ip27-init.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/arch/mips/sgi-ip27/ip27-init.c b/arch/mips/sgi-ip27/ip27-init.c index ad1e86b54fae..8651a0e75404 100644 --- a/arch/mips/sgi-ip27/ip27-init.c +++ b/arch/mips/sgi-ip27/ip27-init.c | |||
@@ -56,12 +56,12 @@ static void __init per_hub_init(cnodeid_t cnode) | |||
56 | { | 56 | { |
57 | struct hub_data *hub = hub_data(cnode); | 57 | struct hub_data *hub = hub_data(cnode); |
58 | nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); | 58 | nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); |
59 | int i; | ||
59 | 60 | ||
60 | cpu_set(smp_processor_id(), hub->h_cpus); | 61 | cpu_set(smp_processor_id(), hub->h_cpus); |
61 | 62 | ||
62 | if (test_and_set_bit(cnode, hub_init_mask)) | 63 | if (test_and_set_bit(cnode, hub_init_mask)) |
63 | return; | 64 | return; |
64 | |||
65 | /* | 65 | /* |
66 | * Set CRB timeout at 5ms, (< PI timeout of 10ms) | 66 | * Set CRB timeout at 5ms, (< PI timeout of 10ms) |
67 | */ | 67 | */ |
@@ -88,6 +88,24 @@ static void __init per_hub_init(cnodeid_t cnode) | |||
88 | __flush_cache_all(); | 88 | __flush_cache_all(); |
89 | } | 89 | } |
90 | #endif | 90 | #endif |
91 | |||
92 | /* | ||
93 | * Some interrupts are reserved by hardware or by software convention. | ||
94 | * Mark these as reserved right away so they won't be used accidently | ||
95 | * later. | ||
96 | */ | ||
97 | for (i = 0; i <= BASE_PCI_IRQ; i++) { | ||
98 | __set_bit(i, hub->irq_alloc_mask); | ||
99 | LOCAL_HUB_CLR_INTR(INT_PEND0_BASELVL + i); | ||
100 | } | ||
101 | |||
102 | __set_bit(IP_PEND0_6_63, hub->irq_alloc_mask); | ||
103 | LOCAL_HUB_S(PI_INT_PEND_MOD, IP_PEND0_6_63); | ||
104 | |||
105 | for (i = NI_BRDCAST_ERR_A; i <= MSC_PANIC_INTR; i++) { | ||
106 | __set_bit(i, hub->irq_alloc_mask); | ||
107 | LOCAL_HUB_CLR_INTR(INT_PEND1_BASELVL + i); | ||
108 | } | ||
91 | } | 109 | } |
92 | 110 | ||
93 | void __init per_cpu_init(void) | 111 | void __init per_cpu_init(void) |
@@ -104,30 +122,12 @@ void __init per_cpu_init(void) | |||
104 | 122 | ||
105 | clear_c0_status(ST0_IM); | 123 | clear_c0_status(ST0_IM); |
106 | 124 | ||
125 | per_hub_init(cnode); | ||
126 | |||
107 | for (i = 0; i < LEVELS_PER_SLICE; i++) | 127 | for (i = 0; i < LEVELS_PER_SLICE; i++) |
108 | si->level_to_irq[i] = -1; | 128 | si->level_to_irq[i] = -1; |
109 | 129 | ||
110 | /* | 130 | /* |
111 | * Some interrupts are reserved by hardware or by software convention. | ||
112 | * Mark these as reserved right away so they won't be used accidently | ||
113 | * later. | ||
114 | */ | ||
115 | for (i = 0; i <= BASE_PCI_IRQ; i++) { | ||
116 | __set_bit(i, si->irq_alloc_mask); | ||
117 | LOCAL_HUB_S(PI_INT_PEND_MOD, i); | ||
118 | } | ||
119 | |||
120 | __set_bit(IP_PEND0_6_63, si->irq_alloc_mask); | ||
121 | LOCAL_HUB_S(PI_INT_PEND_MOD, IP_PEND0_6_63); | ||
122 | |||
123 | for (i = NI_BRDCAST_ERR_A; i <= MSC_PANIC_INTR; i++) { | ||
124 | __set_bit(i, si->irq_alloc_mask + 1); | ||
125 | LOCAL_HUB_S(PI_INT_PEND_MOD, i); | ||
126 | } | ||
127 | |||
128 | LOCAL_HUB_L(PI_INT_PEND0); | ||
129 | |||
130 | /* | ||
131 | * We use this so we can find the local hub's data as fast as only | 131 | * We use this so we can find the local hub's data as fast as only |
132 | * possible. | 132 | * possible. |
133 | */ | 133 | */ |
@@ -140,8 +140,6 @@ void __init per_cpu_init(void) | |||
140 | install_cpu_nmi_handler(cputoslice(cpu)); | 140 | install_cpu_nmi_handler(cputoslice(cpu)); |
141 | 141 | ||
142 | set_c0_status(SRB_DEV0 | SRB_DEV1); | 142 | set_c0_status(SRB_DEV0 | SRB_DEV1); |
143 | |||
144 | per_hub_init(cnode); | ||
145 | } | 143 | } |
146 | 144 | ||
147 | /* | 145 | /* |