[PATCH v1 23/23] board: nbxv3: add the boot environment (FIT over MC, MC memory, PS1)

Vincent Jardin <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <[email protected]>
Add the production boot environment in CFG_EXTRA_ENV_SETTINGS. The
kernel FIT at NOR offset 0x1000000 carries the kernel,
DTB, optional ramdisk and the LX2160A management complex artefacts
(mc, dpc-<carrier>, dpl-<carrier>) as sub-images.

The usage of those variables is described in doc/board/nxp/nbxv3.rst.

Signed-off-by: Vincent Jardin <[email protected]>
---

 configs/nbxv3_tfa_defconfig |  8 ++++++++
 include/configs/nbxv3.h     | 40 ++++++++++++++++++++++++++++++++++++-
 2 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/configs/nbxv3_tfa_defconfig b/configs/nbxv3_tfa_defconfig
index a4c8419f0c3..bc90bb0594c 100644
--- a/configs/nbxv3_tfa_defconfig
+++ b/configs/nbxv3_tfa_defconfig
@@ -25,8 +25,12 @@ CONFIG_MP=y
 CONFIG_DYNAMIC_SYS_CLK_FREQ=y
 # CONFIG_EFI_LOADER is not set
 CONFIG_FIT_VERBOSE=y
+CONFIG_BOOTDELAY=3
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyAMA0,115200 earlycon=pl011,mmio32,0x21c0000 nokaslr"
+CONFIG_USE_PREBOOT=y
 CONFIG_SYS_PBSIZE=532
 CONFIG_LAST_STAGE_INIT=y
 # CONFIG_ID_EEPROM is not set
@@ -52,8 +56,12 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_RNG=y
 CONFIG_CMD_LOG=y
 CONFIG_OF_CONTROL=y
+CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_SPI_BUS=3
+CONFIG_USE_ETHPRIME=y
+CONFIG_ETHPRIME="lanconsole0"
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_FSL_CAAM=y
 CONFIG_DYNAMIC_DDR_CLK_FREQ=y
 CONFIG_DDR_ECC=y
diff --git a/include/configs/nbxv3.h b/include/configs/nbxv3.h
index 287f4110a7c..c266e0f9fe2 100644
--- a/include/configs/nbxv3.h
+++ b/include/configs/nbxv3.h
@@ -14,6 +14,44 @@
 	"pci_iommu_extra=pci@0x3600000,1.0.0,hp,"			\
 		"pci@0x3700000,1.0.0,hp,"				\
 		"pci@0x3800000,1.0.0,hp,"				\
-		"pci@0x3900000,1.0.0,hp\0"
+		"pci@0x3900000,1.0.0,hp\0"				\
+	"kernel_addr_r=0xc0000000\0"					\
+	"fit_nor_offset=0x1000000\0"					\
+	"fit_nor_size=0x1000000\0"					\
+	"mcmemsize=0x70000000\0"					\
+	"mcinitcmd="							\
+		"sf probe 3:0 && "					\
+		"sf read ${kernel_addr_r} ${fit_nor_offset} ${fit_nor_size} && "\
+		"imxtract ${kernel_addr_r} mc 0xa8000000 && "		\
+		"imxtract ${kernel_addr_r} dpc-${carrier} 0xa9000000 && "\
+		"imxtract ${kernel_addr_r} dpl-${carrier} 0xaa000000 && "\
+		"fsl_mc start mc 0xa8000000 0xa9000000 && "		\
+		"fsl_mc lazyapply dpl 0xaa000000\0"			\
+	"mc_init=bootm ${kernel_addr_r}#conf-${carrier}\0"		\
+	"linux_boot_fit="						\
+		"sf probe 3:0 && "					\
+		"sf read ${kernel_addr_r} ${fit_nor_offset} ${fit_nor_size} && "\
+		"bootm ${kernel_addr_r}#conf-${carrier}\0"		\
+	"host_boot="							\
+		"load semihosting - ${kernel_addr_r} fit.itb && "	\
+		"bootm ${kernel_addr_r}#conf-${carrier}\0"		\
+	"provision_openocd_fit="					\
+		"load semihosting - ${kernel_addr_r} fit.itb && "	\
+		"sf probe 3:0 && "					\
+		"sf erase ${fit_nor_offset} ${fit_nor_size} && "	\
+		"sf write ${kernel_addr_r} ${fit_nor_offset} ${filesize} && "\
+		"reset\0"						\
+	"xspi_bootcmd="							\
+		"cp.b 0x21000000 ${kernel_addr_r} ${fit_nor_size} && "	\
+		"bootm ${kernel_addr_r}#conf-${carrier}\0"		\
+	"fsl_bootcmd_mcinitcmd_set=y\0"					\
+	"bootcmd=run mc_init || run provision_openocd_fit\0"		\
+	"mdio_list="							\
+		"echo === Nbxv3 probed PHYs === && "			\
+		"mdio list\0"						\
+	"PS1=nbxv3> \0"							\
+	"ps_refresh="							\
+		"setenv PS1 \"nbxv3 ${ethact} ${ipaddr}> \"\0"		\
+	"preboot=run mdio_list ; run ps_refresh\0"
 
 #endif /* __NBXV3_H */
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.