diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2010-08-04 03:43:59 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-08-06 19:10:43 +0200 |
commit | e2e48bfe48aa2406c494b448e69e66124f9c006a (patch) | |
tree | 0105659e4bc1dae35693d6630001922f1648ab5a /arch/arm/boards/nhk8815/env | |
parent | 7192259daaf5d69441f999bdaabeaf3175e911d9 (diff) | |
download | barebox-e2e48bfe48aa2406c494b448e69e66124f9c006a.tar.gz barebox-e2e48bfe48aa2406c494b448e69e66124f9c006a.tar.xz |
arm: add nhk8815 board support
with the following support
uart 0 & 1
network
nand
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Andrea GALLO <andrea.gallo@stericsson.com>
Cc: Gael SALLES <gael.salles@stericsson.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/nhk8815/env')
-rw-r--r-- | arch/arm/boards/nhk8815/env/bin/_update | 36 | ||||
-rw-r--r-- | arch/arm/boards/nhk8815/env/bin/boot | 38 | ||||
-rw-r--r-- | arch/arm/boards/nhk8815/env/bin/init | 28 | ||||
-rw-r--r-- | arch/arm/boards/nhk8815/env/bin/update_barebox_xmodem | 19 | ||||
-rw-r--r-- | arch/arm/boards/nhk8815/env/bin/update_kernel | 8 | ||||
-rw-r--r-- | arch/arm/boards/nhk8815/env/bin/update_root | 8 | ||||
-rw-r--r-- | arch/arm/boards/nhk8815/env/config | 32 |
7 files changed, 169 insertions, 0 deletions
diff --git a/arch/arm/boards/nhk8815/env/bin/_update b/arch/arm/boards/nhk8815/env/bin/_update new file mode 100644 index 0000000000..fb7cbe8619 --- /dev/null +++ b/arch/arm/boards/nhk8815/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/arm/boards/nhk8815/env/bin/boot b/arch/arm/boards/nhk8815/env/bin/boot new file mode 100644 index 0000000000..fd8d957db1 --- /dev/null +++ b/arch/arm/boards/nhk8815/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" + +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/arch/arm/boards/nhk8815/env/bin/init b/arch/arm/boards/nhk8815/env/bin/init new file mode 100644 index 0000000000..5b45a70d47 --- /dev/null +++ b/arch/arm/boards/nhk8815/env/bin/init @@ -0,0 +1,28 @@ +#!/bin/sh + +PATH=/env/bin +export PATH + +. /env/config + +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 + +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_barebox_xmodem nor to update barebox into flash" + echo + exit +fi + +boot diff --git a/arch/arm/boards/nhk8815/env/bin/update_barebox_xmodem b/arch/arm/boards/nhk8815/env/bin/update_barebox_xmodem new file mode 100644 index 0000000000..40f4ad3dc0 --- /dev/null +++ b/arch/arm/boards/nhk8815/env/bin/update_barebox_xmodem @@ -0,0 +1,19 @@ +#!/bin/sh + +. /env/config + +part=/dev/nand0.barebox + +loadb -f barebox.bin -c + +unprotect $part +echo +echo "erasing partition $part" +erase $part + +echo +echo "flashing barebox.bin to $part" +echo +cp barebox.bin $part +crc32 -f barebox.bin +crc32 -f $part diff --git a/arch/arm/boards/nhk8815/env/bin/update_kernel b/arch/arm/boards/nhk8815/env/bin/update_kernel new file mode 100644 index 0000000000..db0f4c2678 --- /dev/null +++ b/arch/arm/boards/nhk8815/env/bin/update_kernel @@ -0,0 +1,8 @@ +#!/bin/sh + +. /env/config + +image=$uimage +part=/dev/nand0.kernel + +. /env/bin/_update $1 diff --git a/arch/arm/boards/nhk8815/env/bin/update_root b/arch/arm/boards/nhk8815/env/bin/update_root new file mode 100644 index 0000000000..9530e847ef --- /dev/null +++ b/arch/arm/boards/nhk8815/env/bin/update_root @@ -0,0 +1,8 @@ +#!/bin/sh + +. /env/config + +image=$jffs2 +part=/dev/nand0.rootfs + +. /env/bin/_update $1 diff --git a/arch/arm/boards/nhk8815/env/config b/arch/arm/boards/nhk8815/env/config new file mode 100644 index 0000000000..2b50b25ec5 --- /dev/null +++ b/arch/arm/boards/nhk8815/env/config @@ -0,0 +1,32 @@ +#!/bin/sh + +# can be either 'net' or 'flash' +kernel=net +root=net + +# use 'dhcp' todo dhcp in uboot and in kernel +ip=dhcp + +# +# setup default ethernet address +# +#eth0.serverip=192.168.23.108 + +# Partition Size Start +# XloaderTOC + X-Loader 256KB 0x00000000 +# Memory init function 256KB 0x00040000 +# Barebox + env 2MB 0x00080000 +# Kernel Image 3MB 0x00280000 +# JFFS2 Root filesystem 22MB 0x00580000 +# JFFS2 User Data 100MB 0x01b80000 + +nand_parts="256k(xloader)ro,256k(meminit),2M(uboot),3M(kernel),22M(rootfs),100M(userfs),384k(free),128k(ubootenv)" + +uimage=uImage-nhk15 + +# use 'dhcp' to do dhcp in uboot and in kernel +ip=dhcp + +autoboot_timeout=3 + +bootargs="root=/dev/ram0 console=ttyAMA1,115200n8 init=linuxrc" |