[U-Boot] [PATCH v3 6/6] SHEEVAPLUG : REDEFINE MTDPARTS

Gérald Kerma drEagle at doukki.net
Wed Dec 17 15:02:49 CET 2014


Prepare ENV settings for sheevaplugs to be OpenWRT ready.

	+----------+
	| UBOOT    | >> 896 Kb (7x128)	= uboot
	+----------+
	| ENV      | >> 128 Kb		= uboot_env
	+----------+
	| ROOT(FS) | >> 511 Mb @ 1 Mb	= root -> rootfs (ubifs)
	+----------+

With (CC) TRUNK OpenWRT build (QUICK HOWTO) :

	<INTERRUPT>
	Marvell>> nand erase.part root
	Marvell>> ubi part root
	Marvell>> ubi remove rootfs
	Marvell>> ubi create rootfs
	Marvell>> usb reset
	Marvell>> fatload usb 0:1 0x800000 sheevaplug/openwrt/openwrt-kirkwood-sheevaplug-rootfs.ubifs
	Marvell>> ubi write 0x800000 rootfs ${filesize}
	Marvell>> reset

Changes in v3
- Supress image partition (unused)

Change in v2
- Define new NAND partition mapping

Signed-off-by: Gérald Kerma <drEagle at doukki.net>
---
 include/configs/sheevaplug.h | 39 +++++++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 0f523c5..a1ce821 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -78,26 +78,33 @@
  * it has to be rounded to sector size
  */
 #define CONFIG_ENV_SIZE			0x20000	/* 128k */
-#define CONFIG_ENV_ADDR			0x80000
-#define CONFIG_ENV_OFFSET		0x80000	/* env starts here */
+#define CONFIG_ENV_OFFSET		0xE0000	/* env starts here */
 
 /*
  * Default environment variables
  */
-#define CONFIG_BOOTCOMMAND		"${x_bootcmd_kernel}; "	\
-	"setenv bootargs ${x_bootargs} ${x_bootargs_root}; "	\
-	"${x_bootcmd_usb}; bootm 0x6400000;"
-
-#define CONFIG_MTDPARTS		\
-	"mtdparts=orion_nand:512K(uboot),"				\
-	"512K(env),1M(script),6M(kernel),"				\
-	"12M(ramdisk),4M(spare),-(rootfs)"
-
-#define CONFIG_EXTRA_ENV_SETTINGS	"x_bootargs=console"	\
-	"=ttyS0,115200 mtdparts="CONFIG_MTDPARTS	\
-	"x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \
-	"x_bootcmd_usb=usb start\0" \
-	"x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0"
+#define CONFIG_BOOTCOMMAND \
+	"setenv bootargs ${console} ${mtdparts} ${bootargs_root}; "	\
+	"ubi part root; "						\
+	"ubifsmount ubi:rootfs; "					\
+	"ubifsload 0x800000 ${kernel}; "				\
+	"ubifsload 0x700000 ${fdt}; "					\
+	"ubifsumount; "							\
+	"fdt addr 0x700000; fdt resize; fdt chosen; "			\
+	"bootz 0x800000 - 0x700000"
+
+#define CONFIG_MTDPARTS	\
+	"mtdparts=orion_nand:"						\
+	"896K(uboot),128K(uboot_env),"					\
+	"- at 1M(root)\0"
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"console=console=ttyS0,115200\0"				\
+	"mtdids=nand0=orion_nand\0"					\
+	"mtdparts="CONFIG_MTDPARTS					\
+	"kernel=/boot/zImage\0"						\
+	"fdt=/boot/sheevaplug.dtb\0"					\
+	"bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs rw\0"
 
 #define MTDIDS_DEFAULT	"nand0=orion_nand"
 
-- 
2.1.3


More information about the U-Boot mailing list