Restore imx8mn_bsh_smm_s2 properly booting
Subsystems (3)
v2 cover Restore imx8mn_bsh_smm_s2 properly booting
Commits [1] and [2] broke the booting of the BSH SMM S2 board. The patches in this series restore proper booting.
[1] 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options")
[2] dda454e933c6 ("serial: mxc: Support bulk enabling clocks")
(no changes since v1)
Dario Binacchi (4):
spl: Kconfig: support U-Boot load from raw NAND
imx: spl_imx_romapi: support raw NAND sector
configs: imx8mn_bsh_smm_s2: load U-Boot from raw NAND
serial: mxc: restore booting for imx8mn_bsh_smm_s2
arch/arm/mach-imx/spl_imx_romapi.c | 8 +++----- common/spl/Kconfig | 15 +++++++++++++++ configs/imx8mn_bsh_smm_s2_defconfig | 2 ++ drivers/serial/serial_mxc.c | 23 ++++++++++++++++------- 4 files changed, 36 insertions(+), 12 deletions(-)
Signature · 4 lines
2.43.0 base-commit: 1b5e435102aa29a665119430196cb366ce36a01b branch: bsh-s2-break
RFC PATCH v2 1/4 spl: Kconfig: support U-Boot load from raw NAND
Commit 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options") breaks the boot of the BSH SMM S2 board. As stated in the commit itself, "Some boards use this value even though MMC is not enabled in SPL, for example imx8mn_bsh_smm_s2".
Support load of the U-Boot image from raw NAND sector. This is equivalent to load from MMC raw sector.
---
Changes in v2:
- Add SPL_NAND_RAW_U_BOOT_USE_SECTOR and SPL_NAND_RAW_U_BOOT_SECTOR
common/spl/Kconfig | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
common/spl/Kconfig +15 -0
@@ -974,6 +974,21 @@ config SPL_NAND_SUPPORT This enables the drivers in drivers/mtd/nand/raw as part of an SPL build. +config SPL_NAND_RAW_U_BOOT_USE_SECTOR + bool "NAND raw mode: by sector" + depends on SPL_NAND_SUPPORT + select SPL_LOAD_BLOCK + help + Use sector number for specifying U-Boot location on NAND in + raw mode. + +config SPL_NAND_RAW_U_BOOT_SECTOR + hex "Address on the NAND to load U-Boot from" + depends on SPL_NAND_RAW_U_BOOT_USE_SECTOR + help + Address on the NAND to load U-Boot from, when the NAND is being used + in raw mode. Units: NAND disk sectors (1 sector = 512 bytes). + config SPL_NAND_RAW_ONLY bool "Support to boot only raw u-boot.bin images" depends on SPL_NAND_SUPPORT
Signature · 1 line
2.43.0
RFC PATCH v2 2/4 imx: spl_imx_romapi: support raw NAND sector
In reply to Dario BinacchiCommit 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options") breaks the boot of the BSH SMM S2 board. As stated in the dropped comment, "Some boards use this value even though MMC is not enabled in SPL, for example imx8mn_bsh_smm_s2".
Support load of the U-Boot image from raw NAND sector.
---
(no changes since v1)
arch/arm/mach-imx/spl_imx_romapi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
arch/arm/mach-imx/spl_imx_romapi.c +3 -5
@@ -35,12 +35,10 @@ ulong __weak spl_romapi_get_uboot_base(u32 image_offset, u32 rom_bt_dev) {u32 sector =0 ; -/* -* Some boards use this value even though MMC is not enabled in SPL, for -* example imx8mn_bsh_smm_s2 -*/ -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR +#if IS_ENABLED (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR ) sector =CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR ; +#elif IS_ENABLED (CONFIG_SPL_NAND_RAW_U_BOOT_USE_SECTOR ) + sector =CONFIG_SPL_NAND_RAW_U_BOOT_SECTOR ;#endif return image_offset + sector *512 -0x8000 ;
Signature · 1 line
2.43.0
RFC PATCH v2 3/4 configs: imx8mn_bsh_smm_s2: load U-Boot from raw NAND
In reply to Dario BinacchiCommit 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options") breaks the boot of the BSH SMM S2 board. Add options to load U-Boot from raw NAND sector.
---
Changes in v2:
- Drop CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR.
- Add CONFIG_SPL_NAND_RAW_U_BOOT_USE_SECTOR and
CONFIG_SPL_NAND_RAW_U_BOOT_SECTOR options.
configs/imx8mn_bsh_smm_s2_defconfig | 2 ++ 1 file changed, 2 insertions(+)
configs/imx8mn_bsh_smm_s2_defconfig +2 -0
@@ -47,6 +47,8 @@ CONFIG_SPL_DMA=y CONFIG_SPL_I2C=y CONFIG_SPL_MTD=y CONFIG_SPL_NAND_SUPPORT=y +CONFIG_SPL_NAND_RAW_U_BOOT_USE_SECTOR=y +CONFIG_SPL_NAND_RAW_U_BOOT_SECTOR=0x300 CONFIG_SPL_NAND_BASE=y CONFIG_SPL_NAND_IDENT=y CONFIG_SPL_POWER=y
Signature · 1 line
2.43.0
RFC PATCH v2 4/4 serial: mxc: restore booting for imx8mn_bsh_smm_s2
In reply to Dario BinacchiThe commit dda454e933c6 ("serial: mxc: Support bulk enabling clocks") breaks the booting of the BSH SMM S2 board.
Restore proper booting of the board even in case of failure of either clk_get_bulk() or clk_enable_bulk().
---
(no changes since v1)
drivers/serial/serial_mxc.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
drivers/serial/serial_mxc.c +16 -7
@@ -310,22 +310,31 @@ int mxc_serial_setbrg(struct udevice *dev, int baudrate)return 0 ; } -static int mxc_serial_probe (struct udevice *dev) +#if CONFIG_IS_ENABLED (CLK_CCF ) +static void mxc_serial_enable_clk_bulk (struct udevice *dev) {struct mxc_serial_plat *plat =dev_get_plat (dev); -#if CONFIG_IS_ENABLED (CLK_CCF )int ret; ret =clk_get_bulk (dev, &plat->clks);if (ret) -return ret; +return ; - ret =clk_enable_bulk (&plat->clks); -if (ret) -return ret; +clk_enable_bulk (&plat->clks); +} +#else +static mxc_serial_enable_clk_bulk(struct udevice *dev) +{ +}#endif -_mxc_serial_init (plat->reg, plat->use_dte); +static int mxc_serial_probe (struct udevice *dev) +{ +struct mxc_serial_plat *plat =dev_get_plat (dev); + +mxc_serial_enable_clk_bulk (dev); + +_mxc_serial_init (plat->reg, plat->use_dte);return 0 ; }
Signature · 1 line
2.43.0