[Skiboot] [RESEND PATCH v1 09/11]ibm-fsp/firenze: Nest Xlink unit support

Madhavan Srinivasan maddy at linux.vnet.ibm.com
Mon Jul 6 02:55:31 AEST 2015


Patch adds support for Nest Xlink unit. In tuleta, X links connects
the Chips within the DCM. Xlink counter data should give inter chip bandwidth
usage (with in socket).

Signed-off-by: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>
---
 hw/nest.c      | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 include/nest.h |  3 +++
 2 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/hw/nest.c b/hw/nest.c
index df93601..fc83589 100644
--- a/hw/nest.c
+++ b/hw/nest.c
@@ -194,6 +194,51 @@ int dt_create_ima_chip_alink_type( struct dt_node *ima,
 	return 0;
 }
 
+int dt_create_ima_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";
+
+	memset((void *)ev_name, '\0', MAX_NAME_SIZE);
+	snprintf(ev_name, MAX_NAME_SIZE, "Xlink%d", idx);
+	dt_add_property_cells(ima, ev_name, offset);
+
+	/* Unit for the Event */
+	memset((void *)ev_name, '\0', MAX_NAME_SIZE);
+	snprintf(ev_name, MAX_NAME_SIZE, "unit.Xlink%d.unit", idx);
+	dt_add_property_string(ima, ev_name, unit);
+
+	/* Scale for the Event */
+	memset((void *)ev_name, '\0', MAX_NAME_SIZE);
+	snprintf(ev_name, MAX_NAME_SIZE, "scale.Xlink%d.scale", idx);
+	dt_add_property_string(ima, ev_name, scale);
+
+	return 0;
+}
+
+int dt_create_ima_chip_xlink_type( struct dt_node *ima,
+		struct ima_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]);
+		dt_create_ima_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
@@ -203,8 +248,8 @@ int dt_create_ima_chip_type (struct dt_node *ima,
 		struct ima_catalogue_group_data *gptr)
 {
 	char *name;
-	int rc = -EINVAL;
-	char al[]="Alink_BW";
+	int rc = 0;
+	char al[]="Alink_BW", xl[] = "Xlink_BW";
 
 	name = (char *)malloc(gptr->group_name_len);
 	if (!name)
@@ -220,6 +265,9 @@ int dt_create_ima_chip_type (struct dt_node *ima,
 	} else if (strstr(name, "A-link_data")) {
 		if (dt_create_ima_chip_alink_type(ima, gptr,al))
 			goto out;
+	} else if (strstr(name, "X-link_data")) {
+		if (dt_create_ima_chip_xlink_type(ima, gptr,xl))
+			goto out;
 	} else
 		goto out;
 
diff --git a/include/nest.h b/include/nest.h
index 9a5669c..bb72e6e 100644
--- a/include/nest.h
+++ b/include/nest.h
@@ -236,6 +236,9 @@ int dt_create_ima_chip_powerbus_event(struct dt_node *,u32, const char *);
 int dt_create_ima_chip_alink_type(struct dt_node *,
 				struct ima_catalogue_group_data *,char *);
 int dt_create_ima_chip_alink_event(struct dt_node *,int,u32);
+int dt_create_ima_chip_xlink_type(struct dt_node *,
+				struct ima_catalogue_group_data *,char *);
+int dt_create_ima_chip_xlink_event(struct dt_node *,int,u32);
 void nest_ima_init(void);
 
 #endif	/* __NEST_H__ */
-- 
1.9.3



More information about the Skiboot mailing list