summaryrefslogtreecommitdiffstats
path: root/boot-scr/boot.txt
blob: 61600fddf20c820c570db625d97ca2ad154c8796 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
setenv kerneladdr 0x82000000
setenv splashzipaddr 0x80400000
setenv splashaddr 0x86000000
setenv bootargs mpurate=${mpurate} mux=${mux}

echo "Replicant GTA04"

i2c dev 0
status init

if mmc rescan 0
then
	# Load splash

	if fatload mmc 0 ${splashaddr} splash.rgb16
	then
		if lcm init
		then
			lcm power 2
			lcm on
			lcm fb ${splashaddr}
			lcm backlight 255
		fi
	else
		if fatload mmc 0 ${splashzipaddr} splash.rgb16z
		then
			unzip ${splashzipaddr} ${splashaddr}

			if lcm init
			then
				lcm power 2
				lcm on
				lcm fb ${splashaddr}
				lcm backlight 255
			fi
		fi
	fi

	# Load kernel

	if status check 1 || ext4load mmc 0:3 ${kerneladdr} .startrecovery
	then
		status set 3

		if fatload mmc 0 ${kerneladdr} recovery.img
		then
			status set 2
			bootm ${kerneladdr}
		else
			status set 19
			echo "Loading recovery kernel failed"

			if fatload mmc 0 ${kerneladdr} boot.img
			then
				status set 11
				bootm ${kerneladdr}
			else
				status set 9
				echo "Loading kernel failed"
			fi
		fi
	fi

	status set 18

	if fatload mmc 0 ${kerneladdr} boot.img
	then
		status set 10
		bootm ${kerneladdr}
	else
		status set B
		echo "Loading kernel failed"

		if fatload mmc 0 ${kerneladdr} recovery.img
		then
			status set A
			bootm ${kerneladdr}
		else
			status set 9
			echo "Loading recovery kernel failed"
		fi
	fi
else
	echo "Scanning mmc failed"
	status set 8
fi