Rev 3743 | Rev 3783 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3743 | Rev 3770 | ||
---|---|---|---|
Line 33... | Line 33... | ||
33 | */ |
33 | */ |
34 | 34 | ||
35 | #ifndef KERN_sparc64_CPU_H_ |
35 | #ifndef KERN_sparc64_CPU_H_ |
36 | #define KERN_sparc64_CPU_H_ |
36 | #define KERN_sparc64_CPU_H_ |
37 | 37 | ||
38 | #define MANUF_FUJITSU 0x04 |
- | |
39 | #define MANUF_ULTRASPARC 0x17 /**< UltraSPARC I, UltraSPARC II */ |
- | |
40 | #define MANUF_SUN 0x3e |
- | |
41 | - | ||
42 | #define IMPL_ULTRASPARCI 0x10 |
- | |
43 | #define IMPL_ULTRASPARCII 0x11 |
- | |
44 | #define IMPL_ULTRASPARCII_I 0x12 |
- | |
45 | #define IMPL_ULTRASPARCII_E 0x13 |
- | |
46 | #define IMPL_ULTRASPARCIII 0x14 |
- | |
47 | #define IMPL_ULTRASPARCIII_PLUS 0x15 |
- | |
48 | #define IMPL_ULTRASPARCIII_I 0x16 |
- | |
49 | #define IMPL_ULTRASPARCIV 0x18 |
- | |
50 | #define IMPL_ULTRASPARCIV_PLUS 0x19 |
- | |
51 | - | ||
52 | #define IMPL_SPARC64V 0x5 |
- | |
53 | - | ||
54 | #ifndef __ASM__ |
38 | #ifndef __ASM__ |
55 | 39 | ||
56 | #include <arch/types.h> |
40 | #include <arch/types.h> |
57 | #include <typedefs.h> |
41 | #include <typedefs.h> |
58 | #include <arch/register.h> |
42 | #include <arch/register.h> |
59 | #include <arch/sun4u/regdef.h> |
43 | #include <arch/sun4u/regdef.h> |
60 | #include <arch/asm.h> |
- | |
61 | #include <arch/sun4u/arch.h> |
- | |
62 | - | ||
63 | #ifdef CONFIG_SMP |
- | |
64 | #include <arch/mm/cache.h> |
- | |
65 | #endif |
- | |
66 | 44 | ||
67 | typedef struct { |
45 | typedef struct { |
68 | uint32_t mid; /**< Processor ID as read from |
46 | uint32_t mid; /**< Processor ID as read from |
69 | UPA_CONFIG/FIREPLANE_CONFIG. */ |
47 | UPA_CONFIG/FIREPLANE_CONFIG. */ |
70 | ver_reg_t ver; |
48 | ver_reg_t ver; |
Line 72... | Line 50... | ||
72 | uint64_t next_tick_cmpr; /**< Next clock interrupt should be |
50 | uint64_t next_tick_cmpr; /**< Next clock interrupt should be |
73 | generated when the TICK register |
51 | generated when the TICK register |
74 | matches this value. */ |
52 | matches this value. */ |
75 | } cpu_arch_t; |
53 | } cpu_arch_t; |
76 | 54 | ||
77 | - | ||
78 | /** |
- | |
79 | * Reads the module ID (agent ID/CPUID) of the current CPU. |
- | |
80 | */ |
- | |
81 | static inline uint32_t read_mid(void) |
- | |
82 | { |
- | |
83 | uint64_t icbus_config = asi_u64_read(ASI_ICBUS_CONFIG, 0); |
- | |
84 | icbus_config = icbus_config >> ICBUS_CONFIG_MID_SHIFT; |
- | |
85 | #if defined (US) |
- | |
86 | return icbus_config & 0x1f; |
- | |
87 | #elif defined (US3) |
- | |
88 | if (((ver_reg_t) ver_read()).impl == IMPL_ULTRASPARCIII_I) |
- | |
89 | return icbus_config & 0x1f; |
- | |
90 | else |
- | |
91 | return icbus_config & 0x3ff; |
- | |
92 | #else |
- | |
93 | panic("Not implemented for this architecture."); |
- | |
94 | return 0; |
- | |
95 | #endif |
- | |
96 | } |
- | |
97 | - | ||
98 | #endif |
55 | #endif |
99 | 56 | ||
100 | #endif |
57 | #endif |
101 | 58 | ||
102 | /** @} |
59 | /** @} |