summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek')
-rw-r--r--arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek/bin/init_board54
-rw-r--r--arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek/config41
2 files changed, 95 insertions, 0 deletions
diff --git a/arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek/bin/init_board b/arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek/bin/init_board
new file mode 100644
index 0000000000..4931342a0b
--- /dev/null
+++ b/arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek/bin/init_board
@@ -0,0 +1,54 @@
+#!/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_udc.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_udc.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 ds5 1
+dfu ${dfu_config}
diff --git a/arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek/config b/arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek/config
new file mode 100644
index 0000000000..f5cd1cc0f7
--- /dev/null
+++ b/arch/arm/boards/at91sam9n12ek/defaultenv-at91sam9n12ek/config
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# use 'dhcp' to do dhcp in barebox and in kernel
+# use 'none' if you want to skip kernel ip autoconfiguration
+ip=dhcp-barebox
+global.dhcp.vendor_id=barebox-at91sam9n12ek
+
+# 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=nfs
+# can be either 'net', 'nor', 'nand' or 'initrd'
+rootfs_loc=net
+# can be either 'nfs', 'tftp', 'nand' or empty
+oftree_loc=nfs
+
+# can be either 'jffs2' or 'ubifs'
+rootfs_type=ubifs
+rootfsimage=root.$rootfs_type
+ubiroot=rootfs
+
+# The image type of the kernel. Can be uimage, zimage, raw, or raw_lzo
+kernelimage=zImage
+#kernelimage=uImage
+#kernelimage=Image
+#kernelimage=Image.lzo
+
+nand_device=atmel_nand
+nand_parts="256k(at91bootstrap),384k(barebox)ro,128k(bareboxenv),128k(bareboxenv2),128k(oftree),1M(free),6M(kernel),120M(rootfs),-(data)"
+rootfs_mtdblock_nand=7
+
+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# "