summaryrefslogtreecommitdiffstats
path: root/arch/blackfin/boards/ipe337/env
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2010-07-22 05:00:13 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-07-23 08:35:25 +0200
commitd8c86961b333a9c88cf2aa4282a43b8382e9b810 (patch)
treecf8b39db96805a2ed876ba14f6824a96ebffc906 /arch/blackfin/boards/ipe337/env
parentd879de38e8430eeb9b37b7b6a2ac3341b0b029f7 (diff)
downloadbarebox-d8c86961b333a9c88cf2aa4282a43b8382e9b810.tar.gz
barebox-d8c86961b333a9c88cf2aa4282a43b8382e9b810.tar.xz
move boards to arch/<architecure>/boards
this will allow each arch to handle the boards more simply and depending on there need the env var BOARD will refer to the current board dirent for sandbox as we have only one board the board dirent is arch/sandbox/board Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/blackfin/boards/ipe337/env')
-rw-r--r--arch/blackfin/boards/ipe337/env/bin/_alternate9
-rw-r--r--arch/blackfin/boards/ipe337/env/bin/_update37
-rw-r--r--arch/blackfin/boards/ipe337/env/bin/boot54
-rw-r--r--arch/blackfin/boards/ipe337/env/bin/init24
-rw-r--r--arch/blackfin/boards/ipe337/env/bin/magic.bin1
-rw-r--r--arch/blackfin/boards/ipe337/env/bin/reset_ageing27
-rw-r--r--arch/blackfin/boards/ipe337/env/bin/update_application8
-rw-r--r--arch/blackfin/boards/ipe337/env/bin/update_bareboxenv8
-rw-r--r--arch/blackfin/boards/ipe337/env/bin/update_kernel19
-rw-r--r--arch/blackfin/boards/ipe337/env/bin/update_persistent8
-rw-r--r--arch/blackfin/boards/ipe337/env/bin/update_system19
-rw-r--r--arch/blackfin/boards/ipe337/env/config27
12 files changed, 241 insertions, 0 deletions
diff --git a/arch/blackfin/boards/ipe337/env/bin/_alternate b/arch/blackfin/boards/ipe337/env/bin/_alternate
new file mode 100644
index 0000000000..10ae2134c0
--- /dev/null
+++ b/arch/blackfin/boards/ipe337/env/bin/_alternate
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+. /env/config
+
+alternate $ageing
+if [ $? -lt 2 ]; then
+ echo "Error when accesing ageing-partition!"
+ exit 1
+fi
diff --git a/arch/blackfin/boards/ipe337/env/bin/_update b/arch/blackfin/boards/ipe337/env/bin/_update
new file mode 100644
index 0000000000..5419ece6a7
--- /dev/null
+++ b/arch/blackfin/boards/ipe337/env/bin/_update
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+if [ $# = 1 ]; then
+ image=$1
+fi
+
+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 [ 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"
+tftp $image $part
+
+protect $part
diff --git a/arch/blackfin/boards/ipe337/env/bin/boot b/arch/blackfin/boards/ipe337/env/bin/boot
new file mode 100644
index 0000000000..62807d211f
--- /dev/null
+++ b/arch/blackfin/boards/ipe337/env/bin/boot
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+. /env/config
+
+alternate $ageing
+ret=$?
+
+if [ $ret = 0 ]; then
+ echo "Error when accesing ageing-partition!"
+ exit 1
+elif [ $ret = 2 ]; then
+ act_kernel=/dev/nor0.kernel0
+ act_rootfs=/dev/mtdblock5
+else
+ act_kernel=/dev/nor0.kernel1
+ act_rootfs=/dev/mtdblock6
+fi
+echo "-> Active kernel: $act_kernel"
+echo "-> Active system: $act_rootfs"
+echo
+
+if [ x$1 = xflash ]; then
+ root=flash
+ kernel=flash
+fi
+
+if [ x$1 = xnet ]; then
+ root=net
+ kernel=net
+fi
+
+if [ x$ip = xdhcp ]; then
+ bootargs="$bootargs ip=dhcp"
+else
+ bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask:::"
+fi
+
+if [ x$root = xflash ]; then
+ bootargs="$bootargs root=$act_rootfs rootfstype=jffs2"
+else
+ bootargs="$bootargs root=/dev/nfs nfsroot=$eth0.serverip:$nfsroot,v3,tcp"
+fi
+
+bootargs="$bootargs mtdparts=physmap-flash.0:$mtdparts"
+
+if [ $kernel = net ]; then
+ if [ x$ip = xdhcp ]; then
+ dhcp
+ fi
+ tftp $uimage uImage || exit 1
+ bootm uImage
+else
+ bootm $act_kernel
+fi
diff --git a/arch/blackfin/boards/ipe337/env/bin/init b/arch/blackfin/boards/ipe337/env/bin/init
new file mode 100644
index 0000000000..e864dc5a42
--- /dev/null
+++ b/arch/blackfin/boards/ipe337/env/bin/init
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+PATH=/env/bin
+export PATH
+
+. /env/config
+addpart /dev/nor0 $mtdparts
+
+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_system [<imagename>] to update rootfs into flash."
+ echo "Type update_application [<imagename>] to update applications into flash."
+ echo "Type update_persistent [<imagename>] to update persistent into flash."
+ echo "Type update_bareboxenv [<imagename>] to update bareboxenv into flash (use with care!)."
+ echo "Type reset_ageing to initialize the ageing partittion (use with care!)."
+ echo
+ exit
+fi
+
+boot
diff --git a/arch/blackfin/boards/ipe337/env/bin/magic.bin b/arch/blackfin/boards/ipe337/env/bin/magic.bin
new file mode 100644
index 0000000000..f8bff393cf
--- /dev/null
+++ b/arch/blackfin/boards/ipe337/env/bin/magic.bin
@@ -0,0 +1 @@
+(i \ No newline at end of file
diff --git a/arch/blackfin/boards/ipe337/env/bin/reset_ageing b/arch/blackfin/boards/ipe337/env/bin/reset_ageing
new file mode 100644
index 0000000000..2c95ae762e
--- /dev/null
+++ b/arch/blackfin/boards/ipe337/env/bin/reset_ageing
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+. /env/config
+
+image=/env/bin/magic.bin
+part=$ageing
+
+if [ \! -e "$part" ]; then
+ echo "Partition $part does not exist"
+ exit 1
+fi
+
+unprotect $part
+
+echo
+echo "Erasing partition $part"
+erase $part
+
+echo
+echo "Creating magic"
+cp $image $part
+
+echo
+echo "Testing partition"
+. /env/bin/_alternate
+
+protect $part
diff --git a/arch/blackfin/boards/ipe337/env/bin/update_application b/arch/blackfin/boards/ipe337/env/bin/update_application
new file mode 100644
index 0000000000..46ad210e36
--- /dev/null
+++ b/arch/blackfin/boards/ipe337/env/bin/update_application
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+. /env/config
+
+image=$appimage
+part=/dev/nor0.application
+
+. /env/bin/_update $1
diff --git a/arch/blackfin/boards/ipe337/env/bin/update_bareboxenv b/arch/blackfin/boards/ipe337/env/bin/update_bareboxenv
new file mode 100644
index 0000000000..b0a32c626b
--- /dev/null
+++ b/arch/blackfin/boards/ipe337/env/bin/update_bareboxenv
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+. /env/config
+
+image=$envimage
+part=/dev/nor0.bareboxenv
+
+. /env/bin/_update $1
diff --git a/arch/blackfin/boards/ipe337/env/bin/update_kernel b/arch/blackfin/boards/ipe337/env/bin/update_kernel
new file mode 100644
index 0000000000..d5c210eb2b
--- /dev/null
+++ b/arch/blackfin/boards/ipe337/env/bin/update_kernel
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+. /env/config
+
+image=$uimage
+
+alternate $ageing
+ret=$?
+
+if [ $ret = 0 ]; then
+ echo "Error when accesing ageing-partition!"
+ exit 1
+elif [ $ret = 2 ]; then
+ part=/dev/nor0.kernel0
+else
+ part=/dev/nor0.kernel1
+fi
+
+. /env/bin/_update $1
diff --git a/arch/blackfin/boards/ipe337/env/bin/update_persistent b/arch/blackfin/boards/ipe337/env/bin/update_persistent
new file mode 100644
index 0000000000..a869b2218d
--- /dev/null
+++ b/arch/blackfin/boards/ipe337/env/bin/update_persistent
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+. /env/config
+
+image=$perimage
+part=/dev/nor0.persistent
+
+. /env/bin/_update $1
diff --git a/arch/blackfin/boards/ipe337/env/bin/update_system b/arch/blackfin/boards/ipe337/env/bin/update_system
new file mode 100644
index 0000000000..598fc10e81
--- /dev/null
+++ b/arch/blackfin/boards/ipe337/env/bin/update_system
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+. /env/config
+
+image=$jffs2
+
+alternate $ageing
+ret=$?
+
+if [ $ret = 0 ]; then
+ echo "Error when accesing ageing-partition!"
+ exit 1
+elif [ $ret = 2 ]; then
+ part=/dev/nor0.system0
+else
+ part=/dev/nor0.system1
+fi
+
+. /env/bin/_update $1
diff --git a/arch/blackfin/boards/ipe337/env/config b/arch/blackfin/boards/ipe337/env/config
new file mode 100644
index 0000000000..7c5ee76e30
--- /dev/null
+++ b/arch/blackfin/boards/ipe337/env/config
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# can be either 'net' or 'flash'
+kernel=net
+root=net
+
+# use 'dhcp' todo dhcp in barebox and in kernel
+#ip=dhcp
+
+eth0.ipaddr=192.168.23.164
+eth0.netmask=255.255.255.0
+eth0.gateway=192.168.23.2
+eth0.serverip=192.168.23.2
+
+uimage=uImage-bfin
+jffs2=root-bfin.jffs2
+appimage=apps-bfin
+perimage=pers-bfin
+envimage=uEnv-bfin
+
+autoboot_timeout=1
+
+nfsroot="/ptx/work/octopus/wsa/svn/OSELAS.BSP-Pipetronix-ipe337-trunk/root"
+bootargs="console=ttyBF0,115200"
+
+mtdparts="128k(barebox)ro,128k(bareboxenv),128k(ageing),1280k(kernel0),1280k(kernel1),8704k(system0),8704k(system1),8320k(application),4096k(persistent)"
+ageing=/dev/nor0.ageing