summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2015-06-30 12:31:56 +0200
committerStefan Agner <stefan.agner@toradex.com>2015-06-30 12:31:56 +0200
commitfa19144376604fb83b3f977ff6b637434886c646 (patch)
tree56ba4ff7599266c7fe61f490637c6cec0f9ce178
parentcaacb7d519ddf0c697ae20a9c55c6c0aed4b4a61 (diff)
colibri_vf: use device-tree for MTD partitions
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.
-rw-r--r--board/toradex/colibri_vf/colibri_vf.c13
-rw-r--r--include/configs/colibri_vf.h7
2 files changed, 17 insertions, 3 deletions
diff --git a/board/toradex/colibri_vf/colibri_vf.c b/board/toradex/colibri_vf/colibri_vf.c
index 2cf763999b1..180fe2e413c 100644
--- a/board/toradex/colibri_vf/colibri_vf.c
+++ b/board/toradex/colibri_vf/colibri_vf.c
@@ -17,11 +17,14 @@
#include <asm/arch/clock.h>
#include <asm/imx-common/boot_mode.h>
#include <mmc.h>
+#include <mtd_node.h>
+#include <fdt_support.h>
#include <fsl_esdhc.h>
#include <fsl_dcu_fb.h>
#include <miiphy.h>
#include <netdev.h>
#include <i2c.h>
+#include <jffs2/load_kernel.h>
#include <asm/gpio.h>
#include "../common/configblock.h"
@@ -467,6 +470,16 @@ int checkboard_fallback(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 fsl_dcu_fixedfb_setup(blob);
}
#endif
diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index db0593988da..1cbe08d2b96 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -151,7 +151,7 @@
#define SD_BOOTCMD \
"sdargs=root=/dev/mmcblk0p2 rw rootwait\0" \
- "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} ${mtdparts} " \
+ "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} " \
"${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \
"load mmc 0:2 ${kernel_addr_r} /boot/${kernel_file} && " \
"load mmc 0:2 ${fdt_addr_r} /boot/${soc}-colibri-${fdt_board}.dtb && " \
@@ -160,7 +160,7 @@
#define NFS_BOOTCMD \
"nfsargs=ip=:::::eth0: root=/dev/nfs\0" \
"nfsboot=run setup; " \
- "setenv bootargs ${defargs} ${nfsargs} ${mtdparts} " \
+ "setenv bootargs ${defargs} ${nfsargs} " \
"${setupargs} ${vidargs}; echo Booting from NFS...;" \
"dhcp ${kernel_addr_r} && " \
"tftp ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \
@@ -170,7 +170,7 @@
"ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \
"ubi.fm_autoconvert=1\0" \
"ubiboot=run setup; " \
- "setenv bootargs ${defargs} ${ubiargs} ${mtdparts} " \
+ "setenv bootargs ${defargs} ${ubiargs} " \
"${setupargs} ${vidargs}; echo Booting from NAND...; " \
"ubi part ubi && ubifsmount ubi0:rootfs && " \
"ubifsload ${kernel_addr_r} /boot/${kernel_file} && " \
@@ -265,6 +265,7 @@
#define CONFIG_OF_LIBFDT
#define CONFIG_OF_BOARD_SETUP
#define CONFIG_OF_SYSTEM_SETUP
+#define CONFIG_FDT_FIXUP_PARTITIONS
#define CONFIG_CMD_BOOTZ
#define CONFIG_SUPPORT_RAW_INITRD