[Skiboot] [PATCH v7 8/9] nest abus and xbus units support

Madhavan Srinivasan maddy at linux.vnet.ibm.com
Tue Mar 1 21:40:32 AEDT 2016


Add support for nest abus and xbus units. In general xbus connects
the chips within the dual chip modules(dcm) and abus connects sockets.

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

diff --git a/hw/nest.c b/hw/nest.c
index 18780ea7f874..fc02a11f2aa7 100644
--- a/hw/nest.c
+++ b/hw/nest.c
@@ -58,6 +58,23 @@ struct catalog_grp_to_dt_node dev_grp_map[NEST_DT_DEVICE_MAX];
  */
 struct nest_catalog_page_0 *page0_desc;
 
+static bool is_P8_proc(void)
+{
+        struct proc_chip *chip;
+
+        chip = get_chip(this_cpu()->chip_id);
+        switch(chip->type) {
+        case PROC_CHIP_P8_VENICE:
+        case PROC_CHIP_P8_NAPLES:
+                return true;
+        default:
+                break;
+        }
+
+        return false;
+}
+
+
 static struct dt_node *
 dt_add_device_node(struct dt_node *ptr, const char *name)
 {
@@ -192,6 +209,34 @@ static int dt_create_nest_powerbus_node(struct dt_node *type,
 	return 0;
 }
 
+static int dt_create_nest_abus_xbus_node(struct dt_node *type,
+			struct nest_catalog_group_data *gptr, char *name)
+{
+	int idx;
+	u32 offset;
+	const char *unit = "MiB", *scale = "7.629e-6";
+
+	for(idx = 0; idx < 3; idx++) {
+		offset = get_chip_event_offset(gptr->event_index[idx],
+								DOMAIN_CHIP);
+		if (strstr(name, "abus"))
+			dt_create_nest_unit_events(type, idx, offset,
+							name, scale, unit);
+		else if (strstr(name, "xbus")) {
+			/*
+			 * Power8 uses xbus[0,1,3] and not xbus2,
+			 * So skipping it.
+			 */
+			if ((idx == 2) && is_P8_proc())
+				idx = 3;
+			dt_create_nest_unit_events(type, idx, offset,
+							name, scale, unit);
+		}
+	}
+
+	return 0;
+}
+
 /*
  * Wrapper function to call corresponding nest unit functions
  * for event dt creation. Not all the chip groups in the catalog are
@@ -217,6 +262,20 @@ dt_create_nest_unit(struct dt_node *ima,
 	} else if (strstr(name, "PowerBus_BW")) {
 		if (dt_create_nest_powerbus_node(ima, gptr))
 			goto out;
+	} else if (strstr(name, "A-link_data")) {
+		/*
+		 * since dt_create_nest_abus_xbus_node() is a common function
+		 * for both "xbus" and "abus", append nest_unit_name
+		 */
+		if (dt_create_nest_abus_xbus_node(ima, gptr, dev_grp_map[id].nest_unit_name))
+			goto out;
+	} else if (strstr(name, "X-link_data")) {
+		/*
+		 * since dt_create_nest_abus_xbus_node() is a common function
+		 * for both "xbus" and "abus", append nest_unit_name
+		 */
+		if (dt_create_nest_abus_xbus_node(ima, gptr, dev_grp_map[id].nest_unit_name))
+			goto out;
 	} else
 		free(name);
 
-- 
1.9.1



More information about the Skiboot mailing list