[PATCH v2 1/3] firmware: zynqmp: Add config object support macro

Stefan Herbrechtsmeier stefan.herbrechtsmeier-oss at weidmueller.com
Wed Apr 19 11:04:15 CEST 2023


From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>

The driver uses a specific node id to detect if the pmufw support config
objects. Add a macro for the node id to ensure that it match at
different locations.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier at weidmueller.com>

---

Changes in v2:
- Added

 drivers/firmware/firmware-zynqmp.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c
index dc8e3ad2b9..baf5b0c253 100644
--- a/drivers/firmware/firmware-zynqmp.c
+++ b/drivers/firmware/firmware-zynqmp.c
@@ -19,6 +19,7 @@
 #include <asm/arch/sys_proto.h>

 #define PMUFW_PAYLOAD_ARG_CNT  8
+#define PMUFW_CFG_OBJ_SUPPORT_NODE     NODE_OCM_BANK_0

 #define XST_PM_NO_ACCESS       2002L
 #define XST_PM_ALREADY_CONFIGURED      2009L
@@ -82,7 +83,7 @@ int zynqmp_pmufw_node(u32 id)
        ret = zynqmp_pmufw_load_config_object(xpm_configobject,
                                              sizeof(xpm_configobject));

-       if (ret == XST_PM_NO_ACCESS && id == NODE_OCM_BANK_0)
+       if (ret == XST_PM_NO_ACCESS && id == PMUFW_CFG_OBJ_SUPPORT_NODE)
                skip_config = true;

        return 0;
@@ -251,7 +252,9 @@ int zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size)
        err = xilinx_pm_request(PM_SET_CONFIGURATION, (u32)(u64)cfg_obj, 0, 0,
                                0, ret_payload);
        if (err == XST_PM_NO_ACCESS) {
-               if (((u32 *)cfg_obj)[NODE_ID_LOCATION] == NODE_OCM_BANK_0) {
+               u32 id = ((u32 *)cfg_obj)[NODE_ID_LOCATION];
+
+               if (id == PMUFW_CFG_OBJ_SUPPORT_NODE) {
                        printf("PMUFW:  No permission to change config object\n");
                        return err;
                }
@@ -299,7 +302,7 @@ static int zynqmp_power_probe(struct udevice *dev)
               ret & ZYNQMP_PM_VERSION_MINOR_MASK);

        if (IS_ENABLED(CONFIG_ARCH_ZYNQMP))
-               zynqmp_pmufw_node(NODE_OCM_BANK_0);
+               zynqmp_pmufw_node(PMUFW_CFG_OBJ_SUPPORT_NODE);

        return 0;
 };
--
2.30.2

________________________________
Kommanditgesellschaft - Sitz: Detmold - Amtsgericht Lemgo HRA 2790 -
Komplementärin: Weidmüller Interface Führungsgesellschaft mbH -
Sitz: Detmold - Amtsgericht Lemgo HRB 3924;
Geschäftsführer: Dr. Timo Berger, Volker Bibelhausen, Dr. Sebastian Durst, André Sombecki;
USt-ID-Nr. DE124599660


More information about the U-Boot mailing list