blob: 31042fad6709fbaccd440e1136fe075f91ca1f3b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Semen Protsenko334f5bb2017-06-14 21:34:23 +03002/*
3 * Boot related environment variable definitions on TI boards.
4 *
5 * (C) Copyright 2017 Linaro Ltd.
6 * Sam Protsenko <semen.protsenko@linaro.org>
Semen Protsenko334f5bb2017-06-14 21:34:23 +03007 */
8
9#ifndef __TI_BOOT_H
10#define __TI_BOOT_H
11
12#ifndef CONSOLEDEV
13#define CONSOLEDEV "ttyO2"
14#endif
15
16#ifndef PARTS_DEFAULT
17#define PARTS_DEFAULT
18#endif
19
20#define DEFAULT_COMMON_BOOT_TI_ARGS \
21 "console=" CONSOLEDEV ",115200n8\0" \
22 "fdtfile=undefined\0" \
23 "bootpart=0:2\0" \
24 "bootdir=/boot\0" \
25 "bootfile=zImage\0" \
26 "usbtty=cdc_acm\0" \
27 "vram=16M\0" \
28 "partitions=" PARTS_DEFAULT "\0" \
29 "optargs=\0" \
Semen Protsenko93003172017-08-16 15:55:48 +030030 "dofastboot=0\0" \
Sam Protsenko7e43edc2017-09-21 22:37:58 +030031 "emmc_linux_boot=" \
Sam Protsenkobfd9f7c2017-09-21 22:37:59 +030032 "echo Trying to boot Linux from eMMC ...; " \
Sam Protsenko7e43edc2017-09-21 22:37:58 +030033 "setenv mmcdev 1; " \
34 "setenv bootpart 1:2; " \
35 "setenv mmcroot /dev/mmcblk0p2 rw; " \
36 "run mmcboot;\0" \
Semen Protsenko93003172017-08-16 15:55:48 +030037 "emmc_android_boot=" \
Sam Protsenkobfd9f7c2017-09-21 22:37:59 +030038 "echo Trying to boot Android from eMMC ...; " \
Semen Protsenko93003172017-08-16 15:55:48 +030039 "setenv eval_bootargs setenv bootargs $bootargs; " \
40 "run eval_bootargs; " \
41 "setenv mmcdev 1; " \
Semen Protsenko93003172017-08-16 15:55:48 +030042 "setenv machid fe6; " \
43 "mmc dev $mmcdev; " \
44 "mmc rescan; " \
Sam Protsenko88832652018-02-26 23:18:01 +020045 "part start mmc ${mmcdev} environment fdt_start; " \
46 "part size mmc ${mmcdev} environment fdt_size; " \
47 "part start mmc ${mmcdev} boot boot_start; " \
48 "part size mmc ${mmcdev} boot boot_size; " \
Semen Protsenko93003172017-08-16 15:55:48 +030049 "mmc read ${fdtaddr} ${fdt_start} ${fdt_size}; " \
50 "mmc read ${loadaddr} ${boot_start} ${boot_size}; " \
Semen Protsenko93003172017-08-16 15:55:48 +030051 "bootm $loadaddr $loadaddr $fdtaddr;\0"
Semen Protsenko334f5bb2017-06-14 21:34:23 +030052
53#ifdef CONFIG_OMAP54XX
54
55#define DEFAULT_FDT_TI_ARGS \
56 "findfdt="\
57 "if test $board_name = omap5_uevm; then " \
58 "setenv fdtfile omap5-uevm.dtb; fi; " \
59 "if test $board_name = dra7xx; then " \
60 "setenv fdtfile dra7-evm.dtb; fi;" \
61 "if test $board_name = dra72x-revc; then " \
62 "setenv fdtfile dra72-evm-revc.dtb; fi;" \
63 "if test $board_name = dra72x; then " \
64 "setenv fdtfile dra72-evm.dtb; fi;" \
65 "if test $board_name = dra71x; then " \
66 "setenv fdtfile dra71-evm.dtb; fi;" \
Lokesh Vutla7b8b6f72017-12-29 11:47:58 +053067 "if test $board_name = dra76x_acd; then " \
Lokesh Vutla066f5782017-08-21 12:50:58 +053068 "setenv fdtfile dra76-evm.dtb; fi;" \
Semen Protsenko334f5bb2017-06-14 21:34:23 +030069 "if test $board_name = beagle_x15; then " \
70 "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
71 "if test $board_name = beagle_x15_revb1; then " \
72 "setenv fdtfile am57xx-beagle-x15-revb1.dtb; fi;" \
Lokesh Vutla473d8162017-08-23 11:39:07 +053073 "if test $board_name = beagle_x15_revc; then " \
74 "setenv fdtfile am57xx-beagle-x15-revc.dtb; fi;" \
Semen Protsenko334f5bb2017-06-14 21:34:23 +030075 "if test $board_name = am572x_idk; then " \
76 "setenv fdtfile am572x-idk.dtb; fi;" \
Lokesh Vutla7b8b6f72017-12-29 11:47:58 +053077 "if test $board_name = am574x_idk; then " \
78 "setenv fdtfile am574x-idk.dtb; fi;" \
Semen Protsenko334f5bb2017-06-14 21:34:23 +030079 "if test $board_name = am57xx_evm; then " \
80 "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
81 "if test $board_name = am57xx_evm_reva3; then " \
82 "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
83 "if test $board_name = am571x_idk; then " \
84 "setenv fdtfile am571x-idk.dtb; fi;" \
85 "if test $fdtfile = undefined; then " \
86 "echo WARNING: Could not determine device tree to use; fi; \0"
87
88#define CONFIG_BOOTCOMMAND \
89 "if test ${dofastboot} -eq 1; then " \
90 "echo Boot fastboot requested, resetting dofastboot ...;" \
91 "setenv dofastboot 0; saveenv;" \
92 "echo Booting into fastboot ...; " \
93 "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \
94 "fi;" \
95 "if test ${boot_fit} -eq 1; then " \
96 "run update_to_fit;" \
97 "fi;" \
98 "run findfdt; " \
99 "run envboot; " \
100 "run mmcboot;" \
Sam Protsenko7e43edc2017-09-21 22:37:58 +0300101 "run emmc_linux_boot; " \
Semen Protsenko93003172017-08-16 15:55:48 +0300102 "run emmc_android_boot; " \
Semen Protsenko334f5bb2017-06-14 21:34:23 +0300103 ""
104
105#endif /* CONFIG_OMAP54XX */
106
107#endif /* __TI_BOOT_H */