bsh: imx6ulz_smm_m2: Add imx6ulz BSH SMM M2B board
PATCH v3 1/1 bsh: imx6ulz_smm_m2: Add imx6ulz BSH SMM M2B board
Introduce the BSH SystemMaster (SMM) M2B board. Notably, the M2B is designed to leverage the existing device tree of its predecessor, the M2. The primary distinction arises from memory incompatibilities with the M2. To address this, we've implemented a configuration system that allows for selective inclusion of the desired memory components.
---
Changes in v3:
- Fix typo in MAINTAINERS
- Pipeline https://dev.azure.com/u-boot/u-boot/_build/results?buildId=11274&view=results
Changes in v2:
- Ajust commit message and kconfig
- Add MAINTAINERS entry just for configuration file
board/bsh/imx6ulz_smm_m2/Kconfig | 21 +++ board/bsh/imx6ulz_smm_m2/MAINTAINERS | 1 + board/bsh/imx6ulz_smm_m2/Makefile | 4 +- board/bsh/imx6ulz_smm_m2/ddr3l_timing_128m.c | 1 + .../imx6ulz_smm_m2/ddr3l_timing_128m_m2b.c | 152 ++++++++++++++++++ board/bsh/imx6ulz_smm_m2/ddr3l_timing_256m.c | 1 + .../imx6ulz_smm_m2/ddr3l_timing_256m_m2b.c | 137 ++++++++++++++++ board/bsh/imx6ulz_smm_m2/ddr3l_timing_512m.c | 1 + board/bsh/imx6ulz_smm_m2/spl.c | 37 +++-- board/bsh/imx6ulz_smm_m2/spl_mtypes.h | 1 + configs/imx6ulz_smm_m2b_defconfig | 78 +++++++++ 11 files changed, 416 insertions(+), 18 deletions(-) create mode 100644 board/bsh/imx6ulz_smm_m2/ddr3l_timing_128m_m2b.c create mode 100644 board/bsh/imx6ulz_smm_m2/ddr3l_timing_256m_m2b.c create mode 100644 configs/imx6ulz_smm_m2b_defconfig
board/bsh/imx6ulz_smm_m2/Kconfig +21 -0
@@ -9,4 +9,25 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "imx6ulz_smm_m2" +choice + prompt "Memory Type (M2/M2B) board" + default BSH_M2_MEMORY + help + Memory type setup. + Please choose correct memory model here. + +config BSH_M2_MEMORY + bool "Enable for bsh m2 variant" + help + If this option is enabled, U-Boot will be configured to support + imx6ulz bsh m2 revision memories. + +config BSH_M2B_MEMORY + bool "Enable for bsh m2b variant" + help + If this option is enabled, U-Boot will be configured to support + imx6ulz bsh m2b revision memories. + +endchoice + endif
board/bsh/imx6ulz_smm_m2/MAINTAINERS +1 -0
@@ -4,3 +4,4 @@ S: Maintained F: board/bsh/imx6ulz_smm_m2/ F: include/configs/imx6ulz_smm_m2.h F: configs/imx6ulz_smm_m2_defconfig +F: configs/imx6ulz_smm_m2b_defconfig
board/bsh/imx6ulz_smm_m2/Makefile +3 -1
@@ -2,4 +2,6 @@ # (C) Copyright 2021 Amarula Solutions B.V. obj-y := imx6ulz_smm_m2.o -obj-$(CONFIG_XPL_BUILD) += spl.o ddr3l_timing_512m.o ddr3l_timing_256m.o ddr3l_timing_128m.o +obj-$(CONFIG_XPL_BUILD) += spl.o +obj-$(CONFIG_BSH_M2_MEMORY) += ddr3l_timing_512m.o ddr3l_timing_256m.o ddr3l_timing_128m.o +obj-$(CONFIG_BSH_M2B_MEMORY) += ddr3l_timing_256m_m2b.o ddr3l_timing_128m_m2b.o
board/bsh/imx6ulz_smm_m2/ddr3l_timing_128m.c +1 -0
@@ -166,4 +166,5 @@ static const struct dram_cfg_param ddr_ddrc_cfg_128mb[] = {struct dram_timing_info bsh_dram_timing_128mb = { .ddrc_cfg = ddr_ddrc_cfg_128mb, .ddrc_cfg_num =ARRAY_SIZE (ddr_ddrc_cfg_128mb), + .dram_size =SZ_128M , };
board/bsh/imx6ulz_smm_m2/ddr3l_timing_128m_m2b.c new file +152 -0
152 lines not on this page · raw message
board/bsh/imx6ulz_smm_m2/ddr3l_timing_256m.c +1 -0
@@ -165,4 +165,5 @@ static const struct dram_cfg_param ddr_ddrc_cfg_256mb[] = {struct dram_timing_info bsh_dram_timing_256mb = { .ddrc_cfg = ddr_ddrc_cfg_256mb, .ddrc_cfg_num =ARRAY_SIZE (ddr_ddrc_cfg_256mb), + .dram_size =SZ_256M , };
board/bsh/imx6ulz_smm_m2/ddr3l_timing_256m_m2b.c new file +137 -0
137 lines not on this page · raw message
board/bsh/imx6ulz_smm_m2/ddr3l_timing_512m.c +1 -0
@@ -165,4 +165,5 @@ static const struct dram_cfg_param ddr_ddrc_cfg_512mb[] = {struct dram_timing_info bsh_dram_timing_512mb = { .ddrc_cfg = ddr_ddrc_cfg_512mb, .ddrc_cfg_num =ARRAY_SIZE (ddr_ddrc_cfg_512mb), + .dram_size =SZ_512M , };
board/bsh/imx6ulz_smm_m2/spl.c +20 -17
@@ -52,28 +52,31 @@ static void ddr_cfg_write(const struct dram_timing_info *dram_timing_info) } } +static const struct dram_timing_info *board_dram_timing[] = { +#if defined(CONFIG_M2_MEMORY) + &bsh_dram_timing_512mb, +#endif + &bsh_dram_timing_256mb, + &bsh_dram_timing_128mb, +}; +static void spl_dram_init (void ) {/* Configure memory to maximum supported size for detection */ -ddr_cfg_write (&bsh_dram_timing_512mb); +ddr_cfg_write (board_dram_timing[0 ]);/* Detect memory physically present */ - gd->ram_size =get_ram_size ((void *)CFG_SYS_SDRAM_BASE ,SZ_512M ); - -/* Reconfigure memory for actual detected size */ -switch (gd->ram_size) { -case SZ_512M : -/* Already configured, nothing to do */ -break ; -case SZ_256M : -udelay (1 ); -ddr_cfg_write (&bsh_dram_timing_256mb); -break ; -case SZ_128M : -default : -udelay (1 ); -ddr_cfg_write (&bsh_dram_timing_128mb); -break ; + gd->ram_size =get_ram_size ((void *)CFG_SYS_SDRAM_BASE , board_dram_timing[0 ]->dram_size); + +if (board_dram_timing[0 ]->dram_size == gd->ram_size) +return ; + +for (size_t index =1 ; index <ARRAY_SIZE (board_dram_timing); index++) { +if (board_dram_timing[index]->dram_size == gd->ram_size) { +udelay (1 ); +ddr_cfg_write (board_dram_timing[index]); +break ; + } } }
board/bsh/imx6ulz_smm_m2/spl_mtypes.h +1 -0
@@ -18,6 +18,7 @@ struct dram_cfg_param {struct dram_timing_info {const struct dram_cfg_param *ddrc_cfg;unsigned int ddrc_cfg_num; +size_t dram_size; };extern struct dram_timing_info bsh_dram_timing_128mb;
configs/imx6ulz_smm_m2b_defconfig new file +78 -0
78 lines not on this page · raw message
Signature · 4 lines
2.43.0 base-commit: e5990b6f46717bc684672032fe4fb9d7d8bfa278 branch: series
Fabio Estevam
reviewerQuoted 7 lines · Michael Trimarchi
Introduce the BSH SystemMaster (SMM) M2B board. Notably, the M2B is designed to leverage the existing device tree of its predecessor, the M2. The primary distinction arises from memory incompatibilities with the M2. To address this, we've implemented a configuration system that allows for selective inclusion of the desired memory components.
Quoted 7 lines
Signed-off-by Michael Trimarchi <[email protected]>---
Changes in v3:
- Fix typo inMAINTAINERS
- Pipeline https://dev.azure.com/u-boot/u-boot/_build/results?buildId=11274&view=results
Applied to u-boot-imx/next, thanks.