board: stm32mp1: no MTD partitions fixup for serial boot
PATCH 1/1 board: stm32mp1: no MTD partitions fixup for serial boot
Remove the update of the MTD partitions in kernel device tree for serial boot (USB / UART), and the kernel will use the MTD partitions define in the loaded DTB because U-Boot can't known the expected flash layout in this case.
---
board/st/stm32mp1/stm32mp1.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
board/st/stm32mp1/stm32mp1.c +8 -3
@@ -848,9 +848,14 @@ int ft_board_setup(void *blob, struct bd_info *bd) { "st,stm32mp15-fmc2", MTD_DEV_TYPE_NAND, }, { "st,stm32mp1-fmc2-nfc", MTD_DEV_TYPE_NAND, }, }; - -if (IS_ENABLED (CONFIG_FDT_FIXUP_PARTITIONS )) -fdt_fixup_mtdparts (blob, nodes,ARRAY_SIZE (nodes)); +char *boot_device; + +/* Check the boot-source and don't update MTD for serial or usb boot */ + boot_device =env_get ("boot_device" ); +if (!boot_device || + (strcmp (boot_device,"serial" ) &&strcmp (boot_device,"usb" ))) +if (IS_ENABLED (CONFIG_FDT_FIXUP_PARTITIONS )) +fdt_fixup_mtdparts (blob, nodes,ARRAY_SIZE (nodes));return 0 ; }
Signature · 1 line
2.17.1
PATCH 1/1 board: stm32mp1: no MTD partitions fixup for serial boot
Hi Patrick
Quoted 23 lines · Patrick Delaunay
Remove the update of the MTD partitions in kernel device tree for serial boot (USB / UART), and the kernel will use the MTD partitions define in the loaded DTB because U-Boot can't known the expected flash layout in this case.
Signed-off-by Patrick Delaunay <[email protected]>---
board/st/stm32mp1/stm32mp1.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)board/st/stm32mp1/stm32mp1.c +1
-3@@ -848,9 +848,14 @@ int ft_board_setup(void *blob, struct bd_info *bd) { "st,stm32mp15-fmc2", MTD_DEV_TYPE_NAND, }, { "st,stm32mp1-fmc2-nfc", MTD_DEV_TYPE_NAND, }, }; - -if (IS_ENABLED (CONFIG_FDT_FIXUP_PARTITIONS )) -fdt_fixup_mtdparts (blob, nodes,ARRAY_SIZE (nodes)); +char *boot_device;
board/st/stm32mp1/stm32mp1.c int ft_board_setup(void *blob, struct bd_info *bd) · line 861
Quoted 10 lines
board/st/stm32mp1/stm32mp1.c +7
-0+ +/* Check the boot-source and don't update MTD for serial or usb boot */ + boot_device =env_get ("boot_device" ); +if (!boot_device || + (strcmp (boot_device,"serial" ) &&strcmp (boot_device,"usb" ))) +if (IS_ENABLED (CONFIG_FDT_FIXUP_PARTITIONS )) +fdt_fixup_mtdparts (blob, nodes,ARRAY_SIZE (nodes));return 0 ; }
Thanks
PATCH 1/1 board: stm32mp1: no MTD partitions fixup for serial boot
In reply to Patrick DelaunayHi,
Quoted 7 lines
From: Patrick DELAUNAY <[email protected]>
Sent: jeudi 15 octobre 2020 14:53Remove the update of the MTD partitions in kernel device tree for serial boot (USB / UART), and the kernel will use the MTD partitions define in the loaded DTB because U-Boot can't known the expected flash layout in this case.
Quoted 6 lines
Signed-off-by Patrick Delaunay <[email protected]>---
board/st/stm32mp1/stm32mp1.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
Applied to u-boot-stm/master, thanks!
Regards
Patrick