[Skiboot] [PATCH] hdat/spira: export abc and wxyz bus speeds

Madhavan Srinivasan maddy at linux.vnet.ibm.com
Wed Sep 25 14:28:04 AEST 2019


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.
---
 hdata/spira.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/hdata/spira.c b/hdata/spira.c
index e118e229..5e73b7d4 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -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)) {
@@ -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;
 
-- 
2.21.0



More information about the Skiboot mailing list