diff options
Diffstat (limited to 'arch/x86/include/asm/uv/uv_hub.h')
-rw-r--r-- | arch/x86/include/asm/uv/uv_hub.h | 71 |
1 files changed, 58 insertions, 13 deletions
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index 4298002d0c8..f26544a1521 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h | |||
@@ -77,8 +77,9 @@ | |||
77 | * | 77 | * |
78 | * 1111110000000000 | 78 | * 1111110000000000 |
79 | * 5432109876543210 | 79 | * 5432109876543210 |
80 | * pppppppppplc0cch Nehalem-EX | 80 | * pppppppppplc0cch Nehalem-EX (12 bits in hdw reg) |
81 | * ppppppppplcc0cch Westmere-EX | 81 | * ppppppppplcc0cch Westmere-EX (12 bits in hdw reg) |
82 | * pppppppppppcccch SandyBridge (15 bits in hdw reg) | ||
82 | * sssssssssss | 83 | * sssssssssss |
83 | * | 84 | * |
84 | * p = pnode bits | 85 | * p = pnode bits |
@@ -87,7 +88,7 @@ | |||
87 | * h = hyperthread | 88 | * h = hyperthread |
88 | * s = bits that are in the SOCKET_ID CSR | 89 | * s = bits that are in the SOCKET_ID CSR |
89 | * | 90 | * |
90 | * Note: Processor only supports 12 bits in the APICID register. The ACPI | 91 | * Note: Processor may support fewer bits in the APICID register. The ACPI |
91 | * tables hold all 16 bits. Software needs to be aware of this. | 92 | * tables hold all 16 bits. Software needs to be aware of this. |
92 | * | 93 | * |
93 | * Unless otherwise specified, all references to APICID refer to | 94 | * Unless otherwise specified, all references to APICID refer to |
@@ -138,6 +139,8 @@ struct uv_hub_info_s { | |||
138 | unsigned long global_mmr_base; | 139 | unsigned long global_mmr_base; |
139 | unsigned long gpa_mask; | 140 | unsigned long gpa_mask; |
140 | unsigned int gnode_extra; | 141 | unsigned int gnode_extra; |
142 | unsigned char hub_revision; | ||
143 | unsigned char apic_pnode_shift; | ||
141 | unsigned long gnode_upper; | 144 | unsigned long gnode_upper; |
142 | unsigned long lowmem_remap_top; | 145 | unsigned long lowmem_remap_top; |
143 | unsigned long lowmem_remap_base; | 146 | unsigned long lowmem_remap_base; |
@@ -149,13 +152,31 @@ struct uv_hub_info_s { | |||
149 | unsigned char m_val; | 152 | unsigned char m_val; |
150 | unsigned char n_val; | 153 | unsigned char n_val; |
151 | struct uv_scir_s scir; | 154 | struct uv_scir_s scir; |
152 | unsigned char apic_pnode_shift; | ||
153 | }; | 155 | }; |
154 | 156 | ||
155 | DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); | 157 | DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); |
156 | #define uv_hub_info (&__get_cpu_var(__uv_hub_info)) | 158 | #define uv_hub_info (&__get_cpu_var(__uv_hub_info)) |
157 | #define uv_cpu_hub_info(cpu) (&per_cpu(__uv_hub_info, cpu)) | 159 | #define uv_cpu_hub_info(cpu) (&per_cpu(__uv_hub_info, cpu)) |
158 | 160 | ||
161 | /* | ||
162 | * Hub revisions less than UV2_HUB_REVISION_BASE are UV1 hubs. All UV2 | ||
163 | * hubs have revision numbers greater than or equal to UV2_HUB_REVISION_BASE. | ||
164 | * This is a software convention - NOT the hardware revision numbers in | ||
165 | * the hub chip. | ||
166 | */ | ||
167 | #define UV1_HUB_REVISION_BASE 1 | ||
168 | #define UV2_HUB_REVISION_BASE 3 | ||
169 | |||
170 | static inline int is_uv1_hub(void) | ||
171 | { | ||
172 | return uv_hub_info->hub_revision < UV2_HUB_REVISION_BASE; | ||
173 | } | ||
174 | |||
175 | static inline int is_uv2_hub(void) | ||
176 | { | ||
177 | return uv_hub_info->hub_revision >= UV2_HUB_REVISION_BASE; | ||
178 | } | ||
179 | |||
159 | union uvh_apicid { | 180 | union uvh_apicid { |
160 | unsigned long v; | 181 | unsigned long v; |
161 | struct uvh_apicid_s { | 182 | struct uvh_apicid_s { |
@@ -180,11 +201,25 @@ union uvh_apicid { | |||
180 | #define UV_PNODE_TO_GNODE(p) ((p) |uv_hub_info->gnode_extra) | 201 | #define UV_PNODE_TO_GNODE(p) ((p) |uv_hub_info->gnode_extra) |
181 | #define UV_PNODE_TO_NASID(p) (UV_PNODE_TO_GNODE(p) << 1) | 202 | #define UV_PNODE_TO_NASID(p) (UV_PNODE_TO_GNODE(p) << 1) |
182 | 203 | ||
183 | #define UV_LOCAL_MMR_BASE 0xf4000000UL | 204 | #define UV1_LOCAL_MMR_BASE 0xf4000000UL |
184 | #define UV_GLOBAL_MMR32_BASE 0xf8000000UL | 205 | #define UV1_GLOBAL_MMR32_BASE 0xf8000000UL |
206 | #define UV1_LOCAL_MMR_SIZE (64UL * 1024 * 1024) | ||
207 | #define UV1_GLOBAL_MMR32_SIZE (64UL * 1024 * 1024) | ||
208 | |||
209 | #define UV2_LOCAL_MMR_BASE 0xfa000000UL | ||
210 | #define UV2_GLOBAL_MMR32_BASE 0xfc000000UL | ||
211 | #define UV2_LOCAL_MMR_SIZE (32UL * 1024 * 1024) | ||
212 | #define UV2_GLOBAL_MMR32_SIZE (32UL * 1024 * 1024) | ||
213 | |||
214 | #define UV_LOCAL_MMR_BASE (is_uv1_hub() ? UV1_LOCAL_MMR_BASE \ | ||
215 | : UV2_LOCAL_MMR_BASE) | ||
216 | #define UV_GLOBAL_MMR32_BASE (is_uv1_hub() ? UV1_GLOBAL_MMR32_BASE \ | ||
217 | : UV2_GLOBAL_MMR32_BASE) | ||
218 | #define UV_LOCAL_MMR_SIZE (is_uv1_hub() ? UV1_LOCAL_MMR_SIZE : \ | ||
219 | UV2_LOCAL_MMR_SIZE) | ||
220 | #define UV_GLOBAL_MMR32_SIZE (is_uv1_hub() ? UV1_GLOBAL_MMR32_SIZE :\ | ||
221 | UV2_GLOBAL_MMR32_SIZE) | ||
185 | #define UV_GLOBAL_MMR64_BASE (uv_hub_info->global_mmr_base) | 222 | #define UV_GLOBAL_MMR64_BASE (uv_hub_info->global_mmr_base) |
186 | #define UV_LOCAL_MMR_SIZE (64UL * 1024 * 1024) | ||
187 | #define UV_GLOBAL_MMR32_SIZE (64UL * 1024 * 1024) | ||
188 | 223 | ||
189 | #define UV_GLOBAL_GRU_MMR_BASE 0x4000000 | 224 | #define UV_GLOBAL_GRU_MMR_BASE 0x4000000 |
190 | 225 | ||
@@ -301,6 +336,17 @@ static inline int uv_apicid_to_pnode(int apicid) | |||
301 | } | 336 | } |
302 | 337 | ||
303 | /* | 338 | /* |
339 | * Convert an apicid to the socket number on the blade | ||
340 | */ | ||
341 | static inline int uv_apicid_to_socket(int apicid) | ||
342 | { | ||
343 | if (is_uv1_hub()) | ||
344 | return (apicid >> (uv_hub_info->apic_pnode_shift - 1)) & 1; | ||
345 | else | ||
346 | return 0; | ||
347 | } | ||
348 | |||
349 | /* | ||
304 | * Access global MMRs using the low memory MMR32 space. This region supports | 350 | * Access global MMRs using the low memory MMR32 space. This region supports |
305 | * faster MMR access but not all MMRs are accessible in this space. | 351 | * faster MMR access but not all MMRs are accessible in this space. |
306 | */ | 352 | */ |
@@ -519,14 +565,13 @@ static inline void uv_hub_send_ipi(int pnode, int apicid, int vector) | |||
519 | 565 | ||
520 | /* | 566 | /* |
521 | * Get the minimum revision number of the hub chips within the partition. | 567 | * Get the minimum revision number of the hub chips within the partition. |
522 | * 1 - initial rev 1.0 silicon | 568 | * 1 - UV1 rev 1.0 initial silicon |
523 | * 2 - rev 2.0 production silicon | 569 | * 2 - UV1 rev 2.0 production silicon |
570 | * 3 - UV2 rev 1.0 initial silicon | ||
524 | */ | 571 | */ |
525 | static inline int uv_get_min_hub_revision_id(void) | 572 | static inline int uv_get_min_hub_revision_id(void) |
526 | { | 573 | { |
527 | extern int uv_min_hub_revision_id; | 574 | return uv_hub_info->hub_revision; |
528 | |||
529 | return uv_min_hub_revision_id; | ||
530 | } | 575 | } |
531 | 576 | ||
532 | #endif /* CONFIG_X86_64 */ | 577 | #endif /* CONFIG_X86_64 */ |