Skip to content

Commit

Permalink
hdat/spira: export abc and wxyz bus speeds
Browse files Browse the repository at this point in the history
One of the spira structs (iplparams_sysparams) captures
different system bus speeds/frequency. Patch exports the
same in "sys-params" dt node. These values will help in
nest pmu metric calculations.

ABC bus speed values are exported in "abc-bus-freq-mhz"
property. As name suggest, values are in MHz.

WXYZ bus speed values are exported in "wxyz-bus-freq-mhz"
property. As name suggest, values are in MHz.

Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
[oliver: added missing s-o-b, fixed hdat tests]
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
Madhavan Srinivasan authored and oohal committed Oct 2, 2019
1 parent 9f0af27 commit 7066a9c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hdata/spira.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ static void add_iplparams_sys_params(const void *iplp, struct dt_node *node)
u16 version = be16_to_cpu(hdif->version);
const char *vendor = NULL;
u32 sys_attributes;
u64 bus_speed;

p = HDIF_get_idata(iplp, IPLPARAMS_SYSPARAMS, NULL);
if (!CHECK_SPPTR(p)) {
Expand Down Expand Up @@ -1066,6 +1067,16 @@ static void add_iplparams_sys_params(const void *iplp, struct dt_node *node)
dt_add_property_u64(dt_root, "nest-frequency", freq);
}

/* Grab ABC bus speed */
bus_speed = be32_to_cpu(p->abc_bus_speed);
if (bus_speed)
dt_add_property_u64(node, "abc-bus-freq-mhz", bus_speed);

/* Grab WXYZ bus speed */
bus_speed = be32_to_cpu(p->wxyz_bus_speed);
if (bus_speed)
dt_add_property_u64(node, "wxyz-bus-freq-mhz", bus_speed);

if (version >= 0x5f)
vendor = p->sys_vendor;

Expand Down
2 changes: 2 additions & 0 deletions hdata/test/op920.wsp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -3221,8 +3221,10 @@
phandle = <0xb2>;
#address-cells = <0x0>;
#size-cells = <0x0>;
abc-bus-freq-mhz = < 0x00 0x1250 >;
ibm,sys-model = " GTH";
elevated-risk-level;
wxyz-bus-freq-mhz = < 0x00 0x7d0 >;
};
};

Expand Down
3 changes: 3 additions & 0 deletions hdata/test/p8-840-spira.dts
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,10 @@
phandle = <0x3c>;
#address-cells = <0x0>;
#size-cells = <0x0>;
abc-bus-freq-mhz = < 0x00 0x1900 >;
ibm,sys-model = " 41A";
wxyz-bus-freq-mhz = < 0x00 0xfa0 >;

};
};

Expand Down
2 changes: 2 additions & 0 deletions hdata/test/p81-811.spira.dts
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,9 @@
phandle = <0x7c>;
#address-cells = <0x0>;
#size-cells = <0x0>;
abc-bus-freq-mhz = < 0x00 0x1900 >;
ibm,sys-model = " 22L";
wxyz-bus-freq-mhz = < 0x00 0xfa0 >;
};
};

Expand Down

0 comments on commit 7066a9c

Please sign in to comment.