hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/sh/kernel/setup.c
....@@ -43,6 +43,7 @@
4343 #include <asm/smp.h>
4444 #include <asm/mmu_context.h>
4545 #include <asm/mmzone.h>
46
+#include <asm/processor.h>
4647 #include <asm/sparsemem.h>
4748 #include <asm/platform_early.h>
4849
....@@ -244,7 +245,7 @@
244245 {
245246 }
246247
247
-#ifdef CONFIG_OF_FLATTREE
248
+#ifdef CONFIG_OF_EARLY_FLATTREE
248249 void __ref sh_fdt_init(phys_addr_t dt_phys)
249250 {
250251 static int done = 0;
....@@ -329,7 +330,7 @@
329330 /* Let earlyprintk output early console messages */
330331 sh_early_platform_driver_probe("earlyprintk", 1, 1);
331332
332
-#ifdef CONFIG_OF_FLATTREE
333
+#ifdef CONFIG_OF_EARLY_FLATTREE
333334 #ifdef CONFIG_USE_BUILTIN_DTB
334335 unflatten_and_copy_device_tree();
335336 #else
....@@ -357,3 +358,57 @@
357358 {
358359 return sh_mv.mv_mode_pins() & pin;
359360 }
361
+
362
+void __init arch_cpu_finalize_init(void)
363
+{
364
+ char *p = &init_utsname()->machine[2]; /* "sh" */
365
+
366
+ select_idle_routine();
367
+
368
+ current_cpu_data.loops_per_jiffy = loops_per_jiffy;
369
+
370
+ switch (current_cpu_data.family) {
371
+ case CPU_FAMILY_SH2:
372
+ *p++ = '2';
373
+ break;
374
+ case CPU_FAMILY_SH2A:
375
+ *p++ = '2';
376
+ *p++ = 'a';
377
+ break;
378
+ case CPU_FAMILY_SH3:
379
+ *p++ = '3';
380
+ break;
381
+ case CPU_FAMILY_SH4:
382
+ *p++ = '4';
383
+ break;
384
+ case CPU_FAMILY_SH4A:
385
+ *p++ = '4';
386
+ *p++ = 'a';
387
+ break;
388
+ case CPU_FAMILY_SH4AL_DSP:
389
+ *p++ = '4';
390
+ *p++ = 'a';
391
+ *p++ = 'l';
392
+ *p++ = '-';
393
+ *p++ = 'd';
394
+ *p++ = 's';
395
+ *p++ = 'p';
396
+ break;
397
+ case CPU_FAMILY_UNKNOWN:
398
+ /*
399
+ * Specifically use CPU_FAMILY_UNKNOWN rather than
400
+ * default:, so we're able to have the compiler whine
401
+ * about unhandled enumerations.
402
+ */
403
+ break;
404
+ }
405
+
406
+ pr_info("CPU: %s\n", get_cpu_subtype(&current_cpu_data));
407
+
408
+#ifndef __LITTLE_ENDIAN__
409
+ /* 'eb' means 'Endian Big' */
410
+ *p++ = 'e';
411
+ *p++ = 'b';
412
+#endif
413
+ *p = '\0';
414
+}