blob: 02a19a1c033ac71a9f2d4ad16faadf28f9f0bdc3 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#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 Mundtf533c3d2009-10-16 17:20:58 +090017extern void select_idle_routine(void);
18
Linus Torvalds1da177e2005-04-16 15:20:36 -070019static void __init check_bugs(void)
20{
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 extern unsigned long loops_per_jiffy;
Paul Mundt41504c32006-12-11 20:28:03 +090022 char *p = &init_utsname()->machine[2]; /* "sh" */
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
Paul Mundtf533c3d2009-10-16 17:20:58 +090024 select_idle_routine();
25
Paul Mundt11c19652006-12-25 10:19:56 +090026 current_cpu_data.loops_per_jiffy = loops_per_jiffy;
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
Paul Mundte82da212009-08-15 10:48:13 +090028 switch (current_cpu_data.family) {
29 case CPU_FAMILY_SH2:
Linus Torvalds1da177e2005-04-16 15:20:36 -070030 *p++ = '2';
31 break;
Paul Mundte82da212009-08-15 10:48:13 +090032 case CPU_FAMILY_SH2A:
Yoshinori Satob2296322006-11-05 16:18:08 +090033 *p++ = '2';
34 *p++ = 'a';
35 break;
Paul Mundte82da212009-08-15 10:48:13 +090036 case CPU_FAMILY_SH3:
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 *p++ = '3';
38 break;
Paul Mundte82da212009-08-15 10:48:13 +090039 case CPU_FAMILY_SH4:
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 *p++ = '4';
41 break;
Paul Mundte82da212009-08-15 10:48:13 +090042 case CPU_FAMILY_SH4A:
Paul Mundt5b19c902006-09-27 14:31:40 +090043 *p++ = '4';
44 *p++ = 'a';
45 break;
Paul Mundte82da212009-08-15 10:48:13 +090046 case CPU_FAMILY_SH4AL_DSP:
Paul Mundt41504c32006-12-11 20:28:03 +090047 *p++ = '4';
48 *p++ = 'a';
49 *p++ = 'l';
50 *p++ = '-';
51 *p++ = 'd';
52 *p++ = 's';
53 *p++ = 'p';
54 break;
Paul Mundte82da212009-08-15 10:48:13 +090055 case CPU_FAMILY_SH5:
Paul Mundt29e0d202007-11-22 13:11:39 +090056 *p++ = '6';
57 *p++ = '4';
58 break;
Paul Mundte82da212009-08-15 10:48:13 +090059 case CPU_FAMILY_UNKNOWN:
Paul Mundt29e0d202007-11-22 13:11:39 +090060 /*
Paul Mundte82da212009-08-15 10:48:13 +090061 * Specifically use CPU_FAMILY_UNKNOWN rather than
62 * default:, so we're able to have the compiler whine
63 * about unhandled enumerations.
Paul Mundt29e0d202007-11-22 13:11:39 +090064 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070065 break;
66 }
67
Paul Mundt11c19652006-12-25 10:19:56 +090068 printk("CPU: %s\n", get_cpu_subtype(&current_cpu_data));
Linus Torvalds1da177e2005-04-16 15:20:36 -070069
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 */