mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/4] ARM: nxp-imx8mq-evk: switch to SPDX license header
@ 2019-12-19 15:19 Lucas Stach
  2019-12-19 15:19 ` [PATCH 2/4] ARM: nxp-imx8mq-evk: switch the PBL memcpy parameters to common variables Lucas Stach
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Lucas Stach @ 2019-12-19 15:19 UTC (permalink / raw)
  To: barebox

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boards/nxp-imx8mq-evk/lowlevel.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
index 9d060fb5890b..d2042bffcacc 100644
--- a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
+++ b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
@@ -1,13 +1,4 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; version 2.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- */
+// SPDX-License-Identifier: GPL-2.0
 
 #include <common.h>
 #include <linux/sizes.h>
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/4] ARM: nxp-imx8mq-evk: switch the PBL memcpy parameters to common variables
  2019-12-19 15:19 [PATCH 1/4] ARM: nxp-imx8mq-evk: switch to SPDX license header Lucas Stach
@ 2019-12-19 15:19 ` Lucas Stach
  2019-12-19 15:19 ` [PATCH 3/4] ARM: nxp-imx8mq-evk: clean up nxp_imx8mq_evk_start Lucas Stach
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Lucas Stach @ 2019-12-19 15:19 UTC (permalink / raw)
  To: barebox

Use the variables defined in sections.h, instead of hand rolling the
same computation.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boards/nxp-imx8mq-evk/lowlevel.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
index d2042bffcacc..c2f3071e3a9a 100644
--- a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
+++ b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
@@ -90,7 +90,8 @@ static __noreturn noinline void nxp_imx8mq_evk_start(void)
 		 * On completion the TF-A will jump to MX8MQ_ATF_BL33_BASE_ADDR in
 		 * EL2. Copy ourselves there.
 		 */
-		memcpy((void *)MX8MQ_ATF_BL33_BASE_ADDR, _text, __bss_start - _text);
+		memcpy((void *)MX8MQ_ATF_BL33_BASE_ADDR,
+		       __image_start, barebox_pbl_size);
 		imx8mq_atf_load_bl31(bl31, bl31_size);
 		/* not reached */
 	}
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 3/4] ARM: nxp-imx8mq-evk: clean up nxp_imx8mq_evk_start
  2019-12-19 15:19 [PATCH 1/4] ARM: nxp-imx8mq-evk: switch to SPDX license header Lucas Stach
  2019-12-19 15:19 ` [PATCH 2/4] ARM: nxp-imx8mq-evk: switch the PBL memcpy parameters to common variables Lucas Stach
