All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] arm64: zynqmp: Add support for running U-Boot in EL3 again
@ 2020-03-23 13:57 Michal Simek
  2020-03-23 13:57 ` [PATCH 1/3] firmware: zynqmp: Enable IPI code calling also in EL3 Michal Simek
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Michal Simek @ 2020-03-23 13:57 UTC (permalink / raw)
  To: u-boot

Hi,

in past without PMU fw it was possible to run U-Boot in EL3. Firmware
changes made ATF required that's why generation was done like this.
But some recent changes (especially passing PMUFW object to PMU from SPL)
introduce the whole infrastructure for talking to PMU via IPI interface.
That's why this interface can be reused and run U-Boot in EL3 again.

Based on it I have fixed mkimage_fit_atf.sh script to generate
u-boot.its/itb based on ATF availability but still producing working image
without it.

Also found two issues which should be fixed to get U-Boot work in EL3.

Thanks,
Michal


Michal Simek (3):
  firmware: zynqmp: Enable IPI code calling also in EL3
  arm64: zynqmp: Reorder parameters for zynqmp_mmio_write()
  arm64: zynqmp: Add support for u-boot.itb generation without ATF

 arch/arm/mach-zynqmp/mkimage_fit_atf.sh | 16 ++++++++++++----
 board/xilinx/zynqmp/zynqmp.c            |  2 +-
 drivers/firmware/firmware-zynqmp.c      |  2 +-
 3 files changed, 14 insertions(+), 6 deletions(-)

-- 
2.25.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] firmware: zynqmp: Enable IPI code calling also in EL3
  2020-03-23 13:57 [PATCH 0/3] arm64: zynqmp: Add support for running U-Boot in EL3 again Michal Simek
@ 2020-03-23 13:57 ` Michal Simek
  2020-03-23 13:57 ` [PATCH 2/3] arm64: zynqmp: Reorder parameters for zynqmp_mmio_write() Michal Simek
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2020-03-23 13:57 UTC (permalink / raw)
  To: u-boot

U-Boot proper can still run in EL3 without using firmware interface wired
via ATF. For supporting this use case there is a need to check EL level
where U-Boot runs and based on that choose the way how to talk to firmware.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/firmware/firmware-zynqmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c
index 2a2aa2f4f169..c37642569dda 100644
--- a/drivers/firmware/firmware-zynqmp.c
+++ b/drivers/firmware/firmware-zynqmp.c
@@ -51,7 +51,7 @@ static int ipi_req(const u32 *req, size_t req_len, u32 *res, size_t res_maxlen)
 
 static int send_req(const u32 *req, size_t req_len, u32 *res, size_t res_maxlen)
 {
-	if (IS_ENABLED(CONFIG_SPL_BUILD))
+	if (IS_ENABLED(CONFIG_SPL_BUILD) || current_el() == 3)
 		return ipi_req(req, req_len, res, res_maxlen);
 
 	return xilinx_pm_request(req[0], 0, 0, 0, 0, res);
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] arm64: zynqmp: Reorder parameters for zynqmp_mmio_write()
  2020-03-23 13:57 [PATCH 0/3] arm64: zynqmp: Add support for running U-Boot in EL3 again Michal Simek
  2020-03-23 13:57 ` [PATCH 1/3] firmware: zynqmp: Enable IPI code calling also in EL3 Michal Simek
