* [PATCH] Bugfix in xilinx_pm_request: add handling of the NULL return payload pointer.
@ 2021-10-13 14:31 Adrian Fiergolski
2021-10-13 15:31 ` Michal Simek
0 siblings, 1 reply; 2+ messages in thread
From: Adrian Fiergolski @ 2021-10-13 14:31 UTC (permalink / raw)
To: u-boot; +Cc: michal.simek, Adrian Fiergolski
Signed-off-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
---
drivers/firmware/firmware-zynqmp.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c
index d4dc856baf..7517a84f0e 100644
--- a/drivers/firmware/firmware-zynqmp.c
+++ b/drivers/firmware/firmware-zynqmp.c
@@ -154,16 +154,24 @@ U_BOOT_DRIVER(zynqmp_power) = {
int __maybe_unused xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2,
u32 arg3, u32 *ret_payload)
{
+#if defined(CONFIG_ZYNQMP_IPI)
+ /*
+ * Use fixed payload and arg size as the EL2 call. The firmware
+ * is capable to handle PMUFW_PAYLOAD_ARG_CNT bytes but the
+ * firmware API is limited by the SMC call size
+ */
+ u32 regs[] = {api_id, arg0, arg1, arg2, arg3};
+
+ /*
+ * Use regs array in case ret_payload is NULL
+ */
+ if (ret_payload == NULL)
+ ret_payload = regs;
+#endif
debug("%s at EL%d, API ID: 0x%0x\n", __func__, current_el(), api_id);
if (IS_ENABLED(CONFIG_SPL_BUILD) || current_el() == 3) {
#if defined(CONFIG_ZYNQMP_IPI)
- /*
- * Use fixed payload and arg size as the EL2 call. The firmware
- * is capable to handle PMUFW_PAYLOAD_ARG_CNT bytes but the
- * firmware API is limited by the SMC call size
- */
- u32 regs[] = {api_id, arg0, arg1, arg2, arg3};
if (api_id == PM_FPGA_LOAD) {
/* Swap addr_hi/low because of incompatibility */
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Bugfix in xilinx_pm_request: add handling of the NULL return payload pointer.
2021-10-13 14:31 [PATCH] Bugfix in xilinx_pm_request: add handling of the NULL return payload pointer Adrian Fiergolski
@ 2021-10-13 15:31 ` Michal Simek
0 siblings, 0 replies; 2+ messages in thread
From: Michal Simek @ 2021-10-13 15:31 UTC (permalink / raw)
To: Adrian Fiergolski, u-boot; +Cc: michal.simek
Please fix subject just to be aligned with other patches.
Take a look at git log drivers/firmware/firmware-zynqmp.c for inspiration.
And I am missing description which says why you are doing this change.
Thanks,
Michal
On 10/13/21 16:31, Adrian Fiergolski wrote:
> Signed-off-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
> ---
> drivers/firmware/firmware-zynqmp.c | 20 ++++++++++++++------
> 1 file changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c
> index d4dc856baf..7517a84f0e 100644
> --- a/drivers/firmware/firmware-zynqmp.c
> +++ b/drivers/firmware/firmware-zynqmp.c
> @@ -154,16 +154,24 @@ U_BOOT_DRIVER(zynqmp_power) = {
> int __maybe_unused xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2,
> u32 arg3, u32 *ret_payload)
> {
> +#if defined(CONFIG_ZYNQMP_IPI)
> + /*
> + * Use fixed payload and arg size as the EL2 call. The firmware
> + * is capable to handle PMUFW_PAYLOAD_ARG_CNT bytes but the
> + * firmware API is limited by the SMC call size
> + */
> + u32 regs[] = {api_id, arg0, arg1, arg2, arg3};
> +
> + /*
> + * Use regs array in case ret_payload is NULL
> + */
> + if (ret_payload == NULL)
> + ret_payload = regs;
> +#endif
> debug("%s at EL%d, API ID: 0x%0x\n", __func__, current_el(), api_id);
>
> if (IS_ENABLED(CONFIG_SPL_BUILD) || current_el() == 3) {
> #if defined(CONFIG_ZYNQMP_IPI)
> - /*
> - * Use fixed payload and arg size as the EL2 call. The firmware
> - * is capable to handle PMUFW_PAYLOAD_ARG_CNT bytes but the
> - * firmware API is limited by the SMC call size
> - */
> - u32 regs[] = {api_id, arg0, arg1, arg2, arg3};
>
> if (api_id == PM_FPGA_LOAD) {
> /* Swap addr_hi/low because of incompatibility */
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-13 15:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 14:31 [PATCH] Bugfix in xilinx_pm_request: add handling of the NULL return payload pointer Adrian Fiergolski
2021-10-13 15:31 ` Michal Simek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).