.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * MIPS idle loop and WAIT instruction support. |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * Copyright (C) 1994 - 2006 Ralf Baechle |
---|
6 | 7 | * Copyright (C) 2003, 2004 Maciej W. Rozycki |
---|
7 | 8 | * Copyright (C) 2001, 2004, 2011, 2012 MIPS Technologies, Inc. |
---|
8 | | - * |
---|
9 | | - * This program is free software; you can redistribute it and/or |
---|
10 | | - * modify it under the terms of the GNU General Public License |
---|
11 | | - * as published by the Free Software Foundation; either version |
---|
12 | | - * 2 of the License, or (at your option) any later version. |
---|
13 | 9 | */ |
---|
14 | 10 | #include <linux/cpu.h> |
---|
15 | 11 | #include <linux/export.h> |
---|
.. | .. |
---|
37 | 33 | { |
---|
38 | 34 | unsigned long cfg = read_c0_conf(); |
---|
39 | 35 | write_c0_conf(cfg | R30XX_CONF_HALT); |
---|
40 | | - local_irq_enable(); |
---|
| 36 | + raw_local_irq_enable(); |
---|
41 | 37 | } |
---|
42 | 38 | |
---|
43 | 39 | static void __cpuidle r39xx_wait(void) |
---|
44 | 40 | { |
---|
45 | 41 | if (!need_resched()) |
---|
46 | 42 | write_c0_conf(read_c0_conf() | TX39_CONF_HALT); |
---|
47 | | - local_irq_enable(); |
---|
| 43 | + raw_local_irq_enable(); |
---|
48 | 44 | } |
---|
49 | 45 | |
---|
50 | 46 | void __cpuidle r4k_wait(void) |
---|
51 | 47 | { |
---|
52 | | - local_irq_enable(); |
---|
| 48 | + raw_local_irq_enable(); |
---|
53 | 49 | __r4k_wait(); |
---|
54 | 50 | } |
---|
55 | 51 | |
---|
.. | .. |
---|
68 | 64 | " .set arch=r4000 \n" |
---|
69 | 65 | " wait \n" |
---|
70 | 66 | " .set pop \n"); |
---|
71 | | - local_irq_enable(); |
---|
| 67 | + raw_local_irq_enable(); |
---|
72 | 68 | } |
---|
73 | 69 | |
---|
74 | 70 | /* |
---|
.. | .. |
---|
88 | 84 | " wait \n" |
---|
89 | 85 | " mtc0 $1, $12 # stalls until W stage \n" |
---|
90 | 86 | " .set pop \n"); |
---|
91 | | - local_irq_enable(); |
---|
| 87 | + raw_local_irq_enable(); |
---|
92 | 88 | } |
---|
93 | 89 | |
---|
94 | 90 | /* |
---|
.. | .. |
---|
101 | 97 | unsigned long c0status = read_c0_status() | 1; /* irqs on */ |
---|
102 | 98 | |
---|
103 | 99 | __asm__( |
---|
104 | | - " .set arch=r4000 \n" |
---|
| 100 | + " .set push \n" |
---|
| 101 | + " .set arch=r4000 \n" |
---|
105 | 102 | " cache 0x14, 0(%0) \n" |
---|
106 | 103 | " cache 0x14, 32(%0) \n" |
---|
107 | 104 | " sync \n" |
---|
.. | .. |
---|
111 | 108 | " nop \n" |
---|
112 | 109 | " nop \n" |
---|
113 | 110 | " nop \n" |
---|
114 | | - " .set mips0 \n" |
---|
| 111 | + " .set pop \n" |
---|
115 | 112 | : : "r" (au1k_wait), "r" (c0status)); |
---|
116 | 113 | } |
---|
117 | 114 | |
---|
.. | .. |
---|
154 | 151 | cpu_wait = r39xx_wait; |
---|
155 | 152 | break; |
---|
156 | 153 | case CPU_R4200: |
---|
157 | | -/* case CPU_R4300: */ |
---|
158 | 154 | case CPU_R4600: |
---|
159 | 155 | case CPU_R4640: |
---|
160 | 156 | case CPU_R4650: |
---|
.. | .. |
---|
176 | 172 | case CPU_CAVIUM_OCTEON_PLUS: |
---|
177 | 173 | case CPU_CAVIUM_OCTEON2: |
---|
178 | 174 | case CPU_CAVIUM_OCTEON3: |
---|
179 | | - case CPU_JZRISC: |
---|
180 | | - case CPU_LOONGSON1: |
---|
| 175 | + case CPU_XBURST: |
---|
| 176 | + case CPU_LOONGSON32: |
---|
181 | 177 | case CPU_XLR: |
---|
182 | 178 | case CPU_XLP: |
---|
183 | 179 | cpu_wait = r4k_wait; |
---|
184 | 180 | break; |
---|
185 | | - case CPU_LOONGSON3: |
---|
186 | | - if ((c->processor_id & PRID_REV_MASK) >= PRID_REV_LOONGSON3A_R2) |
---|
| 181 | + case CPU_LOONGSON64: |
---|
| 182 | + if ((c->processor_id & (PRID_IMP_MASK | PRID_REV_MASK)) >= |
---|
| 183 | + (PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0) || |
---|
| 184 | + (c->processor_id & PRID_IMP_MASK) == PRID_IMP_LOONGSON_64R) |
---|
187 | 185 | cpu_wait = r4k_wait; |
---|
188 | 186 | break; |
---|
189 | 187 | |
---|
.. | .. |
---|
204 | 202 | */ |
---|
205 | 203 | if (IS_ENABLED(CONFIG_MIPS_EJTAG_FDC_TTY)) |
---|
206 | 204 | break; |
---|
207 | | - /* fall through */ |
---|
| 205 | + fallthrough; |
---|
208 | 206 | case CPU_M14KC: |
---|
209 | 207 | case CPU_M14KEC: |
---|
210 | 208 | case CPU_24K: |
---|
.. | .. |
---|
259 | 257 | if (cpu_wait) |
---|
260 | 258 | cpu_wait(); |
---|
261 | 259 | else |
---|
262 | | - local_irq_enable(); |
---|
| 260 | + raw_local_irq_enable(); |
---|
263 | 261 | } |
---|
264 | 262 | |
---|
265 | 263 | #ifdef CONFIG_CPU_IDLE |
---|