| .. | .. |
|---|
| 35 | 35 | .macro setup_c0_status set clr |
|---|
| 36 | 36 | .set push |
|---|
| 37 | 37 | mfc0 t0, CP0_STATUS |
|---|
| 38 | | - or t0, ST0_CU0|\set|0x1f|\clr |
|---|
| 38 | + or t0, ST0_KERNEL_CUMASK|\set|0x1f|\clr |
|---|
| 39 | 39 | xor t0, 0x1f|\clr |
|---|
| 40 | 40 | mtc0 t0, CP0_STATUS |
|---|
| 41 | 41 | .set noreorder |
|---|
| .. | .. |
|---|
| 77 | 77 | */ |
|---|
| 78 | 78 | FEXPORT(__kernel_entry) |
|---|
| 79 | 79 | j kernel_entry |
|---|
| 80 | | -#endif |
|---|
| 80 | +#endif /* CONFIG_BOOT_RAW */ |
|---|
| 81 | 81 | |
|---|
| 82 | 82 | __REF |
|---|
| 83 | 83 | |
|---|
| .. | .. |
|---|
| 94 | 94 | 0: |
|---|
| 95 | 95 | |
|---|
| 96 | 96 | #ifdef CONFIG_USE_OF |
|---|
| 97 | | -#ifdef CONFIG_MIPS_RAW_APPENDED_DTB |
|---|
| 97 | +#if defined(CONFIG_MIPS_RAW_APPENDED_DTB) || \ |
|---|
| 98 | + defined(CONFIG_MIPS_ELF_APPENDED_DTB) |
|---|
| 99 | + |
|---|
| 98 | 100 | PTR_LA t2, __appended_dtb |
|---|
| 99 | 101 | |
|---|
| 100 | 102 | #ifdef CONFIG_CPU_BIG_ENDIAN |
|---|
| 101 | 103 | li t1, 0xd00dfeed |
|---|
| 102 | | -#else |
|---|
| 104 | +#else /* !CONFIG_CPU_BIG_ENDIAN */ |
|---|
| 103 | 105 | li t1, 0xedfe0dd0 |
|---|
| 104 | | -#endif |
|---|
| 106 | +#endif /* !CONFIG_CPU_BIG_ENDIAN */ |
|---|
| 105 | 107 | lw t0, (t2) |
|---|
| 106 | 108 | beq t0, t1, dtb_found |
|---|
| 107 | | -#endif |
|---|
| 109 | +#endif /* CONFIG_MIPS_RAW_APPENDED_DTB || CONFIG_MIPS_ELF_APPENDED_DTB */ |
|---|
| 108 | 110 | li t1, -2 |
|---|
| 109 | 111 | move t2, a1 |
|---|
| 110 | 112 | beq a0, t1, dtb_found |
|---|
| 111 | 113 | |
|---|
| 114 | +#ifdef CONFIG_BUILTIN_DTB |
|---|
| 115 | + PTR_LA t2, __dtb_start |
|---|
| 116 | + PTR_LA t1, __dtb_end |
|---|
| 117 | + bne t1, t2, dtb_found |
|---|
| 118 | +#endif /* CONFIG_BUILTIN_DTB */ |
|---|
| 119 | + |
|---|
| 112 | 120 | li t2, 0 |
|---|
| 113 | 121 | dtb_found: |
|---|
| 114 | | -#endif |
|---|
| 122 | +#endif /* CONFIG_USE_OF */ |
|---|
| 115 | 123 | PTR_LA t0, __bss_start # clear .bss |
|---|
| 116 | 124 | LONG_S zero, (t0) |
|---|
| 117 | 125 | PTR_LA t1, __bss_stop - LONGSIZE |
|---|
| .. | .. |
|---|
| 130 | 138 | #endif |
|---|
| 131 | 139 | |
|---|
| 132 | 140 | MTC0 zero, CP0_CONTEXT # clear context register |
|---|
| 141 | +#ifdef CONFIG_64BIT |
|---|
| 142 | + MTC0 zero, CP0_XCONTEXT |
|---|
| 143 | +#endif |
|---|
| 133 | 144 | PTR_LA $28, init_thread_union |
|---|
| 134 | 145 | /* Set the SP after an empty pt_regs. */ |
|---|
| 135 | 146 | PTR_LI sp, _THREAD_SIZE - 32 - PT_SIZE |
|---|
| .. | .. |
|---|
| 156 | 167 | * newly sync'd icache. |
|---|
| 157 | 168 | */ |
|---|
| 158 | 169 | jr.hb v0 |
|---|
| 159 | | -#else |
|---|
| 170 | +#else /* !CONFIG_RELOCATABLE */ |
|---|
| 160 | 171 | j start_kernel |
|---|
| 161 | | -#endif |
|---|
| 172 | +#endif /* !CONFIG_RELOCATABLE */ |
|---|
| 162 | 173 | END(kernel_entry) |
|---|
| 163 | 174 | |
|---|
| 164 | 175 | #ifdef CONFIG_SMP |
|---|