Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __ASM_SH_BUGS_H |
| 2 | #define __ASM_SH_BUGS_H |
| 3 | |
| 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 | /* |
| 12 | * I don't know of any Super-H bugs yet. |
| 13 | */ |
| 14 | |
| 15 | #include <asm/processor.h> |
| 16 | |
Paul Mundt | f533c3d | 2009-10-16 17:20:58 +0900 | [diff] [blame] | 17 | extern void select_idle_routine(void); |
| 18 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | static void __init check_bugs(void) |
| 20 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | extern unsigned long loops_per_jiffy; |
Paul Mundt | 41504c3 | 2006-12-11 20:28:03 +0900 | [diff] [blame] | 22 | char *p = &init_utsname()->machine[2]; /* "sh" */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
Paul Mundt | f533c3d | 2009-10-16 17:20:58 +0900 | [diff] [blame] | 24 | select_idle_routine(); |
| 25 | |
Paul Mundt | 11c1965 | 2006-12-25 10:19:56 +0900 | [diff] [blame] | 26 | current_cpu_data.loops_per_jiffy = loops_per_jiffy; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | |
Paul Mundt | e82da21 | 2009-08-15 10:48:13 +0900 | [diff] [blame] | 28 | switch (current_cpu_data.family) { |
| 29 | case CPU_FAMILY_SH2: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | *p++ = '2'; |
| 31 | break; |
Paul Mundt | e82da21 | 2009-08-15 10:48:13 +0900 | [diff] [blame] | 32 | case CPU_FAMILY_SH2A: |
Yoshinori Sato | b229632 | 2006-11-05 16:18:08 +0900 | [diff] [blame] | 33 | *p++ = '2'; |
| 34 | *p++ = 'a'; |
| 35 | break; |
Paul Mundt | e82da21 | 2009-08-15 10:48:13 +0900 | [diff] [blame] | 36 | case CPU_FAMILY_SH3: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | *p++ = '3'; |
| 38 | break; |
Paul Mundt | e82da21 | 2009-08-15 10:48:13 +0900 | [diff] [blame] | 39 | case CPU_FAMILY_SH4: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | *p++ = '4'; |
| 41 | break; |
Paul Mundt | e82da21 | 2009-08-15 10:48:13 +0900 | [diff] [blame] | 42 | case CPU_FAMILY_SH4A: |
Paul Mundt | 5b19c90 | 2006-09-27 14:31:40 +0900 | [diff] [blame] | 43 | *p++ = '4'; |
| 44 | *p++ = 'a'; |
| 45 | break; |
Paul Mundt | e82da21 | 2009-08-15 10:48:13 +0900 | [diff] [blame] | 46 | case CPU_FAMILY_SH4AL_DSP: |
Paul Mundt | 41504c3 | 2006-12-11 20:28:03 +0900 | [diff] [blame] | 47 | *p++ = '4'; |
| 48 | *p++ = 'a'; |
| 49 | *p++ = 'l'; |
| 50 | *p++ = '-'; |
| 51 | *p++ = 'd'; |
| 52 | *p++ = 's'; |
| 53 | *p++ = 'p'; |
| 54 | break; |
Paul Mundt | e82da21 | 2009-08-15 10:48:13 +0900 | [diff] [blame] | 55 | case CPU_FAMILY_SH5: |
Paul Mundt | 29e0d20 | 2007-11-22 13:11:39 +0900 | [diff] [blame] | 56 | *p++ = '6'; |
| 57 | *p++ = '4'; |
| 58 | break; |
Paul Mundt | e82da21 | 2009-08-15 10:48:13 +0900 | [diff] [blame] | 59 | case CPU_FAMILY_UNKNOWN: |
Paul Mundt | 29e0d20 | 2007-11-22 13:11:39 +0900 | [diff] [blame] | 60 | /* |
Paul Mundt | e82da21 | 2009-08-15 10:48:13 +0900 | [diff] [blame] | 61 | * Specifically use CPU_FAMILY_UNKNOWN rather than |
| 62 | * default:, so we're able to have the compiler whine |
| 63 | * about unhandled enumerations. |
Paul Mundt | 29e0d20 | 2007-11-22 13:11:39 +0900 | [diff] [blame] | 64 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | break; |
| 66 | } |
| 67 | |
Paul Mundt | 11c1965 | 2006-12-25 10:19:56 +0900 | [diff] [blame] | 68 | printk("CPU: %s\n", get_cpu_subtype(¤t_cpu_data)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | |
| 70 | #ifndef __LITTLE_ENDIAN__ |
| 71 | /* 'eb' means 'Endian Big' */ |
| 72 | *p++ = 'e'; |
| 73 | *p++ = 'b'; |
| 74 | #endif |
| 75 | *p = '\0'; |
| 76 | } |
| 77 | #endif /* __ASM_SH_BUGS_H */ |