hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/mips/kernel/head.S
....@@ -35,7 +35,7 @@
3535 .macro setup_c0_status set clr
3636 .set push
3737 mfc0 t0, CP0_STATUS
38
- or t0, ST0_CU0|\set|0x1f|\clr
38
+ or t0, ST0_KERNEL_CUMASK|\set|0x1f|\clr
3939 xor t0, 0x1f|\clr
4040 mtc0 t0, CP0_STATUS
4141 .set noreorder
....@@ -77,7 +77,7 @@
7777 */
7878 FEXPORT(__kernel_entry)
7979 j kernel_entry
80
-#endif
80
+#endif /* CONFIG_BOOT_RAW */
8181
8282 __REF
8383
....@@ -94,24 +94,32 @@
9494 0:
9595
9696 #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
+
98100 PTR_LA t2, __appended_dtb
99101
100102 #ifdef CONFIG_CPU_BIG_ENDIAN
101103 li t1, 0xd00dfeed
102
-#else
104
+#else /* !CONFIG_CPU_BIG_ENDIAN */
103105 li t1, 0xedfe0dd0
104
-#endif
106
+#endif /* !CONFIG_CPU_BIG_ENDIAN */
105107 lw t0, (t2)
106108 beq t0, t1, dtb_found
107
-#endif
109
+#endif /* CONFIG_MIPS_RAW_APPENDED_DTB || CONFIG_MIPS_ELF_APPENDED_DTB */
108110 li t1, -2
109111 move t2, a1
110112 beq a0, t1, dtb_found
111113
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
+
112120 li t2, 0
113121 dtb_found:
114
-#endif
122
+#endif /* CONFIG_USE_OF */
115123 PTR_LA t0, __bss_start # clear .bss
116124 LONG_S zero, (t0)
117125 PTR_LA t1, __bss_stop - LONGSIZE
....@@ -130,6 +138,9 @@
130138 #endif
131139
132140 MTC0 zero, CP0_CONTEXT # clear context register
141
+#ifdef CONFIG_64BIT
142
+ MTC0 zero, CP0_XCONTEXT
143
+#endif
133144 PTR_LA $28, init_thread_union
134145 /* Set the SP after an empty pt_regs. */
135146 PTR_LI sp, _THREAD_SIZE - 32 - PT_SIZE
....@@ -156,9 +167,9 @@
156167 * newly sync'd icache.
157168 */
158169 jr.hb v0
159
-#else
170
+#else /* !CONFIG_RELOCATABLE */
160171 j start_kernel
161
-#endif
172
+#endif /* !CONFIG_RELOCATABLE */
162173 END(kernel_entry)
163174
164175 #ifdef CONFIG_SMP