aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2007-07-18 17:56:32 -0400
committerPaul Mackerras <paulus@samba.org>2007-07-22 07:30:58 -0400
commitca8ffc974d43033be6e1d4277a45822d2c3656f4 (patch)
tree6c774a2e500cae66ca30b0b591470cf974d11734
parent4d404edce30f911004850d472e05a31efd751662 (diff)
[POWERPC] Fix future firmware feature fixups function failure
Move firmware feature initialisation from pSeries_init_early to the earlier pSeries_probe_hypertas so they are initialised before firmware feature fixups are applied. Currently firmware feature sections are only used for iSeries which initialises the these features much earlier. This is a bug in waiting on pSeries. Also adds some whitespace fixups. Signed-off-by: Michael Neuling <mikey@neuling.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/platforms/pseries/firmware.c19
-rw-r--r--arch/powerpc/platforms/pseries/pseries.h2
-rw-r--r--arch/powerpc/platforms/pseries/setup.c17
3 files changed, 15 insertions, 23 deletions
diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c
index 29bf83bfb1f0..8b18a1c40092 100644
--- a/arch/powerpc/platforms/pseries/firmware.c
+++ b/arch/powerpc/platforms/pseries/firmware.c
@@ -66,24 +66,13 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = {
66 * device-tree/ibm,hypertas-functions. Ultimately this functionality may 66 * device-tree/ibm,hypertas-functions. Ultimately this functionality may
67 * be moved into prom.c prom_init(). 67 * be moved into prom.c prom_init().
68 */ 68 */
69void __init fw_feature_init(void) 69void __init fw_feature_init(const char *hypertas, unsigned long len)
70{ 70{
71 struct device_node *dn; 71 const char *s;
72 const char *hypertas, *s; 72 int i;
73 int len, i;
74 73
75 DBG(" -> fw_feature_init()\n"); 74 DBG(" -> fw_feature_init()\n");
76 75
77 dn = of_find_node_by_path("/rtas");
78 if (dn == NULL) {
79 printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n");
80 goto out;
81 }
82
83 hypertas = of_get_property(dn, "ibm,hypertas-functions", &len);
84 if (hypertas == NULL)
85 goto out;
86
87 for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) { 76 for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) {
88 for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) { 77 for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) {
89 /* check value against table of strings */ 78 /* check value against table of strings */
@@ -98,7 +87,5 @@ void __init fw_feature_init(void)
98 } 87 }
99 } 88 }
100 89
101out:
102 of_node_put(dn);
103 DBG(" <- fw_feature_init()\n"); 90 DBG(" <- fw_feature_init()\n");
104} 91}
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index 61e19f78b923..61136d019554 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -10,7 +10,7 @@
10#ifndef _PSERIES_PSERIES_H 10#ifndef _PSERIES_PSERIES_H
11#define _PSERIES_PSERIES_H 11#define _PSERIES_PSERIES_H
12 12
13extern void __init fw_feature_init(void); 13extern void __init fw_feature_init(const char *hypertas, unsigned long len);
14 14
15struct pt_regs; 15struct pt_regs;
16 16
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 59e69f085cb4..f0b7146a110f 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -320,8 +320,6 @@ static void __init pSeries_init_early(void)
320{ 320{
321 DBG(" -> pSeries_init_early()\n"); 321 DBG(" -> pSeries_init_early()\n");
322 322
323 fw_feature_init();
324
325 if (firmware_has_feature(FW_FEATURE_LPAR)) 323 if (firmware_has_feature(FW_FEATURE_LPAR))
326 find_udbg_vterm(); 324 find_udbg_vterm();
327 325
@@ -343,14 +341,21 @@ static int __init pSeries_probe_hypertas(unsigned long node,
343 const char *uname, int depth, 341 const char *uname, int depth,
344 void *data) 342 void *data)
345{ 343{
344 const char *hypertas;
345 unsigned long len;
346
346 if (depth != 1 || 347 if (depth != 1 ||
347 (strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0)) 348 (strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0))
348 return 0; 349 return 0;
350
351 hypertas = of_get_flat_dt_prop(node, "ibm,hypertas-functions", &len);
352 if (!hypertas)
353 return 1;
349 354
350 if (of_get_flat_dt_prop(node, "ibm,hypertas-functions", NULL) != NULL) 355 powerpc_firmware_features |= FW_FEATURE_LPAR;
351 powerpc_firmware_features |= FW_FEATURE_LPAR; 356 fw_feature_init(hypertas, len);
352 357
353 return 1; 358 return 1;
354} 359}
355 360
356static int __init pSeries_probe(void) 361static int __init pSeries_probe(void)