From: Stefan Agner Date: Wed, 30 Nov 2016 13:41:54 -0800 Subject: [U-Boot] [PATCH v2 3/6] colibri_vf: use device-tree for MTD partitions In-Reply-To: <20161130214157.22331-1-stefan@agner.ch> References: <20161130214157.22331-1-stefan@agner.ch> Message-ID: <20161130214157.22331-4-stefan@agner.ch> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Stefan Agner Use device-tree fixup to communicate the MTD partitions to the kernel. U-Boot's mtdparts environment variable will be used as partition source for the device-tree based partition table too. Signed-off-by: Stefan Agner --- Changes in v2: None board/toradex/colibri_vf/colibri_vf.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/board/toradex/colibri_vf/colibri_vf.c b/board/toradex/colibri_vf/colibri_vf.c index 86f52c5..0f8b440 100644 --- a/board/toradex/colibri_vf/colibri_vf.c +++ b/board/toradex/colibri_vf/colibri_vf.c @@ -15,8 +15,11 @@ #include #include #include +#include #include +#include #include +#include #include #include #include @@ -532,6 +535,16 @@ int checkboard(void) #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, bd_t *bd) { +#ifdef CONFIG_FDT_FIXUP_PARTITIONS + static struct node_info nodes[] = { + { "fsl,vf610-nfc", 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 -- 2.10.2