[PATCH 1/3] eukrea_cpuimx35: switch to default env

Eric Bénard eric at eukrea.com
Fri Feb 25 09:39:23 EST 2011


Signed-off-by: Eric Bénard <eric at eukrea.com>
---
 arch/arm/boards/eukrea_cpuimx35/env/bin/_update    |   36 -------------
 arch/arm/boards/eukrea_cpuimx35/env/bin/boot       |   52 -------------------
 arch/arm/boards/eukrea_cpuimx35/env/bin/hush_hack  |    1 -
 arch/arm/boards/eukrea_cpuimx35/env/bin/init       |   45 -----------------
 arch/arm/boards/eukrea_cpuimx35/env/bin/init_board |   20 +++++++
 .../boards/eukrea_cpuimx35/env/bin/update_kernel   |    8 ---
 .../arm/boards/eukrea_cpuimx35/env/bin/update_root |    8 ---
 arch/arm/boards/eukrea_cpuimx35/env/config         |   53 ++++++++++++++------
 8 files changed, 57 insertions(+), 166 deletions(-)
 delete mode 100644 arch/arm/boards/eukrea_cpuimx35/env/bin/_update
 delete mode 100644 arch/arm/boards/eukrea_cpuimx35/env/bin/boot
 delete mode 100644 arch/arm/boards/eukrea_cpuimx35/env/bin/hush_hack
 delete mode 100644 arch/arm/boards/eukrea_cpuimx35/env/bin/init
 create mode 100644 arch/arm/boards/eukrea_cpuimx35/env/bin/init_board
 delete mode 100644 arch/arm/boards/eukrea_cpuimx35/env/bin/update_kernel
 delete mode 100644 arch/arm/boards/eukrea_cpuimx35/env/bin/update_root

