summaryrefslogtreecommitdiffstats
path: root/include/chip.h
diff options
context:
space:
mode:
authorMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>2017-12-13 10:54:10 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-12-13 22:04:58 -0600
commit13e1ed3c97bf2faf65c317967254ecc96232753c (patch)
tree28eff96bcd25e29ef9fd304997a1bd6c70d3fb30 /include/chip.h
parenteaf9e0f0981b30bf1667fb6b7532555d9c7444f5 (diff)
downloadblackbird-skiboot-13e1ed3c97bf2faf65c317967254ecc96232753c.tar.gz
blackbird-skiboot-13e1ed3c97bf2faf65c317967254ecc96232753c.zip
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 'include/chip.h')
-rw-r--r--include/chip.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/chip.h b/include/chip.h
index 566edc55..43b5ea55 100644
--- a/include/chip.h
+++ b/include/chip.h
@@ -215,6 +215,9 @@ struct proc_chip {
struct xive *xive;
struct vas *vas;
+
+ /* location code of this chip */
+ const uint8_t *loc_code;
};
extern uint32_t pir_to_chip_id(uint32_t pir);
@@ -241,5 +244,17 @@ static inline int nr_chips(void)
return nr_chips;
}
+/* helper to get location code of a chip */
+static inline const char *chip_loc_code(uint32_t chip_id)
+{
+ struct proc_chip *chip;
+
+ chip = get_chip(chip_id);
+ if (!chip)
+ return NULL;
+
+ return chip->loc_code;
+}
+
#endif /* __CHIP_H */
OpenPOWER on IntegriCloud