summaryrefslogtreecommitdiff
path: root/drivers/firmware/firmware-zynqmp.c
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2020-04-27 11:51:40 +0200
committerMichal Simek <michal.simek@xilinx.com>2020-06-24 13:07:57 +0200
commit4c86e0834aeb3ae06389534ccbc90b8bcf5d95bf (patch)
tree3dee3c96bdbe3420540ec03c48aa9a26fefcc54a /drivers/firmware/firmware-zynqmp.c
parent2b2012d1c1d8515417ba139339d0aa9b47789dca (diff)
downloadu-boot-4c86e0834aeb3ae06389534ccbc90b8bcf5d95bf.tar.gz
u-boot-4c86e0834aeb3ae06389534ccbc90b8bcf5d95bf.tar.bz2
u-boot-4c86e0834aeb3ae06389534ccbc90b8bcf5d95bf.zip
firmware: zynqmp: Change panic logic in zynqmp_pmufw_load_config_object()
There is no need to panic all the time when pmufw config object loading failed. The patch improves function logic to report permission deny case and also panic only for SPL case. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Diffstat (limited to 'drivers/firmware/firmware-zynqmp.c')
-rw-r--r--drivers/firmware/firmware-zynqmp.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c
index 2bdf7771f6..66edc16930 100644
--- a/drivers/firmware/firmware-zynqmp.c
+++ b/drivers/firmware/firmware-zynqmp.c
@@ -18,6 +18,8 @@
#define PMUFW_PAYLOAD_ARG_CNT 8
+#define XST_PM_NO_ACCESS 2002L
+
struct zynqmp_power {
struct mbox_chan tx_chan;
struct mbox_chan rx_chan;
@@ -99,16 +101,25 @@ void zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size)
PM_SET_CONFIGURATION,
(u32)((u64)cfg_obj)
};
- u32 response;
+ u32 response = 0;
int err;
printf("Loading new PMUFW cfg obj (%ld bytes)\n", size);
err = send_req(request, ARRAY_SIZE(request), &response, 1);
+ if (err == XST_PM_NO_ACCESS) {
+ printf("PMUFW no permission to change config object\n");
+ return;
+ }
+
if (err)
- panic("Cannot load PMUFW configuration object (%d)\n", err);
- if (response != 0)
- panic("PMUFW returned 0x%08x status!\n", response);
+ printf("Cannot load PMUFW configuration object (%d)\n", err);
+
+ if (response)
+ printf("PMUFW returned 0x%08x status!\n", response);
+
+ if ((err || response) && IS_ENABLED(CONFIG_SPL_BUILD))
+ panic("PMUFW config object loading failed in EL3\n");
}
static int zynqmp_power_probe(struct udevice *dev)