diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2005-02-22 16:51:30 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2005-10-29 14:30:44 -0400 |
commit | 65bda1a95d395c256818d1d8129487a4497b29d8 (patch) | |
tree | 57bea8a2593b17b987cbc188ecf07c341fda5dbc /arch/mips/sibyte/sb1250 | |
parent | 4912ba72d6e27d0f19ec062ffd00a8c0165a2f67 (diff) |
Switch SiByte drivers back to __raw_*() functions.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/sibyte/sb1250')
-rw-r--r-- | arch/mips/sibyte/sb1250/bcm1250_tbprof.c | 130 | ||||
-rw-r--r-- | arch/mips/sibyte/sb1250/bus_watcher.c | 2 | ||||
-rw-r--r-- | arch/mips/sibyte/sb1250/irq.c | 88 | ||||
-rw-r--r-- | arch/mips/sibyte/sb1250/setup.c | 4 | ||||
-rw-r--r-- | arch/mips/sibyte/sb1250/smp.c | 18 | ||||
-rw-r--r-- | arch/mips/sibyte/sb1250/time.c | 26 |
6 files changed, 139 insertions, 129 deletions
diff --git a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c index dba3d0872e7e..e4dfeb52dcec 100644 --- a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c +++ b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c | |||
@@ -65,24 +65,25 @@ static void arm_tb(void) | |||
65 | u_int64_t tb_options = M_SCD_TRACE_CFG_FREEZE_FULL; | 65 | u_int64_t tb_options = M_SCD_TRACE_CFG_FREEZE_FULL; |
66 | /* Generate an SCD_PERFCNT interrupt in TB_PERIOD Zclks to | 66 | /* Generate an SCD_PERFCNT interrupt in TB_PERIOD Zclks to |
67 | trigger start of trace. XXX vary sampling period */ | 67 | trigger start of trace. XXX vary sampling period */ |
68 | bus_writeq(0, IOADDR(A_SCD_PERF_CNT_1)); | 68 | __raw_writeq(0, IOADDR(A_SCD_PERF_CNT_1)); |
69 | scdperfcnt = bus_readq(IOADDR(A_SCD_PERF_CNT_CFG)); | 69 | scdperfcnt = __raw_readq(IOADDR(A_SCD_PERF_CNT_CFG)); |
70 | /* Unfortunately, in Pass 2 we must clear all counters to knock down | 70 | /* Unfortunately, in Pass 2 we must clear all counters to knock down |
71 | a previous interrupt request. This means that bus profiling | 71 | a previous interrupt request. This means that bus profiling |
72 | requires ALL of the SCD perf counters. */ | 72 | requires ALL of the SCD perf counters. */ |
73 | bus_writeq((scdperfcnt & ~M_SPC_CFG_SRC1) | // keep counters 0,2,3 as is | 73 | __raw_writeq((scdperfcnt & ~M_SPC_CFG_SRC1) | |
74 | M_SPC_CFG_ENABLE | // enable counting | 74 | // keep counters 0,2,3 as is |
75 | M_SPC_CFG_CLEAR | // clear all counters | 75 | M_SPC_CFG_ENABLE | // enable counting |
76 | V_SPC_CFG_SRC1(1), // counter 1 counts cycles | 76 | M_SPC_CFG_CLEAR | // clear all counters |
77 | IOADDR(A_SCD_PERF_CNT_CFG)); | 77 | V_SPC_CFG_SRC1(1), // counter 1 counts cycles |
78 | bus_writeq(next, IOADDR(A_SCD_PERF_CNT_1)); | 78 | IOADDR(A_SCD_PERF_CNT_CFG)); |
79 | __raw_writeq(next, IOADDR(A_SCD_PERF_CNT_1)); | ||
79 | /* Reset the trace buffer */ | 80 | /* Reset the trace buffer */ |
80 | bus_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); | 81 | __raw_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); |
81 | #if 0 && defined(M_SCD_TRACE_CFG_FORCECNT) | 82 | #if 0 && defined(M_SCD_TRACE_CFG_FORCECNT) |
82 | /* XXXKW may want to expose control to the data-collector */ | 83 | /* XXXKW may want to expose control to the data-collector */ |
83 | tb_options |= M_SCD_TRACE_CFG_FORCECNT; | 84 | tb_options |= M_SCD_TRACE_CFG_FORCECNT; |
84 | #endif | 85 | #endif |
85 | bus_writeq(tb_options, IOADDR(A_SCD_TRACE_CFG)); | 86 | __raw_writeq(tb_options, IOADDR(A_SCD_TRACE_CFG)); |
86 | sbp.tb_armed = 1; | 87 | sbp.tb_armed = 1; |
87 | } | 88 | } |
88 | 89 | ||
@@ -94,23 +95,30 @@ static irqreturn_t sbprof_tb_intr(int irq, void *dev_id, struct pt_regs *regs) | |||
94 | /* XXX should use XKPHYS to make writes bypass L2 */ | 95 | /* XXX should use XKPHYS to make writes bypass L2 */ |
95 | u_int64_t *p = sbp.sbprof_tbbuf[sbp.next_tb_sample++]; | 96 | u_int64_t *p = sbp.sbprof_tbbuf[sbp.next_tb_sample++]; |
96 | /* Read out trace */ | 97 | /* Read out trace */ |
97 | bus_writeq(M_SCD_TRACE_CFG_START_READ, IOADDR(A_SCD_TRACE_CFG)); | 98 | __raw_writeq(M_SCD_TRACE_CFG_START_READ, |
99 | IOADDR(A_SCD_TRACE_CFG)); | ||
98 | __asm__ __volatile__ ("sync" : : : "memory"); | 100 | __asm__ __volatile__ ("sync" : : : "memory"); |
99 | /* Loop runs backwards because bundles are read out in reverse order */ | 101 | /* Loop runs backwards because bundles are read out in reverse order */ |
100 | for (i = 256 * 6; i > 0; i -= 6) { | 102 | for (i = 256 * 6; i > 0; i -= 6) { |
101 | // Subscripts decrease to put bundle in the order | 103 | // Subscripts decrease to put bundle in the order |
102 | // t0 lo, t0 hi, t1 lo, t1 hi, t2 lo, t2 hi | 104 | // t0 lo, t0 hi, t1 lo, t1 hi, t2 lo, t2 hi |
103 | p[i-1] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t2 hi | 105 | p[i - 1] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); |
104 | p[i-2] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t2 lo | 106 | // read t2 hi |
105 | p[i-3] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t1 hi | 107 | p[i - 2] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); |
106 | p[i-4] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t1 lo | 108 | // read t2 lo |
107 | p[i-5] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t0 hi | 109 | p[i - 3] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); |
108 | p[i-6] = bus_readq(IOADDR(A_SCD_TRACE_READ)); // read t0 lo | 110 | // read t1 hi |
111 | p[i - 4] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); | ||
112 | // read t1 lo | ||
113 | p[i - 5] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); | ||
114 | // read t0 hi | ||
115 | p[i - 6] = __raw_readq(IOADDR(A_SCD_TRACE_READ)); | ||
116 | // read t0 lo | ||
109 | } | 117 | } |
110 | if (!sbp.tb_enable) { | 118 | if (!sbp.tb_enable) { |
111 | DBG(printk(DEVNAME ": tb_intr shutdown\n")); | 119 | DBG(printk(DEVNAME ": tb_intr shutdown\n")); |
112 | bus_writeq(M_SCD_TRACE_CFG_RESET, | 120 | __raw_writeq(M_SCD_TRACE_CFG_RESET, |
113 | IOADDR(A_SCD_TRACE_CFG)); | 121 | IOADDR(A_SCD_TRACE_CFG)); |
114 | sbp.tb_armed = 0; | 122 | sbp.tb_armed = 0; |
115 | wake_up(&sbp.tb_sync); | 123 | wake_up(&sbp.tb_sync); |
116 | } else { | 124 | } else { |
@@ -119,7 +127,7 @@ static irqreturn_t sbprof_tb_intr(int irq, void *dev_id, struct pt_regs *regs) | |||
119 | } else { | 127 | } else { |
120 | /* No more trace buffer samples */ | 128 | /* No more trace buffer samples */ |
121 | DBG(printk(DEVNAME ": tb_intr full\n")); | 129 | DBG(printk(DEVNAME ": tb_intr full\n")); |
122 | bus_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); | 130 | __raw_writeq(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); |
123 | sbp.tb_armed = 0; | 131 | sbp.tb_armed = 0; |
124 | if (!sbp.tb_enable) { | 132 | if (!sbp.tb_enable) { |
125 | wake_up(&sbp.tb_sync); | 133 | wake_up(&sbp.tb_sync); |
@@ -153,13 +161,11 @@ int sbprof_zbprof_start(struct file *filp) | |||
153 | return -EBUSY; | 161 | return -EBUSY; |
154 | } | 162 | } |
155 | /* Make sure there isn't a perf-cnt interrupt waiting */ | 163 | /* Make sure there isn't a perf-cnt interrupt waiting */ |
156 | scdperfcnt = bus_readq(IOADDR(A_SCD_PERF_CNT_CFG)); | 164 | scdperfcnt = __raw_readq(IOADDR(A_SCD_PERF_CNT_CFG)); |
157 | /* Disable and clear counters, override SRC_1 */ | 165 | /* Disable and clear counters, override SRC_1 */ |
158 | bus_writeq((scdperfcnt & ~(M_SPC_CFG_SRC1 | M_SPC_CFG_ENABLE)) | | 166 | __raw_writeq((scdperfcnt & ~(M_SPC_CFG_SRC1 | M_SPC_CFG_ENABLE)) | |
159 | M_SPC_CFG_ENABLE | | 167 | M_SPC_CFG_ENABLE | M_SPC_CFG_CLEAR | V_SPC_CFG_SRC1(1), |
160 | M_SPC_CFG_CLEAR | | 168 | IOADDR(A_SCD_PERF_CNT_CFG)); |
161 | V_SPC_CFG_SRC1(1), | ||
162 | IOADDR(A_SCD_PERF_CNT_CFG)); | ||
163 | 169 | ||
164 | /* We grab this interrupt to prevent others from trying to use | 170 | /* We grab this interrupt to prevent others from trying to use |
165 | it, even though we don't want to service the interrupts | 171 | it, even though we don't want to service the interrupts |
@@ -173,55 +179,55 @@ int sbprof_zbprof_start(struct file *filp) | |||
173 | /* I need the core to mask these, but the interrupt mapper to | 179 | /* I need the core to mask these, but the interrupt mapper to |
174 | pass them through. I am exploiting my knowledge that | 180 | pass them through. I am exploiting my knowledge that |
175 | cp0_status masks out IP[5]. krw */ | 181 | cp0_status masks out IP[5]. krw */ |
176 | bus_writeq(K_INT_MAP_I3, | 182 | __raw_writeq(K_INT_MAP_I3, |
177 | IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + | 183 | IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + |
178 | (K_INT_PERF_CNT << 3))); | 184 | (K_INT_PERF_CNT << 3))); |
179 | 185 | ||
180 | /* Initialize address traps */ | 186 | /* Initialize address traps */ |
181 | bus_writeq(0, IOADDR(A_ADDR_TRAP_UP_0)); | 187 | __raw_writeq(0, IOADDR(A_ADDR_TRAP_UP_0)); |
182 | bus_writeq(0, IOADDR(A_ADDR_TRAP_UP_1)); | 188 | __raw_writeq(0, IOADDR(A_ADDR_TRAP_UP_1)); |
183 | bus_writeq(0, IOADDR(A_ADDR_TRAP_UP_2)); | 189 | __raw_writeq(0, IOADDR(A_ADDR_TRAP_UP_2)); |
184 | bus_writeq(0, IOADDR(A_ADDR_TRAP_UP_3)); | 190 | __raw_writeq(0, IOADDR(A_ADDR_TRAP_UP_3)); |
185 | 191 | ||
186 | bus_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_0)); | 192 | __raw_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_0)); |
187 | bus_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_1)); | 193 | __raw_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_1)); |
188 | bus_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_2)); | 194 | __raw_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_2)); |
189 | bus_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_3)); | 195 | __raw_writeq(0, IOADDR(A_ADDR_TRAP_DOWN_3)); |
190 | 196 | ||
191 | bus_writeq(0, IOADDR(A_ADDR_TRAP_CFG_0)); | 197 | __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_0)); |
192 | bus_writeq(0, IOADDR(A_ADDR_TRAP_CFG_1)); | 198 | __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_1)); |
193 | bus_writeq(0, IOADDR(A_ADDR_TRAP_CFG_2)); | 199 | __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_2)); |
194 | bus_writeq(0, IOADDR(A_ADDR_TRAP_CFG_3)); | 200 | __raw_writeq(0, IOADDR(A_ADDR_TRAP_CFG_3)); |
195 | 201 | ||
196 | /* Initialize Trace Event 0-7 */ | 202 | /* Initialize Trace Event 0-7 */ |
197 | // when interrupt | 203 | // when interrupt |
198 | bus_writeq(M_SCD_TREVT_INTERRUPT, IOADDR(A_SCD_TRACE_EVENT_0)); | 204 | __raw_writeq(M_SCD_TREVT_INTERRUPT, IOADDR(A_SCD_TRACE_EVENT_0)); |
199 | bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_1)); | 205 | __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_1)); |
200 | bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_2)); | 206 | __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_2)); |
201 | bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_3)); | 207 | __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_3)); |
202 | bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_4)); | 208 | __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_4)); |
203 | bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_5)); | 209 | __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_5)); |
204 | bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_6)); | 210 | __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_6)); |
205 | bus_writeq(0, IOADDR(A_SCD_TRACE_EVENT_7)); | 211 | __raw_writeq(0, IOADDR(A_SCD_TRACE_EVENT_7)); |
206 | 212 | ||
207 | /* Initialize Trace Sequence 0-7 */ | 213 | /* Initialize Trace Sequence 0-7 */ |
208 | // Start on event 0 (interrupt) | 214 | // Start on event 0 (interrupt) |
209 | bus_writeq(V_SCD_TRSEQ_FUNC_START | 0x0fff, | 215 | __raw_writeq(V_SCD_TRSEQ_FUNC_START | 0x0fff, |
210 | IOADDR(A_SCD_TRACE_SEQUENCE_0)); | 216 | IOADDR(A_SCD_TRACE_SEQUENCE_0)); |
211 | // dsamp when d used | asamp when a used | 217 | // dsamp when d used | asamp when a used |
212 | bus_writeq(M_SCD_TRSEQ_ASAMPLE | M_SCD_TRSEQ_DSAMPLE | | 218 | __raw_writeq(M_SCD_TRSEQ_ASAMPLE | M_SCD_TRSEQ_DSAMPLE | |
213 | K_SCD_TRSEQ_TRIGGER_ALL, | 219 | K_SCD_TRSEQ_TRIGGER_ALL, |
214 | IOADDR(A_SCD_TRACE_SEQUENCE_1)); | 220 | IOADDR(A_SCD_TRACE_SEQUENCE_1)); |
215 | bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_2)); | 221 | __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_2)); |
216 | bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_3)); | 222 | __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_3)); |
217 | bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_4)); | 223 | __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_4)); |
218 | bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_5)); | 224 | __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_5)); |
219 | bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_6)); | 225 | __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_6)); |
220 | bus_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_7)); | 226 | __raw_writeq(0, IOADDR(A_SCD_TRACE_SEQUENCE_7)); |
221 | 227 | ||
222 | /* Now indicate the PERF_CNT interrupt as a trace-relevant interrupt */ | 228 | /* Now indicate the PERF_CNT interrupt as a trace-relevant interrupt */ |
223 | bus_writeq((1ULL << K_INT_PERF_CNT), | 229 | __raw_writeq(1ULL << K_INT_PERF_CNT, |
224 | IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_TRACE))); | 230 | IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_TRACE))); |
225 | 231 | ||
226 | arm_tb(); | 232 | arm_tb(); |
227 | 233 | ||
diff --git a/arch/mips/sibyte/sb1250/bus_watcher.c b/arch/mips/sibyte/sb1250/bus_watcher.c index 1a97e3127aeb..482dee054e68 100644 --- a/arch/mips/sibyte/sb1250/bus_watcher.c +++ b/arch/mips/sibyte/sb1250/bus_watcher.c | |||
@@ -189,7 +189,7 @@ static irqreturn_t sibyte_bw_int(int irq, void *data, struct pt_regs *regs) | |||
189 | 189 | ||
190 | for (i=0; i<256*6; i++) | 190 | for (i=0; i<256*6; i++) |
191 | printk("%016llx\n", | 191 | printk("%016llx\n", |
192 | (unsigned long long)bus_readq(IOADDR(A_SCD_TRACE_READ))); | 192 | (long long)__raw_readq(IOADDR(A_SCD_TRACE_READ))); |
193 | 193 | ||
194 | csr_out32(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); | 194 | csr_out32(M_SCD_TRACE_CFG_RESET, IOADDR(A_SCD_TRACE_CFG)); |
195 | csr_out32(M_SCD_TRACE_CFG_START, IOADDR(A_SCD_TRACE_CFG)); | 195 | csr_out32(M_SCD_TRACE_CFG_START, IOADDR(A_SCD_TRACE_CFG)); |
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c index 2725b263cced..a62cba9f32ba 100644 --- a/arch/mips/sibyte/sb1250/irq.c +++ b/arch/mips/sibyte/sb1250/irq.c | |||
@@ -96,11 +96,11 @@ void sb1250_mask_irq(int cpu, int irq) | |||
96 | u64 cur_ints; | 96 | u64 cur_ints; |
97 | 97 | ||
98 | spin_lock_irqsave(&sb1250_imr_lock, flags); | 98 | spin_lock_irqsave(&sb1250_imr_lock, flags); |
99 | cur_ints = __bus_readq(IOADDR(A_IMR_MAPPER(cpu) + | 99 | cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) + |
100 | R_IMR_INTERRUPT_MASK)); | 100 | R_IMR_INTERRUPT_MASK)); |
101 | cur_ints |= (((u64) 1) << irq); | 101 | cur_ints |= (((u64) 1) << irq); |
102 | __bus_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + | 102 | ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + |
103 | R_IMR_INTERRUPT_MASK)); | 103 | R_IMR_INTERRUPT_MASK)); |
104 | spin_unlock_irqrestore(&sb1250_imr_lock, flags); | 104 | spin_unlock_irqrestore(&sb1250_imr_lock, flags); |
105 | } | 105 | } |
106 | 106 | ||
@@ -110,11 +110,11 @@ void sb1250_unmask_irq(int cpu, int irq) | |||
110 | u64 cur_ints; | 110 | u64 cur_ints; |
111 | 111 | ||
112 | spin_lock_irqsave(&sb1250_imr_lock, flags); | 112 | spin_lock_irqsave(&sb1250_imr_lock, flags); |
113 | cur_ints = __bus_readq(IOADDR(A_IMR_MAPPER(cpu) + | 113 | cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) + |
114 | R_IMR_INTERRUPT_MASK)); | 114 | R_IMR_INTERRUPT_MASK)); |
115 | cur_ints &= ~(((u64) 1) << irq); | 115 | cur_ints &= ~(((u64) 1) << irq); |
116 | __bus_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + | 116 | ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + |
117 | R_IMR_INTERRUPT_MASK)); | 117 | R_IMR_INTERRUPT_MASK)); |
118 | spin_unlock_irqrestore(&sb1250_imr_lock, flags); | 118 | spin_unlock_irqrestore(&sb1250_imr_lock, flags); |
119 | } | 119 | } |
120 | 120 | ||
@@ -149,23 +149,23 @@ static void sb1250_set_affinity(unsigned int irq, unsigned long mask) | |||
149 | 149 | ||
150 | /* Swizzle each CPU's IMR (but leave the IP selection alone) */ | 150 | /* Swizzle each CPU's IMR (but leave the IP selection alone) */ |
151 | old_cpu = sb1250_irq_owner[irq]; | 151 | old_cpu = sb1250_irq_owner[irq]; |
152 | cur_ints = __bus_readq(IOADDR(A_IMR_MAPPER(old_cpu) + | 152 | cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(old_cpu) + |
153 | R_IMR_INTERRUPT_MASK)); | 153 | R_IMR_INTERRUPT_MASK)); |
154 | int_on = !(cur_ints & (((u64) 1) << irq)); | 154 | int_on = !(cur_ints & (((u64) 1) << irq)); |
155 | if (int_on) { | 155 | if (int_on) { |
156 | /* If it was on, mask it */ | 156 | /* If it was on, mask it */ |
157 | cur_ints |= (((u64) 1) << irq); | 157 | cur_ints |= (((u64) 1) << irq); |
158 | __bus_writeq(cur_ints, IOADDR(A_IMR_MAPPER(old_cpu) + | 158 | ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(old_cpu) + |
159 | R_IMR_INTERRUPT_MASK)); | 159 | R_IMR_INTERRUPT_MASK)); |
160 | } | 160 | } |
161 | sb1250_irq_owner[irq] = cpu; | 161 | sb1250_irq_owner[irq] = cpu; |
162 | if (int_on) { | 162 | if (int_on) { |
163 | /* unmask for the new CPU */ | 163 | /* unmask for the new CPU */ |
164 | cur_ints = __bus_readq(IOADDR(A_IMR_MAPPER(cpu) + | 164 | cur_ints = ____raw_readq(IOADDR(A_IMR_MAPPER(cpu) + |
165 | R_IMR_INTERRUPT_MASK)); | 165 | R_IMR_INTERRUPT_MASK)); |
166 | cur_ints &= ~(((u64) 1) << irq); | 166 | cur_ints &= ~(((u64) 1) << irq); |
167 | __bus_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + | 167 | ____raw_writeq(cur_ints, IOADDR(A_IMR_MAPPER(cpu) + |
168 | R_IMR_INTERRUPT_MASK)); | 168 | R_IMR_INTERRUPT_MASK)); |
169 | } | 169 | } |
170 | spin_unlock(&sb1250_imr_lock); | 170 | spin_unlock(&sb1250_imr_lock); |
171 | spin_unlock_irqrestore(&desc->lock, flags); | 171 | spin_unlock_irqrestore(&desc->lock, flags); |
@@ -208,8 +208,8 @@ static void ack_sb1250_irq(unsigned int irq) | |||
208 | * deliver the interrupts to all CPUs (which makes affinity | 208 | * deliver the interrupts to all CPUs (which makes affinity |
209 | * changing easier for us) | 209 | * changing easier for us) |
210 | */ | 210 | */ |
211 | pending = bus_readq(IOADDR(A_IMR_REGISTER(sb1250_irq_owner[irq], | 211 | pending = __raw_readq(IOADDR(A_IMR_REGISTER(sb1250_irq_owner[irq], |
212 | R_IMR_LDT_INTERRUPT))); | 212 | R_IMR_LDT_INTERRUPT))); |
213 | pending &= ((u64)1 << (irq)); | 213 | pending &= ((u64)1 << (irq)); |
214 | if (pending) { | 214 | if (pending) { |
215 | int i; | 215 | int i; |
@@ -224,8 +224,8 @@ static void ack_sb1250_irq(unsigned int irq) | |||
224 | * Clear for all CPUs so an affinity switch | 224 | * Clear for all CPUs so an affinity switch |
225 | * doesn't find an old status | 225 | * doesn't find an old status |
226 | */ | 226 | */ |
227 | bus_writeq(pending, | 227 | __raw_writeq(pending, |
228 | IOADDR(A_IMR_REGISTER(cpu, | 228 | IOADDR(A_IMR_REGISTER(cpu, |
229 | R_IMR_LDT_INTERRUPT_CLR))); | 229 | R_IMR_LDT_INTERRUPT_CLR))); |
230 | } | 230 | } |
231 | 231 | ||
@@ -340,12 +340,14 @@ void __init arch_init_irq(void) | |||
340 | 340 | ||
341 | /* Default everything to IP2 */ | 341 | /* Default everything to IP2 */ |
342 | for (i = 0; i < SB1250_NR_IRQS; i++) { /* was I0 */ | 342 | for (i = 0; i < SB1250_NR_IRQS; i++) { /* was I0 */ |
343 | bus_writeq(IMR_IP2_VAL, | 343 | __raw_writeq(IMR_IP2_VAL, |
344 | IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + | 344 | IOADDR(A_IMR_REGISTER(0, |
345 | (i << 3))); | 345 | R_IMR_INTERRUPT_MAP_BASE) + |
346 | bus_writeq(IMR_IP2_VAL, | 346 | (i << 3))); |
347 | IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MAP_BASE) + | 347 | __raw_writeq(IMR_IP2_VAL, |
348 | (i << 3))); | 348 | IOADDR(A_IMR_REGISTER(1, |
349 | R_IMR_INTERRUPT_MAP_BASE) + | ||
350 | (i << 3))); | ||
349 | } | 351 | } |
350 | 352 | ||
351 | init_sb1250_irqs(); | 353 | init_sb1250_irqs(); |
@@ -355,23 +357,23 @@ void __init arch_init_irq(void) | |||
355 | * inter-cpu messages | 357 | * inter-cpu messages |
356 | */ | 358 | */ |
357 | /* Was I1 */ | 359 | /* Was I1 */ |
358 | bus_writeq(IMR_IP3_VAL, | 360 | __raw_writeq(IMR_IP3_VAL, |
359 | IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + | 361 | IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + |
360 | (K_INT_MBOX_0 << 3))); | 362 | (K_INT_MBOX_0 << 3))); |
361 | bus_writeq(IMR_IP3_VAL, | 363 | __raw_writeq(IMR_IP3_VAL, |
362 | IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MAP_BASE) + | 364 | IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MAP_BASE) + |
363 | (K_INT_MBOX_0 << 3))); | 365 | (K_INT_MBOX_0 << 3))); |
364 | 366 | ||
365 | /* Clear the mailboxes. The firmware may leave them dirty */ | 367 | /* Clear the mailboxes. The firmware may leave them dirty */ |
366 | bus_writeq(0xffffffffffffffffULL, | 368 | __raw_writeq(0xffffffffffffffffULL, |
367 | IOADDR(A_IMR_REGISTER(0, R_IMR_MAILBOX_CLR_CPU))); | 369 | IOADDR(A_IMR_REGISTER(0, R_IMR_MAILBOX_CLR_CPU))); |
368 | bus_writeq(0xffffffffffffffffULL, | 370 | __raw_writeq(0xffffffffffffffffULL, |
369 | IOADDR(A_IMR_REGISTER(1, R_IMR_MAILBOX_CLR_CPU))); | 371 | IOADDR(A_IMR_REGISTER(1, R_IMR_MAILBOX_CLR_CPU))); |
370 | 372 | ||
371 | /* Mask everything except the mailbox registers for both cpus */ | 373 | /* Mask everything except the mailbox registers for both cpus */ |
372 | tmp = ~((u64) 0) ^ (((u64) 1) << K_INT_MBOX_0); | 374 | tmp = ~((u64) 0) ^ (((u64) 1) << K_INT_MBOX_0); |
373 | bus_writeq(tmp, IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MASK))); | 375 | __raw_writeq(tmp, IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MASK))); |
374 | bus_writeq(tmp, IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MASK))); | 376 | __raw_writeq(tmp, IOADDR(A_IMR_REGISTER(1, R_IMR_INTERRUPT_MASK))); |
375 | 377 | ||
376 | sb1250_steal_irq(K_INT_MBOX_0); | 378 | sb1250_steal_irq(K_INT_MBOX_0); |
377 | 379 | ||
@@ -396,12 +398,14 @@ void __init arch_init_irq(void) | |||
396 | sb1250_duart_present[kgdb_port] = 0; | 398 | sb1250_duart_present[kgdb_port] = 0; |
397 | #endif | 399 | #endif |
398 | /* Setup uart 1 settings, mapper */ | 400 | /* Setup uart 1 settings, mapper */ |
399 | bus_writeq(M_DUART_IMR_BRK, IOADDR(A_DUART_IMRREG(kgdb_port))); | 401 | __raw_writeq(M_DUART_IMR_BRK, |
402 | IOADDR(A_DUART_IMRREG(kgdb_port))); | ||
400 | 403 | ||
401 | sb1250_steal_irq(kgdb_irq); | 404 | sb1250_steal_irq(kgdb_irq); |
402 | bus_writeq(IMR_IP6_VAL, | 405 | __raw_writeq(IMR_IP6_VAL, |
403 | IOADDR(A_IMR_REGISTER(0, R_IMR_INTERRUPT_MAP_BASE) + | 406 | IOADDR(A_IMR_REGISTER(0, |
404 | (kgdb_irq<<3))); | 407 | R_IMR_INTERRUPT_MAP_BASE) + |
408 | (kgdb_irq << 3))); | ||
405 | sb1250_unmask_irq(0, kgdb_irq); | 409 | sb1250_unmask_irq(0, kgdb_irq); |
406 | } | 410 | } |
407 | #endif | 411 | #endif |
diff --git a/arch/mips/sibyte/sb1250/setup.c b/arch/mips/sibyte/sb1250/setup.c index f8c605be96c7..df2e266c700c 100644 --- a/arch/mips/sibyte/sb1250/setup.c +++ b/arch/mips/sibyte/sb1250/setup.c | |||
@@ -153,7 +153,7 @@ void sb1250_setup(void) | |||
153 | int bad_config = 0; | 153 | int bad_config = 0; |
154 | 154 | ||
155 | sb1_pass = read_c0_prid() & 0xff; | 155 | sb1_pass = read_c0_prid() & 0xff; |
156 | sys_rev = bus_readq(IOADDR(A_SCD_SYSTEM_REVISION)); | 156 | sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION)); |
157 | soc_type = SYS_SOC_TYPE(sys_rev); | 157 | soc_type = SYS_SOC_TYPE(sys_rev); |
158 | soc_pass = G_SYS_REVISION(sys_rev); | 158 | soc_pass = G_SYS_REVISION(sys_rev); |
159 | 159 | ||
@@ -162,7 +162,7 @@ void sb1250_setup(void) | |||
162 | machine_restart(NULL); | 162 | machine_restart(NULL); |
163 | } | 163 | } |
164 | 164 | ||
165 | plldiv = G_SYS_PLL_DIV(bus_readq(IOADDR(A_SCD_SYSTEM_CFG))); | 165 | plldiv = G_SYS_PLL_DIV(__raw_readq(IOADDR(A_SCD_SYSTEM_CFG))); |
166 | zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25); | 166 | zbbus_mhz = ((plldiv >> 1) * 50) + ((plldiv & 1) * 25); |
167 | 167 | ||
168 | prom_printf("Broadcom SiByte %s %s @ %d MHz (SB1 rev %d)\n", | 168 | prom_printf("Broadcom SiByte %s %s @ %d MHz (SB1 rev %d)\n", |
diff --git a/arch/mips/sibyte/sb1250/smp.c b/arch/mips/sibyte/sb1250/smp.c index be91b3990952..f859db02d3c9 100644 --- a/arch/mips/sibyte/sb1250/smp.c +++ b/arch/mips/sibyte/sb1250/smp.c | |||
@@ -29,18 +29,18 @@ | |||
29 | #include <asm/sibyte/sb1250_int.h> | 29 | #include <asm/sibyte/sb1250_int.h> |
30 | 30 | ||
31 | static void *mailbox_set_regs[] = { | 31 | static void *mailbox_set_regs[] = { |
32 | (void *)IOADDR(A_IMR_CPU0_BASE + R_IMR_MAILBOX_SET_CPU), | 32 | IOADDR(A_IMR_CPU0_BASE + R_IMR_MAILBOX_SET_CPU), |
33 | (void *)IOADDR(A_IMR_CPU1_BASE + R_IMR_MAILBOX_SET_CPU) | 33 | IOADDR(A_IMR_CPU1_BASE + R_IMR_MAILBOX_SET_CPU) |
34 | }; | 34 | }; |
35 | 35 | ||
36 | static void *mailbox_clear_regs[] = { | 36 | static void *mailbox_clear_regs[] = { |
37 | (void *)IOADDR(A_IMR_CPU0_BASE + R_IMR_MAILBOX_CLR_CPU), | 37 | IOADDR(A_IMR_CPU0_BASE + R_IMR_MAILBOX_CLR_CPU), |
38 | (void *)IOADDR(A_IMR_CPU1_BASE + R_IMR_MAILBOX_CLR_CPU) | 38 | IOADDR(A_IMR_CPU1_BASE + R_IMR_MAILBOX_CLR_CPU) |
39 | }; | 39 | }; |
40 | 40 | ||
41 | static void *mailbox_regs[] = { | 41 | static void *mailbox_regs[] = { |
42 | (void *)IOADDR(A_IMR_CPU0_BASE + R_IMR_MAILBOX_CPU), | 42 | IOADDR(A_IMR_CPU0_BASE + R_IMR_MAILBOX_CPU), |
43 | (void *)IOADDR(A_IMR_CPU1_BASE + R_IMR_MAILBOX_CPU) | 43 | IOADDR(A_IMR_CPU1_BASE + R_IMR_MAILBOX_CPU) |
44 | }; | 44 | }; |
45 | 45 | ||
46 | /* | 46 | /* |
@@ -73,7 +73,7 @@ void sb1250_smp_finish(void) | |||
73 | */ | 73 | */ |
74 | void core_send_ipi(int cpu, unsigned int action) | 74 | void core_send_ipi(int cpu, unsigned int action) |
75 | { | 75 | { |
76 | bus_writeq((((u64)action) << 48), mailbox_set_regs[cpu]); | 76 | __raw_writeq((((u64)action) << 48), mailbox_set_regs[cpu]); |
77 | } | 77 | } |
78 | 78 | ||
79 | void sb1250_mailbox_interrupt(struct pt_regs *regs) | 79 | void sb1250_mailbox_interrupt(struct pt_regs *regs) |
@@ -83,10 +83,10 @@ void sb1250_mailbox_interrupt(struct pt_regs *regs) | |||
83 | 83 | ||
84 | kstat_this_cpu.irqs[K_INT_MBOX_0]++; | 84 | kstat_this_cpu.irqs[K_INT_MBOX_0]++; |
85 | /* Load the mailbox register to figure out what we're supposed to do */ | 85 | /* Load the mailbox register to figure out what we're supposed to do */ |
86 | action = (__bus_readq(mailbox_regs[cpu]) >> 48) & 0xffff; | 86 | action = (____raw_readq(mailbox_regs[cpu]) >> 48) & 0xffff; |
87 | 87 | ||
88 | /* Clear the mailbox to clear the interrupt */ | 88 | /* Clear the mailbox to clear the interrupt */ |
89 | __bus_writeq(((u64)action) << 48, mailbox_clear_regs[cpu]); | 89 | ____raw_writeq(((u64)action) << 48, mailbox_clear_regs[cpu]); |
90 | 90 | ||
91 | /* | 91 | /* |
92 | * Nothing to do for SMP_RESCHEDULE_YOURSELF; returning from the | 92 | * Nothing to do for SMP_RESCHEDULE_YOURSELF; returning from the |
diff --git a/arch/mips/sibyte/sb1250/time.c b/arch/mips/sibyte/sb1250/time.c index 8b4c848c907b..0ffbc835b116 100644 --- a/arch/mips/sibyte/sb1250/time.c +++ b/arch/mips/sibyte/sb1250/time.c | |||
@@ -67,24 +67,24 @@ void sb1250_time_init(void) | |||
67 | sb1250_mask_irq(cpu, irq); | 67 | sb1250_mask_irq(cpu, irq); |
68 | 68 | ||
69 | /* Map the timer interrupt to ip[4] of this cpu */ | 69 | /* Map the timer interrupt to ip[4] of this cpu */ |
70 | bus_writeq(IMR_IP4_VAL, | 70 | __raw_writeq(IMR_IP4_VAL, |
71 | IOADDR(A_IMR_REGISTER(cpu, R_IMR_INTERRUPT_MAP_BASE) + | 71 | IOADDR(A_IMR_REGISTER(cpu, R_IMR_INTERRUPT_MAP_BASE) + |
72 | (irq << 3))); | 72 | (irq << 3))); |
73 | 73 | ||
74 | /* the general purpose timer ticks at 1 Mhz independent if the rest of the system */ | 74 | /* the general purpose timer ticks at 1 Mhz independent if the rest of the system */ |
75 | /* Disable the timer and set up the count */ | 75 | /* Disable the timer and set up the count */ |
76 | bus_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); | 76 | __raw_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); |
77 | #ifdef CONFIG_SIMULATION | 77 | #ifdef CONFIG_SIMULATION |
78 | bus_writeq(50000 / HZ, | 78 | __raw_writeq(50000 / HZ, |
79 | IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); | 79 | IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); |
80 | #else | 80 | #else |
81 | bus_writeq(1000000/HZ, | 81 | __raw_writeq(1000000 / HZ, |
82 | IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); | 82 | IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); |
83 | #endif | 83 | #endif |
84 | 84 | ||
85 | /* Set the timer running */ | 85 | /* Set the timer running */ |
86 | bus_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS, | 86 | __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS, |
87 | IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); | 87 | IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); |
88 | 88 | ||
89 | sb1250_unmask_irq(cpu, irq); | 89 | sb1250_unmask_irq(cpu, irq); |
90 | sb1250_steal_irq(irq); | 90 | sb1250_steal_irq(irq); |
@@ -105,8 +105,8 @@ void sb1250_timer_interrupt(struct pt_regs *regs) | |||
105 | int irq = K_INT_TIMER_0 + cpu; | 105 | int irq = K_INT_TIMER_0 + cpu; |
106 | 106 | ||
107 | /* Reset the timer */ | 107 | /* Reset the timer */ |
108 | __bus_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS, | 108 | ____raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS, |
109 | IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); | 109 | IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); |
110 | 110 | ||
111 | /* | 111 | /* |
112 | * CPU 0 handles the global timer interrupt job | 112 | * CPU 0 handles the global timer interrupt job |
@@ -130,7 +130,7 @@ void sb1250_timer_interrupt(struct pt_regs *regs) | |||
130 | unsigned long sb1250_gettimeoffset(void) | 130 | unsigned long sb1250_gettimeoffset(void) |
131 | { | 131 | { |
132 | unsigned long count = | 132 | unsigned long count = |
133 | bus_readq(IOADDR(A_SCD_TIMER_REGISTER(0, R_SCD_TIMER_CNT))); | 133 | __raw_readq(IOADDR(A_SCD_TIMER_REGISTER(0, R_SCD_TIMER_CNT))); |
134 | 134 | ||
135 | return 1000000/HZ - count; | 135 | return 1000000/HZ - count; |
136 | } | 136 | } |