hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/sh/kernel/setup.c
....@@ -32,6 +32,7 @@
3232 #include <linux/of.h>
3333 #include <linux/of_fdt.h>
3434 #include <linux/uaccess.h>
35
+#include <uapi/linux/mount.h>
3536 #include <asm/io.h>
3637 #include <asm/page.h>
3738 #include <asm/elf.h>
....@@ -42,7 +43,9 @@
4243 #include <asm/smp.h>
4344 #include <asm/mmu_context.h>
4445 #include <asm/mmzone.h>
46
+#include <asm/processor.h>
4547 #include <asm/sparsemem.h>
48
+#include <asm/platform_early.h>
4649
4750 /*
4851 * Initialize loops_per_jiffy as 10000000 (1000MIPS).
....@@ -242,7 +245,7 @@
242245 {
243246 }
244247
245
-#ifdef CONFIG_OF_FLATTREE
248
+#ifdef CONFIG_OF_EARLY_FLATTREE
246249 void __ref sh_fdt_init(phys_addr_t dt_phys)
247250 {
248251 static int done = 0;
....@@ -288,8 +291,6 @@
288291
289292 #ifdef CONFIG_BLK_DEV_RAM
290293 rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK;
291
- rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0);
292
- rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0);
293294 #endif
294295
295296 if (!MOUNT_ROOT_RDONLY)
....@@ -327,9 +328,9 @@
327328 sh_mv_setup();
328329
329330 /* Let earlyprintk output early console messages */
330
- early_platform_driver_probe("earlyprintk", 1, 1);
331
+ 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
....@@ -338,10 +339,6 @@
338339 #endif
339340
340341 paging_init();
341
-
342
-#ifdef CONFIG_DUMMY_CONSOLE
343
- conswitchp = &dummy_con;
344
-#endif
345342
346343 /* Perform the machine specific initialisation */
347344 if (likely(sh_mv.mv_setup))
....@@ -353,7 +350,7 @@
353350 /* processor boot mode configuration */
354351 int generic_mode_pins(void)
355352 {
356
- pr_warning("generic_mode_pins(): missing mode pin configuration\n");
353
+ pr_warn("generic_mode_pins(): missing mode pin configuration\n");
357354 return 0;
358355 }
359356
....@@ -361,3 +358,57 @@
361358 {
362359 return sh_mv.mv_mode_pins() & pin;
363360 }
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
+}