~funderscore blog cgit wiki get in touch
aboutsummaryrefslogtreecommitdiff
blob: 6fb47fb266738e2876fa8b20e58755221860695d (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
mmcdev=0
mmcrootfstype=ext4 rootwait
finduuid=part uuid ${boot} ${bootpart} uuid
args_mmc=run finduuid;setenv bootargs console=${console}
	${optargs}
	root=PARTUUID=${uuid} rw
	rootfstype=${mmcrootfstype}
loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
bootscript=echo Running bootscript from mmc${mmcdev} ...;
	source ${loadaddr}
bootenvfile=uEnv.txt
importbootenv=echo Importing environment from mmc${mmcdev} ...;
	env import -t ${loadaddr} ${filesize}
loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile}
get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt}
envboot=mmc dev ${mmcdev};
	if mmc rescan; then
		echo SD/MMC found on device ${mmcdev};
		if run loadbootscript; then
			run bootscript;
		else
			if run loadbootenv; then
				echo Loaded env from ${bootenvfile};
				run importbootenv;
			fi;
			if test -n $uenvcmd; then
				echo Running uenvcmd ...;
				run uenvcmd;
			fi;
		fi;
	fi;
mmcloados=
	if test ${boot_fdt} = yes || test ${boot_fdt} = try; then
		if run get_fdt_mmc; then
			bootz ${loadaddr} - ${fdtaddr};
		else
			if test ${boot_fdt} = try; then
				bootz;
			else
				echo WARN: Cannot load the DT;
				fi;
		fi;
	else
		bootz;
	fi;
mmcboot=mmc dev ${mmcdev};
	devnum=${mmcdev};
	devtype=mmc;
	if mmc rescan; then
		echo SD/MMC found on device ${mmcdev};
		if run loadimage; then
			run args_mmc;
			if test ${boot_fit} -eq 1; then
				run run_fit;
			else
				run mmcloados;
			fi;
		fi;
fi;

init_mmc=run args_all args_mmc
get_overlay_mmc=
	fdt address ${fdtaddr};
	fdt resize 0x100000;
	for overlay in $name_overlays;
	do;
	load mmc ${bootpart} ${dtboaddr} ${bootdir}/dtb/${overlay} &&
	fdt apply ${dtboaddr};
	done;
get_kern_mmc=load mmc ${bootpart} ${loadaddr}
	${bootdir}/${name_kern}
get_fit_mmc=load mmc ${bootpart} ${addr_fit}
	${bootdir}/${name_fit}
partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}