summaryrefslogtreecommitdiffstats
path: root/board/ipe337
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-10-24 11:53:02 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2007-10-24 11:53:02 +0200
commitc7655ebd4396a85440f967154c33d354e205fe76 (patch)
treeaef86dc880d6644522633448cf15e1f86aac81c3 /board/ipe337
parent5614e5c6d63154d68656b40b758bd8128cf180ac (diff)
downloadbarebox-c7655ebd4396a85440f967154c33d354e205fe76.tar.gz
barebox-c7655ebd4396a85440f967154c33d354e205fe76.tar.xz
ipe337: Make the default environment more sophisticated
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'board/ipe337')
-rw-r--r--board/ipe337/defenv/bin/boot35
-rw-r--r--board/ipe337/defenv/bin/init14
-rw-r--r--board/ipe337/defenv/bin/update_kernel20
-rw-r--r--board/ipe337/defenv/bin/update_root20
-rw-r--r--board/ipe337/defenv/config17
5 files changed, 97 insertions, 9 deletions
diff --git a/board/ipe337/defenv/bin/boot b/board/ipe337/defenv/bin/boot
new file mode 100644
index 0000000000..b10ab73d64
--- /dev/null
+++ b/board/ipe337/defenv/bin/boot
@@ -0,0 +1,35 @@
+
+. /env/config
+
+if [ x$1 = "xflash" ]; then
+ root=flash
+ kernel=flash
+fi
+
+if [ x$1 = "xnet" ]; then
+ root=net
+ kernel=net
+fi
+
+if [ "$root" = flash ]; then
+ bootargs="$bootargs root=/dev/mtdblock4 rootfstype=jffs2"
+else
+ if [ "$ip" = dhcp ]; then
+ bootargs="$bootargs ip=dhcp"
+ else
+ bootargs="$bootargs ip=$eth0.ip:$eth0.serverip:$eth0.gateway:$eth0.netmask:::"
+ fi
+ bootargs="$bootargs root=/dev/nfs nfsroot=$eth0.serverip:$nfsroot,v3,tcp"
+fi
+
+bootargs="$bootargs mtdparts=physmap-flash.0:$mtdparts"
+
+if [ "$kernel" = net ]; then
+ if [ $ip = dhcp ]; then
+ dhcp
+ fi
+ tftp $uimage uImage
+ bootm uImage
+else
+ bootm /dev/nor0.kernel
+fi
diff --git a/board/ipe337/defenv/bin/init b/board/ipe337/defenv/bin/init
new file mode 100644
index 0000000000..93eef1c9ca
--- /dev/null
+++ b/board/ipe337/defenv/bin/init
@@ -0,0 +1,14 @@
+PATH=/env/bin
+export PATH
+
+. /env/config
+
+echo -n "Hit any key to stop autoboot: "
+timeout -a 1
+if [ $? != 0 ]; then
+ echo "type update_kernel <imagename> to update kernel into flash"
+ echo "type udate_root <imagename> to update rootfs into flash"
+ exit
+fi
+
+boot
diff --git a/board/ipe337/defenv/bin/update_kernel b/board/ipe337/defenv/bin/update_kernel
new file mode 100644
index 0000000000..a9ce158f9c
--- /dev/null
+++ b/board/ipe337/defenv/bin/update_kernel
@@ -0,0 +1,20 @@
+. /env/config
+
+if [ -z /dev/nor0.kernel ]; then
+ echo "Please add a partition /dev/nor0.kernel containing the kernel image"
+ exit 1
+fi
+
+image=uImage-ipe337
+
+if [ $# = 1 ]; then
+ image=$1
+fi
+
+if [ x$ip = xdhcp ]; then
+ dhcp
+fi
+
+unprotect /dev/nor0.kernel
+erase /dev/nor0.kernel
+tftp "$image" /dev/nor0.kernel
diff --git a/board/ipe337/defenv/bin/update_root b/board/ipe337/defenv/bin/update_root
new file mode 100644
index 0000000000..7d0a21dea1
--- /dev/null
+++ b/board/ipe337/defenv/bin/update_root
@@ -0,0 +1,20 @@
+. /env/config
+
+if [ -z $rootdev ]; then
+ echo "$rootdev not set. Please set to your device containing the root image"
+ exit 1
+fi
+
+image=root-ipe337.jffs2
+
+if [ $# = 1 ]; then
+ image=$1
+fi
+
+if [ x$ip = xdhcp ]; then
+ dhcp
+fi
+
+unprotect "$rootdev"
+erase "$rootdev"
+tftp $image "$rootdev"
diff --git a/board/ipe337/defenv/config b/board/ipe337/defenv/config
index 91b800c9c7..c7d6368d68 100644
--- a/board/ipe337/defenv/config
+++ b/board/ipe337/defenv/config
@@ -1,14 +1,14 @@
-
echo /env/config
eth0.serverip=192.168.23.2
-eth0.mac=80:87:78:74:73:63
+eth0.ethaddr=80:87:78:74:73:63
-mtdparts="128k(uboot)ro,128k(ubootenv),1536k(kernel),-(jffs2)"
-kerneldev="/dev/nor0.2"
-jffs2dev="/dev/nor0.3"
+mtdparts="128k(uboot)ro,128k(ubootenv),128k(alternate),1536k(kernel),-(root)"
ip=dhcp
+eth0.ip=192.168.25.2
+eth0.netmask=255.255.255.0
+eth0.gateway=192.168.25.1
nfsroot="/home/sha/octopus/blackfin/OSELAS.BSP-Pipetronix-ipe337-trunk/root"
uimage=uImage-bfin
@@ -17,10 +17,9 @@ jffs2=root-bfin.jffs2
bootargs="console=ttyBF0,115200"
# can be either 'net' or 'flash'
-kernel=net
-root=net
+kernel=flash
+root=flash
if [ ! -e dev/nor0.0 ]; then
- addpart nor0:$mtdparts
+ addpart /dev/nor0 $mtdparts
fi
-