aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2017-01-13 14:08:24 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-01-16 11:54:00 +1100
commit5b5dc42a4dc35a948831da0e7b5456fc88bab59d (patch)
tree0e0112ce0e54a19ef8a3a61469ac6e6dc7d129e3
parent1357e64dbf0bb2f02db2a126ad18ade23f407127 (diff)
downloadskiboot-5b5dc42a4dc35a948831da0e7b5456fc88bab59d.zip
skiboot-5b5dc42a4dc35a948831da0e7b5456fc88bab59d.tar.gz
skiboot-5b5dc42a4dc35a948831da0e7b5456fc88bab59d.tar.bz2
hdat: Grab vendor information from HDAT when available
Latest spec added vendor information to IPL PARAMS ntuple. Grab this information when available instead of hardcoding vendor name. Also move vendor property code from vpd.c to iplparms parsing function in spira.c. Suggested-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--hdata/spira.c10
-rw-r--r--hdata/test/p8-840-spira.dt2
-rw-r--r--hdata/test/p81-811.spira.dt2
-rw-r--r--hdata/vpd.c1
4 files changed, 12 insertions, 3 deletions
diff --git a/hdata/spira.c b/hdata/spira.c
index 13cb905..f316f21 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -779,6 +779,7 @@ static void add_iplparams_sys_params(const void *iplp, struct dt_node *node)
const struct iplparams_sysparams *p;
const struct HDIF_common_hdr *hdif = iplp;
u16 version = be16_to_cpu(hdif->version);
+ const char *vendor = NULL;
p = HDIF_get_idata(iplp, IPLPARAMS_SYSPARAMS, NULL);
if (!CHECK_SPPTR(p)) {
@@ -845,6 +846,15 @@ static void add_iplparams_sys_params(const void *iplp, struct dt_node *node)
freq *= 1000000;
dt_add_property_u64(dt_root, "nest-frequency", freq);
}
+
+ if (version >= 0x5f)
+ vendor = p->sys_vendor;
+
+ /* Workaround a bug where we have NULL vendor */
+ if (!vendor || vendor[0] == '\0')
+ vendor = "IBM";
+
+ dt_add_property_string(dt_root, "vendor", vendor);
}
static void add_iplparams_ipl_params(const void *iplp, struct dt_node *node)
diff --git a/hdata/test/p8-840-spira.dt b/hdata/test/p8-840-spira.dt
index 7566e9c..90a6f1a 100644
--- a/hdata/test/p8-840-spira.dt
+++ b/hdata/test/p8-840-spira.dt
@@ -41,10 +41,10 @@ prop: #size-cells size: 4 val: 00000002
prop: lid-type size: 5 val: 7068797000
prop: compatible size: 24 val: 69626d2c706f7765726e760069626d2c666972656e7a6500
prop: nest-frequency size: 8 val: 0000000077359400
+prop: vendor size: 4 val: 49424d00
prop: skiboot,maxmem size: 8 val: 80000007ffffffff
prop: model size: 9 val: 383238362d34314100
prop: model-name size: 22 val: 49424d20506f7765722053797374656d205338313400
-prop: vendor size: 4 val: 49424d00
prop: system-id size: 8 val: 5455303031363300
prop: system-brand size: 3 val: 533000
prop: ibm,hbrt-mini-fdt size: 4096 val: d00dfeed000005c20000012800000528000000280000001100000010000000000000009a000004
diff --git a/hdata/test/p81-811.spira.dt b/hdata/test/p81-811.spira.dt
index a98cc46..9435d2d 100644
--- a/hdata/test/p81-811.spira.dt
+++ b/hdata/test/p81-811.spira.dt
@@ -92,10 +92,10 @@ prop: #size-cells size: 4 val: 00000002
prop: lid-type size: 5 val: 7068797000
prop: compatible size: 24 val: 69626d2c706f7765726e760069626d2c666972656e7a6500
prop: nest-frequency size: 8 val: 0000000077359400
+prop: vendor size: 4 val: 49424d00
prop: skiboot,maxmem size: 8 val: 8000001fffffffff
prop: model size: 9 val: 383234372d32324c00
prop: model-name size: 23 val: 49424d20506f7765722053797374656d20533832324c00
-prop: vendor size: 4 val: 49424d00
prop: system-id size: 8 val: 3130313043384100
prop: system-brand size: 3 val: 533000
prop: ibm,hbrt-mini-fdt size: 4096 val: d00dfeed0000026e0000012800000214000000280000001100000010000000000000005a000000
diff --git a/hdata/vpd.c b/hdata/vpd.c
index cb7a8da..d9f7da5 100644
--- a/hdata/vpd.c
+++ b/hdata/vpd.c
@@ -650,7 +650,6 @@ static void sysvpd_parse(void)
}
free(str);
- dt_add_property_string(dt_root, "vendor", "IBM");
system_id = vpd_find(sysvpd, sysvpd_sz, "VSYS", "SE", &sz);
if (!system_id)