diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-06-04 09:31:15 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-06-06 09:30:32 +0200 |
commit | f3351ebd7864b83b1f5f3cdc7c8a9f9110cb562f (patch) | |
tree | d552d362afb4ffd949dba5e758e9e8fbfe73b9a1 /board/at91sam9260ek/env/bin | |
parent | 3cde41fb901f1c6157c7e3e845239b279e5a2cb0 (diff) | |
download | barebox-f3351ebd7864b83b1f5f3cdc7c8a9f9110cb562f.tar.gz barebox-f3351ebd7864b83b1f5f3cdc7c8a9f9110cb562f.tar.xz |
add basic at91sam9260 support. Currently only second stage
bootloader is supported:
- No SDRAM initialisation
- No UART init / baudrate change
Diffstat (limited to 'board/at91sam9260ek/env/bin')
-rw-r--r-- | board/at91sam9260ek/env/bin/_update | 36 | ||||
-rw-r--r-- | board/at91sam9260ek/env/bin/boot | 38 | ||||
-rw-r--r-- | board/at91sam9260ek/env/bin/init | 19 | ||||
-rw-r--r-- | board/at91sam9260ek/env/bin/pcidmaloop | 14 | ||||
-rw-r--r-- | board/at91sam9260ek/env/bin/pciloop | 13 | ||||
-rw-r--r-- | board/at91sam9260ek/env/bin/update_kernel | 8 | ||||
-rw-r--r-- | board/at91sam9260ek/env/bin/update_root | 8 |
7 files changed, 136 insertions, 0 deletions
diff --git a/board/at91sam9260ek/env/bin/_update b/board/at91sam9260ek/env/bin/_update new file mode 100644 index 0000000000..fb7cbe8619 --- /dev/null +++ b/board/at91sam9260ek/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/at91sam9260ek/env/bin/boot b/board/at91sam9260ek/env/bin/boot new file mode 100644 index 0000000000..ed6f11a108 --- /dev/null +++ b/board/at91sam9260ek/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=192.168.23.111:$nfsroot" +fi + +bootargs="$bootargs mtdparts=physmap-flash.0:$mtdparts" + +if [ $kernel = net ]; then + if [ x$ip = xdhcp ]; then + dhcp + fi + tftp $uimage uImage + bootm uImage +else + bootm /dev/nor0.kernel +fi + diff --git a/board/at91sam9260ek/env/bin/init b/board/at91sam9260ek/env/bin/init new file mode 100644 index 0000000000..b8d8399842 --- /dev/null +++ b/board/at91sam9260ek/env/bin/init @@ -0,0 +1,19 @@ +#!/bin/sh + +PATH=/env/bin +export PATH + +. /env/config + +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/board/at91sam9260ek/env/bin/pcidmaloop b/board/at91sam9260ek/env/bin/pcidmaloop new file mode 100644 index 0000000000..24e76cbed7 --- /dev/null +++ b/board/at91sam9260ek/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/board/at91sam9260ek/env/bin/pciloop b/board/at91sam9260ek/env/bin/pciloop new file mode 100644 index 0000000000..4a804f9f31 --- /dev/null +++ b/board/at91sam9260ek/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/board/at91sam9260ek/env/bin/update_kernel b/board/at91sam9260ek/env/bin/update_kernel new file mode 100644 index 0000000000..1ad95fc5d6 --- /dev/null +++ b/board/at91sam9260ek/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/board/at91sam9260ek/env/bin/update_root b/board/at91sam9260ek/env/bin/update_root new file mode 100644 index 0000000000..b757a5b922 --- /dev/null +++ b/board/at91sam9260ek/env/bin/update_root @@ -0,0 +1,8 @@ +#!/bin/sh + +. /env/config + +image=$jffs2 +part=/dev/nor0.root + +. /env/bin/_update $1 |