@ 2020-03-23 13:57 ` Michal Simek
  2020-03-23 13:58 ` [PATCH 3/3] arm64: zynqmp: Add support for u-boot.itb generation without ATF Michal Simek
  2020-04-06 11:08 ` [PATCH 0/3] arm64: zynqmp: Add support for running U-Boot in EL3 again Michal Simek
  3 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2020-03-23 13:57 UTC (permalink / raw)
  To: u-boot

Parameter order is not correct based on zynqmp_mmio_write() declaration.

Fixes: be52372ff1bb ("arm64: zynqmp: Use zynqmp_mmio_read/write functions")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 board/xilinx/zynqmp/zynqmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index eb1bc0861e2f..3c92b1a5825f 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -515,7 +515,7 @@ static int reset_reason(void)
 
 	env_set("reset_reason", reason);
 
-	ret = zynqmp_mmio_write(~0, ~0, (ulong)&crlapb_base->reset_reason);
+	ret = zynqmp_mmio_write((ulong)&crlapb_base->reset_reason, ~0, ~0);
 	if (ret)
 		return -EINVAL;
 
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] arm64: zynqmp: Add support for u-boot.itb generation without ATF
  2020-03-23 13:57 [PATCH 0/3] arm64: zynqmp: Add support for running U-Boot in EL3 again Michal Simek
  2020-03-23 13:57 ` [PATCH 1/3] firmware: zynqmp: Enable IPI code calling also in EL3 Michal Simek
  2020-03-23 13:57 ` [PATCH 2/3] arm64: zynqmp: Reorder parameters for zynqmp_mmio_write() Michal Simek
@ 2020-03-23 13:58 ` Michal Simek
  2020-04-06 11:08 ` [PATCH 0/3] arm64: zynqmp: Add support for running U-Boot in EL3 again Michal Simek
  3 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2020-03-23 13:58 UTC (permalink / raw)
  To: u-boot

If ATF doesn't exist generate u-boot.itb without it and let U-Boot run in
EL3. Still keep warning to let user know that ATF/BL31 is missing.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 arch/arm/mach-zynqmp/mkimage_fit_atf.sh | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-zynqmp/mkimage_fit_atf.sh b/arch/arm/mach-zynqmp/mkimage_fit_atf.sh
index 1e770ba111d3..e221e92828ad 100755
--- a/arch/arm/mach-zynqmp/mkimage_fit_atf.sh
+++ b/arch/arm/mach-zynqmp/mkimage_fit_atf.sh
@@ -29,11 +29,8 @@ else
 fi
 
 if [ ! -f $BL31 ]; then
-	echo "WARNING: BL31 file $BL31 NOT found, resulting binary is non-functional" >&2
+	echo "WARNING: BL31 file $BL31 NOT found, U-Boot will run in EL3" >&2
 	BL31=/dev/null
-	# But U-Boot proper could be loaded in EL3 by specifying
-	# firmware = "uboot";
-	# instead of "atf" in config node
 fi
 
 cat << __HEADER_EOF
@@ -106,6 +103,15 @@ __CONF_HEADER_EOF
 cnt=1
 for dtname in $DT
 do
+if [ ! -f $BL31 ]; then
+cat << __CONF_SECTION1_EOF
+		config_$cnt {
+			description = "$(basename $dtname .dtb)";
+			firmware = "uboot";
+			fdt = "fdt_$cnt";
+		};
+__CONF_SECTION1_EOF
+else
 cat << __CONF_SECTION1_EOF
 		config_$cnt {
 			description = "$(basename $dtname .dtb)";
@@ -114,6 +120,8 @@ cat << __CONF_SECTION1_EOF
 			fdt = "fdt_$cnt";
 		};
 __CONF_SECTION1_EOF
+fi
+
 cnt=$((cnt+1))
 done
 
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 0/3] arm64: zynqmp: Add support for running U-Boot in EL3 again
  2020-03-23 13:57 [PATCH 0/3] arm64: zynqmp: Add support for running U-Boot in EL3 again Michal Simek
                   ` (2 preceding siblings ...)
  2020-03-23 13:58 ` [PATCH 3/3] arm64: zynqmp: Add support for u-boot.itb generation without ATF Michal Simek
@ 2020-04-06 11:08 ` Michal Simek
  3 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2020-04-06 11:08 UTC (permalink / raw)
  To: u-boot

po 23. 3. 2020 v 14:58 odes?latel Michal Simek <michal.simek@xilinx.com> napsal:
>
> Hi,
>
> in past without PMU fw it was possible to run U-Boot in EL3. Firmware
> changes made ATF required that's why generation was done like this.
> But some recent changes (especially passing PMUFW object to PMU from SPL)
> introduce the whole infrastructure for talking to PMU via IPI interface.
> That's why this interface can be reused and run U-Boot in EL3 again.
>
> Based on it I have fixed mkimage_fit_atf.sh script to generate
> u-boot.its/itb based on ATF availability but still producing working image
> without it.
>
> Also found two issues which should be fixed to get U-Boot work in EL3.
>
> Thanks,
> Michal
>
>
> Michal Simek (3):
>   firmware: zynqmp: Enable IPI code calling also in EL3
>   arm64: zynqmp: Reorder parameters for zynqmp_mmio_write()
>   arm64: zynqmp: Add support for u-boot.itb generation without ATF
>
>  arch/arm/mach-zynqmp/mkimage_fit_atf.sh | 16 ++++++++++++----
>  board/xilinx/zynqmp/zynqmp.c            |  2 +-
>  drivers/firmware/firmware-zynqmp.c      |  2 +-
>  3 files changed, 14 insertions(+), 6 deletions(-)
>
> --
> 2.25.1
>

Applied all.
M

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-06 11:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23 13:57 [PATCH 0/3] arm64: zynqmp: Add support for running U-Boot in EL3 again Michal Simek
2020-03-23 13:57 ` [PATCH 1/3] firmware: zynqmp: Enable IPI code calling also in EL3 Michal Simek
2020-03-23 13:57 ` [PATCH 2/3] arm64: zynqmp: Reorder parameters for zynqmp_mmio_write() Michal Simek
2020-03-23 13:58 ` [PATCH 3/3] arm64: zynqmp: Add support for u-boot.itb generation without ATF Michal Simek
2020-04-06 11:08 ` [PATCH 0/3] arm64: zynqmp: Add support for running U-Boot in EL3 again Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.