summaryrefslogtreecommitdiff
path: root/include/env/phytec/overlays.env
blob: 78721cde654a5b1e41450710c9ac79211e180db1 (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
/* SPDX-License-Identifier: GPL-2.0-or-later  */
/*
 * Copyright (C) 2024 PHYTEC Messtechnik GmbH
 * Author: Benjamin Hahn <b.hahn@phytec.de>
 */

/* Logic to load and apply overlays. Load overlays from bootenv.txt into
 * environment and apply those overlays.
 * The variables bootenv_addr_r and fdtoverlay_addr_r are board specific.
 * get_cmd can be either tftp or dhcp. */

bootenv=bootenv.txt
mmc_load_bootenv=load mmc ${mmcdev}:${mmcpart} ${bootenv_addr_r} ${bootenv}
mmc_load_overlay=load mmc ${mmcdev}:${mmcpart} ${fdtoverlay_addr_r} ${overlay}
mmc_apply_overlays=
	fdt address ${fdt_addr_r};
	if test ${no_overlays} = 0; then
		for overlay in ${overlays};
		do;
			if run mmc_load_overlay; then
				fdt resize ${filesize};
				fdt apply ${fdtoverlay_addr_r};
			fi;
		done;
	fi;
net_load_bootenv=${get_cmd} ${bootenv_addr_r} ${bootenv}
net_load_overlay=${get_cmd} ${fdtoverlay_addr_r} ${overlay}
net_apply_overlays=
	fdt address ${fdt_addr_r};
	if test ${no_overlays} = 0; then
		for overlay in ${overlays};
		do;
			if run net_load_overlay; then
				fdt resize ${filesize};
				fdt apply ${fdtoverlay_addr_r};
			fi;
		done;
	fi;