|
22 | 22 | #include <linux/init.h>
|
23 | 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)
|
@@ -70,6 +70,47 @@ $bss_loop:
|
70 | 70 | stw,ma %arg2,4(%r1)
|
71 | 71 | stw,ma %arg3,4(%r1)
|
72 | 72 |
|
| 73 | +#if !defined(CONFIG_64BIT) && defined(CONFIG_PA20) |
| 74 | + /* This 32-bit kernel was compiled for PA2.0 CPUs. Check current CPU |
| 75 | + * and halt kernel if we detect a PA1.x CPU. */ |
| 76 | + ldi 32,%r10 |
| 77 | + mtctl %r10,%cr11 |
| 78 | + .level 2.0 |
| 79 | + mfctl,w %cr11,%r10 |
| 80 | + .level 1.1 |
| 81 | + comib,<>,n 0,%r10,$cpu_ok |
| 82 | + |
| 83 | + load32 PA(msg1),%arg0 |
| 84 | + ldi msg1_end-msg1,%arg1 |
| 85 | +$iodc_panic: |
| 86 | + copy %arg0, %r10 |
| 87 | + copy %arg1, %r11 |
| 88 | + load32 PA(init_stack),%sp |
| 89 | +#define MEM_CONS 0x3A0 |
| 90 | + ldw MEM_CONS+32(%r0),%arg0 // HPA |
| 91 | + ldi ENTRY_IO_COUT,%arg1 |
| 92 | + ldw MEM_CONS+36(%r0),%arg2 // SPA |
| 93 | + ldw MEM_CONS+8(%r0),%arg3 // layers |
| 94 | + load32 PA(__bss_start),%r1 |
| 95 | + stw %r1,-52(%sp) // arg4 |
| 96 | + stw %r0,-56(%sp) // arg5 |
| 97 | + stw %r10,-60(%sp) // arg6 = ptr to text |
| 98 | + stw %r11,-64(%sp) // arg7 = len |
| 99 | + stw %r0,-68(%sp) // arg8 |
| 100 | + load32 PA(.iodc_panic_ret), %rp |
| 101 | + ldw MEM_CONS+40(%r0),%r1 // ENTRY_IODC |
| 102 | + bv,n (%r1) |
| 103 | +.iodc_panic_ret: |
| 104 | + b . /* wait endless with ... */ |
| 105 | + or %r10,%r10,%r10 /* qemu idle sleep */ |
| 106 | +msg1: .ascii "Can't boot kernel which was built for PA8x00 CPUs on this machine.\r\n" |
| 107 | +msg1_end: |
| 108 | + |
| 109 | +$cpu_ok: |
| 110 | +#endif |
| 111 | + |
| 112 | + .level PA_ASM_LEVEL |
| 113 | + |
73 | 114 | /* Initialize startup VM. Just map first 16/32 MB of memory */
|
74 | 115 | load32 PA(swapper_pg_dir),%r4
|
75 | 116 | mtctl %r4,%cr24 /* Initialize kernel root pointer */
|
|
0 commit comments