@@ -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;
}
Patch adds catalog parser function to detect Nest units. Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> --- hw/nest.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)