summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2008-09-02 09:26:30 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2008-09-02 09:26:30 +0200
commit6b1c8e0f50f73552c9db2a7e04960deef5cd0e6a (patch)
tree66f7d1deb96a87a424890b9bac7502e48d2a39d0
parentb1e93dc9ae57cf009b093eab1a935efb2bb45527 (diff)
parent53c4ef6b693e7a3ecd09a16c6d96aaf512bf6738 (diff)
downloadbarebox-6b1c8e0f50f73552c9db2a7e04960deef5cd0e6a.tar.gz
barebox-6b1c8e0f50f73552c9db2a7e04960deef5cd0e6a.tar.xz
Merge branch 'for-sha' of ssh://sha@octopus/home/git/projects/u-boot-v2 into from-mkl
-rw-r--r--arch/arm/configs/pm9263_defconfig (renamed from arch/arm/configs/pn9263_defconfig)0
-rw-r--r--board/pm9263/env/bin/_update36
-rw-r--r--board/pm9263/env/bin/boot25
-rw-r--r--board/pm9263/env/bin/hush_hack1
-rw-r--r--board/pm9263/env/bin/init24
-rw-r--r--board/pm9263/env/bin/update_kernel11
-rw-r--r--board/pm9263/env/bin/update_root14
-rw-r--r--board/pm9263/env/config30
-rw-r--r--board/pm9263/init.c4
9 files changed, 115 insertions, 30 deletions
diff --git a/arch/arm/configs/pn9263_defconfig b/arch/arm/configs/pm9263_defconfig
index 682eacba78..682eacba78 100644
--- a/arch/arm/configs/pn9263_defconfig
+++ b/arch/arm/configs/pm9263_defconfig
diff --git a/board/pm9263/env/bin/_update b/board/pm9263/env/bin/_update
new file mode 100644
index 0000000000..fb7cbe8619
--- /dev/null
+++ b/board/pm9263/env/bin/_update
@@ -0,0 +1,36 @@
+#!/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/board/pm9263/env/bin/boot b/board/pm9263/env/bin/boot
index ed6f11a108..05241d93c0 100644
--- a/board/pm9263/env/bin/boot
+++ b/board/pm9263/env/bin/boot
@@ -2,9 +2,9 @@
. /env/config
-if [ x$1 = xflash ]; then
- root=flash
- kernel=flash
+if [ x$1 = xnand ]; then
+ root=nand
+ kernel=nand
fi
if [ x$1 = xnet ]; then
@@ -12,19 +12,26 @@ if [ x$1 = xnet ]; then
kernel=net
fi
+if [ x$1 = xnor ]; then
+ root=nor
+ kernel=nor
+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=$rootpart rootfstype=jffs2"
+if [ x$root = xnand ]; then
+ bootargs="$bootargs root=$rootpart_nand rootfstype=jffs2"
+elif [ x$root = xnor ]; then
+ bootargs="$bootargs root=$rootpart_nor rootfstype=jffs2"
else
- bootargs="$bootargs root=/dev/nfs nfsroot=192.168.23.111:$nfsroot"
+ bootargs="$bootargs root=/dev/nfs nfsroot=$eth0.serverip:$nfsroot,v3,tcp"
fi
-bootargs="$bootargs mtdparts=physmap-flash.0:$mtdparts"
+bootargs="$bootargs mtdparts=physmap-flash.0:$nor_parts"
if [ $kernel = net ]; then
if [ x$ip = xdhcp ]; then
@@ -32,7 +39,9 @@ if [ $kernel = net ]; then
fi
tftp $uimage uImage
bootm uImage
-else
+elif [ $kernel = nor ]; then
bootm /dev/nor0.kernel
+else
+ bootm /dev/nand0.kernel.bb
fi
diff --git a/board/pm9263/env/bin/hush_hack b/board/pm9263/env/bin/hush_hack
new file mode 100644
index 0000000000..5fffa92ecd
--- /dev/null
+++ b/board/pm9263/env/bin/hush_hack
@@ -0,0 +1 @@
+nand -a /dev/nand0.*
diff --git a/board/pm9263/env/bin/init b/board/pm9263/env/bin/init
index b8d8399842..02f5cd415b 100644
--- a/board/pm9263/env/bin/init
+++ b/board/pm9263/env/bin/init
@@ -4,16 +4,34 @@ PATH=/env/bin
export PATH
. /env/config
+if [ -e /dev/nor0 ]; then
+ addpart /dev/nor0 $nor_parts
+fi
+
+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 [ -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: "
timeout -a $autoboot_timeout
if [ $? != 0 ]; then
echo
- echo "type update_kernel [<imagename>] to update kernel into flash"
- echo "type udate_root [<imagename>] to update rootfs into flash"
+ echo "type update_kernel nor [<imagename>] to update kernel into flash"
+ echo "type update_root nor [<imagename>] to update rootfs into flash"
echo
exit
fi
-boot \ No newline at end of file
+boot
diff --git a/board/pm9263/env/bin/update_kernel b/board/pm9263/env/bin/update_kernel
index 1ad95fc5d6..05c822d860 100644
--- a/board/pm9263/env/bin/update_kernel
+++ b/board/pm9263/env/bin/update_kernel
@@ -3,6 +3,13 @@
. /env/config
image=$uimage
-part=/dev/nor0.kernel
+if [ x$1 = xnand ]; then
+ part=/dev/nand0.kernel.bb
+elif [ x$1 = xnor ]; then
+ part=/dev/nor0.kernel
+else
+ echo "usage: $0 nor|nand [imagename]"
+ exit 1
+fi
-. /env/bin/_update $1
+. /env/bin/_update $2
diff --git a/board/pm9263/env/bin/update_root b/board/pm9263/env/bin/update_root
index b757a5b922..eaf36ebcea 100644
--- a/board/pm9263/env/bin/update_root
+++ b/board/pm9263/env/bin/update_root
@@ -2,7 +2,15 @@
. /env/config
-image=$jffs2
-part=/dev/nor0.root
+image=$uimage
+if [ x$1 = xnand ]; then
+ part=/dev/nand0.root.bb
+elif [ x$1 = xnor ]; then
+ part=/dev/nor0.root
+else
+ echo "usage: $0 nor|nand [imagename]"
+ exit 1
+fi
+
+. /env/bin/_update $2
-. /env/bin/_update $1
diff --git a/board/pm9263/env/config b/board/pm9263/env/config
index c9b0e0ea91..7cbff9476b 100644
--- a/board/pm9263/env/config
+++ b/board/pm9263/env/config
@@ -1,20 +1,28 @@
#!/bin/sh
-# can be either 'net' or 'flash'
+# can be either 'net', 'nor' or 'nand''
kernel=net
root=net
-# use 'dhcp' todo dhcp in uboot and in kernel
-ip=dhcp
+uimage=uImage-PM9263
+jffs2=root-PM9263.jffs2
-#
-# setup default ethernet address
-#
-eth0.serverip=192.168.23.108
+autoboot_timeout=3
-uimage=uImage-at91sam9260ek
+nfsroot="/ptx/work/octopus/mkl/bucyrus/OSELAS.BSP-Bucyrus-Grabowski-trunk/platform-Ronetix-PM9263/root"
+bootargs="console=ttyS0,115200"
-autoboot_timeout=3
+nor_parts="256k(uboot)ro,64k(ubootenv),1536k(kernel),-(root)"
+rootpart_nor="/dev/mtdblock3"
+
+#nand_parts="256k(uboot)ro,64k(ubootenv),1536k(kernel),-(root)"
+#rootpart_nand="/dev/mtdblock7"
+
+# use 'dhcp' to do dhcp in uboot and in kernel
+ip=dhcp
-nfsroot="/home/jbe/pengutronix/bsp/OSELAS.BSP-Phytec-phyCORE-i.MX27-trunk/root,v3"
-bootargs="console=ttyS0,115200 rw init=/bin/sh"
+# 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=192.168.23.1
diff --git a/board/pm9263/init.c b/board/pm9263/init.c
index 001879ae07..778c5a0b23 100644
--- a/board/pm9263/init.c
+++ b/board/pm9263/init.c
@@ -98,13 +98,11 @@ static int pm9263_devices_init(void)
register_device(&macb_dev);
register_device(&cfi_dev);
-#ifdef CONFIG_PARTITION
dev_add_partition(&cfi_dev, 0x00000, 0x40000, PARTITION_FIXED, "self");
dev_add_partition(&cfi_dev, 0x40000, 0x10000, PARTITION_FIXED, "env");
-#endif
armlinux_set_bootparams((void *)0x20000100);
- armlinux_set_architecture(0x4b2);
+ armlinux_set_architecture(0x5c3);
return 0;
}