-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathm_load_fdt.uboot
42 lines (41 loc) · 1.09 KB
/
m_load_fdt.uboot
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
# m_load_fdt
# load device tree binary
#
# global varable
# - list of file names (`fdt`): _StringValue_
# - load address (`fdt_addr_r`): _HexValue_
# - name prefix (`prefix`): _StringValue_
#
# input parameter
# - storage class (`p_class`): mmc, usb, sata
# - storage device (`p_device`): _HexValue_
#
# output parameter
# - fdt_addr_r will be set to '-' if no dtb file was loaded
if test "${fdt}" != ""; then
v_success=false;
for v_fdt in ${fdt}; do
if test ${v_success} = false; then
p_filename=${prefix}/${p_conf}/kernel/${v_fdt};
p_loadaddr=${fdt_addr_r};
if run m_load; then
if test ${dbglevel} -gt 0; then
echo [m_load_fdt]Device Tree loaded from ${p_class}:${p_device}:${p_filename}, size ${filesize};
fi;
v_success=true;
else
if test ${errlevel} -gt 0; then
echo [m_load_fdt]Loading device tree from ${p_class}:${p_device}:${p_filename} failed!;
fi;
v_success=false;
fi;
fi;
done;
if test ${v_success} = false; then
setenv fdt_addr_r -;
fi;
else
setenv fdt_addr_r -;
fi;
true;
# vim:ft=sh