]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: stm32mp1: use fdt_copy_fixed_partitions
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Thu, 8 Jun 2023 15:16:44 +0000 (17:16 +0200)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Fri, 16 Jun 2023 09:01:16 +0000 (11:01 +0200)
Copy the fixed partition nodes from U-Boot device tree to Linux kernel
device tree to dynamically configure the MTD partitions.

fdt_copy_fixed_partitions is only based on device tree
and replace the function fdt_fixup_mtdparts based on mtdparts variable;
the variable mtdid and mtdparts are not more required.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
board/st/stm32mp1/stm32mp1.c
configs/stm32mp13_defconfig
configs/stm32mp15_basic_defconfig
configs/stm32mp15_defconfig
configs/stm32mp15_trusted_defconfig

index 5b28ccd32e60fd408034898139e8b2e292419f78..3205a31c6d0f29ee5e088908a45c70231004705b 100644 (file)
@@ -25,7 +25,6 @@
 #include <log.h>
 #include <malloc.h>
 #include <misc.h>
-#include <mtd_node.h>
 #include <net.h>
 #include <netdev.h>
 #include <phy.h>
@@ -915,20 +914,7 @@ int mmc_get_env_dev(void)
 #if defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
-       static const struct node_info nodes[] = {
-               { "jedec,spi-nor",              MTD_DEV_TYPE_NOR,  },
-               { "spi-nand",                   MTD_DEV_TYPE_SPINAND},
-               { "st,stm32mp15-fmc2",          MTD_DEV_TYPE_NAND, },
-               { "st,stm32mp1-fmc2-nfc",       MTD_DEV_TYPE_NAND, },
-       };
-       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));
+       fdt_copy_fixed_partitions(blob);
 
        if (IS_ENABLED(CONFIG_FDT_SIMPLEFB))
                fdt_simplefb_enable_and_mem_rsv(blob);
index 02a29cd9f03a11ea5b51732e638ddbecb1b7ce63..a9cc7e4d0353af9d5511e4dcf71eddf9e96a50cc 100644 (file)
@@ -74,7 +74,6 @@ CONFIG_TEE=y
 CONFIG_OPTEE=y
 # CONFIG_OPTEE_TA_AVB is not set
 CONFIG_ERRNO_STR=y
-CONFIG_FDT_FIXUP_PARTITIONS=y
 # CONFIG_LMB_USE_MAX_REGIONS is not set
 CONFIG_LMB_MEMORY_REGIONS=2
 CONFIG_LMB_RESERVED_REGIONS=16
index 273b72fdaf0a9fa5dd5015bd1df383e77f6dd7e7..7661159110e5f47c1bbe5706444bae3e24d4c19e 100644 (file)
@@ -188,7 +188,6 @@ CONFIG_WDT=y
 CONFIG_WDT_STM32MP=y
 # CONFIG_BINMAN_FDT is not set
 CONFIG_ERRNO_STR=y
-CONFIG_FDT_FIXUP_PARTITIONS=y
 # CONFIG_LMB_USE_MAX_REGIONS is not set
 CONFIG_LMB_MEMORY_REGIONS=2
 CONFIG_LMB_RESERVED_REGIONS=16
index b1f0f2f7c78436e7c490d19beb36f836a39079e0..1ff9f73730d3cca476759a4039a2dd2d9f8dc0eb 100644 (file)
@@ -164,7 +164,6 @@ CONFIG_WDT=y
 CONFIG_WDT_STM32MP=y
 # CONFIG_BINMAN_FDT is not set
 CONFIG_ERRNO_STR=y
-CONFIG_FDT_FIXUP_PARTITIONS=y
 # CONFIG_LMB_USE_MAX_REGIONS is not set
 CONFIG_LMB_MEMORY_REGIONS=2
 CONFIG_LMB_RESERVED_REGIONS=16
index bcfd60e5a85acd69ef2bd716bf2215eb2e04d61d..e7bf2e171ace3deef1252bbad49f29ad91b398ec 100644 (file)
@@ -164,7 +164,6 @@ CONFIG_WDT=y
 CONFIG_WDT_STM32MP=y
 # CONFIG_BINMAN_FDT is not set
 CONFIG_ERRNO_STR=y
-CONFIG_FDT_FIXUP_PARTITIONS=y
 # CONFIG_LMB_USE_MAX_REGIONS is not set
 CONFIG_LMB_MEMORY_REGIONS=2
 CONFIG_LMB_RESERVED_REGIONS=16