diff --git a/arch/arm/boards/eukrea_cpuimx35/env/bin/_update b/arch/arm/boards/eukrea_cpuimx35/env/bin/_update
deleted file mode 100644
index 014bce3..0000000
--- a/arch/arm/boards/eukrea_cpuimx35/env/bin/_update
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-if [ -z "$part" -o -z "$image" ]; then
-	echo "define \$part and \$image"
-	exit 1
-fi
-
-if [ ! -e "$part" ]; then
-	echo "Partition $part does not exist"
-	exit 1
-fi
-
-if [ $# = 1 ]; then
-	image=$1
-fi
-
-if [ x$ip = xdhcp ]; then
-	dhcp
-fi
-
-ping $eth0.serverip
-if [ $? -ne 0 ] ; then
-	echo "update aborted"
-	exit 1
-fi
-
-unprotect $part
-
-echo
-echo "erasing partition $part"
-erase $part
-
-echo
-echo "flashing $image to $part"
-echo
-tftp $image $part
diff --git a/arch/arm/boards/eukrea_cpuimx35/env/bin/boot b/arch/arm/boards/eukrea_cpuimx35/env/bin/boot
deleted file mode 100644
index fca5b8c..0000000
--- a/arch/arm/boards/eukrea_cpuimx35/env/bin/boot
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-
-. /env/config
-
-if [ x$1 = xjffS2 ]; then
-	root=jffs2
-	kernel=nand
-fi
-
-if [ x$1 = xubifs ]; then
-	root=ubifs
-	kernel=nand
-fi
-
-if [ x$1 = xnet ]; then
-	root=net
-	kernel=net
-fi
-
-if [ x$ip = xdhcp ]; then
-	bootargs="$bootargs ip=dhcp"
-else
-	if [ x$ip = xoff ]; then
-		bootargs="$bootargs ip=off"
-	else
-		bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask:::"
-	fi
-fi
-
-if [ x$root = xjffs2 ]; then
-	bootargs="$bootargs root=/dev/mtdblock$rootpartnum_nand rootfstype=jffs2"
-fi
-
-if [ x$root = xubifs ]; then
-	bootargs="$bootargs root=ubi0:$ubiroot ubi.mtd=$rootpartnum_nand rootfstype=ubifs"
-fi
-
-if [ x$root = xnet ]; then
-	bootargs="$bootargs root=/dev/nfs nfsroot=$eth0.serverip:$nfsroot,v3,tcp"
-fi
-
-bootargs="$bootargs mtdparts=mxc_nand:$nand_parts"
-
-if [ $kernel = net ]; then
-	if [ x$ip = xdhcp ]; then
-		dhcp
-	fi
-	tftp $uimage uImage || exit 1
-	bootm uImage
-else
-	bootm /dev/nand0.kernel.bb
-fi
diff --git a/arch/arm/boards/eukrea_cpuimx35/env/bin/hush_hack b/arch/arm/boards/eukrea_cpuimx35/env/bin/hush_hack
deleted file mode 100644
index 5fffa92..0000000
--- a/arch/arm/boards/eukrea_cpuimx35/env/bin/hush_hack
+++ /dev/null
@@ -1 +0,0 @@
-nand -a /dev/nand0.*
diff --git a/arch/arm/boards/eukrea_cpuimx35/env/bin/init b/arch/arm/boards/eukrea_cpuimx35/env/bin/init
deleted file mode 100644
index b56d7b5..0000000
--- a/arch/arm/boards/eukrea_cpuimx35/env/bin/init
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-PATH=/env/bin
-export PATH
-
-. /env/config
-if [ -e /dev/nand0 ]; then
-	addpart /dev/nand0 $nand_parts
-
-	# Uh, oh, hush first expands wildcards and then starts executing
-	# commands. What a bug!
-	source /env/bin/hush_hack 
-fi
-
-if [ -f /env/logo.bmp ]; then
-	fb0.enable=1
-	bmp /env/logo.bmp
-	gpio_set_value 1 1
-elif [ -f /env/logo.bmp.lzo ]; then
-	unlzo /env/logo.bmp.lzo /logo.bmp
-	fb0.enable=1
-	bmp /logo.bmp
-	gpio_set_value 1 1
-fi
-
-if [ -z $eth0.ethaddr ]; then
-	while [ -z $eth0.ethaddr ]; do
-		readline "no MAC address set for eth0. please enter the one found on your board: " eth0.ethaddr
-	done
-	echo -a /env/config "eth0.ethaddr=$eth0.ethaddr"
-	saveenv
-fi
-
-echo
-echo -n "Hit any key to stop autoboot: "
-timeout -a $autoboot_timeout
-if [ $? != 0 ]; then
-	echo
-	echo "type update_kernel [<imagename>] to update kernel into flash"
-	echo "type update_root [<imagename>] to update rootfs into flash"
-	echo
-	exit
-fi
-
-boot
diff --git a/arch/arm/boards/eukrea_cpuimx35/env/bin/init_board b/arch/arm/boards/eukrea_cpuimx35/env/bin/init_board
new file mode 100644
index 0000000..173ecf9
--- /dev/null
+++ b/arch/arm/boards/eukrea_cpuimx35/env/bin/init_board
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+if [ -f /env/logo.bmp ]; then
+	bmp /env/logo.bmp
+	fb0.enable=1
+	gpio_set_value 1 1
+elif [ -f /env/logo.bmp.lzo ]; then
+	unlzo /env/logo.bmp.lzo /logo.bmp
+	bmp /logo.bmp
+	fb0.enable=1
+	gpio_set_value 1 1
+fi
+
+if [ -z $eth0.ethaddr ]; then
+	while [ -z $eth0.ethaddr ]; do
+		readline "no MAC address set for eth0. please enter the one found on your board: " eth0.ethaddr
+	done
+	echo -a /env/config "eth0.ethaddr=$eth0.ethaddr"
+	saveenv
+fi
diff --git a/arch/arm/boards/eukrea_cpuimx35/env/bin/update_kernel b/arch/arm/boards/eukrea_cpuimx35/env/bin/update_kernel
deleted file mode 100644
index c2d2cc3..0000000
--- a/arch/arm/boards/eukrea_cpuimx35/env/bin/update_kernel
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-. /env/config
-
-image=$uimage
-part=/dev/nand0.kernel.bb
-
-. /env/bin/_update $1
diff --git a/arch/arm/boards/eukrea_cpuimx35/env/bin/update_root b/arch/arm/boards/eukrea_cpuimx35/env/bin/update_root
deleted file mode 100644
index dd89a5a..0000000
--- a/arch/arm/boards/eukrea_cpuimx35/env/bin/update_root
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-. /env/config
-
-image=$rootfs
-part=/dev/nand0.root.bb
-
-. /env/bin/_update $1
diff --git a/arch/arm/boards/eukrea_cpuimx35/env/config b/arch/arm/boards/eukrea_cpuimx35/env/config
index fc99e51..6ed6b24 100644
--- a/arch/arm/boards/eukrea_cpuimx35/env/config
+++ b/arch/arm/boards/eukrea_cpuimx35/env/config
@@ -1,27 +1,48 @@
 #!/bin/sh
 
-# can be either 'net' or 'nand''
-kernel=nand
-root=ubifs
+# otg port mode : can be 'host' or 'device'
+otg_mode="device"
 
-basedir=cpuimx35
-uimage=$basedir/uImage
-rootfs=$basedir/rootfs
-
-autoboot_timeout=1
-
-nfsroot=""
-bootargs="console=ttymxc0,115200"
-
-nand_parts="256k(barebox)ro,128k(bareboxenv),2432k(kernel),-(root)"
-rootpartnum_nand=3
-ubiroot="eukrea-cpuimx35-rootfs"
+machine=eukrea-cpuimx35
 
 # use 'dhcp' to do dhcp in barebox and in kernel
-ip=off
+# use 'none' if you want to skip kernel ip autoconfiguration
+ip=none
 
 # or set your networking parameters here
 #eth0.ipaddr=a.b.c.d
 #eth0.netmask=a.b.c.d
 #eth0.gateway=a.b.c.d
 #eth0.serverip=a.b.c.d
+
+# can be either 'net' or 'nand'
+kernel_loc=nand
+# can be either 'net', 'nand' or 'initrd'
+rootfs_loc=nand
+
+# rootfs
+rootfs_type=ubifs
+rootfsimage=$machine/rootfs.$rootfs_type
+
+# kernel
+kernelimage_type=uimage
+kernelimage=$machine/uImage-${machine}.bin
+
+# barebox and it's env
+bareboximage=$machine/barebox-${machine}.bin
+bareboxenvimage=$machine/bareboxenv-${machine}.bin
+
+nfsroot="$eth0.serverip:/srv/nfs/$machine"
+
+autoboot_timeout=1
+
+bootargs="console=ttymxc0,115200 otg_mode=$otg_mode"
+
+nand_parts="256k(barebox)ro,128k(bareboxenv),3M(kernel),-(root)"
+rootfs_mtdblock_nand=3
+nand_device="mxc_nand"
+ubiroot="$machine-rootfs"
+device_type="nand"
+
+# set a fancy prompt (if support is compiled in)
+PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m "
-- 
1.7.4




More information about the barebox mailing list