.. | .. |
---|
32 | 32 | #include <linux/of.h> |
---|
33 | 33 | #include <linux/of_fdt.h> |
---|
34 | 34 | #include <linux/uaccess.h> |
---|
| 35 | +#include <uapi/linux/mount.h> |
---|
35 | 36 | #include <asm/io.h> |
---|
36 | 37 | #include <asm/page.h> |
---|
37 | 38 | #include <asm/elf.h> |
---|
.. | .. |
---|
42 | 43 | #include <asm/smp.h> |
---|
43 | 44 | #include <asm/mmu_context.h> |
---|
44 | 45 | #include <asm/mmzone.h> |
---|
| 46 | +#include <asm/processor.h> |
---|
45 | 47 | #include <asm/sparsemem.h> |
---|
| 48 | +#include <asm/platform_early.h> |
---|
46 | 49 | |
---|
47 | 50 | /* |
---|
48 | 51 | * Initialize loops_per_jiffy as 10000000 (1000MIPS). |
---|
.. | .. |
---|
242 | 245 | { |
---|
243 | 246 | } |
---|
244 | 247 | |
---|
245 | | -#ifdef CONFIG_OF_FLATTREE |
---|
| 248 | +#ifdef CONFIG_OF_EARLY_FLATTREE |
---|
246 | 249 | void __ref sh_fdt_init(phys_addr_t dt_phys) |
---|
247 | 250 | { |
---|
248 | 251 | static int done = 0; |
---|
.. | .. |
---|
288 | 291 | |
---|
289 | 292 | #ifdef CONFIG_BLK_DEV_RAM |
---|
290 | 293 | 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); |
---|
293 | 294 | #endif |
---|
294 | 295 | |
---|
295 | 296 | if (!MOUNT_ROOT_RDONLY) |
---|
.. | .. |
---|
327 | 328 | sh_mv_setup(); |
---|
328 | 329 | |
---|
329 | 330 | /* Let earlyprintk output early console messages */ |
---|
330 | | - early_platform_driver_probe("earlyprintk", 1, 1); |
---|
| 331 | + sh_early_platform_driver_probe("earlyprintk", 1, 1); |
---|
331 | 332 | |
---|
332 | | -#ifdef CONFIG_OF_FLATTREE |
---|
| 333 | +#ifdef CONFIG_OF_EARLY_FLATTREE |
---|
333 | 334 | #ifdef CONFIG_USE_BUILTIN_DTB |
---|
334 | 335 | unflatten_and_copy_device_tree(); |
---|
335 | 336 | #else |
---|
.. | .. |
---|
338 | 339 | #endif |
---|
339 | 340 | |
---|
340 | 341 | paging_init(); |
---|
341 | | - |
---|
342 | | -#ifdef CONFIG_DUMMY_CONSOLE |
---|
343 | | - conswitchp = &dummy_con; |
---|
344 | | -#endif |
---|
345 | 342 | |
---|
346 | 343 | /* Perform the machine specific initialisation */ |
---|
347 | 344 | if (likely(sh_mv.mv_setup)) |
---|
.. | .. |
---|
353 | 350 | /* processor boot mode configuration */ |
---|
354 | 351 | int generic_mode_pins(void) |
---|
355 | 352 | { |
---|
356 | | - pr_warning("generic_mode_pins(): missing mode pin configuration\n"); |
---|
| 353 | + pr_warn("generic_mode_pins(): missing mode pin configuration\n"); |
---|
357 | 354 | return 0; |
---|
358 | 355 | } |
---|
359 | 356 | |
---|
.. | .. |
---|
361 | 358 | { |
---|
362 | 359 | return sh_mv.mv_mode_pins() & pin; |
---|
363 | 360 | } |
---|
| 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(¤t_cpu_data)); |
---|
| 407 | + |
---|
| 408 | +#ifndef __LITTLE_ENDIAN__ |
---|
| 409 | + /* 'eb' means 'Endian Big' */ |
---|
| 410 | + *p++ = 'e'; |
---|
| 411 | + *p++ = 'b'; |
---|
| 412 | +#endif |
---|
| 413 | + *p = '\0'; |
---|
| 414 | +} |
---|