]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/platforms/pseries/setup.c
powerpc/pseries: Update firmware_has_feature() to check architecture vector 5 bits
[karo-tx-linux.git] / arch / powerpc / platforms / pseries / setup.c
index 8bcc9ca6682f66a15e96ea4d4f6deb4c14ff1f61..ac932a9eb440620487ecd679ea51741614f7e9c3 100644 (file)
@@ -628,25 +628,39 @@ static void __init pSeries_init_early(void)
  * Called very early, MMU is off, device-tree isn't unflattened
  */
 
-static int __init pSeries_probe_hypertas(unsigned long node,
-                                        const char *uname, int depth,
-                                        void *data)
+static int __init pseries_probe_fw_features(unsigned long node,
+                                           const char *uname, int depth,
+                                           void *data)
 {
-       const char *hypertas;
+       const char *prop;
        unsigned long len;
+       static int hypertas_found;
+       static int vec5_found;
 
-       if (depth != 1 ||
-           (strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas@0") != 0))
+       if (depth != 1)
                return 0;
 
-       hypertas = of_get_flat_dt_prop(node, "ibm,hypertas-functions", &len);
-       if (!hypertas)
-               return 1;
+       if (!strcmp(uname, "rtas") || !strcmp(uname, "rtas@0")) {
+               prop = of_get_flat_dt_prop(node, "ibm,hypertas-functions",
+                                          &len);
+               if (prop) {
+                       powerpc_firmware_features |= FW_FEATURE_LPAR;
+                       fw_hypertas_feature_init(prop, len);
+               }
 
-       powerpc_firmware_features |= FW_FEATURE_LPAR;
-       fw_feature_init(hypertas, len);
+               hypertas_found = 1;
+       }
 
-       return 1;
+       if (!strcmp(uname, "chosen")) {
+               prop = of_get_flat_dt_prop(node, "ibm,architecture-vec-5",
+                                          &len);
+               if (prop)
+                       fw_vec5_feature_init(prop, len);
+
+               vec5_found = 1;
+       }
+
+       return hypertas_found && vec5_found;
 }
 
 static int __init pSeries_probe(void)
@@ -669,7 +683,7 @@ static int __init pSeries_probe(void)
        pr_debug("pSeries detected, looking for LPAR capability...\n");
 
        /* Now try to figure out if we are running on LPAR */
-       of_scan_flat_dt(pSeries_probe_hypertas, NULL);
+       of_scan_flat_dt(pseries_probe_fw_features, NULL);
 
        if (firmware_has_feature(FW_FEATURE_LPAR))
                hpte_init_lpar();