.. | .. |
---|
17 | 17 | #include <asm/pdc.h> |
---|
18 | 18 | |
---|
19 | 19 | #include <asm/assembly.h> |
---|
20 | | -#include <asm/pgtable.h> |
---|
21 | 20 | |
---|
22 | 21 | #include <linux/linkage.h> |
---|
23 | 22 | #include <linux/init.h> |
---|
| 23 | +#include <linux/pgtable.h> |
---|
24 | 24 | |
---|
25 | | - .level PA_ASM_LEVEL |
---|
| 25 | + .level 1.1 |
---|
26 | 26 | |
---|
27 | 27 | __INITDATA |
---|
28 | 28 | ENTRY(boot_args) |
---|
.. | .. |
---|
68 | 68 | stw,ma %arg1,4(%r1) |
---|
69 | 69 | stw,ma %arg2,4(%r1) |
---|
70 | 70 | 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 |
---|
71 | 112 | |
---|
72 | 113 | /* Initialize startup VM. Just map first 16/32 MB of memory */ |
---|
73 | 114 | load32 PA(swapper_pg_dir),%r4 |
---|
.. | .. |
---|
329 | 370 | mtsp %r0,%sr6 |
---|
330 | 371 | mtsp %r0,%sr7 |
---|
331 | 372 | |
---|
| 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 | + |
---|
332 | 386 | /* Initialize the SP - monarch sets up smp_init_current_idle_task */ |
---|
333 | 387 | load32 PA(smp_init_current_idle_task),%sp |
---|
334 | 388 | LDREG 0(%sp),%sp /* load task address */ |
---|
.. | .. |
---|
363 | 417 | ENDPROC(parisc_kernel_start) |
---|
364 | 418 | |
---|
365 | 419 | #ifndef CONFIG_64BIT |
---|
366 | | - .section .data..read_mostly |
---|
| 420 | + .section .data..ro_after_init |
---|
367 | 421 | |
---|
368 | 422 | .align 4 |
---|
369 | 423 | .export $global$,data |
---|