diff options
Diffstat (limited to 'arch/m68k/boards/phycore_mcf54xx/env')
-rw-r--r-- | arch/m68k/boards/phycore_mcf54xx/env/bin/_update | 36 | ||||
-rw-r--r-- | arch/m68k/boards/phycore_mcf54xx/env/bin/boot | 38 | ||||
-rw-r--r-- | arch/m68k/boards/phycore_mcf54xx/env/bin/init | 20 | ||||
-rw-r--r-- | arch/m68k/boards/phycore_mcf54xx/env/bin/pcidmaloop | 14 | ||||
-rw-r--r-- | arch/m68k/boards/phycore_mcf54xx/env/bin/pciloop | 13 | ||||
-rw-r--r-- | arch/m68k/boards/phycore_mcf54xx/env/bin/update_kernel | 8 | ||||
-rw-r--r-- | arch/m68k/boards/phycore_mcf54xx/env/bin/update_root | 8 | ||||
-rw-r--r-- | arch/m68k/boards/phycore_mcf54xx/env/config | 32 |
8 files changed, 169 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 diff --git a/arch/m68k/boards/phycore_mcf54xx/env/config b/arch/m68k/boards/phycore_mcf54xx/env/config new file mode 100644 index 0000000000..58550625d2 --- /dev/null +++ b/arch/m68k/boards/phycore_mcf54xx/env/config @@ -0,0 +1,32 @@ +#!/bin/sh + +# can be either 'net' or 'flash' +kernel=net +root=net + +# use 'dhcp' todo dhcp in barebox and in kernel +ip=dhcp + +# +# setup default ethernet address +# +eth0.ipaddr=192.168.0.99 +eth0.netmask=255.255.255.0 +eth0.gateway=192.168.0.110 +eth0.serverip=192.168.0.110 + +uimage=uImage-mcf5485 +jffs2=root-mcf5485-ptx.jffs2 + +autoboot_timeout=3 + +#nfsroot="/home/cschlote/src/bitshrine/ltib/rootfs" +nfsroot="/home/cschlote/src/pengutronics/ptxdist-project-KP-UKD/root-debug,v3" +bootargs="console=ttyS0 rw initcall_debug debug" + +# +# setup the partitions in the main flash +# +mtdparts=512k(self),256k(env),3M(kernel),-(root) +rootpart="/dev/mtdblock3" + |