aboutsummaryrefslogtreecommitdiff
path: root/hdata/spira.c
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2017-01-12 14:54:00 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-01-15 12:32:23 +1100
commit2a71fe7410253fd99b1651e15f4402267f004ed0 (patch)
treecf7cba39bd8df1f80219dab6ac11436bde5f5c74 /hdata/spira.c
parent293ca03683bfcd2c787b7e6f7c760238ba8eeae3 (diff)
downloadskiboot-2a71fe7410253fd99b1651e15f4402267f004ed0.zip
skiboot-2a71fe7410253fd99b1651e15f4402267f004ed0.tar.gz
skiboot-2a71fe7410253fd99b1651e15f4402267f004ed0.tar.bz2
hdat: Add new fields to IPL params structure
Add new fields to sys params structure and update sys family for p9. In P9 the compatible string is supplied by hostboot through the HDAT. This patch add support for using these strings to set the compatible property in the device tree rather than using the machine ID number scheme traditionally used in the HDAT. [removed ibm,firenze from, add some prints - Oliver] Signed-off-by: Oliver O'Halloran <oohall@gmail.com> [Folded Oliver's changes to original patch - Vasant] Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: fixup test case] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata/spira.c')
-rw-r--r--hdata/spira.c63
1 files changed, 40 insertions, 23 deletions
diff --git a/hdata/spira.c b/hdata/spira.c
index f87aa27..a19b4db 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -756,8 +756,6 @@ static void add_nx(void)
static void add_iplparams_sys_params(const void *iplp, struct dt_node *node)
{
const struct iplparams_sysparams *p;
- u32 sys_type;
- const char *sys_family;
const struct HDIF_common_hdr *hdif = iplp;
u16 version = be16_to_cpu(hdif->version);
@@ -776,29 +774,48 @@ static void add_iplparams_sys_params(const void *iplp, struct dt_node *node)
dt_add_property_nstr(node, "ibm,sys-model", p->sys_model, 4);
- /* Compatible is 2 entries: ibm,powernv and ibm,<platform>
+ /*
+ * Compatible has up to three entries:
+ * "ibm,powernv", the system family and system type.
+ *
+ * On P9 and above the family and type strings come from the HDAT
+ * directly. On P8 we find it from the system ID numbers.
*/
- sys_type = be32_to_cpu(p->system_type);
- switch(sys_type >> 28) {
- case 0:
- sys_family = "ibm,squadrons";
- break;
- case 1:
- sys_family = "ibm,eclipz";
- break;
- case 2:
- sys_family = "ibm,apollo";
- break;
- case 3:
- sys_family = "ibm,firenze";
- break;
- default:
- sys_family = NULL;
- prerror("IPLPARAMS: Unknown system family\n");
- break;
+ if (proc_gen >= proc_gen_p9) {
+ dt_add_property_strings(dt_root, "compatible", "ibm,powernv",
+ p->sys_family_str, p->sys_type_str);
+
+ prlog(PR_INFO, "IPLPARAMS: v0x70 Platform family/type: %s/%s\n",
+ p->sys_family_str, p->sys_type_str);
+ } else {
+ u32 sys_type = be32_to_cpu(p->system_type);
+ const char *sys_family;
+
+ switch (sys_type >> 28) {
+ case 0:
+ sys_family = "ibm,squadrons";
+ break;
+ case 1:
+ sys_family = "ibm,eclipz";
+ break;
+ case 2:
+ sys_family = "ibm,apollo";
+ break;
+ case 3:
+ sys_family = "ibm,firenze";
+ break;
+ default:
+ sys_family = NULL;
+ prerror("IPLPARAMS: Unknown system family\n");
+ break;
+ }
+
+ dt_add_property_strings(dt_root, "compatible", "ibm,powernv",
+ sys_family);
+ prlog(PR_INFO,
+ "IPLPARAMS: Legacy platform family: %s"
+ " (sys_type=0x%08x)\n", sys_family, sys_type);
}
- dt_add_property_strings(dt_root, "compatible", "ibm,powernv",
- sys_family);
/* Grab nest frequency when available */
if (version >= 0x005b) {