blob: 769ea9d5ef700fde6444f004e8a6e5deb5e94eda [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Sekhar Nori0ea56fe2017-04-06 14:52:56 +05302/*
3 * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com
4 *
5 * Environment variable definitions for MMC/SD on TI boards.
Sekhar Nori0ea56fe2017-04-06 14:52:56 +05306 */
7
Semen Protsenko9a5a5b52017-06-13 18:15:58 +03008#ifndef __TI_MMC_H
9#define __TI_MMC_H
10
Sekhar Nori0ea56fe2017-04-06 14:52:56 +053011#define DEFAULT_MMC_TI_ARGS \
12 "mmcdev=0\0" \
13 "mmcrootfstype=ext4 rootwait\0" \
Aswath Govindrajub60facd2021-08-04 18:42:45 +053014 "finduuid=part uuid ${boot} ${bootpart} uuid\0" \
Sekhar Nori0ea56fe2017-04-06 14:52:56 +053015 "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. Davis8c2334c2020-01-10 14:35:19 -050044 "mmcloados=" \
Sekhar Nori0ea56fe2017-04-06 14:52:56 +053045 "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 Rinifff2aaa2019-09-09 10:55:45 -040059 "devnum=${mmcdev}; " \
Matwey V. Kornilov0c925c42020-08-24 21:00:32 +030060 "devtype=mmc; " \
Sekhar Nori0ea56fe2017-04-06 14:52:56 +053061 "if mmc rescan; then " \
62 "echo SD/MMC found on device ${mmcdev};" \
63 "if run loadimage; then " \
Andrew F. Davis8c2334c2020-01-10 14:35:19 -050064 "run args_mmc; " \
Sekhar Nori0ea56fe2017-04-06 14:52:56 +053065 "if test ${boot_fit} -eq 1; then " \
Andrew F. Davis8c2334c2020-01-10 14:35:19 -050066 "run run_fit; " \
Sekhar Nori0ea56fe2017-04-06 14:52:56 +053067 "else " \
68 "run mmcloados;" \
69 "fi;" \
70 "fi;" \
71 "fi;\0"
Semen Protsenko9a5a5b52017-06-13 18:15:58 +030072
73#endif /* __TI_MMC_H */