[Skiboot] [RESEND PATCH v1 05/11]ibm-fsp/firenze: Nest unit parser function

Madhavan Srinivasan maddy at linux.vnet.ibm.com
Mon Jul 6 02:55:27 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      | 36 ++++++++++++++++++++++++++++++++++++
 include/nest.h |  3 +++
 2 files changed, 39 insertions(+)

diff --git a/hw/nest.c b/hw/nest.c
index 1798351..dd03c3a 100644
--- a/hw/nest.c
+++ b/hw/nest.c
@@ -32,6 +32,39 @@
 struct ima_catalog_page_0 *page0_ptr;
 struct page0_offsets *pg0_offsets;
 
+/*
+ * 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_ima_chip_type (struct dt_node *ima,
+		struct ima_catalogue_group_data *gptr)
+{
+	int rc;
+
+
+	return rc;
+}
+
+int dt_create_ima_chip_types(struct dt_node *ima)
+{
+        struct ima_catalogue_group_data *group_ptr;
+        char *marker;
+        int rc = CHIP_EVENTS_NOT_SUPPORTED;
+
+        marker = CHIP_GROUP_ENTRY(pg0_offsets);
+        group_ptr = (struct ima_catalogue_group_data *) marker;
+        while (group_ptr->domain == DOMAIN_CHIP) {
+                rc = dt_create_ima_chip_type (ima, group_ptr);
+                if (rc)
+                        break;
+                marker += group_ptr->length;
+                group_ptr = (struct ima_catalogue_group_data *) marker;
+        };
+
+        return rc;
+}
+
 int load_catalogue_lid()
 {
 	struct proc_chip *chip = get_chip(pir_to_chip_id(this_cpu()->pir));
@@ -164,5 +197,8 @@ void nest_ima_init(void)
 		break;
 	}
 
+	if (dt_create_ima_chip_types(dev))
+		dt_free(dev);
+
 	return;
 }
diff --git a/include/nest.h b/include/nest.h
index 368815b..413a89e 100644
--- a/include/nest.h
+++ b/include/nest.h
@@ -224,6 +224,9 @@ struct page0_offsets {
  * Function prototypes
  */
 int load_catalogue_lid(void);
+int dt_create_ima_chip_types(struct dt_node *);
+int dt_create_ima_chip_type (struct dt_node *,
+				struct ima_catalogue_group_data *);
 void nest_ima_init(void);
 
 #endif	/* __NEST_H__ */
-- 
1.9.3



More information about the Skiboot mailing list