Skip to contentSkip to conversation

SHEEVAPLUG : OPENWRT READY

PATCH New Gérald Kerma 1 participant 3 messages Dec 13, 2014

lore
Share & tools
lore
#0 lore raw

cover SHEEVAPLUG : OPENWRT READY

Prepare ENV settings for sheevaplugs to be OpenWRT ready.

	+----------+
	| UBOOT    | >> 896 Kb (7x128)	= uboot
	+----------+
	| ENV      | >> 128 Kb		= uboot_env
	+----------+
	| IMAGES   | >> 23 Mb @ 1 Mb	= image -> UIMAGE+UINITRD+FDT
	+----------+
	| ROOT(FS) | >> 488 Mb @ 24 Mb	= root -> rootfs (ubifs)
	+----------+

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

<INTERRUPT>
### INITIALIZE
Marvell>> nand erase.part root
### PREPARE
Marvell>> ubi part root
Marvell>> ubi remove rootfs
Marvell>> ubi create rootfs
### UPGRADE

	Marvell>> usb reset
	Marvell>> fatload usb 0:1 0x800000 sheevaplug/openwrt/openwrt-kirkwood-sheevaplug-rootfs.ubifs
	Marvell>> ubi write 0x800000 rootfs ${filesize}
	Marvell>> reset

G?rald Kerma (2):
SHEEVAPLUG : REDEFINE MTDPARTS
SHEEVAPLUG : REDEFINE ENV

 include/configs/sheevaplug.h | 40 ++++++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 16 deletions(-)
Signature · 1 line
2.1.3
#1 lore raw

PATCH 1/2 SHEEVAPLUG : REDEFINE MTDPARTS

---
 include/configs/sheevaplug.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
include/configs/sheevaplug.h +6 -6
index 0f523c5..96fbe87 100644
@@ -78,8 +78,7 @@
  * 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
@@ -88,10 +87,11 @@
 	"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_MTDPARTS	\
+	"mtdparts=orion_nand:"					\
+	"640K(uboot),128K(uboot_env),"				\
+	"256K(script),23M at 1M(image),"				\
+	"- at 24M(rootfs)"
 
 #define CONFIG_EXTRA_ENV_SETTINGS	"x_bootargs=console"	\
 	"=ttyS0,115200 mtdparts="CONFIG_MTDPARTS	\
Signature · 1 line
2.1.3
#2 lore raw

PATCH 2/2 SHEEVAPLUG : REDEFINE ENV

In reply to Gérald Kerma

Define ENV for OpenWRT by default

---
 include/configs/sheevaplug.h | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)
include/configs/sheevaplug.h +20 -12
index 96fbe87..dc51a4a 100644
@@ -83,21 +83,29 @@
 /*
  * Default environment variables
  */
-#define CONFIG_BOOTCOMMAND		"${x_bootcmd_kernel}; "	\
-	"setenv bootargs ${x_bootargs} ${x_bootargs_root}; "	\
-	"${x_bootcmd_usb}; bootm 0x6400000;"
+#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:"					\
-	"640K(uboot),128K(uboot_env),"				\
-	"256K(script),23M at 1M(image),"				\
-	"- at 24M(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"
+	"896K(uboot),128K(uboot_env),"				\
+	"23M at 1M(image),"					\
+	"- at 24M(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=3 root=ubi0:rootfs rootfstype=ubifs rw\0"
 
 #define MTDIDS_DEFAULT	"nand0=orion_nand"
 
Signature · 1 line
2.1.3