summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/eukrea_cpuimx35/env/bin/init_board
blob: 2a07a8425a4e0204fc0a7f11d76c6f23e4479a58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh

if [ -f /env/logo.bmp ]; then
	splash /env/logo.bmp
	fb0.enable=1
	gpio_set_value 1 1
elif [ -f /env/logo.bmp.lzo ]; then
	uncompress /env/logo.bmp.lzo /logo.bmp
	splash /logo.bmp
	fb0.enable=1
	gpio_set_value 1 1
fi

gpio_get_value 89
if [ $? -eq 0 ]; then
	gpio_set_value 93 0
	usbserial
	timeout -s -a 2
	gpio_get_value 89
	if [ $? -eq 0 ]; then
		usbserial -d
		dfu -V 0x1234 -P 0x1234 /dev/nand0.barebox.bb(barebox)sr,/dev/nand0.kernel.bb(kernel)r,/dev/nand0.root.bb(root)r
		gpio_get_value 89
		if [ $? -eq 0 ]; then
			usbserial
			autoboot_timeout=60
		else
			reset
		fi
	else
		autoboot_timeout=28
	fi
fi

if [ -z $eth0.ethaddr ]; then
	while [ -z $eth0.ethaddr ]; do
		readline "no MAC address set for eth0. please enter the one found on your board: " eth0.ethaddr
	done
	echo -a /env/config "eth0.ethaddr=$eth0.ethaddr"
	saveenv
fi