From 640957042d8f878d093f37aadc04f6d08a7252a1 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Thu, 9 Mar 2017 17:17:54 -0800 Subject: [PATCH] colibri_imx7: use device-tree for MTD partitions Use device-tree fixup to communicate the MTD partitions to the kernel. Remove mtdparts from the kernel command line. Signed-off-by: Stefan Agner --- board/toradex/colibri_imx7/colibri_imx7.c | 13 +++++++++++++ configs/colibri_imx7_defconfig | 1 + include/configs/colibri_imx7.h | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index a106b3bed3..b2b12e4519 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -16,10 +16,13 @@ #include #include #include +#include #include +#include #include #include #include +#include #include #include #include @@ -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 diff --git a/configs/colibri_imx7_defconfig b/configs/colibri_imx7_defconfig index 2d75b27613..ce60056596 100644 --- a/configs/colibri_imx7_defconfig +++ b/configs/colibri_imx7_defconfig @@ -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 diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h index 80eeae46c2..4de866836d 100644 --- a/include/configs/colibri_imx7.h +++ b/include/configs/colibri_imx7.h @@ -120,7 +120,7 @@ "${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} " \ -- 2.25.1