]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
stm32mp1: activate OF_BOARD_SETUP and FDT_FIXUP_PARTITIONS
authorPatrick Delaunay <patrick.delaunay@st.com>
Tue, 2 Jul 2019 11:26:07 +0000 (13:26 +0200)
committerPatrick Delaunay <patrick.delaunay@st.com>
Fri, 12 Jul 2019 09:50:53 +0000 (11:50 +0200)
Update kernel MTD partition in device tree with U-Boot information.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
arch/arm/mach-stm32mp/Kconfig
board/st/stm32mp1/stm32mp1.c
configs/stm32mp15_basic_defconfig
configs/stm32mp15_optee_defconfig
configs/stm32mp15_trusted_defconfig

index 7f6e805e489ed23a0bd089fab25b4cadff5a3a54..9dc3c4d1c5f3593e1c92e464a4ad6f3cc19d62cc 100644 (file)
@@ -38,6 +38,7 @@ config TARGET_STM32MP1
        select CPU_V7A
        select CPU_V7_HAS_NONSEC if !STM32MP1_TRUSTED
        select CPU_V7_HAS_VIRT
+       select OF_BOARD_SETUP
        select PINCTRL_STM32
        select STM32_RCC
        select STM32_RESET
index 40adf3a99235ae1cd52db7bde4a2f99cd408f753..ff4907d44aa027e086148d994c5138f3e657c37c 100644 (file)
@@ -13,6 +13,8 @@
 #include <i2c.h>
 #include <led.h>
 #include <misc.h>
+#include <mtd.h>
+#include <mtd_node.h>
 #include <phy.h>
 #include <reset.h>
 #include <syscon.h>
@@ -21,6 +23,7 @@
 #include <asm/gpio.h>
 #include <asm/arch/stm32.h>
 #include <asm/arch/sys_proto.h>
+#include <jffs2/load_kernel.h>
 #include <power/regulator.h>
 #include <usb/dwc2_udc.h>
 
@@ -751,3 +754,18 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
        debug("%s:mtdids=%s & mtdparts=%s\n", __func__, ids, parts);
 }
 #endif
+
+#if defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, bd_t *bd)
+{
+#ifdef CONFIG_FDT_FIXUP_PARTITIONS
+       struct node_info nodes[] = {
+               { "st,stm32f469-qspi",          MTD_DEV_TYPE_NOR,  },
+               { "st,stm32mp15-fmc2",          MTD_DEV_TYPE_NAND, },
+       };
+       fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
+#endif
+
+       return 0;
+}
+#endif
index fcd81c99a18d7b4942da750477652809fe785a45..cc2861186160af7202bc94d0dab4e5817157622a 100644 (file)
@@ -114,3 +114,4 @@ CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0483
 CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
 CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_FDT_FIXUP_PARTITIONS=y
index 83b0b033038d870f507145f348a133574067867f..a205f47cd89f427766561f7de2fa40ce299d7ed2 100644 (file)
@@ -104,3 +104,4 @@ CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0483
 CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
 CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_FDT_FIXUP_PARTITIONS=y
index cf7114cd7e96f19e1bdb314979c4908356d594b3..cdb4d95bf6f24d2b5390441a3eb4fd340ca8f2da 100644 (file)
@@ -103,3 +103,4 @@ CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0483
 CONFIG_USB_GADGET_PRODUCT_NUM=0x5720
 CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_FDT_FIXUP_PARTITIONS=y