Benjamin Hahn | 2b143e2 | 2024-07-16 22:11:26 -0700 | [diff] [blame^] | 1 | /* 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 | |
| 11 | bootenv=bootenv.txt |
| 12 | mmc_load_bootenv=load mmc ${mmcdev}:${mmcpart} ${bootenv_addr} ${bootenv} |
| 13 | mmc_load_overlay=load mmc ${mmcdev}:${mmcpart} ${fdto_addr} ${overlay} |
| 14 | mmc_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; |
| 25 | net_load_bootenv=${get_cmd} ${bootenv_addr} ${bootenv} |
| 26 | net_load_overlay=${get_cmd} ${fdto_addr} ${overlay} |
| 27 | net_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; |