Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Sekhar Nori | 88fdfcd | 2017-04-06 14:52:56 +0530 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com |
| 4 | * |
| 5 | * Environment variable definitions for MMC/SD on TI boards. |
Sekhar Nori | 88fdfcd | 2017-04-06 14:52:56 +0530 | [diff] [blame] | 6 | */ |
| 7 | |
Semen Protsenko | 19de2de | 2017-06-13 18:15:58 +0300 | [diff] [blame] | 8 | #ifndef __TI_MMC_H |
| 9 | #define __TI_MMC_H |
| 10 | |
Sekhar Nori | 88fdfcd | 2017-04-06 14:52:56 +0530 | [diff] [blame] | 11 | #define DEFAULT_MMC_TI_ARGS \ |
| 12 | "mmcdev=0\0" \ |
| 13 | "mmcrootfstype=ext4 rootwait\0" \ |
| 14 | "finduuid=part uuid mmc ${bootpart} uuid\0" \ |
| 15 | "args_mmc=run finduuid;setenv bootargs console=${console} " \ |
| 16 | "${optargs} " \ |
| 17 | "root=PARTUUID=${uuid} rw " \ |
| 18 | "rootfstype=${mmcrootfstype}\0" \ |
| 19 | "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ |
| 20 | "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ |
| 21 | "source ${loadaddr}\0" \ |
| 22 | "bootenvfile=uEnv.txt\0" \ |
| 23 | "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \ |
| 24 | "env import -t ${loadaddr} ${filesize}\0" \ |
| 25 | "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}\0" \ |
| 26 | "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ |
| 27 | "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ |
| 28 | "envboot=mmc dev ${mmcdev}; " \ |
| 29 | "if mmc rescan; then " \ |
| 30 | "echo SD/MMC found on device ${mmcdev};" \ |
| 31 | "if run loadbootscript; then " \ |
| 32 | "run bootscript;" \ |
| 33 | "else " \ |
| 34 | "if run loadbootenv; then " \ |
| 35 | "echo Loaded env from ${bootenvfile};" \ |
| 36 | "run importbootenv;" \ |
| 37 | "fi;" \ |
| 38 | "if test -n $uenvcmd; then " \ |
| 39 | "echo Running uenvcmd ...;" \ |
| 40 | "run uenvcmd;" \ |
| 41 | "fi;" \ |
| 42 | "fi;" \ |
| 43 | "fi;\0" \ |
| 44 | "mmcloados=run args_mmc; " \ |
| 45 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 46 | "if run loadfdt; then " \ |
| 47 | "bootz ${loadaddr} - ${fdtaddr}; " \ |
| 48 | "else " \ |
| 49 | "if test ${boot_fdt} = try; then " \ |
| 50 | "bootz; " \ |
| 51 | "else " \ |
| 52 | "echo WARN: Cannot load the DT; " \ |
| 53 | "fi; " \ |
| 54 | "fi; " \ |
| 55 | "else " \ |
| 56 | "bootz; " \ |
| 57 | "fi;\0" \ |
| 58 | "mmcboot=mmc dev ${mmcdev}; " \ |
Tom Rini | c705fc3 | 2019-09-09 10:55:45 -0400 | [diff] [blame] | 59 | "devnum=${mmcdev}; " \ |
Sekhar Nori | 88fdfcd | 2017-04-06 14:52:56 +0530 | [diff] [blame] | 60 | "setenv devtype mmc; " \ |
| 61 | "if mmc rescan; then " \ |
| 62 | "echo SD/MMC found on device ${mmcdev};" \ |
| 63 | "if run loadimage; then " \ |
| 64 | "if test ${boot_fit} -eq 1; then " \ |
| 65 | "run loadfit; " \ |
| 66 | "else " \ |
| 67 | "run mmcloados;" \ |
| 68 | "fi;" \ |
| 69 | "fi;" \ |
| 70 | "fi;\0" |
Semen Protsenko | 19de2de | 2017-06-13 18:15:58 +0300 | [diff] [blame] | 71 | |
| 72 | #endif /* __TI_MMC_H */ |