summaryrefslogtreecommitdiffstats
path: root/arch/m68k/boards/phycore_mcf54xx/env/bin
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68k/boards/phycore_mcf54xx/env/bin')
-rw-r--r--arch/m68k/boards/phycore_mcf54xx/env/bin/_update36
-rw-r--r--arch/m68k/boards/phycore_mcf54xx/env/bin/boot38
-rw-r--r--arch/m68k/boards/phycore_mcf54xx/env/bin/init20
-rw-r--r--arch/m68k/boards/phycore_mcf54xx/env/bin/pcidmaloop14
-rw-r--r--arch/m68k/boards/phycore_mcf54xx/env/bin/pciloop13
-rw-r--r--arch/m68k/boards/phycore_mcf54xx/env/bin/update_kernel8
-rw-r--r--arch/m68k/boards/phycore_mcf54xx/env/bin/update_root8
7 files changed, 137 insertions, 0 deletions
diff --git a/arch/m68k/boards/phycore_mcf54xx/env/bin/_update b/arch/m68k/boards/phycore_mcf54xx/env/bin/_update
new file mode 100644
index 0000000000..014bce3512
--- /dev/null
+++ b/arch/m68k/boards/phycore_mcf54xx/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/arch/m68k/boards/phycore_mcf54xx/env/bin/boot b/arch/m68k/boards/phycore_mcf54xx/env/bin/boot
new file mode 100644
index 0000000000..c9fcbac620
--- /dev/null
+++ b/arch/m68k/boards/phycore_mcf54xx/env/bin/boot
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+. /env/config
+
+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=$rootpart rootfstype=jffs2"
+else
+ bootargs="$bootargs root=/dev/nfs nfsroot=$eth0.serverip:$nfsroot"
+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 /dev/nor0.kernel
+fi
+
diff --git a/arch/m68k/boards/phycore_mcf54xx/env/bin/init b/arch/m68k/boards/phycore_mcf54xx/env/bin/init
new file mode 100644
index 0000000000..48e2139f7d
--- /dev/null
+++ b/arch/m68k/boards/phycore_mcf54xx/env/bin/init
@@ -0,0 +1,20 @@
+#!/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 udate_root [<imagename>] to update rootfs into flash"
+ echo
+ exit
+fi
+
+boot \ No newline at end of file
diff --git a/arch/m68k/boards/phycore_mcf54xx/env/bin/pcidmaloop b/arch/m68k/boards/phycore_mcf54xx/env/bin/pcidmaloop
new file mode 100644
index 0000000000..24e76cbed7
--- /dev/null
+++ b/arch/m68k/boards/phycore_mcf54xx/env/bin/pcidmaloop
@@ -0,0 +1,14 @@
+pci stat
+pci stat -c
+while true; do
+ pci readm 32 0xA1000000 32 -s
+ pci readm 32 0xA2000000 256 -s
+ pci dmatx 2000 a2000100 128 -s
+ pci writem 32 0xa2000100 0x12345678 4 -s
+ pci readm 32 0xA3000000 256 -s
+ pci dmatx 2000 a3000040 128 -s
+ pci writem 32 0xa3000100 0x12345678 4 -s
+ pci readm 32 0xA4000000 16 -s
+ pci dmatx 2000 a4000080 4 -s
+ pci writem 32 0xa4000080 0x12345678 4 -s
+done
diff --git a/arch/m68k/boards/phycore_mcf54xx/env/bin/pciloop b/arch/m68k/boards/phycore_mcf54xx/env/bin/pciloop
new file mode 100644
index 0000000000..4a804f9f31
--- /dev/null
+++ b/arch/m68k/boards/phycore_mcf54xx/env/bin/pciloop
@@ -0,0 +1,13 @@
+pci stat
+pci stat -c
+while true; do
+ pci readm 32 0xA1000000 32 -s
+ pci readm 32 0xA2000000 256 -s
+ pci writem 32 0xa2000100 0x12345678 4 -s
+ pci readm 32 0xA3000000 256 -s
+ pci writem 32 0xa3000100 0x12345678 4 -s
+ pci readm 32 0xA4000000 16 -s
+ pci writem 32 0xa4000080 0x12345678 4 -s
+
+# pci dmatx 2000 a3000040 128 -s
+done
diff --git a/arch/m68k/boards/phycore_mcf54xx/env/bin/update_kernel b/arch/m68k/boards/phycore_mcf54xx/env/bin/update_kernel
new file mode 100644
index 0000000000..1ad95fc5d6
--- /dev/null
+++ b/arch/m68k/boards/phycore_mcf54xx/env/bin/update_kernel
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+. /env/config
+
+image=$uimage
+part=/dev/nor0.kernel
+
+. /env/bin/_update $1
diff --git a/arch/m68k/boards/phycore_mcf54xx/env/bin/update_root b/arch/m68k/boards/phycore_mcf54xx/env/bin/update_root
new file mode 100644
index 0000000000..b757a5b922
--- /dev/null
+++ b/arch/m68k/boards/phycore_mcf54xx/env/bin/update_root
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+. /env/config
+
+image=$jffs2
+part=/dev/nor0.root
+
+. /env/bin/_update $1