mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/4] ARM: nxp-imx8mq-evk: clean up nxp_imx8mq_evk_start
Date: Thu, 19 Dec 2019 16:19:28 +0100	[thread overview]
Message-ID: <20191219151929.19521-3-l.stach@pengutronix.de> (raw)
In-Reply-To: <20191219151929.19521-1-l.stach@pengutronix.de>

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

  parent reply	other threads:[~2019-12-19 15:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191219151929.19521-3-l.stach@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox