bugs.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_SH_BUGS_H
  3. #define __ASM_SH_BUGS_H
  4. /*
  5. * This is included by init/main.c to check for architecture-dependent bugs.
  6. *
  7. * Needs:
  8. * void check_bugs(void);
  9. */
  10. /*
  11. * I don't know of any Super-H bugs yet.
  12. */
  13. #include <asm/processor.h>
  14. extern void select_idle_routine(void);
  15. static void __init check_bugs(void)
  16. {
  17. extern unsigned long loops_per_jiffy;
  18. char *p = &init_utsname()->machine[2]; /* "sh" */
  19. select_idle_routine();
  20. current_cpu_data.loops_per_jiffy = loops_per_jiffy;
  21. switch (current_cpu_data.family) {
  22. case CPU_FAMILY_SH2:
  23. *p++ = '2';
  24. break;
  25. case CPU_FAMILY_SH2A:
  26. *p++ = '2';
  27. *p++ = 'a';
  28. break;
  29. case CPU_FAMILY_SH3:
  30. *p++ = '3';
  31. break;
  32. case CPU_FAMILY_SH4:
  33. *p++ = '4';
  34. break;
  35. case CPU_FAMILY_SH4A:
  36. *p++ = '4';
  37. *p++ = 'a';
  38. break;
  39. case CPU_FAMILY_SH4AL_DSP:
  40. *p++ = '4';
  41. *p++ = 'a';
  42. *p++ = 'l';
  43. *p++ = '-';
  44. *p++ = 'd';
  45. *p++ = 's';
  46. *p++ = 'p';
  47. break;
  48. case CPU_FAMILY_SH5:
  49. *p++ = '6';
  50. *p++ = '4';
  51. break;
  52. case CPU_FAMILY_UNKNOWN:
  53. /*
  54. * Specifically use CPU_FAMILY_UNKNOWN rather than
  55. * default:, so we're able to have the compiler whine
  56. * about unhandled enumerations.
  57. */
  58. break;
  59. }
  60. printk("CPU: %s\n", get_cpu_subtype(&current_cpu_data));
  61. #ifndef __LITTLE_ENDIAN__
  62. /* 'eb' means 'Endian Big' */
  63. *p++ = 'e';
  64. *p++ = 'b';
  65. #endif
  66. *p = '\0';
  67. }
  68. #endif /* __ASM_SH_BUGS_H */