1
2
3
4
5
6
7#ifndef _SPARC_MBUS_H
8#define _SPARC_MBUS_H
9
10#include <asm/ross.h>
11#include <asm/viking.h>
12
13enum mbus_module {
14 HyperSparc = 0,
15 Swift_ok = 4,
16 Swift_bad_c = 5,
17 Swift_lots_o_bugs = 6,
18 Tsunami = 7,
19 Viking_12 = 8,
20 Viking_2x = 9,
21 Viking_30 = 10,
22 Viking_35 = 11,
23 Viking_new = 12,
24 TurboSparc = 13,
25 SRMMU_INVAL_MOD = 14,
26};
27
28extern enum mbus_module srmmu_modtype;
29extern unsigned int viking_rev, swift_rev, cypress_rev;
30
31
32#define HWBUG_COPYBACK_BROKEN 0x00000001
33#define HWBUG_ASIFLUSH_BROKEN 0x00000002
34#define HWBUG_VACFLUSH_BITROT 0x00000004
35#define HWBUG_KERN_ACCBROKEN 0x00000008
36#define HWBUG_KERN_CBITBROKEN 0x00000010
37#define HWBUG_MODIFIED_BITROT 0x00000020
38#define HWBUG_PC_BADFAULT_ADDR 0x00000040
39#define HWBUG_SUPERSCALAR_BAD 0x00000080
40#define HWBUG_PACINIT_BITROT 0x00000100
41
42
43
44
45
46
47#define MBUS_VIKING 0x4
48#define MBUS_LSI 0x3
49#define MBUS_ROSS 0x1
50#define MBUS_FMI 0x0
51
52
53#define ROSS_604_REV_CDE 0x0
54#define ROSS_604_REV_F 0x1
55#define ROSS_605 0xf
56#define ROSS_605_REV_B 0xe
57
58
59#define VIKING_REV_12 0x1
60#define VIKING_REV_2 0x2
61#define VIKING_REV_30 0x3
62#define VIKING_REV_35 0x4
63
64
65#define LSI_L64815 0x0
66
67
68#define FMI_AURORA 0x4
69#define FMI_TURBO 0x5
70
71
72
73
74
75
76
77
78#define TBR_ID_SHIFT 20
79
80static inline int get_cpuid(void)
81{
82 register int retval;
83 __asm__ __volatile__("rd %%tbr, %0\n\t"
84 "srl %0, %1, %0\n\t" :
85 "=r" (retval) :
86 "i" (TBR_ID_SHIFT));
87 return (retval & 3);
88}
89
90static inline int get_modid(void)
91{
92 return (get_cpuid() | 0x8);
93}
94
95
96#endif
97