diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-10-10 08:31:06 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-10-10 08:31:06 +0200 |
commit | db9c78d57949cdd4c2c019eba9bd193c3171eb4d (patch) | |
tree | 79234eed17e54e07d38214b0186e05f775f220d9 /arch/arm/boards/at91sam9261ek/defaultenv-at91sam9261ek/bin | |
parent | c80ba33cbe1eb2331a0544d0f553d73e091bb322 (diff) | |
parent | 790980bf18af13f5d72a31b49febd7086cf307af (diff) | |
download | barebox-db9c78d57949cdd4c2c019eba9bd193c3171eb4d.tar.gz barebox-db9c78d57949cdd4c2c019eba9bd193c3171eb4d.tar.xz |
Merge branch 'for-next/defenv'
Diffstat (limited to 'arch/arm/boards/at91sam9261ek/defaultenv-at91sam9261ek/bin')
-rw-r--r-- | arch/arm/boards/at91sam9261ek/defaultenv-at91sam9261ek/bin/init_board | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/arch/arm/boards/at91sam9261ek/defaultenv-at91sam9261ek/bin/init_board b/arch/arm/boards/at91sam9261ek/defaultenv-at91sam9261ek/bin/init_board new file mode 100644 index 0000000000..39a7f0826b --- /dev/null +++ b/arch/arm/boards/at91sam9261ek/defaultenv-at91sam9261ek/bin/init_board @@ -0,0 +1,55 @@ +#!/bin/sh + +splash=/env/splash.png + +if [ -f ${splash} -a -e /dev/fb0 ]; then + splash -o ${splash} + fb0.enable=1 +fi + +button_name="dfu_bp" +button_wait=5 + +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 "" + +led ds7 1 +dfu ${dfu_config} +led ds7 0 |