diff options
author | Tony Luck <tony.luck@intel.com> | 2005-09-11 17:34:23 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-09-11 17:34:23 -0400 |
commit | d67eb16f5d444fb6d173bcec889ddb2066c0fa0c (patch) | |
tree | cc0587f23ed46f2838d4169b3c021b54d877bab7 | |
parent | c85b2a5fe200d744a814d23c258460d4fc98a546 (diff) | |
parent | a1cddb88920b915eaba10712ecfd0fc698b00a22 (diff) |
Pull sn-features into release branch
-rw-r--r-- | arch/ia64/sn/kernel/setup.c | 30 | ||||
-rw-r--r-- | include/asm-ia64/sn/sn_feature_sets.h | 57 | ||||
-rw-r--r-- | include/asm-ia64/sn/sn_sal.h | 36 |
3 files changed, 103 insertions, 20 deletions
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c index 14908ad7db8c..6f8c5883716b 100644 --- a/arch/ia64/sn/kernel/setup.c +++ b/arch/ia64/sn/kernel/setup.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <asm/sn/clksupport.h> | 49 | #include <asm/sn/clksupport.h> |
50 | #include <asm/sn/sn_sal.h> | 50 | #include <asm/sn/sn_sal.h> |
51 | #include <asm/sn/geo.h> | 51 | #include <asm/sn/geo.h> |
52 | #include <asm/sn/sn_feature_sets.h> | ||
52 | #include "xtalk/xwidgetdev.h" | 53 | #include "xtalk/xwidgetdev.h" |
53 | #include "xtalk/hubdev.h" | 54 | #include "xtalk/hubdev.h" |
54 | #include <asm/sn/klconfig.h> | 55 | #include <asm/sn/klconfig.h> |
@@ -97,6 +98,7 @@ EXPORT_SYMBOL(sn_region_size); | |||
97 | int sn_prom_type; /* 0=hardware, 1=medusa/realprom, 2=medusa/fakeprom */ | 98 | int sn_prom_type; /* 0=hardware, 1=medusa/realprom, 2=medusa/fakeprom */ |
98 | 99 | ||
99 | short physical_node_map[MAX_PHYSNODE_ID]; | 100 | short physical_node_map[MAX_PHYSNODE_ID]; |
101 | static unsigned long sn_prom_features[MAX_PROM_FEATURE_SETS]; | ||
100 | 102 | ||
101 | EXPORT_SYMBOL(physical_node_map); | 103 | EXPORT_SYMBOL(physical_node_map); |
102 | 104 | ||
@@ -271,7 +273,10 @@ void __init sn_setup(char **cmdline_p) | |||
271 | u32 version = sn_sal_rev(); | 273 | u32 version = sn_sal_rev(); |
272 | extern void sn_cpu_init(void); | 274 | extern void sn_cpu_init(void); |
273 | 275 | ||
274 | ia64_sn_plat_set_error_handling_features(); | 276 | ia64_sn_plat_set_error_handling_features(); // obsolete |
277 | ia64_sn_set_os_feature(OSF_MCA_SLV_TO_OS_INIT_SLV); | ||
278 | ia64_sn_set_os_feature(OSF_FEAT_LOG_SBES); | ||
279 | |||
275 | 280 | ||
276 | #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) | 281 | #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) |
277 | /* | 282 | /* |
@@ -314,16 +319,6 @@ void __init sn_setup(char **cmdline_p) | |||
314 | 319 | ||
315 | printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF); | 320 | printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF); |
316 | 321 | ||
317 | /* | ||
318 | * Confirm the SAL we're running on is recent enough... | ||
319 | */ | ||
320 | if (version < SN_SAL_MIN_VERSION) { | ||
321 | printk(KERN_ERR "This kernel needs SGI SAL version >= " | ||
322 | "%x.%02x\n", SN_SAL_MIN_VERSION >> 8, | ||
323 | SN_SAL_MIN_VERSION & 0x00FF); | ||
324 | panic("PROM version too old\n"); | ||
325 | } | ||
326 | |||
327 | master_nasid = boot_get_nasid(); | 322 | master_nasid = boot_get_nasid(); |
328 | 323 | ||
329 | status = | 324 | status = |
@@ -480,6 +475,10 @@ void __init sn_cpu_init(void) | |||
480 | if (nodepdaindr[0] == NULL) | 475 | if (nodepdaindr[0] == NULL) |
481 | return; | 476 | return; |
482 | 477 | ||
478 | for (i = 0; i < MAX_PROM_FEATURE_SETS; i++) | ||
479 | if (ia64_sn_get_prom_feature_set(i, &sn_prom_features[i]) != 0) | ||
480 | break; | ||
481 | |||
483 | cpuid = smp_processor_id(); | 482 | cpuid = smp_processor_id(); |
484 | cpuphyid = get_sapicid(); | 483 | cpuphyid = get_sapicid(); |
485 | 484 | ||
@@ -651,3 +650,12 @@ nasid_slice_to_cpuid(int nasid, int slice) | |||
651 | 650 | ||
652 | return -1; | 651 | return -1; |
653 | } | 652 | } |
653 | |||
654 | int sn_prom_feature_available(int id) | ||
655 | { | ||
656 | if (id >= BITS_PER_LONG * MAX_PROM_FEATURE_SETS) | ||
657 | return 0; | ||
658 | return test_bit(id, sn_prom_features); | ||
659 | } | ||
660 | EXPORT_SYMBOL(sn_prom_feature_available); | ||
661 | |||
diff --git a/include/asm-ia64/sn/sn_feature_sets.h b/include/asm-ia64/sn/sn_feature_sets.h new file mode 100644 index 000000000000..e68a80853d5d --- /dev/null +++ b/include/asm-ia64/sn/sn_feature_sets.h | |||
@@ -0,0 +1,57 @@ | |||
1 | #ifndef _ASM_IA64_SN_FEATURE_SETS_H | ||
2 | #define _ASM_IA64_SN_FEATURE_SETS_H | ||
3 | |||
4 | /* | ||
5 | * SN PROM Features | ||
6 | * | ||
7 | * This file is subject to the terms and conditions of the GNU General Public | ||
8 | * License. See the file "COPYING" in the main directory of this archive | ||
9 | * for more details. | ||
10 | * | ||
11 | * Copyright (c) 2005 Silicon Graphics, Inc. All rights reserved. | ||
12 | */ | ||
13 | |||
14 | |||
15 | #include <asm/types.h> | ||
16 | #include <asm/bitops.h> | ||
17 | |||
18 | /* --------------------- PROM Features -----------------------------*/ | ||
19 | extern int sn_prom_feature_available(int id); | ||
20 | |||
21 | #define MAX_PROM_FEATURE_SETS 2 | ||
22 | |||
23 | /* | ||
24 | * The following defines features that may or may not be supported by the | ||
25 | * current PROM. The OS uses sn_prom_feature_available(feature) to test for | ||
26 | * the presence of a PROM feature. Down rev (old) PROMs will always test | ||
27 | * "false" for new features. | ||
28 | * | ||
29 | * Use: | ||
30 | * if (sn_prom_feature_available(PRF_FEATURE_XXX)) | ||
31 | * ... | ||
32 | */ | ||
33 | |||
34 | /* | ||
35 | * Example: feature XXX | ||
36 | */ | ||
37 | #define PRF_FEATURE_XXX 0 | ||
38 | |||
39 | |||
40 | |||
41 | /* --------------------- OS Features -------------------------------*/ | ||
42 | |||
43 | /* | ||
44 | * The following defines OS features that are optionally present in | ||
45 | * the operating system. | ||
46 | * During boot, PROM is notified of these features via a series of calls: | ||
47 | * | ||
48 | * ia64_sn_set_os_feature(feature1); | ||
49 | * | ||
50 | * Once enabled, a feature cannot be disabled. | ||
51 | * | ||
52 | * By default, features are disabled unless explicitly enabled. | ||
53 | */ | ||
54 | #define OSF_MCA_SLV_TO_OS_INIT_SLV 0 | ||
55 | #define OSF_FEAT_LOG_SBES 1 | ||
56 | |||
57 | #endif /* _ASM_IA64_SN_FEATURE_SETS_H */ | ||
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h index e67825ad1930..fea35b33d4e4 100644 --- a/include/asm-ia64/sn/sn_sal.h +++ b/include/asm-ia64/sn/sn_sal.h | |||
@@ -80,6 +80,9 @@ | |||
80 | #define SN_SAL_RESERVED_DO_NOT_USE 0x02000062 | 80 | #define SN_SAL_RESERVED_DO_NOT_USE 0x02000062 |
81 | #define SN_SAL_IOIF_GET_PCI_TOPOLOGY 0x02000064 | 81 | #define SN_SAL_IOIF_GET_PCI_TOPOLOGY 0x02000064 |
82 | 82 | ||
83 | #define SN_SAL_GET_PROM_FEATURE_SET 0x02000065 | ||
84 | #define SN_SAL_SET_OS_FEATURE_SET 0x02000066 | ||
85 | |||
83 | /* | 86 | /* |
84 | * Service-specific constants | 87 | * Service-specific constants |
85 | */ | 88 | */ |
@@ -118,8 +121,8 @@ | |||
118 | /* | 121 | /* |
119 | * Error Handling Features | 122 | * Error Handling Features |
120 | */ | 123 | */ |
121 | #define SAL_ERR_FEAT_MCA_SLV_TO_OS_INIT_SLV 0x1 | 124 | #define SAL_ERR_FEAT_MCA_SLV_TO_OS_INIT_SLV 0x1 // obsolete |
122 | #define SAL_ERR_FEAT_LOG_SBES 0x2 | 125 | #define SAL_ERR_FEAT_LOG_SBES 0x2 // obsolete |
123 | #define SAL_ERR_FEAT_MFR_OVERRIDE 0x4 | 126 | #define SAL_ERR_FEAT_MFR_OVERRIDE 0x4 |
124 | #define SAL_ERR_FEAT_SBE_THRESHOLD 0xffff0000 | 127 | #define SAL_ERR_FEAT_SBE_THRESHOLD 0xffff0000 |
125 | 128 | ||
@@ -152,12 +155,6 @@ sn_sal_rev(void) | |||
152 | } | 155 | } |
153 | 156 | ||
154 | /* | 157 | /* |
155 | * Specify the minimum PROM revsion required for this kernel. | ||
156 | * Note that they're stored in hex format... | ||
157 | */ | ||
158 | #define SN_SAL_MIN_VERSION 0x0404 | ||
159 | |||
160 | /* | ||
161 | * Returns the master console nasid, if the call fails, return an illegal | 158 | * Returns the master console nasid, if the call fails, return an illegal |
162 | * value. | 159 | * value. |
163 | */ | 160 | */ |
@@ -336,7 +333,7 @@ ia64_sn_plat_cpei_handler(void) | |||
336 | } | 333 | } |
337 | 334 | ||
338 | /* | 335 | /* |
339 | * Set Error Handling Features | 336 | * Set Error Handling Features (Obsolete) |
340 | */ | 337 | */ |
341 | static inline u64 | 338 | static inline u64 |
342 | ia64_sn_plat_set_error_handling_features(void) | 339 | ia64_sn_plat_set_error_handling_features(void) |
@@ -1052,4 +1049,25 @@ ia64_sn_is_fake_prom(void) | |||
1052 | return (rv.status == 0); | 1049 | return (rv.status == 0); |
1053 | } | 1050 | } |
1054 | 1051 | ||
1052 | static inline int | ||
1053 | ia64_sn_get_prom_feature_set(int set, unsigned long *feature_set) | ||
1054 | { | ||
1055 | struct ia64_sal_retval rv; | ||
1056 | |||
1057 | SAL_CALL_NOLOCK(rv, SN_SAL_GET_PROM_FEATURE_SET, set, 0, 0, 0, 0, 0, 0); | ||
1058 | if (rv.status != 0) | ||
1059 | return rv.status; | ||
1060 | *feature_set = rv.v0; | ||
1061 | return 0; | ||
1062 | } | ||
1063 | |||
1064 | static inline int | ||
1065 | ia64_sn_set_os_feature(int feature) | ||
1066 | { | ||
1067 | struct ia64_sal_retval rv; | ||
1068 | |||
1069 | SAL_CALL_NOLOCK(rv, SN_SAL_SET_OS_FEATURE_SET, feature, 0, 0, 0, 0, 0, 0); | ||
1070 | return rv.status; | ||
1071 | } | ||
1072 | |||
1055 | #endif /* _ASM_IA64_SN_SN_SAL_H */ | 1073 | #endif /* _ASM_IA64_SN_SN_SAL_H */ |