hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/linux/rockchip/cpu.h
....@@ -19,6 +19,8 @@
1919 #define ROCKCHIP_CPU_MASK 0xffff0000
2020 #define ROCKCHIP_CPU_SHIFT 16
2121 #define ROCKCHIP_CPU_PX30 0x33260000
22
+#define ROCKCHIP_CPU_RV1103 0x11030000
23
+#define ROCKCHIP_CPU_RV1106 0x11060000
2224 #define ROCKCHIP_CPU_RV1109 0x11090000
2325 #define ROCKCHIP_CPU_RV1126 0x11260000
2426 #define ROCKCHIP_CPU_RK312X 0x31260000
....@@ -26,9 +28,10 @@
2628 #define ROCKCHIP_CPU_RK3308 0x33080000
2729 #define ROCKCHIP_CPU_RK3528 0x35280000
2830 #define ROCKCHIP_CPU_RK3566 0x35660000
31
+#define ROCKCHIP_CPU_RK3567 0x35670000
2932 #define ROCKCHIP_CPU_RK3568 0x35680000
3033
31
-#if IS_ENABLED(CONFIG_ROCKCHIP_CPUINFO)
34
+#if IS_REACHABLE(CONFIG_ROCKCHIP_CPUINFO)
3235
3336 extern unsigned long rockchip_soc_id;
3437
....@@ -97,6 +100,25 @@
97100 static inline bool cpu_is_px30(void) { return false; }
98101 #endif
99102
103
+#if defined(CONFIG_CPU_RV1106)
104
+static inline bool cpu_is_rv1103(void)
105
+{
106
+ if (rockchip_soc_id)
107
+ return (rockchip_soc_id & ROCKCHIP_CPU_MASK) == ROCKCHIP_CPU_RV1103;
108
+ return of_machine_is_compatible("rockchip,rv1103");
109
+}
110
+
111
+static inline bool cpu_is_rv1106(void)
112
+{
113
+ if (rockchip_soc_id)
114
+ return (rockchip_soc_id & ROCKCHIP_CPU_MASK) == ROCKCHIP_CPU_RV1106;
115
+ return of_machine_is_compatible("rockchip,rv1106");
116
+}
117
+#else
118
+static inline bool cpu_is_rv1103(void) { return false; }
119
+static inline bool cpu_is_rv1106(void) { return false; }
120
+#endif
121
+
100122 #if defined(CONFIG_CPU_RV1126) || defined(CONFIG_CPU_RV1109)
101123 static inline bool cpu_is_rv1109(void)
102124 {
....@@ -148,7 +170,8 @@
148170 if (rockchip_soc_id)
149171 return (rockchip_soc_id & ROCKCHIP_CPU_MASK) == ROCKCHIP_CPU_RK3308;
150172
151
- return of_machine_is_compatible("rockchip,rk3308");
173
+ return of_machine_is_compatible("rockchip,rk3308") ||
174
+ of_machine_is_compatible("rockchip,rk3308bs");
152175 }
153176 #else
154177 static inline bool cpu_is_rk3308(void) { return false; }
....@@ -159,7 +182,8 @@
159182 {
160183 if (rockchip_soc_id)
161184 return (rockchip_soc_id & ROCKCHIP_CPU_MASK) == ROCKCHIP_CPU_RK3528;
162
- return of_machine_is_compatible("rockchip,rk3528");
185
+ return of_machine_is_compatible("rockchip,rk3528") ||
186
+ of_machine_is_compatible("rockchip,rk3528a");
163187 }
164188 #else
165189 static inline bool cpu_is_rk3528(void) { return false; }
....@@ -173,6 +197,13 @@
173197 return of_machine_is_compatible("rockchip,rk3566");
174198 }
175199
200
+static inline bool cpu_is_rk3567(void)
201
+{
202
+ if (rockchip_soc_id)
203
+ return (rockchip_soc_id & ROCKCHIP_CPU_MASK) == ROCKCHIP_CPU_RK3567;
204
+ return of_machine_is_compatible("rockchip,rk3567");
205
+}
206
+
176207 static inline bool cpu_is_rk3568(void)
177208 {
178209 if (rockchip_soc_id)
....@@ -181,12 +212,15 @@
181212 }
182213 #else
183214 static inline bool cpu_is_rk3566(void) { return false; }
215
+static inline bool cpu_is_rk3567(void) { return false; }
184216 static inline bool cpu_is_rk3568(void) { return false; }
185217 #endif
186218
187219 #define ROCKCHIP_SOC_MASK (ROCKCHIP_CPU_MASK | 0xff)
188220 #define ROCKCHIP_SOC_PX30 (ROCKCHIP_CPU_PX30 | 0x00)
189221 #define ROCKCHIP_SOC_PX30S (ROCKCHIP_CPU_PX30 | 0x01)
222
+#define ROCKCHIP_SOC_RV1103 (ROCKCHIP_CPU_RV1103 | 0x00)
223
+#define ROCKCHIP_SOC_RV1106 (ROCKCHIP_CPU_RV1106 | 0x00)
190224 #define ROCKCHIP_SOC_RV1109 (ROCKCHIP_CPU_RV1109 | 0x00)
191225 #define ROCKCHIP_SOC_RV1126 (ROCKCHIP_CPU_RV1126 | 0x00)
192226 #define ROCKCHIP_SOC_RK3126 (ROCKCHIP_CPU_RK312X | 0x00)
....@@ -197,32 +231,42 @@
197231 #define ROCKCHIP_SOC_RK3288W (ROCKCHIP_CPU_RK3288 | 0x01)
198232 #define ROCKCHIP_SOC_RK3308 (ROCKCHIP_CPU_RK3308 | 0x00)
199233 #define ROCKCHIP_SOC_RK3308B (ROCKCHIP_CPU_RK3308 | 0x01)
234
+#define ROCKCHIP_SOC_RK3308BS (ROCKCHIP_CPU_RK3308 | 0x02)
200235 #define ROCKCHIP_SOC_RK3528 (ROCKCHIP_CPU_RK3528 | 0x00)
236
+#define ROCKCHIP_SOC_RK3528A (ROCKCHIP_CPU_RK3528 | 0x01)
201237 #define ROCKCHIP_SOC_RK3566 (ROCKCHIP_CPU_RK3566 | 0x00)
238
+#define ROCKCHIP_SOC_RK3567 (ROCKCHIP_CPU_RK3567 | 0x00)
202239 #define ROCKCHIP_SOC_RK3568 (ROCKCHIP_CPU_RK3568 | 0x00)
203240
204
-#define ROCKCHIP_SOC(id, ID) \
241
+#define ROCKCHIP_SOC(CPU, id, ID) \
205242 static inline bool soc_is_##id(void) \
206243 { \
244
+ if (!IS_ENABLED(CONFIG_CPU_##CPU)) \
245
+ return false; \
207246 if (rockchip_soc_id) \
208247 return ((rockchip_soc_id & ROCKCHIP_SOC_MASK) == ROCKCHIP_SOC_ ##ID); \
209248 return of_machine_is_compatible("rockchip,"#id); \
210249 }
211250
212
-ROCKCHIP_SOC(px30, PX30)
213
-ROCKCHIP_SOC(px30s, PX30S)
214
-ROCKCHIP_SOC(rv1109, RV1109)
215
-ROCKCHIP_SOC(rv1126, RV1126)
216
-ROCKCHIP_SOC(rk3126, RK3126)
217
-ROCKCHIP_SOC(rk3126b, RK3126B)
218
-ROCKCHIP_SOC(rk3126c, RK3126C)
219
-ROCKCHIP_SOC(rk3128, RK3128)
220
-ROCKCHIP_SOC(rk3288, RK3288)
221
-ROCKCHIP_SOC(rk3288w, RK3288W)
222
-ROCKCHIP_SOC(rk3308, RK3308)
223
-ROCKCHIP_SOC(rk3308b, RK3308B)
224
-ROCKCHIP_SOC(rk3528, RK3528)
225
-ROCKCHIP_SOC(rk3566, RK3566)
226
-ROCKCHIP_SOC(rk3568, RK3568)
251
+ROCKCHIP_SOC(PX30, px30, PX30)
252
+ROCKCHIP_SOC(PX30, px30s, PX30S)
253
+ROCKCHIP_SOC(RV1106, rv1103, RV1103)
254
+ROCKCHIP_SOC(RV1106, rv1106, RV1106)
255
+ROCKCHIP_SOC(RV1126, rv1109, RV1109)
256
+ROCKCHIP_SOC(RV1126, rv1126, RV1126)
257
+ROCKCHIP_SOC(RK312X, rk3126, RK3126)
258
+ROCKCHIP_SOC(RK312X, rk3126b, RK3126B)
259
+ROCKCHIP_SOC(RK312X, rk3126c, RK3126C)
260
+ROCKCHIP_SOC(RK312X, rk3128, RK3128)
261
+ROCKCHIP_SOC(RK3288, rk3288, RK3288)
262
+ROCKCHIP_SOC(RK3288, rk3288w, RK3288W)
263
+ROCKCHIP_SOC(RK3308, rk3308, RK3308)
264
+ROCKCHIP_SOC(RK3308, rk3308b, RK3308B)
265
+ROCKCHIP_SOC(RK3308, rk3308bs, RK3308BS)
266
+ROCKCHIP_SOC(RK3528, rk3528, RK3528)
267
+ROCKCHIP_SOC(RK3528, rk3528a, RK3528A)
268
+ROCKCHIP_SOC(RK3568, rk3566, RK3566)
269
+ROCKCHIP_SOC(RK3567, rk3567, RK3567)
270
+ROCKCHIP_SOC(RK3568, rk3568, RK3568)
227271
228272 #endif