@ 2019-12-19 15:19 ` Lucas Stach
  2019-12-19 15:19 ` [PATCH 4/4] ARM: nxp-imx8mq-evk: fix bootflow comment Lucas Stach
  2019-12-20 15:15 ` [PATCH 1/4] ARM: nxp-imx8mq-evk: switch to SPDX license header Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Lucas Stach @ 2019-12-19 15:19 UTC (permalink / raw)
  To: barebox

Mostly cosmetic changes:
- reduce scope of local variabes
- wrap comment to fir 80 char limit
- check return value from imx8_esdhc_load_piggy
- drop intermediate function that only wraps a single other function

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boards/nxp-imx8mq-evk/lowlevel.c | 24 +++++++++++------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
index c2f3071e3a9a..213ab7068271 100644
--- a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
+++ b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
@@ -42,11 +42,6 @@ static void setup_uart(void)
 	putc_ll('>');
 }
 
-static void nxp_imx8mq_evk_sram_setup(void)
-{
-	ddr_init();
-}
-
 /*
  * Power-on execution flow of start_nxp_imx8mq_evk() might not be
  * obvious for a very first read, so here's, hopefully helpful,
@@ -72,8 +67,6 @@ static __noreturn noinline void nxp_imx8mq_evk_start(void)
 	enum bootsource src = BOOTSOURCE_UNKNOWN;
 	int instance = BOOTSOURCE_INSTANCE_UNKNOWN;
 	int ret = -ENOTSUPP;
-	const u8 *bl31;
-	size_t bl31_size;
 
 	if (IS_ENABLED(CONFIG_DEBUG_LL))
 		setup_uart();
@@ -84,14 +77,18 @@ static __noreturn noinline void nxp_imx8mq_evk_start(void)
 	 * to DRAM in EL2.
 	 */
 	if (current_el() == 3) {
-		nxp_imx8mq_evk_sram_setup();
-		get_builtin_firmware(imx8mq_bl31_bin, &bl31, &bl31_size);
+		const u8 *bl31;
+		size_t bl31_size;
+
+		ddr_init();
 		/*
-		 * On completion the TF-A will jump to MX8MQ_ATF_BL33_BASE_ADDR in
-		 * EL2. Copy ourselves there.
+		 * On completion the TF-A will jump to MX8MQ_ATF_BL33_BASE_ADDR
+		 * in EL2. Copy ourselves there.
 		 */
 		memcpy((void *)MX8MQ_ATF_BL33_BASE_ADDR,
 		       __image_start, barebox_pbl_size);
+
+		get_builtin_firmware(imx8mq_bl31_bin, &bl31, &bl31_size);
 		imx8mq_atf_load_bl31(bl31, bl31_size);
 		/* not reached */
 	}
@@ -100,8 +97,9 @@ static __noreturn noinline void nxp_imx8mq_evk_start(void)
 
 	if (src == BOOTSOURCE_MMC)
 		ret = imx8_esdhc_load_piggy(instance);
-	else
-		BUG_ON(ret);
+
+	BUG_ON(ret);
+
 	/*
 	 * Standard entry we hit once we initialized both DDR and ATF
 	 */
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 4/4] ARM: nxp-imx8mq-evk: fix bootflow comment
  2019-12-19 15:19 [PATCH 1/4] ARM: nxp-imx8mq-evk: switch to SPDX license header Lucas Stach
  2019-12-19 15:19 ` [PATCH 2/4] ARM: nxp-imx8mq-evk: switch the PBL memcpy parameters to common variables Lucas Stach
  2019-12-19 15:19 ` [PATCH 3/4] ARM: nxp-imx8mq-evk: clean up nxp_imx8mq_evk_start Lucas Stach
@ 2019-12-19 15:19 ` Lucas Stach
  2019-12-20 15:15 ` [PATCH 1/4] ARM: nxp-imx8mq-evk: switch to SPDX license header Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Lucas Stach @ 2019-12-19 15:19 UTC (permalink / raw)
  To: barebox

The comment above nxp_imx8mq_evk_start is no longer accurate, as there
is no trampoline in DRAM anymore. Change the comment to reflect the current
boot flow.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boards/nxp-imx8mq-evk/lowlevel.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
index 213ab7068271..eb96c0805169 100644
--- a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
+++ b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
@@ -48,14 +48,13 @@ static void setup_uart(void)
  * summary:
  *
  * 1. MaskROM uploads PBL into OCRAM and that's where this function is
- *    executed for the first time
+ *    executed for the first time. At entry the exception level is EL3.
  *
- * 2. DDR is initialized and the TF-A trampoline is installed in the
- *    DRAM.
+ * 2. DDR is initialized and the PBL is copied from OCRAM to the TF-A return
+ *    address in DRAM.
  *
- * 3. TF-A is executed and exits into the trampoline in RAM, which enters the
- *    PBL for the second time. DRAM setup done is indicated by a one in register
- *    x0 by the trampoline
+ * 3. TF-A is executed and exits into the PBL code in DRAM. TF-A has taken us
+ *    from EL3 to EL2.
  *
  * 4. The piggydata is loaded from the SD card and copied to the expected
  *    location in the DRAM.
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 1/4] ARM: nxp-imx8mq-evk: switch to SPDX license header
  2019-12-19 15:19 [PATCH 1/4] ARM: nxp-imx8mq-evk: switch to SPDX license header Lucas Stach
                   ` (2 preceding siblings ...)
  2019-12-19 15:19 ` [PATCH 4/4] ARM: nxp-imx8mq-evk: fix bootflow comment Lucas Stach
@ 2019-12-20 15:15 ` Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2019-12-20 15:15 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox

On Thu, Dec 19, 2019 at 04:19:26PM +0100, Lucas Stach wrote:
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  arch/arm/boards/nxp-imx8mq-evk/lowlevel.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2019-12-20 15:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19 15:19 [PATCH 1/4] ARM: nxp-imx8mq-evk: switch to SPDX license header Lucas Stach
2019-12-19 15:19 ` [PATCH 2/4] ARM: nxp-imx8mq-evk: switch the PBL memcpy parameters to common variables Lucas Stach
2019-12-19 15:19 ` [PATCH 3/4] ARM: nxp-imx8mq-evk: clean up nxp_imx8mq_evk_start Lucas Stach
2019-12-19 15:19 ` [PATCH 4/4] ARM: nxp-imx8mq-evk: fix bootflow comment Lucas Stach
2019-12-20 15:15 ` [PATCH 1/4] ARM: nxp-imx8mq-evk: switch to SPDX license header Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox