From 380bd08370b363a4bfe76e70fbbaead10541445b Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 18 Nov 2021 13:00:02 +0100 Subject: xilinx: firmware: Move dcache handling directly to pmufw load config Core function should make sure that data is stored properly that's why move cache operations directly to zynqmp_pmufw_load_config_object() to be able to call it from other functions. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/8c92edd3650ce34a3cfd1c1e4e9103980830b1fa.1637236800.git.michal.simek@xilinx.com --- drivers/firmware/firmware-zynqmp.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/firmware') diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index b44fede3079..aa20e33b404 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -99,6 +100,8 @@ void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size) printf("Loading new PMUFW cfg obj (%ld bytes)\n", size); + flush_dcache_range((ulong)cfg_obj, (ulong)(cfg_obj + size)); + err = xilinx_pm_request(PM_SET_CONFIGURATION, (u32)(u64)cfg_obj, 0, 0, 0, ret_payload); if (err == XST_PM_NO_ACCESS) { -- cgit v1.2.3 From 12662e7034b4b6e070830e074f1cfab139dd21d6 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 14 Jan 2022 13:25:36 +0100 Subject: firmware: zynqmp: Move loading message to debug Power domain driver is using this function for every IP which is PD listed. This can end up with a lot of messages which end up in boot log. That's why show it only in EL3 as was used in past. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/d73fc8bc663110b6e8d5e70fdb6435d1199e9db8.1642163135.git.michal.simek@xilinx.com --- drivers/firmware/firmware-zynqmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/firmware') diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index aa20e33b404..18a092c7b45 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -98,7 +98,8 @@ void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size) int err; u32 ret_payload[PAYLOAD_ARG_CNT]; - printf("Loading new PMUFW cfg obj (%ld bytes)\n", size); + if (IS_ENABLED(CONFIG_SPL_BUILD)) + printf("Loading new PMUFW cfg obj (%ld bytes)\n", size); flush_dcache_range((ulong)cfg_obj, (ulong)(cfg_obj + size)); -- cgit v1.2.3 From 11c07719d58d4627e21fc59f5ab58f85edd5c024 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 14 Jan 2022 13:25:37 +0100 Subject: firmware: zynqmp: Do not report error if node is already configured Power domain driver sends PM fragment to PMUFW. It is sent for every node which is listed in DT. But some nodes could be already enabled but driver is not capable to find it out. That's why it blinly sents request for every listed IP. When PMUFW response by XST_PM_ALREADY_CONFIGURED error code there is no need to show any error message because node is already enabled. That's why cover this case with message when DEBUG is enabled. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/8c15ef0b68cf191f693d3d010f70ac24cfd8171f.1642163135.git.michal.simek@xilinx.com --- drivers/firmware/firmware-zynqmp.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/firmware') diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c index 18a092c7b45..839203ec82a 100644 --- a/drivers/firmware/firmware-zynqmp.c +++ b/drivers/firmware/firmware-zynqmp.c @@ -20,6 +20,7 @@ #define PMUFW_PAYLOAD_ARG_CNT 8 #define XST_PM_NO_ACCESS 2002L +#define XST_PM_ALREADY_CONFIGURED 2009L struct zynqmp_power { struct mbox_chan tx_chan; @@ -110,6 +111,11 @@ void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size) return; } + if (err == XST_PM_ALREADY_CONFIGURED) { + debug("PMUFW Node is already configured\n"); + return; + } + if (err) printf("Cannot load PMUFW configuration object (%d)\n", err); -- cgit v1.2.3