[PATCH 13/19] ppc64: Add /system-id, /model and /compatible
Michael Ellerman
michael at ellerman.id.au
Tue Jul 26 18:58:41 EST 2005
Add /system-id, /model and /compatible to the iSeries device tree. This should
allow us to remove some iSeries specific code (at least for lparcfg) but I
haven't got around to that yet.
---
arch/ppc64/kernel/iSeries_setup.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+)
Index: work/arch/ppc64/kernel/iSeries_setup.c
===================================================================
--- work.orig/arch/ppc64/kernel/iSeries_setup.c
+++ work/arch/ppc64/kernel/iSeries_setup.c
@@ -58,6 +58,7 @@
#include <asm/iSeries/HvLpEvent.h>
#include <asm/iSeries/iSeries_irq.h>
#include <asm/iSeries/IoHriProcessorVpd.h>
+#include <asm/iSeries/ItExtVpdPanel.h>
#include <asm/iSeries/ItVpdAreas.h>
#include <asm/iSeries/LparMap.h>
@@ -1056,6 +1057,22 @@ void dt_prop_empty(struct iseries_flat_d
dt_prop(dt, name, NULL, 0);
}
+void dt_model(struct iseries_flat_dt *dt)
+{
+ char buf[16] = "IBM,";
+
+ strne2a(buf + 4, xItExtVpdPanel.mfgID + 2, 2);
+ strne2a(buf + 6, xItExtVpdPanel.systemSerial + 1, 5);
+ buf[11] = '\0';
+ dt_prop_str(dt, "system-id", buf);
+
+ strne2a(buf + 4, xItExtVpdPanel.machineType, 4);
+ buf[8] = '\0';
+ dt_prop_str(dt, "model", buf);
+
+ dt_prop_str(dt, "compatible", "IBM,iSeries");
+}
+
void build_flat_dt(struct iseries_flat_dt *dt)
{
u64 tmp[2];
@@ -1066,6 +1083,7 @@ void build_flat_dt(struct iseries_flat_d
dt_prop_u32(dt, "#address-cells", 2);
dt_prop_u32(dt, "#size-cells", 2);
+ dt_model(dt);
/* /memory */
dt_start_node(dt, "/memory at 0");
More information about the Linuxppc64-dev
mailing list