Add support for the PowerNV platform
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 18 Oct 2011 01:09:23 +0000 (12:09 +1100)
committerTony Breeds <tony@bakeyournoodle.com>
Tue, 18 Oct 2011 04:11:10 +0000 (15:11 +1100)
While there correct the detection for IBM pSeries.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
second/yaboot.c
ybin/ybin

index 0fd26a1..9b66ab4 100644 (file)
@@ -205,6 +205,9 @@ yaboot_start (unsigned long r3, unsigned long r4, unsigned long r5)
          else if (prom_getprop(root, "device_type", model, 256 ) > 0 &&
              !strncmp("chrp", model, 4))
               _machine = _MACH_chrp;
+         else if (prom_getprop(root, "compatible", model, 256 ) > 0 &&
+                  strstr(model, "ibm,powernv"))
+              _machine = _MACH_chrp;
          else {
               if (prom_getprop(root, "model", model, 256 ) > 0 &&
                   !strncmp(model, "IBM", 3))
index 44e63f4..c1e95ba 100755 (executable)
--- a/ybin/ybin
+++ b/ybin/ybin
@@ -73,7 +73,9 @@ fi
 
 ## defaults
 usemount=no
-if (cat /proc/cpuinfo 2> /dev/null | grep ^machine | grep -q 'CHRP IBM') ; then
+if (cat /proc/cpuinfo 2> /dev/null | grep ^platform | grep -q 'pSeries') ; then
+    fstype=raw
+elif (cat /proc/cpuinfo 2> /dev/null | grep ^platform | grep -q 'PowerNV') ; then
     fstype=raw
 else
     fstype=hfs
@@ -504,7 +506,11 @@ checkconf()
        echo 1>&2
        [ "$nonvram" = 0 ] && echo 1>&2 "$PRG: OldWorld PowerMac, nvram will not be updated"
        nonvram=1
-    elif (cat /proc/cpuinfo 2> /dev/null | grep ^machine | grep -q 'CHRP IBM') ; then
+    elif (cat /proc/cpuinfo 2> /dev/null | grep ^platform | grep -q 'pSeries') ; then
+       ## IBM hardware does not need nvram update AFAICT
+       nonvram=1
+       ADDNOTE=yes
+    elif (cat /proc/cpuinfo 2> /dev/null | grep ^platform | grep -q 'PowerNV') ; then
        ## IBM hardware does not need nvram update AFAICT
        nonvram=1
        ADDNOTE=yes