aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hdata/test/hdata_to_dt.c31
-rw-r--r--hdata/test/p8-840-spira.dts16
-rw-r--r--hdata/test/p81-811.spira.dts48
3 files changed, 53 insertions, 42 deletions
diff --git a/hdata/test/hdata_to_dt.c b/hdata/test/hdata_to_dt.c
index f109bbb..511facd 100644
--- a/hdata/test/hdata_to_dt.c
+++ b/hdata/test/hdata_to_dt.c
@@ -25,6 +25,7 @@
#include <mem_region-malloc.h>
#include <interrupts.h>
+#include <bitutils.h>
#include <valgrind/memcheck.h>
@@ -52,7 +53,14 @@ unsigned long tb_hz = 512000000;
/* Don't include processor-specific stuff. */
#define __PROCESSOR_H
-#define PVR_TYPE(_pvr) _pvr
+/* PVR bits */
+#define SPR_PVR_TYPE 0xffff0000
+#define SPR_PVR_VERS_MAJ 0x00000f00
+#define SPR_PVR_VERS_MIN 0x000000ff
+
+#define PVR_TYPE(_pvr) GETFIELD(SPR_PVR_TYPE, _pvr)
+#define PVR_VERS_MAJ(_pvr) GETFIELD(SPR_PVR_VERS_MAJ, _pvr)
+#define PVR_VERS_MIN(_pvr) GETFIELD(SPR_PVR_VERS_MIN, _pvr)
/* PVR definitions - copied from skiboot include/processor.h */
#define PVR_TYPE_P7 0x003f
@@ -61,6 +69,12 @@ unsigned long tb_hz = 512000000;
#define PVR_TYPE_P8 0x004d
#define PVR_TYPE_P8NVL 0x004c
#define PVR_TYPE_P9 0x004e
+#define PVR_P7 0x003f0201
+#define PVR_P7P 0x004a0201
+#define PVR_P8E 0x004b0201
+#define PVR_P8 0x004d0200
+#define PVR_P8NVL 0x004c0100
+#define PVR_P9 0x004e0200
#define SPR_PVR 0x11f /* RO: Processor version register */
@@ -71,15 +85,12 @@ struct cpu_thread {
};
struct cpu_thread __boot_cpu, *boot_cpu = &__boot_cpu;
-static unsigned long fake_pvr_type = PVR_TYPE_P7;
-
-// Fake PVR_VERS_MAJ to 1
-#define PVR_VERS_MAJ(v) (1)
+static unsigned long fake_pvr = PVR_P7;
static inline unsigned long mfspr(unsigned int spr)
{
assert(spr == SPR_PVR);
- return fake_pvr_type;
+ return fake_pvr;
}
struct dt_node *add_ics_node(void)
@@ -241,19 +252,19 @@ int main(int argc, char *argv[])
blobs = true;
opt_count++;
} else if (strcmp(argv[i], "-7") == 0) {
- fake_pvr_type = PVR_TYPE_P7;
+ fake_pvr = PVR_P7;
proc_gen = proc_gen_p7;
opt_count++;
} else if (strcmp(argv[i], "-8E") == 0) {
- fake_pvr_type = PVR_TYPE_P8;
+ fake_pvr = PVR_P8;
proc_gen = proc_gen_p8;
opt_count++;
} else if (strcmp(argv[i], "-8") == 0) {
- fake_pvr_type = PVR_TYPE_P8;
+ fake_pvr = PVR_P8;
proc_gen = proc_gen_p8;
opt_count++;
} else if (strcmp(argv[i], "-9") == 0) {
- fake_pvr_type = PVR_TYPE_P9;
+ fake_pvr = PVR_P9;
proc_gen = proc_gen_p9;
opt_count++;
}
diff --git a/hdata/test/p8-840-spira.dts b/hdata/test/p8-840-spira.dts
index c787fa6..dbb3618 100644
--- a/hdata/test/p8-840-spira.dts
+++ b/hdata/test/p8-840-spira.dts
@@ -32,7 +32,7 @@
device_type = "cpu";
status = "okay";
reg = <0x28>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -75,7 +75,7 @@
device_type = "cpu";
status = "okay";
reg = <0x60>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -118,7 +118,7 @@
device_type = "cpu";
status = "okay";
reg = <0x68>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -161,7 +161,7 @@
device_type = "cpu";
status = "okay";
reg = <0xb0>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -204,7 +204,7 @@
device_type = "cpu";
status = "okay";
reg = <0xe8>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -247,7 +247,7 @@
device_type = "cpu";
status = "okay";
reg = <0xf0>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -896,8 +896,8 @@
nx@2010000 {
phandle = <0x4b>;
- reg = <0x2010000 0x4000>;
compatible = "ibm,power-nx", "ibm,power8-nx";
+ reg = <0x2010000 0x4000>;
};
pbcq@2012000 {
@@ -958,8 +958,8 @@
nx@2010000 {
phandle = <0x4c>;
- reg = <0x2010000 0x4000>;
compatible = "ibm,power-nx", "ibm,power8-nx";
+ reg = <0x2010000 0x4000>;
};
pbcq@2012000 {
diff --git a/hdata/test/p81-811.spira.dts b/hdata/test/p81-811.spira.dts
index 770fb34..b3d5a94 100644
--- a/hdata/test/p81-811.spira.dts
+++ b/hdata/test/p81-811.spira.dts
@@ -32,7 +32,7 @@
device_type = "cpu";
status = "okay";
reg = <0x20>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -75,7 +75,7 @@
device_type = "cpu";
status = "okay";
reg = <0x30>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -118,7 +118,7 @@
device_type = "cpu";
status = "okay";
reg = <0x60>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -161,7 +161,7 @@
device_type = "cpu";
status = "okay";
reg = <0x68>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -204,7 +204,7 @@
device_type = "cpu";
status = "okay";
reg = <0x70>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -247,7 +247,7 @@
device_type = "cpu";
status = "okay";
reg = <0xa8>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -290,7 +290,7 @@
device_type = "cpu";
status = "okay";
reg = <0xb0>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -333,7 +333,7 @@
device_type = "cpu";
status = "okay";
reg = <0xe0>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -376,7 +376,7 @@
device_type = "cpu";
status = "okay";
reg = <0xe8>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -419,7 +419,7 @@
device_type = "cpu";
status = "okay";
reg = <0xf0>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -462,7 +462,7 @@
device_type = "cpu";
status = "okay";
reg = <0x828>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -505,7 +505,7 @@
device_type = "cpu";
status = "okay";
reg = <0x830>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -548,7 +548,7 @@
device_type = "cpu";
status = "okay";
reg = <0x860>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -591,7 +591,7 @@
device_type = "cpu";
status = "okay";
reg = <0x868>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -634,7 +634,7 @@
device_type = "cpu";
status = "okay";
reg = <0x870>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -677,7 +677,7 @@
device_type = "cpu";
status = "okay";
reg = <0x8a0>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -720,7 +720,7 @@
device_type = "cpu";
status = "okay";
reg = <0x8a8>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -763,7 +763,7 @@
device_type = "cpu";
status = "okay";
reg = <0x8b0>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -806,7 +806,7 @@
device_type = "cpu";
status = "okay";
reg = <0x8e8>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -849,7 +849,7 @@
device_type = "cpu";
status = "okay";
reg = <0x8f0>;
- cpu-version = <0x4d>;
+ cpu-version = <0x4d0200>;
64-bit;
32-64-bridge;
graphics;
@@ -2091,8 +2091,8 @@
nx@2010000 {
phandle = <0x92>;
- reg = <0x2010000 0x4000>;
compatible = "ibm,power-nx", "ibm,power8-nx";
+ reg = <0x2010000 0x4000>;
};
pbcq@2012000 {
@@ -2152,8 +2152,8 @@
nx@2010000 {
phandle = <0x93>;
- reg = <0x2010000 0x4000>;
compatible = "ibm,power-nx", "ibm,power8-nx";
+ reg = <0x2010000 0x4000>;
};
pbcq@2012000 {
@@ -2212,8 +2212,8 @@
nx@2010000 {
phandle = <0x94>;
- reg = <0x2010000 0x4000>;
compatible = "ibm,power-nx", "ibm,power8-nx";
+ reg = <0x2010000 0x4000>;
};
pbcq@2012000 {
@@ -2261,8 +2261,8 @@
nx@2010000 {
phandle = <0x95>;
- reg = <0x2010000 0x4000>;
compatible = "ibm,power-nx", "ibm,power8-nx";
+ reg = <0x2010000 0x4000>;
};
pbcq@2012000 {