[Skiboot] [PATCH v3 7/9] Nest Alink and Xlink unit support

Madhavan Srinivasan maddy at linux.vnet.ibm.com
Mon Aug 3 17:33:46 AEST 2015


Add support for Nest Alink and Xlink unit. In Power8 systems, X links connects
the Chips within the DCM. Alinks connects sockets. Xlink counter data will
give inter chip bandwidth usage (with in socket) and Alink counters data
will give inter socket bandwidth.

Signed-off-by: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>
---
 hw/nest.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/hw/nest.c b/hw/nest.c
index 42c2bfc224c9..879bf10b6e27 100644
--- a/hw/nest.c
+++ b/hw/nest.c
@@ -150,6 +150,67 @@ int dt_create_nest_chip_powerbus_type( struct dt_node *ima,
 	return 0;
 }
 
+int dt_create_nest_chip_alink_event(struct dt_node *ima, int idx, u32 offset)
+{
+	char ev_name[MAX_NAME_SIZE];
+	const char *unit = "MiB", *scale = "7.629e-6";
+
+	snprintf(ev_name, MAX_NAME_SIZE, "Alink%d", idx);
+	dt_add_property_cells(ima, ev_name, offset);
+
+	snprintf(ev_name, MAX_NAME_SIZE, "unit.Alink%d.unit", idx);
+	dt_add_property_string(ima, ev_name, unit);
+
+	snprintf(ev_name, MAX_NAME_SIZE, "scale.Alink%d.scale", idx);
+	dt_add_property_string(ima, ev_name, scale);
+
+	return 0;
+}
+
+int dt_create_nest_chip_xlink_event(struct dt_node *ima, int idx, u32 offset)
+{
+	char ev_name[MAX_NAME_SIZE];
+	const char *unit = "MiB", *scale = "7.629e-6";
+
+	snprintf(ev_name, MAX_NAME_SIZE, "Xlink%d", idx);
+	dt_add_property_cells(ima, ev_name, offset);
+
+	/* Unit for the Event */
+	snprintf(ev_name, MAX_NAME_SIZE, "unit.Xlink%d.unit", idx);
+	dt_add_property_string(ima, ev_name, unit);
+
+	/* Scale for the Event */
+	snprintf(ev_name, MAX_NAME_SIZE, "scale.Xlink%d.scale", idx);
+	dt_add_property_string(ima, ev_name, scale);
+
+	return 0;
+}
+
+int dt_create_nest_chip_alink_xlink_type( struct dt_node *ima,
+			struct nest_catalogue_group_data *gptr, char *name)
+{
+	struct dt_node *type;
+	int idx;
+	u32 offset;
+
+	type = dt_new(ima, name);
+	if (!type) {
+		prlog(PR_DEBUG, "ima %s type creation failed \n", name);
+		return -1;
+	}
+
+	dt_add_property_string(type, "device_type", "nest-ima-unit");
+	for(idx=0; idx < 3; idx++) {
+		offset = get_chip_event_offset( gptr->event_index[idx]);
+		if (strstr(name, "Alink_BW"))
+			dt_create_nest_chip_alink_event(type, idx, offset);
+		else
+			dt_create_nest_chip_xlink_event(type, idx, offset);
+	}
+
+	return 0;
+}
+
 /*
  * Wrapper Function to call Corresponding Nest unit functions
  * for event dt creation. Not all the Chip Groups in the Catalog are
@@ -159,6 +220,7 @@ int dt_create_nest_chip_type(struct dt_node *ima,
 		struct nest_catalogue_group_data *gptr)
 {
 	char *name;
+	char al[]="Alink_BW", xl[] = "Xlink_BW";
 
 	name = malloc(gptr->group_name_len);
 	if (!name)
@@ -171,6 +233,12 @@ int dt_create_nest_chip_type(struct dt_node *ima,
 	} else if (strstr(name, "PowerBus_BW")) {
 		if (dt_create_nest_chip_powerbus_type(ima, gptr,name))
 			goto out;
+	} else if (strstr(name, "A-link_data")) {
+		if (dt_create_nest_chip_alink_xlink_type(ima, gptr,al))
+			goto out;
+	} else if (strstr(name, "X-link_data")) {
+		if (dt_create_nest_chip_alink_xlink_type(ima, gptr,xl))
+			goto out;
 	}
 
 	return OPAL_SUCCESS;
-- 
1.9.1



More information about the Skiboot mailing list