]> Git Repo - J-linux.git/commitdiff
drivers: soc: xilinx: add check for platform
authorJay Buddhabhatti <[email protected]>
Tue, 19 Dec 2023 05:50:25 +0000 (21:50 -0800)
committerGreg Kroah-Hartman <[email protected]>
Thu, 4 Jan 2024 16:02:49 +0000 (17:02 +0100)
Some error event IDs for Versal and Versal NET are different.
Both the platforms should access their respective error event
IDs so use sub_family_code to check for platform and check
error IDs for respective platforms. The family code is passed
via platform data to avoid platform detection again.
Platform data is setup when even driver is registered.

Signed-off-by: Jay Buddhabhatti <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/edac/versal_edac.c
drivers/soc/xilinx/xlnx_event_manager.c
include/linux/firmware/xlnx-zynqmp.h

index 87e730dfefa08d89cae6487726e264d6dd945451..116ed9b375de7655ded881eb815e9c550a4d1a79 100644 (file)
@@ -1005,7 +1005,7 @@ static int mc_probe(struct platform_device *pdev)
                goto free_edac_mc;
        }
 
-       rc = xlnx_register_event(PM_NOTIFY_CB, EVENT_ERROR_PMC_ERR1,
+       rc = xlnx_register_event(PM_NOTIFY_CB, VERSAL_EVENT_ERROR_PMC_ERR1,
                                 XPM_EVENT_ERROR_MASK_DDRMC_CR | XPM_EVENT_ERROR_MASK_DDRMC_NCR |
                                 XPM_EVENT_ERROR_MASK_NOC_CR | XPM_EVENT_ERROR_MASK_NOC_NCR,
                                 false, err_callback, mci);
@@ -1042,7 +1042,7 @@ static int mc_remove(struct platform_device *pdev)
        debugfs_remove_recursive(priv->debugfs);
 #endif
 
-       xlnx_unregister_event(PM_NOTIFY_CB, EVENT_ERROR_PMC_ERR1,
+       xlnx_unregister_event(PM_NOTIFY_CB, VERSAL_EVENT_ERROR_PMC_ERR1,
                              XPM_EVENT_ERROR_MASK_DDRMC_CR |
                              XPM_EVENT_ERROR_MASK_NOC_CR |
                              XPM_EVENT_ERROR_MASK_NOC_NCR |
index 27a8d89a0a091ff36c4edf8f4e35cc745308e406..2ce4c8e01f57ccba709e9ff13258553897957b8e 100644 (file)
@@ -77,11 +77,26 @@ struct registered_event_data {
 
 static bool xlnx_is_error_event(const u32 node_id)
 {
-       if (node_id == EVENT_ERROR_PMC_ERR1 ||
-           node_id == EVENT_ERROR_PMC_ERR2 ||
-           node_id == EVENT_ERROR_PSM_ERR1 ||
-           node_id == EVENT_ERROR_PSM_ERR2)
-               return true;
+       u32 pm_family_code, pm_sub_family_code;
+
+       zynqmp_pm_get_family_info(&pm_family_code, &pm_sub_family_code);
+
+       if (pm_sub_family_code == VERSAL_SUB_FAMILY_CODE) {
+               if (node_id == VERSAL_EVENT_ERROR_PMC_ERR1 ||
+                   node_id == VERSAL_EVENT_ERROR_PMC_ERR2 ||
+                   node_id == VERSAL_EVENT_ERROR_PSM_ERR1 ||
+                   node_id == VERSAL_EVENT_ERROR_PSM_ERR2)
+                       return true;
+       } else {
+               if (node_id == VERSAL_NET_EVENT_ERROR_PMC_ERR1 ||
+                   node_id == VERSAL_NET_EVENT_ERROR_PMC_ERR2 ||
+                   node_id == VERSAL_NET_EVENT_ERROR_PMC_ERR3 ||
+                   node_id == VERSAL_NET_EVENT_ERROR_PSM_ERR1 ||
+                   node_id == VERSAL_NET_EVENT_ERROR_PSM_ERR2 ||
+                   node_id == VERSAL_NET_EVENT_ERROR_PSM_ERR3 ||
+                   node_id == VERSAL_NET_EVENT_ERROR_PSM_ERR4)
+                       return true;
+       }
 
        return false;
 }
index 06f4e6eaf13e52c018c923f4190b104935126596..9a7e527392512c69955ab015ac9f9f5273c4c65f 100644 (file)
 /*
  * Node IDs for the Error Events.
  */
-#define EVENT_ERROR_PMC_ERR1   (0x28100000U)
-#define EVENT_ERROR_PMC_ERR2   (0x28104000U)
-#define EVENT_ERROR_PSM_ERR1   (0x28108000U)
-#define EVENT_ERROR_PSM_ERR2   (0x2810C000U)
+#define VERSAL_EVENT_ERROR_PMC_ERR1    (0x28100000U)
+#define VERSAL_EVENT_ERROR_PMC_ERR2    (0x28104000U)
+#define VERSAL_EVENT_ERROR_PSM_ERR1    (0x28108000U)
+#define VERSAL_EVENT_ERROR_PSM_ERR2    (0x2810C000U)
+
+#define VERSAL_NET_EVENT_ERROR_PMC_ERR1        (0x28100000U)
+#define VERSAL_NET_EVENT_ERROR_PMC_ERR2        (0x28104000U)
+#define VERSAL_NET_EVENT_ERROR_PMC_ERR3        (0x28108000U)
+#define VERSAL_NET_EVENT_ERROR_PSM_ERR1        (0x2810C000U)
+#define VERSAL_NET_EVENT_ERROR_PSM_ERR2        (0x28110000U)
+#define VERSAL_NET_EVENT_ERROR_PSM_ERR3        (0x28114000U)
+#define VERSAL_NET_EVENT_ERROR_PSM_ERR4        (0x28118000U)
 
 /* ZynqMP SD tap delay tuning */
 #define SD_ITAPDLY     0xFF180314
This page took 0.056999 seconds and 4 git commands to generate.