Daniel Schultz | d0039d3 | 2024-07-16 22:11:31 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright (C) 2024 PHYTEC Messtechnik GmbH |
| 4 | * Author: Daniel Schultz <d.schultz@phytec.de> |
| 5 | */ |
| 6 | |
| 7 | /* Logic for TI K3 based SoCs to boot from a MMC device. */ |
| 8 | |
Daniel Schultz | 4d7437c | 2024-07-16 22:11:32 -0700 | [diff] [blame] | 9 | #include <env/phytec/overlays.env> |
Daniel Schultz | 18df585 | 2024-08-30 02:09:30 -0700 | [diff] [blame] | 10 | #include <env/phytec/rauc.env> |
Daniel Schultz | 4d7437c | 2024-07-16 22:11:32 -0700 | [diff] [blame] | 11 | |
Daniel Schultz | d0039d3 | 2024-07-16 22:11:31 -0700 | [diff] [blame] | 12 | mmcargs=setenv bootargs console=${console} earlycon=${earlycon} |
Daniel Schultz | 18df585 | 2024-08-30 02:09:30 -0700 | [diff] [blame] | 13 | root=/dev/mmcblk${mmcdev}p${mmcroot} ${raucargs} rootwait rw |
Daniel Schultz | b59e7ed | 2024-08-30 02:09:29 -0700 | [diff] [blame] | 14 | mmcloadimage=load mmc ${mmcdev}:${mmcpart} ${kernel_addr_r} Image |
| 15 | mmcloadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile} |
Daniel Schultz | 18df585 | 2024-08-30 02:09:30 -0700 | [diff] [blame] | 16 | mmcboot=if test ${doraucboot} = 1; then run raucinit; fi; |
| 17 | run mmcargs; |
Daniel Schultz | d0039d3 | 2024-07-16 22:11:31 -0700 | [diff] [blame] | 18 | mmc dev ${mmcdev}; |
| 19 | mmc rescan; |
Daniel Schultz | b59e7ed | 2024-08-30 02:09:29 -0700 | [diff] [blame] | 20 | run mmcloadimage; |
| 21 | run mmcloadfdt; |
Daniel Schultz | 4d7437c | 2024-07-16 22:11:32 -0700 | [diff] [blame] | 22 | run mmc_apply_overlays; |
Daniel Schultz | b59e7ed | 2024-08-30 02:09:29 -0700 | [diff] [blame] | 23 | booti ${kernel_addr_r} - ${fdt_addr_r} |