diff options
author | Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> | 2017-12-13 10:54:10 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-12-13 22:04:58 -0600 |
commit | 13e1ed3c97bf2faf65c317967254ecc96232753c (patch) | |
tree | 28eff96bcd25e29ef9fd304997a1bd6c70d3fb30 /core | |
parent | eaf9e0f0981b30bf1667fb6b7532555d9c7444f5 (diff) | |
download | skiboot-13e1ed3c97bf2faf65c317967254ecc96232753c.zip skiboot-13e1ed3c97bf2faf65c317967254ecc96232753c.tar.gz skiboot-13e1ed3c97bf2faf65c317967254ecc96232753c.tar.bz2 |
opal: Get chip location code
and store it under proc_chip for quick reference during HMI handling
code.
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/chip.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/chip.c b/core/chip.c index d2ff3f4..6526325 100644 --- a/core/chip.c +++ b/core/chip.c @@ -76,6 +76,7 @@ static void init_chip(struct dt_node *dn) { struct proc_chip *chip; uint32_t id; + const char *lc = NULL; id = dt_get_chip_id(dn); assert(id < MAX_CHIPS); @@ -97,6 +98,15 @@ static void init_chip(struct dt_node *dn) list_head_init(&chip->i2cms); + /* Update the location code for this chip. */ + if (dt_has_node_property(dn, "ibm,loc-code", NULL)) + lc = dt_prop_get(dn, "ibm,loc-code"); + else if (dt_has_node_property(dn, "ibm,slot-location-code", NULL)) + lc = dt_prop_get(dn, "ibm,slot-location-code"); + + if (lc) + chip->loc_code = strdup(lc); + prlog(PR_INFO, "CHIP: Initialised chip %d from %s\n", id, dn->name); chips[id] = chip; } |