hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/arch/xtensa/kernel/setup.c
....@@ -37,7 +37,6 @@
3737 #include <asm/bootparam.h>
3838 #include <asm/kasan.h>
3939 #include <asm/mmu_context.h>
40
-#include <asm/pgtable.h>
4140 #include <asm/processor.h>
4241 #include <asm/timex.h>
4342 #include <asm/platform.h>
....@@ -61,7 +60,6 @@
6160 #ifdef CONFIG_BLK_DEV_INITRD
6261 extern unsigned long initrd_start;
6362 extern unsigned long initrd_end;
64
-int initrd_is_mapped = 0;
6563 extern int initrd_below_start_ok;
6664 #endif
6765
....@@ -95,7 +93,7 @@
9593 } tagtable_t;
9694
9795 #define __tagtable(tag, fn) static tagtable_t __tagtable_##fn \
98
- __attribute__((used, section(".taglist"))) = { tag, fn }
96
+ __section(".taglist") __attribute__((used)) = { tag, fn }
9997
10098 /* parse current tag */
10199
....@@ -285,6 +283,8 @@
285283 extern char _UserExceptionVector_text_end;
286284 extern char _DoubleExceptionVector_text_start;
287285 extern char _DoubleExceptionVector_text_end;
286
+extern char _exception_text_start;
287
+extern char _exception_text_end;
288288 #if XCHAL_EXCM_LEVEL >= 2
289289 extern char _Level2InterruptVector_text_start;
290290 extern char _Level2InterruptVector_text_end;
....@@ -309,6 +309,10 @@
309309 extern char _SecondaryResetVector_text_start;
310310 extern char _SecondaryResetVector_text_end;
311311 #endif
312
+#ifdef CONFIG_XIP_KERNEL
313
+extern char _xip_start[];
314
+extern char _xip_end[];
315
+#endif
312316
313317 static inline int __init_memblock mem_reserve(unsigned long start,
314318 unsigned long end)
....@@ -319,9 +323,9 @@
319323 void __init setup_arch(char **cmdline_p)
320324 {
321325 pr_info("config ID: %08x:%08x\n",
322
- get_sr(SREG_EPC), get_sr(SREG_EXCSAVE));
323
- if (get_sr(SREG_EPC) != XCHAL_HW_CONFIGID0 ||
324
- get_sr(SREG_EXCSAVE) != XCHAL_HW_CONFIGID1)
326
+ xtensa_get_sr(SREG_EPC), xtensa_get_sr(SREG_EXCSAVE));
327
+ if (xtensa_get_sr(SREG_EPC) != XCHAL_HW_CONFIGID0 ||
328
+ xtensa_get_sr(SREG_EXCSAVE) != XCHAL_HW_CONFIGID1)
325329 pr_info("built for config ID: %08x:%08x\n",
326330 XCHAL_HW_CONFIGID0, XCHAL_HW_CONFIGID1);
327331
....@@ -332,18 +336,19 @@
332336 /* Reserve some memory regions */
333337
334338 #ifdef CONFIG_BLK_DEV_INITRD
335
- if (initrd_start < initrd_end) {
336
- initrd_is_mapped = mem_reserve(__pa(initrd_start),
337
- __pa(initrd_end)) == 0;
339
+ if (initrd_start < initrd_end &&
340
+ !mem_reserve(__pa(initrd_start), __pa(initrd_end)))
338341 initrd_below_start_ok = 1;
339
- } else {
342
+ else
340343 initrd_start = 0;
341
- }
342344 #endif
343345
344346 mem_reserve(__pa(_stext), __pa(_end));
347
+#ifdef CONFIG_XIP_KERNEL
348
+ mem_reserve(__pa(_xip_start), __pa(_xip_end));
349
+#endif
345350
346
-#ifdef CONFIG_VECTORS_OFFSET
351
+#ifdef CONFIG_VECTORS_ADDR
347352 mem_reserve(__pa(&_WindowVectors_text_start),
348353 __pa(&_WindowVectors_text_end));
349354
....@@ -359,6 +364,8 @@
359364 mem_reserve(__pa(&_DoubleExceptionVector_text_start),
360365 __pa(&_DoubleExceptionVector_text_end));
361366
367
+ mem_reserve(__pa(&_exception_text_start),
368
+ __pa(&_exception_text_end));
362369 #if XCHAL_EXCM_LEVEL >= 2
363370 mem_reserve(__pa(&_Level2InterruptVector_text_start),
364371 __pa(&_Level2InterruptVector_text_end));
....@@ -380,7 +387,7 @@
380387 __pa(&_Level6InterruptVector_text_end));
381388 #endif
382389
383
-#endif /* CONFIG_VECTORS_OFFSET */
390
+#endif /* CONFIG_VECTORS_ADDR */
384391
385392 #ifdef CONFIG_SMP
386393 mem_reserve(__pa(&_SecondaryResetVector_text_start),
....@@ -401,13 +408,7 @@
401408 #ifdef CONFIG_VT
402409 # if defined(CONFIG_VGA_CONSOLE)
403410 conswitchp = &vga_con;
404
-# elif defined(CONFIG_DUMMY_CONSOLE)
405
- conswitchp = &dummy_con;
406411 # endif
407
-#endif
408
-
409
-#ifdef CONFIG_PCI
410
- platform_pcibios_init();
411412 #endif
412413 }
413414
....@@ -598,7 +599,7 @@
598599 num_online_cpus(),
599600 cpumask_pr_args(cpu_online_mask),
600601 XCHAL_BUILD_UNIQUE_ID,
601
- get_sr(SREG_EPC), get_sr(SREG_EXCSAVE),
602
+ xtensa_get_sr(SREG_EPC), xtensa_get_sr(SREG_EXCSAVE),
602603 XCHAL_HAVE_BE ? "big" : "little",
603604 ccount_freq/1000000,
604605 (ccount_freq/10000) % 100,
....@@ -653,6 +654,9 @@
653654 #if XCHAL_HAVE_S32C1I
654655 "s32c1i "
655656 #endif
657
+#if XCHAL_HAVE_EXCLUSIVE
658
+ "exclusive "
659
+#endif
656660 "\n");
657661
658662 /* Registers. */