board: st: remove the nand MTD configuration for NOR boot in stm32mp1 board
PATCH 1/1 board: st: remove the nand MTD configuration for NOR boot in stm32mp1 board
Since commit d5d726d3cc47 ("configs: stm32mp1: only support SD card after NOR in bootcmd_stm32mp"), the stm32mp1 boards only support SD card after NOR boot device, so the MTD partitions for nand0 or spi-nand0 are useless (no need of "UBI" partition in nand0 or spi-nand0).
This patch removes these nand MTD update for nor boot and simplify nand0 and spi-nand0 support (remove the mtd_boot variable).
---
board/st/common/stm32mp_mtdparts.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
board/st/common/stm32mp_mtdparts.c +5 -11
@@ -122,28 +122,24 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)log_debug ("mtd device = %s\n" , dev->name); } -if (nor || nand) { +if (nand) { mtd =get_mtd_device_nm ("nand0" );if (!IS_ERR_OR_NULL (mtd)) { -const char *mtd_boot =CONFIG_MTDPARTS_NAND0_BOOT ;const char *mtd_tee =CONFIG_MTDPARTS_NAND0_TEE ; -board_set_mtdparts ("nand0" , ids, parts, - !nor ? mtd_boot :NULL , +CONFIG_MTDPARTS_NAND0_BOOT , !nor && tee ? mtd_tee :NULL ,"-(UBI)" );put_mtd_device (mtd); } } -if (nor || spinand) { +if (spinand) { mtd =get_mtd_device_nm ("spi-nand0" );if (!IS_ERR_OR_NULL (mtd)) { -const char *mtd_boot =CONFIG_MTDPARTS_SPINAND0_BOOT ;const char *mtd_tee =CONFIG_MTDPARTS_SPINAND0_TEE ; -board_set_mtdparts ("spi-nand0" , ids, parts, - !nor ? mtd_boot :NULL , +CONFIG_MTDPARTS_SPINAND0_BOOT , !nor && tee ? mtd_tee :NULL ,"-(UBI)" );put_mtd_device (mtd);
@@ -152,11 +148,9 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)if (nor) {if (!uclass_get_device (UCLASS_SPI_FLASH ,0 , &dev)) { -const char *mtd_boot =CONFIG_MTDPARTS_NOR0_BOOT ;const char *mtd_tee =CONFIG_MTDPARTS_NOR0_TEE ; -board_set_mtdparts ("nor0" , ids, parts, - mtd_boot, +CONFIG_MTDPARTS_NOR0_BOOT , tee ? mtd_tee :NULL ,"-(nor_user)" ); }
Signature · 1 line
2.17.1
PATCH 1/1 board: st: remove the nand MTD configuration for NOR boot in stm32mp1 board
Hi Patrick
Quoted 56 lines · Patrick Delaunay
Since commit
d5d726d3cc47("configs: stm32mp1: only support SD card after NOR inbootcmd_stm32mp"), the stm32mp1 boards only support SD card after NOR boot device, so the MTD partitions for nand0 or spi-nand0 are useless (no need of "UBI" partition in nand0 or spi-nand0).This patch removes these nand MTD update for nor boot and simplify nand0 and spi-nand0 support (remove the
mtd_bootvariable).Signed-off-by Patrick Delaunay <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
board/st/common/stm32mp_mtdparts.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)board/st/common/stm32mp_mtdparts.c +4
-8@@ -122,28 +122,24 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)log_debug ("mtd device = %s\n" , dev->name); } -if (nor || nand) { +if (nand) { mtd =get_mtd_device_nm ("nand0" );if (!IS_ERR_OR_NULL (mtd)) { -const char *mtd_boot =CONFIG_MTDPARTS_NAND0_BOOT ;const char *mtd_tee =CONFIG_MTDPARTS_NAND0_TEE ; -board_set_mtdparts ("nand0" , ids, parts, - !nor ? mtd_boot :NULL , +CONFIG_MTDPARTS_NAND0_BOOT , !nor && tee ? mtd_tee :NULL ,"-(UBI)" );put_mtd_device (mtd); } } -if (nor || spinand) { +if (spinand) { mtd =get_mtd_device_nm ("spi-nand0" );if (!IS_ERR_OR_NULL (mtd)) { -const char *mtd_boot =CONFIG_MTDPARTS_SPINAND0_BOOT ;const char *mtd_tee =CONFIG_MTDPARTS_SPINAND0_TEE ; -board_set_mtdparts ("spi-nand0" , ids, parts, - !nor ? mtd_boot :NULL , +CONFIG_MTDPARTS_SPINAND0_BOOT , !nor && tee ? mtd_tee :NULL ,"-(UBI)" );put_mtd_device (mtd);@@ -152,11 +148,9 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)if (nor) {
board/st/common/stm32mp_mtdparts.c void board_mtdparts_default(const char **mtdids, const char **mtdparts) · line 156
Quoted 10 lines
board/st/common/stm32mp_mtdparts.c +1
-3if (!uclass_get_device (UCLASS_SPI_FLASH ,0 , &dev)) { -const char *mtd_boot =CONFIG_MTDPARTS_NOR0_BOOT ;const char *mtd_tee =CONFIG_MTDPARTS_NOR0_TEE ; -board_set_mtdparts ("nor0" , ids, parts, - mtd_boot, +CONFIG_MTDPARTS_NOR0_BOOT , tee ? mtd_tee :NULL ,"-(nor_user)" ); }
Thanks
Patrice
PATCH 1/1 board: st: remove the nand MTD configuration for NOR boot in stm32mp1 board
Hi
Quoted 74 lines · Patrice CHOTARD
Hi Patrick
Quoted 56 lines · Patrick Delaunay
Since commit
d5d726d3cc47("configs: stm32mp1: only support SD card after NOR inbootcmd_stm32mp"), the stm32mp1 boards only support SD card after NOR boot device, so the MTD partitions for nand0 or spi-nand0 are useless (no need of "UBI" partition in nand0 or spi-nand0).This patch removes these nand MTD update for nor boot and simplify nand0 and spi-nand0 support (remove the
mtd_bootvariable).Signed-off-by Patrick Delaunay <[email protected]>Signed-off-by Patrick Delaunay <[email protected]>---
board/st/common/stm32mp_mtdparts.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)board/st/common/stm32mp_mtdparts.c +4
-8@@ -122,28 +122,24 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)log_debug ("mtd device = %s\n" , dev->name); } -if (nor || nand) { +if (nand) { mtd =get_mtd_device_nm ("nand0" );if (!IS_ERR_OR_NULL (mtd)) { -const char *mtd_boot =CONFIG_MTDPARTS_NAND0_BOOT ;const char *mtd_tee =CONFIG_MTDPARTS_NAND0_TEE ; -board_set_mtdparts ("nand0" , ids, parts, - !nor ? mtd_boot :NULL , +CONFIG_MTDPARTS_NAND0_BOOT , !nor && tee ? mtd_tee :NULL ,"-(UBI)" );put_mtd_device (mtd); } } -if (nor || spinand) { +if (spinand) { mtd =get_mtd_device_nm ("spi-nand0" );if (!IS_ERR_OR_NULL (mtd)) { -const char *mtd_boot =CONFIG_MTDPARTS_SPINAND0_BOOT ;const char *mtd_tee =CONFIG_MTDPARTS_SPINAND0_TEE ; -board_set_mtdparts ("spi-nand0" , ids, parts, - !nor ? mtd_boot :NULL , +CONFIG_MTDPARTS_SPINAND0_BOOT , !nor && tee ? mtd_tee :NULL ,"-(UBI)" );put_mtd_device (mtd);@@ -152,11 +148,9 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)if (nor) {board/st/common/stm32mp_mtdparts.c void board_mtdparts_default(const char **mtdids, const char **mtdparts) · line 156
Quoted 10 lines
board/st/common/stm32mp_mtdparts.c +1
-3if (!uclass_get_device (UCLASS_SPI_FLASH ,0 , &dev)) { -const char *mtd_boot =CONFIG_MTDPARTS_NOR0_BOOT ;const char *mtd_tee =CONFIG_MTDPARTS_NOR0_TEE ; -board_set_mtdparts ("nor0" , ids, parts, - mtd_boot, +CONFIG_MTDPARTS_NOR0_BOOT , tee ? mtd_tee :NULL ,"-(nor_user)" ); }Reviewed-by Patrice Chotard <[email protected]>
Quoted 3 lines
Thanks
Patrice
Applied to u-boot-stm/next
Thanks
Patrice