colibri_imx7: use device-tree for MTD partitions
authorStefan Agner <stefan.agner@toradex.com>
Fri, 10 Mar 2017 01:17:54 +0000 (17:17 -0800)
committerStefano Babic <sbabic@denx.de>
Sun, 19 Mar 2017 16:29:28 +0000 (17:29 +0100)
Use device-tree fixup to communicate the MTD partitions to the
kernel. Remove mtdparts from the kernel command line.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
board/toradex/colibri_imx7/colibri_imx7.c
configs/colibri_imx7_defconfig
include/configs/colibri_imx7.h

index a106b3bed3f808de9a866a0a04ca75e1cddbf39c..b2b12e451999615d2107e5fd8d9480d2897b60d2 100644 (file)
 #include <common.h>
 #include <dm.h>
 #include <dm/platform_data/serial_mxc.h>
+#include <fdt_support.h>
 #include <fsl_esdhc.h>
+#include <jffs2/load_kernel.h>
 #include <linux/sizes.h>
 #include <mmc.h>
 #include <miiphy.h>
+#include <mtd_node.h>
 #include <netdev.h>
 #include <power/pmic.h>
 #include <power/rn5t567_pmic.h>
@@ -421,6 +424,16 @@ int checkboard(void)
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, bd_t *bd)
 {
+#if defined(CONFIG_FDT_FIXUP_PARTITIONS)
+       static struct node_info nodes[] = {
+               { "fsl,imx7d-gpmi-nand", MTD_DEV_TYPE_NAND, }, /* NAND flash */
+       };
+
+       /* Update partition nodes using info from mtdparts env var */
+       puts("   Updating MTD partitions...\n");
+       fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
+#endif
+
        return ft_common_board_setup(blob, bd);
 }
 #endif
index 2d75b276138064f36d34879cef89d10f9ed9c4b7..ce600565962029e5e773485537c39422f3e0a60f 100644 (file)
@@ -55,3 +55,4 @@ CONFIG_G_DNL_MANUFACTURER="Toradex"
 CONFIG_G_DNL_VENDOR_NUM=0x1b67
 CONFIG_G_DNL_PRODUCT_NUM=0x4000
 CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_FDT_FIXUP_PARTITIONS=y
index 80eeae46c2def2669208c12e517bd15e92d39804..4de866836d194192163aafeb72dddfa03cbcf81b 100644 (file)
                "${board}/flash_blk.img && source ${loadaddr}\0" \
        "setup=setenv setupargs " \
                "console=tty1 console=${console}" \
-               ",${baudrate}n8 ${memargs} consoleblank=0 ${mtdparts}\0" \
+               ",${baudrate}n8 ${memargs} consoleblank=0\0" \
        "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
        "setusbupdate=usb start && setenv interface usb && " \
                "fatload ${interface} 0:1 ${loadaddr} " \