summaryrefslogtreecommitdiffstats
path: root/board
diff options
context:
space:
mode:
Diffstat (limited to 'board')
-rw-r--r--board/freescale-mx35-3-stack/env/bin/_update5
-rw-r--r--board/freescale-mx35-3-stack/env/bin/boot50
-rw-r--r--board/freescale-mx35-3-stack/env/bin/init14
-rw-r--r--board/freescale-mx35-3-stack/env/bin/update_kernel2
-rw-r--r--board/freescale-mx35-3-stack/env/bin/update_rootfs (renamed from board/freescale-mx35-3-stack/env/bin/update_root)8
-rw-r--r--board/freescale-mx35-3-stack/env/config41
6 files changed, 72 insertions, 48 deletions
diff --git a/board/freescale-mx35-3-stack/env/bin/_update b/board/freescale-mx35-3-stack/env/bin/_update
index fb7cbe8..4f0839f 100644
--- a/board/freescale-mx35-3-stack/env/bin/_update
+++ b/board/freescale-mx35-3-stack/env/bin/_update
@@ -20,7 +20,7 @@ fi
ping $eth0.serverip
if [ $? -ne 0 ] ; then
- echo "update aborted"
+ echo "Server did not reply! Update aborted."
exit 1
fi
@@ -28,9 +28,12 @@ unprotect $part
echo
echo "erasing partition $part"
+echo
erase $part
echo
echo "flashing $image to $part"
echo
tftp $image $part
+
+protect $part
diff --git a/board/freescale-mx35-3-stack/env/bin/boot b/board/freescale-mx35-3-stack/env/bin/boot
index dfb59aa..fb2fe61 100644
--- a/board/freescale-mx35-3-stack/env/bin/boot
+++ b/board/freescale-mx35-3-stack/env/bin/boot
@@ -3,43 +3,53 @@
. /env/config
if [ x$1 = xnand ]; then
- root=nand
- kernel=nand
+ rootfs_loc=nand
+ kernel_loc=nand
+elif [ x$1 = xnor ]; then
+ rootfs_loc=nor
+ kernel_loc=nor
+elif [ x$1 = xnet ]; then
+ rootfs_loc=net
+ kernel_loc=net
fi
-if [ x$1 = xnet ]; then
- root=net
- kernel=net
-fi
-
-if [ x$1 = xnor ]; then
- root=nor
- kernel=nor
-fi
if [ x$ip = xdhcp ]; then
bootargs="$bootargs ip=dhcp"
-else
+elif [ x$ip != xno ]; then
bootargs="$bootargs ip=$eth0.ipaddr:$eth0.serverip:$eth0.gateway:$eth0.netmask:::"
fi
-if [ x$root = xnand ]; then
- bootargs="$bootargs root=$rootpart_nand rootfstype=jffs2"
-elif [ x$root = xnor ]; then
- bootargs="$bootargs root=$rootpart_nor rootfstype=jffs2"
+
+if [ $rootfs_loc != net ]; then
+ if [ x$rootfs_loc = xnand ]; then
+ rootfs_mtdblock=$rootfs_mtdblock_nand
+ else
+ rootfs_mtdblock=$rootfs_mtdblock_nor
+ fi
+
+
+ if [ $rootfs_type = ubifs ]; then
+ bootargs="$bootargs root=ubi0:root ubi.mtd=$rootfs_mtdblock"
+ else
+ bootargs="$bootargs root=/dev/mtdblock$rootfs_mtdblock"
+ fi
+
+ bootargs="$bootargs rootfstype=$rootfs_type"
else
bootargs="$bootargs root=/dev/nfs nfsroot=$eth0.serverip:$nfsroot,v3,tcp"
fi
-bootargs="$bootargs mtdparts=physmap-flash.0:$nor_parts;imx_nand:$nand_parts"
-if [ $kernel = net ]; then
+bootargs="$bootargs mtdparts=\"physmap-flash.0:$nor_parts;mxc_nand:$nand_parts\""
+
+if [ $kernel_loc = net ]; then
if [ x$ip = xdhcp ]; then
dhcp
fi
- tftp $uimage uImage || exit 1
+ tftp $kernel uImage || exit 1
bootm uImage
-elif [ $kernel = nor ]; then
+elif [ $kernel_loc = nor ]; then
bootm /dev/nor0.kernel
else
bootm /dev/nand0.kernel.bb
diff --git a/board/freescale-mx35-3-stack/env/bin/init b/board/freescale-mx35-3-stack/env/bin/init
index cdf0f6b..f083ace 100644
--- a/board/freescale-mx35-3-stack/env/bin/init
+++ b/board/freescale-mx35-3-stack/env/bin/init
@@ -16,12 +16,12 @@ if [ -e /dev/nand0 ]; then
source /env/bin/hush_hack
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"
-#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"
+fi
echo
echo -n "Hit any key to stop autoboot: "
@@ -29,7 +29,7 @@ timeout -a $autoboot_timeout
if [ $? != 0 ]; then
echo
echo "type update_kernel nand|nor [<imagename>] to update kernel into flash"
- echo "type update_root nand|nor [<imagename>] to update rootfs into flash"
+ echo "type update_rootfs nand|nor [<imagename>] to update rootfs into flash"
echo
exit
fi
diff --git a/board/freescale-mx35-3-stack/env/bin/update_kernel b/board/freescale-mx35-3-stack/env/bin/update_kernel
index 05c822d..63ad11a 100644
--- a/board/freescale-mx35-3-stack/env/bin/update_kernel
+++ b/board/freescale-mx35-3-stack/env/bin/update_kernel
@@ -1,8 +1,8 @@
#!/bin/sh
. /env/config
+image=$kernel
-image=$uimage
if [ x$1 = xnand ]; then
part=/dev/nand0.kernel.bb
elif [ x$1 = xnor ]; then
diff --git a/board/freescale-mx35-3-stack/env/bin/update_root b/board/freescale-mx35-3-stack/env/bin/update_rootfs
index eaf36eb..53dd2ca 100644
--- a/board/freescale-mx35-3-stack/env/bin/update_root
+++ b/board/freescale-mx35-3-stack/env/bin/update_rootfs
@@ -2,7 +2,12 @@
. /env/config
-image=$uimage
+if [ $rootfs_type = ubifs ]; then
+ image=${rootfs}.ubi
+else
+ image=${rootfs}.$rootfs_type
+fi
+
if [ x$1 = xnand ]; then
part=/dev/nand0.root.bb
elif [ x$1 = xnor ]; then
@@ -13,4 +18,3 @@ else
fi
. /env/bin/_update $2
-
diff --git a/board/freescale-mx35-3-stack/env/config b/board/freescale-mx35-3-stack/env/config
index d6afdfb..49c75bf 100644
--- a/board/freescale-mx35-3-stack/env/config
+++ b/board/freescale-mx35-3-stack/env/config
@@ -1,28 +1,35 @@
#!/bin/sh
+# use 'dhcp' to do dhcp in uboot and in kernel
+# use 'no' if you don't want to pass the ip from barebox to the kernel
+#ip=dhcp
+
+# 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', 'nor' or 'nand''
-kernel=net
-root=net
+kernel_loc=nand
+rootfs_loc=nand
-uimage=uImage-pcm038
-jffs2=root-pcm038.jffs2
+# can be either 'jffs2', or 'ubifs'
+rootfs_type=ubifs
+
+kernel=uImage-mx35-3-stack
+rootfs=root-mx35-3-stack
+envimage=u-boot-v2-environment-mx35-3-stack
autoboot_timeout=3
-nfsroot="/ptx/work/octopus/rsc/svn/oselas/bsp/phytec/phyCORE-i.MX27/OSELAS.BSP-Phytec-phyCORE-i.MX27-trunk/root"
+nfsroot="/path/to/nfs/root"
bootargs="console=ttymxc0,115200"
-nor_parts="256k(uboot)ro,128k(ubootenv),1536k(kernel),-(root)"
-rootpart_nor="/dev/mtdblock3"
-
-nand_parts="256k(uboot)ro,128k(ubootenv),1536k(kernel),-(root)"
-rootpart_nand="/dev/mtdblock7"
+bootargs="$bootargs video=mx3fb:CTP-CLAA070LC0ACW"
-# use 'dhcp' to do dhcp in uboot and in kernel
-ip=dhcp
+nor_parts="256k(uboot)ro,512k(ubootenv),2M(kernel),-(root)"
+rootfs_mtdblock_nor=3
-# 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
+nand_parts="256k(uboot)ro,512k(ubootenv),2M(kernel),-(root)"
+rootfs_mtdblock_nand=7