diff options
Diffstat (limited to 'arch/arm/boards/haba-knx/defaultenv-haba-knx')
-rw-r--r-- | arch/arm/boards/haba-knx/defaultenv-haba-knx/bin/init_board | 49 | ||||
-rw-r--r-- | arch/arm/boards/haba-knx/defaultenv-haba-knx/config | 40 |
2 files changed, 89 insertions, 0 deletions
diff --git a/arch/arm/boards/haba-knx/defaultenv-haba-knx/bin/init_board b/arch/arm/boards/haba-knx/defaultenv-haba-knx/bin/init_board new file mode 100644 index 0000000000..0a6baf722b --- /dev/null +++ b/arch/arm/boards/haba-knx/defaultenv-haba-knx/bin/init_board @@ -0,0 +1,49 @@ +#!/bin/sh + +button_name="dfu_bp" +button_wait=5 + +product_id=0x1234 +vendor_id=0x4321 + +dfu_config="/dev/nand0.barebox.bb(barebox)sr,/dev/nand0.kernel.bb(kernel)r,/dev/nand0.rootfs.bb(rootfs)r" + +if [ $at91_udc0.vbus != 1 ] +then + echo "No USB Device cable plugged, normal boot" + exit +fi + +gpio_get_value ${dfu_button} +if [ $? != 0 ] +then + autoboot_timeout=16 + echo "enable tty over USB Device, increase the boot delay to ${autoboot_timeout}s" + usbserial + exit +fi + +echo "${button_name} pressed detected wait ${button_wait}s" +timeout -s -a ${button_wait} + +if [ $at91_udc0.vbus != 1 ] +then + echo "No USB Device cable plugged, normal boot" + exit +fi + +gpio_get_value ${dfu_button} +if [ $? != 0 ] +then + echo "${button_name} released, normal boot" + autoboot_timeout=16 + echo "enable tty over USB Device, increase the boot delay to ${autoboot_timeout}s" + usbserial + exit +fi + +echo "" +echo "Start DFU Mode" +echo "" + +dfu ${dfu_config} -P ${product_id} -V ${vendor_id} diff --git a/arch/arm/boards/haba-knx/defaultenv-haba-knx/config b/arch/arm/boards/haba-knx/defaultenv-haba-knx/config new file mode 100644 index 0000000000..d1dca105ad --- /dev/null +++ b/arch/arm/boards/haba-knx/defaultenv-haba-knx/config @@ -0,0 +1,40 @@ +#!/bin/sh + +# use 'dhcp' to do dhcp in barebox and in kernel +# use 'none' if you want to skip kernel ip autoconfiguration +ip=none +#ip=dhcp-barebox +[ x$armlinux_architecture = x4310 ] && dhcp_vendor_id=barebox-haba-knx-lite + +# 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=a.b.c.d + +# can be either 'nfs', 'tftp', 'nor' or 'nand' +kernel_loc=nand +# can be either 'net', 'nor', 'nand' or 'initrd' +rootfs_loc=nand +# can be either 'nfs', 'tftp', 'nor', 'nand' or empty +oftree_loc=nand + +# can be either 'jffs2' or 'ubifs' +rootfs_type=ubifs +rootfsimage=root.$rootfs_type + +kernelimage=zImage +#kernelimage=uImage +#kernelimage=Image +#kernelimage=Image.lzo + +nand_device=atmel_nand +nand_parts="128k(at91bootstrap),256k(barebox)ro,128k(bareboxenv),128k(bareboxenv2),128k(oftree),4M(kernel),120M(rootfs),-(data)" +rootfs_mtdblock_nand=6 + +autoboot_timeout=3 + +bootargs="console=ttyS0,115200" + +# set a fancy prompt (if support is compiled in) +PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m\n# " |