Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Sekhar Nori | 0ea56fe | 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 | 0ea56fe | 2017-04-06 14:52:56 +0530 | [diff] [blame] | 6 | */ |
| 7 | |
Semen Protsenko | 9a5a5b5 | 2017-06-13 18:15:58 +0300 | [diff] [blame] | 8 | #ifndef __TI_MMC_H |
| 9 | #define __TI_MMC_H |
| 10 | |
Sekhar Nori | 0ea56fe | 2017-04-06 14:52:56 +0530 | [diff] [blame] | 11 | #define DEFAULT_MMC_TI_ARGS \ |
| 12 | "mmcdev=0\0" \ |
| 13 | "mmcrootfstype=ext4 rootwait\0" \ |
Aswath Govindraju | b60facd | 2021-08-04 18:42:45 +0530 | [diff] [blame] | 14 | "finduuid=part uuid ${boot} ${bootpart} uuid\0" \ |
Sekhar Nori | 0ea56fe | 2017-04-06 14:52:56 +0530 | [diff] [blame] | 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" \ |
Andrew F. Davis | 8c2334c | 2020-01-10 14:35:19 -0500 | [diff] [blame] | 44 | "mmcloados=" \ |
Sekhar Nori | 0ea56fe | 2017-04-06 14:52:56 +0530 | [diff] [blame] | 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 | fff2aaa | 2019-09-09 10:55:45 -0400 | [diff] [blame] | 59 | "devnum=${mmcdev}; " \ |
Matwey V. Kornilov | 0c925c4 | 2020-08-24 21:00:32 +0300 | [diff] [blame] | 60 | "devtype=mmc; " \ |
Sekhar Nori | 0ea56fe | 2017-04-06 14:52:56 +0530 | [diff] [blame] | 61 | "if mmc rescan; then " \ |
| 62 | "echo SD/MMC found on device ${mmcdev};" \ |
| 63 | "if run loadimage; then " \ |
Andrew F. Davis | 8c2334c | 2020-01-10 14:35:19 -0500 | [diff] [blame] | 64 | "run args_mmc; " \ |
Sekhar Nori | 0ea56fe | 2017-04-06 14:52:56 +0530 | [diff] [blame] | 65 | "if test ${boot_fit} -eq 1; then " \ |
Andrew F. Davis | 8c2334c | 2020-01-10 14:35:19 -0500 | [diff] [blame] | 66 | "run run_fit; " \ |
Sekhar Nori | 0ea56fe | 2017-04-06 14:52:56 +0530 | [diff] [blame] | 67 | "else " \ |
| 68 | "run mmcloados;" \ |
| 69 | "fi;" \ |
| 70 | "fi;" \ |
| 71 | "fi;\0" |
Semen Protsenko | 9a5a5b5 | 2017-06-13 18:15:58 +0300 | [diff] [blame] | 72 | |
| 73 | #endif /* __TI_MMC_H */ |