diff options
author | Russ Anderson <rja@sgi.com> | 2010-10-26 17:27:28 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2010-10-26 18:15:28 -0400 |
commit | c8f730b1ab825f06733e1c074264f0078721f365 (patch) | |
tree | 90f5b48ececb4020beeb3b6612e994f3e8f1f594 /arch/x86/include/asm/uv | |
parent | b365a85c68161ea5db5476eb8845a91ceb1777ea (diff) |
x86, uv: Enable Westmere support on SGI UV
Enable Westmere support on SGI UV. The UV initialization code is dependent on
the APICID bits. Westmere-EX uses different APIC bit mapping than Nehalem-EX.
This code reads the apic shift value from a UV MMR to do the proper bit
decoding to determint the pnode.
Signed-off-by: Russ Anderson <rja@sgi.com>
LKML-Reference: <20101026212728.GB15071@sgi.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/include/asm/uv')
-rw-r--r-- | arch/x86/include/asm/uv/uv_hub.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index bf6b88ef8eeb..e969f691cbfd 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * SGI UV architectural definitions | 6 | * SGI UV architectural definitions |
7 | * | 7 | * |
8 | * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved. | 8 | * Copyright (C) 2007-2010 Silicon Graphics, Inc. All rights reserved. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #ifndef _ASM_X86_UV_UV_HUB_H | 11 | #ifndef _ASM_X86_UV_UV_HUB_H |
@@ -77,7 +77,8 @@ | |||
77 | * | 77 | * |
78 | * 1111110000000000 | 78 | * 1111110000000000 |
79 | * 5432109876543210 | 79 | * 5432109876543210 |
80 | * pppppppppplc0cch | 80 | * pppppppppplc0cch Nehalem-EX |
81 | * ppppppppplcc0cch Westmere-EX | ||
81 | * sssssssssss | 82 | * sssssssssss |
82 | * | 83 | * |
83 | * p = pnode bits | 84 | * p = pnode bits |
@@ -148,12 +149,25 @@ struct uv_hub_info_s { | |||
148 | unsigned char m_val; | 149 | unsigned char m_val; |
149 | unsigned char n_val; | 150 | unsigned char n_val; |
150 | struct uv_scir_s scir; | 151 | struct uv_scir_s scir; |
152 | unsigned char apic_pnode_shift; | ||
151 | }; | 153 | }; |
152 | 154 | ||
153 | DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); | 155 | DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); |
154 | #define uv_hub_info (&__get_cpu_var(__uv_hub_info)) | 156 | #define uv_hub_info (&__get_cpu_var(__uv_hub_info)) |
155 | #define uv_cpu_hub_info(cpu) (&per_cpu(__uv_hub_info, cpu)) | 157 | #define uv_cpu_hub_info(cpu) (&per_cpu(__uv_hub_info, cpu)) |
156 | 158 | ||
159 | union uvh_apicid { | ||
160 | unsigned long v; | ||
161 | struct uvh_apicid_s { | ||
162 | unsigned long local_apic_mask : 24; | ||
163 | unsigned long local_apic_shift : 5; | ||
164 | unsigned long unused1 : 3; | ||
165 | unsigned long pnode_mask : 24; | ||
166 | unsigned long pnode_shift : 5; | ||
167 | unsigned long unused2 : 3; | ||
168 | } s; | ||
169 | }; | ||
170 | |||
157 | /* | 171 | /* |
158 | * Local & Global MMR space macros. | 172 | * Local & Global MMR space macros. |
159 | * Note: macros are intended to be used ONLY by inline functions | 173 | * Note: macros are intended to be used ONLY by inline functions |
@@ -182,6 +196,7 @@ DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); | |||
182 | #define UV_GLOBAL_MMR64_PNODE_BITS(p) \ | 196 | #define UV_GLOBAL_MMR64_PNODE_BITS(p) \ |
183 | (((unsigned long)(p)) << UV_GLOBAL_MMR64_PNODE_SHIFT) | 197 | (((unsigned long)(p)) << UV_GLOBAL_MMR64_PNODE_SHIFT) |
184 | 198 | ||
199 | #define UVH_APICID 0x002D0E00L | ||
185 | #define UV_APIC_PNODE_SHIFT 6 | 200 | #define UV_APIC_PNODE_SHIFT 6 |
186 | 201 | ||
187 | /* Local Bus from cpu's perspective */ | 202 | /* Local Bus from cpu's perspective */ |
@@ -280,7 +295,7 @@ static inline void *uv_pnode_offset_to_vaddr(int pnode, unsigned long offset) | |||
280 | */ | 295 | */ |
281 | static inline int uv_apicid_to_pnode(int apicid) | 296 | static inline int uv_apicid_to_pnode(int apicid) |
282 | { | 297 | { |
283 | return (apicid >> UV_APIC_PNODE_SHIFT); | 298 | return (apicid >> uv_hub_info->apic_pnode_shift); |
284 | } | 299 | } |
285 | 300 | ||
286 | /* | 301 | /* |