From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: To: Paul Mackerras From: Michael Ellerman Date: Tue, 21 Mar 2006 20:46:09 +1100 Subject: [PATCH 9/11] powerpc: iseries: Add /system-id, /model and /compatible In-Reply-To: <1142934351.193140.181086235013.qpush@concordia> Message-Id: <20060321094638.7A28D67BC1@ozlabs.org> Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Add /system-id, /model and /compatible to the iSeries device tree. Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/iseries/setup.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+) Index: to-merge/arch/powerpc/platforms/iseries/setup.c =================================================================== --- to-merge.orig/arch/powerpc/platforms/iseries/setup.c +++ to-merge/arch/powerpc/platforms/iseries/setup.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -888,6 +889,24 @@ void dt_cpus(struct iseries_flat_dt *dt) dt_end_node(dt); } +void dt_model(struct iseries_flat_dt *dt) +{ + char buf[16] = "IBM,"; + + /* "IBM," + mfgId[2:3] + systemSerial[1:5] */ + strne2a(buf + 4, xItExtVpdPanel.mfgID + 2, 2); + strne2a(buf + 6, xItExtVpdPanel.systemSerial + 1, 5); + buf[11] = '\0'; + dt_prop_str(dt, "system-id", buf); + + /* "IBM," + machineType[0:4] */ + 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, unsigned long phys_mem_size) { u64 tmp[2]; @@ -898,6 +917,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@0");