* [PATCH 0/2] add platform check in event manager driver
@ 2023-12-18 9:40 Jay Buddhabhatti
2023-12-18 9:40 ` [PATCH 1/2] firmware: xilinx: Export function to use in other module Jay Buddhabhatti
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jay Buddhabhatti @ 2023-12-18 9:40 UTC (permalink / raw)
To: michal.simek, gregkh, sai.krishna.potthuri, linus.walleij,
nava.kishore.manne, dhaval.r.shah, robh, marex, roman.gushchin,
arnd, shubhrajyoti.datta
Cc: linux-arm-kernel, linux-kernel, Jay Buddhabhatti
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 Versal or Versal NET
platform and check error IDs for respective platforms.
Jay Buddhabhatti (2):
firmware: xilinx: Export function to use in other module
drivers: soc: xilinx: add check for platform
drivers/firmware/xilinx/zynqmp.c | 3 ++-
drivers/soc/xilinx/xlnx_event_manager.c | 25 ++++++++++++++++++++-----
include/linux/firmware/xlnx-zynqmp.h | 22 ++++++++++++++++++----
3 files changed, 40 insertions(+), 10 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] firmware: xilinx: Export function to use in other module
2023-12-18 9:40 [PATCH 0/2] add platform check in event manager driver Jay Buddhabhatti
@ 2023-12-18 9:40 ` Jay Buddhabhatti
2023-12-18 9:40 ` [PATCH 2/2] drivers: soc: xilinx: add check for platform Jay Buddhabhatti
2023-12-18 10:56 ` [PATCH 0/2] add platform check in event manager driver Michal Simek
2 siblings, 0 replies; 4+ messages in thread
From: Jay Buddhabhatti @ 2023-12-18 9:40 UTC (permalink / raw)
To: michal.simek, gregkh, sai.krishna.potthuri, linus.walleij,
nava.kishore.manne, dhaval.r.shah, robh, marex, roman.gushchin,
arnd, shubhrajyoti.datta
Cc: linux-arm-kernel, linux-kernel, Jay Buddhabhatti
Export zynqmp_pm_get_family_info() to access and find family information
in other module.
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
---
drivers/firmware/xilinx/zynqmp.c | 3 ++-
include/linux/firmware/xlnx-zynqmp.h | 6 ++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
index b0d22d4455d9..313965f79dd7 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -414,7 +414,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_get_chipid);
*
* Return: Returns status, either success or error+reason
*/
-static int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily)
+int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily)
{
u32 ret_payload[PAYLOAD_ARG_CNT];
u32 idcode;
@@ -439,6 +439,7 @@ static int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily)
return 0;
}
+EXPORT_SYMBOL_GPL(zynqmp_pm_get_family_info);
/**
* zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version
diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h
index d1ea3898564c..2375ce9b38df 100644
--- a/include/linux/firmware/xlnx-zynqmp.h
+++ b/include/linux/firmware/xlnx-zynqmp.h
@@ -515,6 +515,7 @@ int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1,
#if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE)
int zynqmp_pm_get_api_version(u32 *version);
int zynqmp_pm_get_chipid(u32 *idcode, u32 *version);
+int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily);
int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out);
int zynqmp_pm_clock_enable(u32 clock_id);
int zynqmp_pm_clock_disable(u32 clock_id);
@@ -596,6 +597,11 @@ static inline int zynqmp_pm_get_chipid(u32 *idcode, u32 *version)
return -ENODEV;
}
+static inline int zynqmp_pm_get_family_info(u32 *family, u32 *subfamily)
+{
+ return -ENODEV;
+}
+
static inline int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata,
u32 *out)
{
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] drivers: soc: xilinx: add check for platform
2023-12-18 9:40 [PATCH 0/2] add platform check in event manager driver Jay Buddhabhatti
2023-12-18 9:40 ` [PATCH 1/2] firmware: xilinx: Export function to use in other module Jay Buddhabhatti
@ 2023-12-18 9:40 ` Jay Buddhabhatti
2023-12-18 10:56 ` [PATCH 0/2] add platform check in event manager driver Michal Simek
2 siblings, 0 replies; 4+ messages in thread
From: Jay Buddhabhatti @ 2023-12-18 9:40 UTC (permalink / raw)
To: michal.simek, gregkh, sai.krishna.potthuri, linus.walleij,
nava.kishore.manne, dhaval.r.shah, robh, marex, roman.gushchin,
arnd, shubhrajyoti.datta
Cc: linux-arm-kernel, linux-kernel, Jay Buddhabhatti
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 Versal or Versal NET
platform and check error IDs for respective platforms.
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
---
drivers/soc/xilinx/xlnx_event_manager.c | 25 ++++++++++++++++++++-----
include/linux/firmware/xlnx-zynqmp.h | 16 ++++++++++++----
2 files changed, 32 insertions(+), 9 deletions(-)
diff --git a/drivers/soc/xilinx/xlnx_event_manager.c b/drivers/soc/xilinx/xlnx_event_manager.c
index 86a048a10a13..78f9a3c6ae11 100644
--- a/drivers/soc/xilinx/xlnx_event_manager.c
+++ b/drivers/soc/xilinx/xlnx_event_manager.c
@@ -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;
}
diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h
index 2375ce9b38df..2cfd78f232dc 100644
--- a/include/linux/firmware/xlnx-zynqmp.h
+++ b/include/linux/firmware/xlnx-zynqmp.h
@@ -91,10 +91,18 @@
/*
* 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
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] add platform check in event manager driver
2023-12-18 9:40 [PATCH 0/2] add platform check in event manager driver Jay Buddhabhatti
2023-12-18 9:40 ` [PATCH 1/2] firmware: xilinx: Export function to use in other module Jay Buddhabhatti
2023-12-18 9:40 ` [PATCH 2/2] drivers: soc: xilinx: add check for platform Jay Buddhabhatti
@ 2023-12-18 10:56 ` Michal Simek
2 siblings, 0 replies; 4+ messages in thread
From: Michal Simek @ 2023-12-18 10:56 UTC (permalink / raw)
To: Jay Buddhabhatti, gregkh, sai.krishna.potthuri, linus.walleij,
nava.kishore.manne, dhaval.r.shah, robh, marex, roman.gushchin,
arnd, shubhrajyoti.datta
Cc: linux-arm-kernel, linux-kernel
On 12/18/23 10:40, Jay Buddhabhatti wrote:
> 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 Versal or Versal NET
> platform and check error IDs for respective platforms.
>
> Jay Buddhabhatti (2):
> firmware: xilinx: Export function to use in other module
> drivers: soc: xilinx: add check for platform
>
> drivers/firmware/xilinx/zynqmp.c | 3 ++-
> drivers/soc/xilinx/xlnx_event_manager.c | 25 ++++++++++++++++++++-----
> include/linux/firmware/xlnx-zynqmp.h | 22 ++++++++++++++++++----
> 3 files changed, 40 insertions(+), 10 deletions(-)
>
Acked-by: Michal Simek <michal.simek@amd.com>
Thanks,
Michal
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-18 10:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-18 9:40 [PATCH 0/2] add platform check in event manager driver Jay Buddhabhatti
2023-12-18 9:40 ` [PATCH 1/2] firmware: xilinx: Export function to use in other module Jay Buddhabhatti
2023-12-18 9:40 ` [PATCH 2/2] drivers: soc: xilinx: add check for platform Jay Buddhabhatti
2023-12-18 10:56 ` [PATCH 0/2] add platform check in event manager driver Michal Simek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®