blob: febb991f4f5366258b91b6141120e07429c17d15 [file] [log] [blame]
Benjamin Hahn2b143e22024-07-16 22:11:26 -07001/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * Copyright (C) 2024 PHYTEC Messtechnik GmbH
4 * Author: Benjamin Hahn <b.hahn@phytec.de>
5 */
6
7/* Logic to load and apply overlays. Load overlays from bootenv.txt into
8 * environment and apply those overlays.
9 * The variables bootenv_addr and fdto_addr are board specific. */
10
11bootenv=bootenv.txt
12mmc_load_bootenv=load mmc ${mmcdev}:${mmcpart} ${bootenv_addr} ${bootenv}
13mmc_load_overlay=load mmc ${mmcdev}:${mmcpart} ${fdto_addr} ${overlay}
14mmc_apply_overlays=
15 fdt address ${fdt_addr};
16 if test ${no_overlays} = 0; then
17 for overlay in ${overlays};
18 do;
19 if run mmc_load_overlay; then
20 fdt resize ${filesize};
21 fdt apply ${fdto_addr};
22 fi;
23 done;
24 fi;
25net_load_bootenv=${get_cmd} ${bootenv_addr} ${bootenv}
26net_load_overlay=${get_cmd} ${fdto_addr} ${overlay}
27net_apply_overlays=
28 fdt address ${fdt_addr};
29 if test ${no_overlays} = 0; then
30 for overlay in ${overlays};
31 do;
32 if run net_load_overlay; then
33 fdt resize ${filesize};
34 fdt apply ${fdto_addr};
35 fi;
36 done;
37 fi;