Skip to contentSkip to conversation

imx8mn_bsh_smm_s2: fix NAND booting

PATCH RESEND In review Dario Binacchi 2 participants 9 messages Jun 26, 2022 – Jun 28, 2022 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

cover imx8mn_bsh_smm_s2: fix NAND booting

The series contains all the patches required by the BSH smm s2 board for booting from NAND and properly mounting the UBI rootfs.

Dario Binacchi (4):
configs: imx8mn_bsh_smm_s2: add NAND driver
configs: imx8mn_bsh_smm_s2: add UBI commands
configs: imx8mn_bsh_smm_s2: remove console from bootargs
configs: imx8mn_bsh_smm_s2: add mtdparts to bootargs

 configs/imx8mn_bsh_smm_s2_defconfig | 6 ++++++
 include/configs/imx8mn_bsh_smm_s2.h | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)
Signature · 1 line
2.32.0
#1 lore raw

PATCH RESEND 1/4 configs: imx8mn_bsh_smm_s2: add NAND driver

It allows to boot from NAND.

---

 configs/imx8mn_bsh_smm_s2_defconfig | 5 +++++
 1 file changed, 5 insertions(+)
configs/imx8mn_bsh_smm_s2_defconfig +5 -0
index 49f425300151..08f52e50609b 100644
@@ -30,8 +30,10 @@ CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_BOOTROM_SUPPORT=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x300
+CONFIG_SPL_DMA=y
 CONFIG_SPL_I2C=y
 CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_POWER=y
 CONFIG_SPL_WATCHDOG=y
 CONFIG_SYS_PROMPT="> "
@@ -65,6 +67,9 @@ CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_MXS=y
 CONFIG_NAND_MXS_DT=y
 CONFIG_SYS_NAND_ONFI_DETECTION=y
+CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
+CONFIG_SYS_NAND_U_BOOT_OFFS=0xD8000
+CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND=0x4058000
 CONFIG_PHYLIB=y
 CONFIG_PHY_NXP_TJA11XX=y
 CONFIG_DM_ETH=y
Signature · 1 line
2.32.0
#3 lore raw

PATCH RESEND 2/4 configs: imx8mn_bsh_smm_s2: add UBI commands

In reply to Dario Binacchi

imx8mn_bsh_smm_s2 uses ubifs rootfs, UBI commands are required to flash it.

---

 configs/imx8mn_bsh_smm_s2_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/imx8mn_bsh_smm_s2_defconfig +1 -0
index 08f52e50609b..f8c75a2b237e 100644
@@ -43,6 +43,7 @@ CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nand0=gpmi-nand"
 CONFIG_MTDPARTS_DEFAULT="gpmi-nand:64m(nandboot),16m(nandfit),32m(nandkernel),1m(nanddtb),8m(nandtee),-(nandrootfs)"
+CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
Signature · 1 line
2.32.0
#5 lore raw

PATCH RESEND 3/4 configs: imx8mn_bsh_smm_s2: remove console from bootargs

In reply to Dario Binacchi

The Linux kernel device tree already specifies the device to be used for boot console output with a stdout-path property under /chosen.

---

 include/configs/imx8mn_bsh_smm_s2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/imx8mn_bsh_smm_s2.h +1 -1
index 098f23b206d1..1eff8c43701c 100644
@@ -16,7 +16,7 @@
 #define NANDARGS \
 	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
 	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
-	"nandargs=setenv bootargs console=${console} " \
+	"nandargs=setenv bootargs " \
 		"${optargs} " \
 		"root=${nandroot} " \
 		"rootfstype=${nandrootfstype}\0" \
Signature · 1 line
2.32.0
#6 lore raw

Re: [RESEND PATCH 3/4] configs: imx8mn_bsh_smm_s2: remove console from bootargs

Quoted 6 lines · Dario Binacchi

The Linux kernel device tree already specifies the device to be used for boot console output with a stdout-path property under /chosen.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#7 lore raw

PATCH RESEND 4/4 configs: imx8mn_bsh_smm_s2: add mtdparts to bootargs

In reply to Dario Binacchi

Passing the mtdparts environment variable to the Linux kernel is required to properly mount the UBI rootfs.

---

 include/configs/imx8mn_bsh_smm_s2.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/imx8mn_bsh_smm_s2.h +1 -0
index 1eff8c43701c..d09c2ab01610 100644
@@ -18,6 +18,7 @@
 	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
 	"nandargs=setenv bootargs " \
 		"${optargs} " \
+		"mtdparts=${mtdparts} " \
 		"root=${nandroot} " \
 		"rootfstype=${nandrootfstype}\0" \
 	"nandroot=ubi0:root rw ubi.mtd=nandrootfs\0" \
Signature · 1 line
2.32.0