diff mbox series

[5/6] ARM: uniphier: support fdt_fixup_mtdparts

Message ID 1531985307-4208-5-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit bb04d2ec4d1fc1924b491c074ccfdad633167cc7
Headers show
Series [1/6] fdt_support: make fdt_fixup_mtdparts() prototype more specific | expand

Commit Message

Masahiro Yamada July 19, 2018, 7:28 a.m. UTC
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 | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm/mach-uniphier/fdt-fixup.c b/arch/arm/mach-uniphier/fdt-fixup.c
index 022e442..6f3c29d 100644
--- a/arch/arm/mach-uniphier/fdt-fixup.c
+++ b/arch/arm/mach-uniphier/fdt-fixup.c
@@ -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;