mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Joacim Zetterling <joacim.zetterling@westermo.com>
To: barebox@lists.infradead.org
Cc: a.fatoum@pengutronix.de
Subject: [PATCH 3/3] arch: arm: imx: spi: Add QSPI boot option to the IMX8MN-EVK
Date: Tue,  8 Mar 2022 17:08:01 +0100	[thread overview]
Message-ID: <20220308160801.782206-4-joacim.zetterling@westermo.com> (raw)
In-Reply-To: <20220308160801.782206-1-joacim.zetterling@westermo.com>

Add lowlevel board functionality to be able to boot from
a QSPI device.

Also added configuration parameters for a QSPI device to be
included in a final QSPI boot image.
All configuration for a QSPI boot image are controlled within
the board flash header configuration file.

Signed-off-by: Joacim Zetterling <joacim.zetterling@westermo.com>
---
 .../nxp-imx8mn-evk/bb-cfg-param-imx8mn-evk.bin    | Bin 0 -> 512 bytes
 .../nxp-imx8mn-evk/flash-header-imx8mn-evk.imxcfg |   5 +++++
 arch/arm/boards/nxp-imx8mn-evk/lowlevel.c         |   3 +++
 3 files changed, 8 insertions(+)
 create mode 100644 arch/arm/boards/nxp-imx8mn-evk/bb-cfg-param-imx8mn-evk.bin

diff --git a/arch/arm/boards/nxp-imx8mn-evk/bb-cfg-param-imx8mn-evk.bin b/arch/arm/boards/nxp-imx8mn-evk/bb-cfg-param-imx8mn-evk.bin
new file mode 100644
index 0000000000000000000000000000000000000000..b39e85b8442f27660eb8d797233cdcc02759bc0e
GIT binary patch
literal 512
zcmZ>Bc5`B2U<_jb0cK_}MJmC_$b_s#0GUIG&CMdg!C}CnLP*`HJb@5k1j&O50t!*3
E0ni%)6aWAK

literal 0
HcmV?d00001

diff --git a/arch/arm/boards/nxp-imx8mn-evk/flash-header-imx8mn-evk.imxcfg b/arch/arm/boards/nxp-imx8mn-evk/flash-header-imx8mn-evk.imxcfg
index 27a2138e4322..232ce5f59bdf 100644
--- a/arch/arm/boards/nxp-imx8mn-evk/flash-header-imx8mn-evk.imxcfg
+++ b/arch/arm/boards/nxp-imx8mn-evk/flash-header-imx8mn-evk.imxcfg
@@ -5,3 +5,8 @@ soc imx8mn
 loadaddr 0x912000
 max_load_size 0x3f000
 ivtofs 0x0
+
+# Uncomment the following for QSPI boot
+# header_gap 0x1000
+# bb_cfg_ofs 0x400
+# bb_cfg_file "arch/arm/boards/nxp-imx8mn-evk/bb-cfg-param-imx8mn-evk.bin"
diff --git a/arch/arm/boards/nxp-imx8mn-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mn-evk/lowlevel.c
index de53213ebc77..c8a43e48c085 100644
--- a/arch/arm/boards/nxp-imx8mn-evk/lowlevel.c
+++ b/arch/arm/boards/nxp-imx8mn-evk/lowlevel.c
@@ -170,6 +170,9 @@ static void start_atf(void)
 	case BOOTSOURCE_MMC:
 		imx8mn_esdhc_load_image(instance, false);
 		break;
+	case BOOTSOURCE_SPI:
+		imx8mn_qspi_start_image(0, false);
+		break;
 	default:
 		printf("Unhandled bootsource BOOTSOURCE_%d\n", src);
 		hang();
-- 
2.25.1


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


  parent reply	other threads:[~2022-03-08 16:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 16:07 [PATCH 0/3] arch: arm: imx: spi: Add QSPI boot support to the IMX8 platforms Joacim Zetterling
2022-03-08 16:07 ` [PATCH 1/3] " Joacim Zetterling
2022-03-08 16:18   ` Ahmad Fatoum
2022-03-08 16:08 ` [PATCH 2/3] scripts: arch: imx: Add QSPI boot support to IMX build image script Joacim Zetterling
2022-03-08 16:21   ` Ahmad Fatoum
2022-03-09  8:43   ` Sascha Hauer
2022-03-08 16:08 ` Joacim Zetterling [this message]
2022-03-09  8:53   ` [PATCH 3/3] arch: arm: imx: spi: Add QSPI boot option to the IMX8MN-EVK 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=20220308160801.782206-4-joacim.zetterling@westermo.com \
    --to=joacim.zetterling@westermo.com \
    --cc=a.fatoum@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