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 | |
| 17 | static void __init check_bugs(void) |
| 18 | { |
| 19 | extern char *get_cpu_subtype(void); |
| 20 | extern unsigned long loops_per_jiffy; |
Serge E. Hallyn | 96b644b | 2006-10-02 02:18:13 -0700 | [diff] [blame] | 21 | char *p= &init_utsname()->machine[2]; /* "sh" */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | |
| 23 | cpu_data->loops_per_jiffy = loops_per_jiffy; |
| 24 | |
| 25 | switch (cpu_data->type) { |
Yoshinori Sato | b229632 | 2006-11-05 16:18:08 +0900 | [diff] [blame] | 26 | case CPU_SH7604 ... CPU_SH7619: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | *p++ = '2'; |
| 28 | break; |
Yoshinori Sato | b229632 | 2006-11-05 16:18:08 +0900 | [diff] [blame] | 29 | case CPU_SH7206: |
| 30 | *p++ = '2'; |
| 31 | *p++ = 'a'; |
| 32 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | case CPU_SH7705 ... CPU_SH7300: |
| 34 | *p++ = '3'; |
| 35 | break; |
| 36 | case CPU_SH7750 ... CPU_SH4_501: |
| 37 | *p++ = '4'; |
| 38 | break; |
Paul Mundt | b552c7e | 2006-11-20 14:14:29 +0900 | [diff] [blame] | 39 | case CPU_SH7770 ... CPU_SH7785: |
Paul Mundt | 5b19c90 | 2006-09-27 14:31:40 +0900 | [diff] [blame] | 40 | *p++ = '4'; |
| 41 | *p++ = 'a'; |
| 42 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | default: |
| 44 | *p++ = '?'; |
| 45 | *p++ = '!'; |
| 46 | break; |
| 47 | } |
| 48 | |
| 49 | printk("CPU: %s\n", get_cpu_subtype()); |
| 50 | |
| 51 | #ifndef __LITTLE_ENDIAN__ |
| 52 | /* 'eb' means 'Endian Big' */ |
| 53 | *p++ = 'e'; |
| 54 | *p++ = 'b'; |
| 55 | #endif |
| 56 | *p = '\0'; |
| 57 | } |
| 58 | #endif /* __ASM_SH_BUGS_H */ |