[Skiboot] [PATCH v2 05/11] Nest unit parser function

Madhavan Srinivasan maddy at linux.vnet.ibm.com
Tue Jul 21 16:38:45 AEST 2015


Patch adds catalog parser function to detect Nest units.

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

diff --git a/hw/nest.c b/hw/nest.c
index e3b0a4ffca75..46a60f3168e2 100644
--- a/hw/nest.c
+++ b/hw/nest.c
@@ -38,6 +38,37 @@ struct nest_catalogue_ptr *c_ptr;
  */
 struct nest_catalog_page_0 *page0_ptr;
 
+/*
+ * Wrapper Function to call Corresponding Nest unit functions
+ * for event dt creation. Not all the Chip Groups in the Catalog are
+ * supported at this point.
+ */
+int dt_create_nest_chip_type (struct dt_node *ima,
+                struct nest_catalogue_group_data *gptr)
+{
+
+	return OPAL_SUCCESS;
+}
+
+int dt_create_nest_chip_types(struct dt_node *ima)
+{
+	struct nest_catalogue_group_data *group_ptr;
+	char *marker;
+	int rc = CHIP_EVENTS_NOT_SUPPORTED;
+
+	marker = CHIP_GROUP_ENTRY(c_ptr);
+	group_ptr = (struct nest_catalogue_group_data *) marker;
+	while (group_ptr->domain == DOMAIN_CHIP) {
+		rc = dt_create_nest_chip_type (ima, group_ptr);
+		if (rc)
+			break;
+		marker += group_ptr->length;
+		group_ptr = (struct nest_catalogue_group_data *) marker;
+	};
+
+	return rc;
+}
+
 int preload_catalogue_lid()
 {
 	size_t size = NEST_CATALOGUE_SIZE;
@@ -182,5 +213,8 @@ void nest_pmu_init(int loaded)
 		break;
 	}
 
+	if (dt_create_nest_chip_types(dev))
+		dt_free(dev);
+
 	return;
 }
-- 
1.9.1



More information about the Skiboot mailing list