ARM: uniphier: support fdt_fixup_mtdparts
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 19 Jul 2018 07:28:26 +0000 (16:28 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 24 Jul 2018 23:47:53 +0000 (08:47 +0900)
Propagate the "mtdparts" environment variable to the DT passed
in to OS.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
arch/arm/mach-uniphier/fdt-fixup.c

index 022e44216efd4270d3a49221adcbba4ab5cd41cf..6f3c29d8c0215e7f96ee965ed86c6b9a2ff51f7f 100644 (file)
@@ -7,6 +7,8 @@
 #include <common.h>
 #include <fdt_support.h>
 #include <fdtdec.h>
+#include <jffs2/load_kernel.h>
+#include <mtd_node.h>
 #include <linux/kernel.h>
 #include <linux/printk.h>
 
@@ -46,8 +48,14 @@ static int uniphier_ld20_fdt_mem_rsv(void *fdt, bd_t *bd)
 
 int ft_board_setup(void *fdt, bd_t *bd)
 {
+       static const struct node_info nodes[] = {
+               { "socionext,uniphier-denali-nand-v5a", MTD_DEV_TYPE_NAND },
+               { "socionext,uniphier-denali-nand-v5b", MTD_DEV_TYPE_NAND },
+       };
        int ret;
 
+       fdt_fixup_mtdparts(fdt, nodes, ARRAY_SIZE(nodes));
+
        ret = uniphier_ld20_fdt_mem_rsv(fdt, bd);
        if (ret)
                return ret;