Semen Protsenko | 334f5bb | 2017-06-14 21:34:23 +0300 | [diff] [blame] | 1 | /* |
| 2 | * Boot related environment variable definitions on TI boards. |
| 3 | * |
| 4 | * (C) Copyright 2017 Linaro Ltd. |
| 5 | * Sam Protsenko <semen.protsenko@linaro.org> |
| 6 | * |
| 7 | * SPDX-License-Identifier: GPL-2.0+ |
| 8 | */ |
| 9 | |
| 10 | #ifndef __TI_BOOT_H |
| 11 | #define __TI_BOOT_H |
| 12 | |
| 13 | #ifndef CONSOLEDEV |
| 14 | #define CONSOLEDEV "ttyO2" |
| 15 | #endif |
| 16 | |
| 17 | #ifndef PARTS_DEFAULT |
| 18 | #define PARTS_DEFAULT |
| 19 | #endif |
| 20 | |
| 21 | #define DEFAULT_COMMON_BOOT_TI_ARGS \ |
| 22 | "console=" CONSOLEDEV ",115200n8\0" \ |
| 23 | "fdtfile=undefined\0" \ |
| 24 | "bootpart=0:2\0" \ |
| 25 | "bootdir=/boot\0" \ |
| 26 | "bootfile=zImage\0" \ |
| 27 | "usbtty=cdc_acm\0" \ |
| 28 | "vram=16M\0" \ |
| 29 | "partitions=" PARTS_DEFAULT "\0" \ |
| 30 | "optargs=\0" \ |
Semen Protsenko | 9300317 | 2017-08-16 15:55:48 +0300 | [diff] [blame] | 31 | "dofastboot=0\0" \ |
Sam Protsenko | 7e43edc | 2017-09-21 22:37:58 +0300 | [diff] [blame] | 32 | "emmc_linux_boot=" \ |
Sam Protsenko | bfd9f7c | 2017-09-21 22:37:59 +0300 | [diff] [blame] | 33 | "echo Trying to boot Linux from eMMC ...; " \ |
Sam Protsenko | 7e43edc | 2017-09-21 22:37:58 +0300 | [diff] [blame] | 34 | "setenv mmcdev 1; " \ |
| 35 | "setenv bootpart 1:2; " \ |
| 36 | "setenv mmcroot /dev/mmcblk0p2 rw; " \ |
| 37 | "run mmcboot;\0" \ |
Semen Protsenko | 9300317 | 2017-08-16 15:55:48 +0300 | [diff] [blame] | 38 | "emmc_android_boot=" \ |
Sam Protsenko | bfd9f7c | 2017-09-21 22:37:59 +0300 | [diff] [blame] | 39 | "echo Trying to boot Android from eMMC ...; " \ |
Semen Protsenko | 9300317 | 2017-08-16 15:55:48 +0300 | [diff] [blame] | 40 | "setenv eval_bootargs setenv bootargs $bootargs; " \ |
| 41 | "run eval_bootargs; " \ |
| 42 | "setenv mmcdev 1; " \ |
Semen Protsenko | 9300317 | 2017-08-16 15:55:48 +0300 | [diff] [blame] | 43 | "setenv machid fe6; " \ |
| 44 | "mmc dev $mmcdev; " \ |
| 45 | "mmc rescan; " \ |
Sam Protsenko | 8883265 | 2018-02-26 23:18:01 +0200 | [diff] [blame] | 46 | "part start mmc ${mmcdev} environment fdt_start; " \ |
| 47 | "part size mmc ${mmcdev} environment fdt_size; " \ |
| 48 | "part start mmc ${mmcdev} boot boot_start; " \ |
| 49 | "part size mmc ${mmcdev} boot boot_size; " \ |
Semen Protsenko | 9300317 | 2017-08-16 15:55:48 +0300 | [diff] [blame] | 50 | "mmc read ${fdtaddr} ${fdt_start} ${fdt_size}; " \ |
| 51 | "mmc read ${loadaddr} ${boot_start} ${boot_size}; " \ |
Semen Protsenko | 9300317 | 2017-08-16 15:55:48 +0300 | [diff] [blame] | 52 | "bootm $loadaddr $loadaddr $fdtaddr;\0" |
Semen Protsenko | 334f5bb | 2017-06-14 21:34:23 +0300 | [diff] [blame] | 53 | |
| 54 | #ifdef CONFIG_OMAP54XX |
| 55 | |
| 56 | #define DEFAULT_FDT_TI_ARGS \ |
| 57 | "findfdt="\ |
| 58 | "if test $board_name = omap5_uevm; then " \ |
| 59 | "setenv fdtfile omap5-uevm.dtb; fi; " \ |
| 60 | "if test $board_name = dra7xx; then " \ |
| 61 | "setenv fdtfile dra7-evm.dtb; fi;" \ |
| 62 | "if test $board_name = dra72x-revc; then " \ |
| 63 | "setenv fdtfile dra72-evm-revc.dtb; fi;" \ |
| 64 | "if test $board_name = dra72x; then " \ |
| 65 | "setenv fdtfile dra72-evm.dtb; fi;" \ |
| 66 | "if test $board_name = dra71x; then " \ |
| 67 | "setenv fdtfile dra71-evm.dtb; fi;" \ |
Lokesh Vutla | 7b8b6f7 | 2017-12-29 11:47:58 +0530 | [diff] [blame] | 68 | "if test $board_name = dra76x_acd; then " \ |
Lokesh Vutla | 066f578 | 2017-08-21 12:50:58 +0530 | [diff] [blame] | 69 | "setenv fdtfile dra76-evm.dtb; fi;" \ |
Semen Protsenko | 334f5bb | 2017-06-14 21:34:23 +0300 | [diff] [blame] | 70 | "if test $board_name = beagle_x15; then " \ |
| 71 | "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \ |
| 72 | "if test $board_name = beagle_x15_revb1; then " \ |
| 73 | "setenv fdtfile am57xx-beagle-x15-revb1.dtb; fi;" \ |
Lokesh Vutla | 473d816 | 2017-08-23 11:39:07 +0530 | [diff] [blame] | 74 | "if test $board_name = beagle_x15_revc; then " \ |
| 75 | "setenv fdtfile am57xx-beagle-x15-revc.dtb; fi;" \ |
Semen Protsenko | 334f5bb | 2017-06-14 21:34:23 +0300 | [diff] [blame] | 76 | "if test $board_name = am572x_idk; then " \ |
| 77 | "setenv fdtfile am572x-idk.dtb; fi;" \ |
Lokesh Vutla | 7b8b6f7 | 2017-12-29 11:47:58 +0530 | [diff] [blame] | 78 | "if test $board_name = am574x_idk; then " \ |
| 79 | "setenv fdtfile am574x-idk.dtb; fi;" \ |
Semen Protsenko | 334f5bb | 2017-06-14 21:34:23 +0300 | [diff] [blame] | 80 | "if test $board_name = am57xx_evm; then " \ |
| 81 | "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \ |
| 82 | "if test $board_name = am57xx_evm_reva3; then " \ |
| 83 | "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \ |
| 84 | "if test $board_name = am571x_idk; then " \ |
| 85 | "setenv fdtfile am571x-idk.dtb; fi;" \ |
| 86 | "if test $fdtfile = undefined; then " \ |
| 87 | "echo WARNING: Could not determine device tree to use; fi; \0" |
| 88 | |
| 89 | #define CONFIG_BOOTCOMMAND \ |
| 90 | "if test ${dofastboot} -eq 1; then " \ |
| 91 | "echo Boot fastboot requested, resetting dofastboot ...;" \ |
| 92 | "setenv dofastboot 0; saveenv;" \ |
| 93 | "echo Booting into fastboot ...; " \ |
| 94 | "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \ |
| 95 | "fi;" \ |
| 96 | "if test ${boot_fit} -eq 1; then " \ |
| 97 | "run update_to_fit;" \ |
| 98 | "fi;" \ |
| 99 | "run findfdt; " \ |
| 100 | "run envboot; " \ |
| 101 | "run mmcboot;" \ |
Sam Protsenko | 7e43edc | 2017-09-21 22:37:58 +0300 | [diff] [blame] | 102 | "run emmc_linux_boot; " \ |
Semen Protsenko | 9300317 | 2017-08-16 15:55:48 +0300 | [diff] [blame] | 103 | "run emmc_android_boot; " \ |
Semen Protsenko | 334f5bb | 2017-06-14 21:34:23 +0300 | [diff] [blame] | 104 | "" |
| 105 | |
| 106 | #endif /* CONFIG_OMAP54XX */ |
| 107 | |
| 108 | #endif /* __TI_BOOT_H */ |