hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/arch/parisc/kernel/head.S
....@@ -17,12 +17,12 @@
1717 #include <asm/pdc.h>
1818
1919 #include <asm/assembly.h>
20
-#include <asm/pgtable.h>
2120
2221 #include <linux/linkage.h>
2322 #include <linux/init.h>
23
+#include <linux/pgtable.h>
2424
25
- .level PA_ASM_LEVEL
25
+ .level 1.1
2626
2727 __INITDATA
2828 ENTRY(boot_args)
....@@ -68,6 +68,47 @@
6868 stw,ma %arg1,4(%r1)
6969 stw,ma %arg2,4(%r1)
7070 stw,ma %arg3,4(%r1)
71
+
72
+#if !defined(CONFIG_64BIT) && defined(CONFIG_PA20)
73
+ /* This 32-bit kernel was compiled for PA2.0 CPUs. Check current CPU
74
+ * and halt kernel if we detect a PA1.x CPU. */
75
+ ldi 32,%r10
76
+ mtctl %r10,%cr11
77
+ .level 2.0
78
+ mfctl,w %cr11,%r10
79
+ .level 1.1
80
+ comib,<>,n 0,%r10,$cpu_ok
81
+
82
+ load32 PA(msg1),%arg0
83
+ ldi msg1_end-msg1,%arg1
84
+$iodc_panic:
85
+ copy %arg0, %r10
86
+ copy %arg1, %r11
87
+ load32 PA(init_stack),%sp
88
+#define MEM_CONS 0x3A0
89
+ ldw MEM_CONS+32(%r0),%arg0 // HPA
90
+ ldi ENTRY_IO_COUT,%arg1
91
+ ldw MEM_CONS+36(%r0),%arg2 // SPA
92
+ ldw MEM_CONS+8(%r0),%arg3 // layers
93
+ load32 PA(__bss_start),%r1
94
+ stw %r1,-52(%sp) // arg4
95
+ stw %r0,-56(%sp) // arg5
96
+ stw %r10,-60(%sp) // arg6 = ptr to text
97
+ stw %r11,-64(%sp) // arg7 = len
98
+ stw %r0,-68(%sp) // arg8
99
+ load32 PA(.iodc_panic_ret), %rp
100
+ ldw MEM_CONS+40(%r0),%r1 // ENTRY_IODC
101
+ bv,n (%r1)
102
+.iodc_panic_ret:
103
+ b . /* wait endless with ... */
104
+ or %r10,%r10,%r10 /* qemu idle sleep */
105
+msg1: .ascii "Can't boot kernel which was built for PA8x00 CPUs on this machine.\r\n"
106
+msg1_end:
107
+
108
+$cpu_ok:
109
+#endif
110
+
111
+ .level PA_ASM_LEVEL
71112
72113 /* Initialize startup VM. Just map first 16/32 MB of memory */
73114 load32 PA(swapper_pg_dir),%r4
....@@ -329,6 +370,19 @@
329370 mtsp %r0,%sr6
330371 mtsp %r0,%sr7
331372
373
+#ifdef CONFIG_64BIT
374
+ /*
375
+ * Enable Wide mode early, in case the task_struct for the idle
376
+ * task in smp_init_current_idle_task was allocated above 4GB.
377
+ */
378
+1: mfia %rp /* clear upper part of pcoq */
379
+ ldo 2f-1b(%rp),%rp
380
+ depdi 0,31,32,%rp
381
+ bv (%rp)
382
+ ssm PSW_SM_W,%r0
383
+2:
384
+#endif
385
+
332386 /* Initialize the SP - monarch sets up smp_init_current_idle_task */
333387 load32 PA(smp_init_current_idle_task),%sp
334388 LDREG 0(%sp),%sp /* load task address */
....@@ -363,7 +417,7 @@
363417 ENDPROC(parisc_kernel_start)
364418
365419 #ifndef CONFIG_64BIT
366
- .section .data..read_mostly
420
+ .section .data..ro_after_init
367421
368422 .align 4
369423 .export $global$,data