Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2015 |
| 4 | * Heiko Schocher, DENX Software Engineering, hs@denx.de. |
| 5 | * |
| 6 | * Based on: |
| 7 | * Copyright (C) 2012 Freescale Semiconductor, Inc. |
| 8 | * |
| 9 | * Configuration settings for the Freescale i.MX6DL aristainetos2 board. |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 10 | */ |
| 11 | #ifndef __ARISTAINETOS2_CONFIG_H |
| 12 | #define __ARISTAINETOS2_CONFIG_H |
| 13 | |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 14 | #if (CONFIG_SYS_BOARD_VERSION == 5) |
Simon Glass | 12ca05a | 2016-10-17 20:12:39 -0600 | [diff] [blame] | 15 | #define CONSOLE_DEV "ttymxc1" |
Heiko Schocher | 015c026 | 2020-11-30 20:46:03 +0100 | [diff] [blame] | 16 | #elif (CONFIG_SYS_BOARD_VERSION == 6) |
Heiko Schocher | 015c026 | 2020-11-30 20:46:03 +0100 | [diff] [blame] | 17 | #define CONSOLE_DEV "ttymxc0" |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 18 | #endif |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 19 | |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 20 | /* Framebuffer */ |
Tom Rini | 65cc0e2 | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 21 | #define CFG_SYS_LDB_CLOCK 28341000 |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 22 | |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 23 | #include "mx6_common.h" |
| 24 | |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 25 | |
| 26 | /* MMC Configs */ |
Tom Rini | 6cc0454 | 2022-10-28 20:27:13 -0400 | [diff] [blame] | 27 | #define CFG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 28 | |
Tom Rini | fa760c3 | 2022-12-04 10:03:53 -0500 | [diff] [blame] | 29 | #define CFG_FEC_MXC_PHYADDR 0 |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 30 | |
Heiko Schocher | 1c9c464 | 2019-12-01 11:23:29 +0100 | [diff] [blame] | 31 | #ifdef CONFIG_IMX_HAB |
| 32 | #define HAB_EXTRA_SETTINGS \ |
| 33 | "hab_check_addr=" \ |
| 34 | "if hab_auth_img ${check_addr} ${filesize} ; then " \ |
| 35 | "true;" \ |
| 36 | "else " \ |
| 37 | "echo \"HAB checks ${hab_check_filetype} " \ |
| 38 | "failed!\"; " \ |
| 39 | "false; " \ |
| 40 | "fi;\0" \ |
| 41 | "hab_check_file_fit=" \ |
| 42 | "if env exists enable_hab_check && test " \ |
| 43 | "${enable_hab_check} -eq 1 ; then " \ |
| 44 | "setenv hab_check_filetype \"FIT file on SD card " \ |
| 45 | "or eMMC\";" \ |
| 46 | "env set check_addr ${fit_addr_r};" \ |
| 47 | "run hab_check_addr;" \ |
| 48 | "else " \ |
| 49 | "true; "\ |
| 50 | "fi;\0" \ |
| 51 | "hab_check_file_bootscript=" \ |
| 52 | "if env exists enable_hab_check && test " \ |
| 53 | "${enable_hab_check} -eq 1 ; then " \ |
| 54 | "setenv hab_check_filetype \"Bootscript file\";" \ |
| 55 | "env set check_addr ${loadaddr};" \ |
| 56 | "run hab_check_addr;" \ |
| 57 | "else " \ |
| 58 | "true; "\ |
| 59 | "fi;\0" \ |
| 60 | "hab_check_flash_fit=" \ |
| 61 | "if env exists enable_hab_check && test " \ |
| 62 | "${enable_hab_check} -eq 1 ; then " \ |
| 63 | "setenv hab_check_filetype \"FIT files on flash\";" \ |
| 64 | "env set check_addr ${fit_addr_r};" \ |
| 65 | "run hab_check_addr;" \ |
| 66 | "else " \ |
| 67 | "true; "\ |
| 68 | "fi;\0" \ |
| 69 | "enable_hab_check=1\0" |
| 70 | #else |
| 71 | #define HAB_EXTRA_SETTINGS \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 72 | "hab_check_addr=echo HAB check addr always returns " \ |
| 73 | "true;true\0" \ |
Heiko Schocher | 1c9c464 | 2019-12-01 11:23:29 +0100 | [diff] [blame] | 74 | "hab_check_file_fit=echo HAB check FIT file always returns " \ |
| 75 | "true;true\0" \ |
| 76 | "hab_check_flash_fit=echo HAB check flash FIT always returns " \ |
| 77 | "true;true\0" \ |
| 78 | "hab_check_file_bootscript=echo HAB check bootscript always " \ |
| 79 | "returns true;true\0" \ |
| 80 | "enable_hab_check=0\0" |
| 81 | #endif |
| 82 | |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 83 | #if (CONFIG_SYS_BOARD_VERSION == 5) |
Tom Rini | eb7d30e | 2021-08-10 17:34:20 -0400 | [diff] [blame] | 84 | #define EXTRA_ENV_BOARD_SETTINGS \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 85 | "dead=while true; do; " \ |
| 86 | "led led_red on; sleep 1;" \ |
| 87 | "led led_red off; sleep 1;" \ |
| 88 | "done\0" |
Heiko Schocher | 015c026 | 2020-11-30 20:46:03 +0100 | [diff] [blame] | 89 | #elif (CONFIG_SYS_BOARD_VERSION == 6) |
Tom Rini | eb7d30e | 2021-08-10 17:34:20 -0400 | [diff] [blame] | 90 | #define EXTRA_ENV_BOARD_SETTINGS \ |
Heiko Schocher | 015c026 | 2020-11-30 20:46:03 +0100 | [diff] [blame] | 91 | "dead=while true; do; " \ |
| 92 | "led led_red on; led led_red2 on; sleep 1;" \ |
| 93 | "led led_red off; led led_red2 off;; sleep 1;" \ |
| 94 | "done\0" |
Heiko Schocher | 1204b96 | 2019-12-01 11:23:30 +0100 | [diff] [blame] | 95 | #endif |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 96 | |
Tom Rini | 0613c36 | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 97 | #define CFG_EXTRA_ENV_SETTINGS \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 98 | "disable_giga=yes\0" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 99 | "usb_pgood_delay=2000\0" \ |
| 100 | "nor_bootdelay=-2\0" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 101 | "script=u-boot.scr\0" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 102 | "loadaddr=0x12000000\0" \ |
| 103 | "fit_addr_r=0x14000000\0" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 104 | "uboot_sz=d0000\0" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 105 | "panel=lb07wv8\0" \ |
| 106 | "splashpos=m,m\0" \ |
| 107 | "console=" CONSOLE_DEV "\0" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 108 | "emmcroot=/dev/mmcblk1p1 rootwait rw\0" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 109 | "mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \ |
| 110 | "mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \ |
| 111 | "mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \ |
| 112 | "mk_pubkey_path=setenv pubkey /${sysnum}/PCR.pem\0" \ |
| 113 | "mk_rescue_pubkey_path=setenv pubkey /${rescue_sysnum}/PCR.pem\0" \ |
| 114 | "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \ |
| 115 | "bootmode=${bootmode} rng_core.default_quality=1000 " \ |
| 116 | "mmcpart=${mmcpart} emmcpart=${emmcpart} sysnum=${sysnum}\0" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 117 | "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 118 | "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 119 | "get_env=mw ${loadaddr} 0 0x20000;" \ |
| 120 | "mmc rescan;" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 121 | "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 122 | "env import -t ${loadaddr}\0" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 123 | "default_env=gpio set wp_spi_nor.gpio-hog;" \ |
| 124 | "sf probe;" \ |
| 125 | "sf protect unlock 0 0x1000000;" \ |
| 126 | "mw ${loadaddr} 0 0x20000;" \ |
| 127 | "env export -t ${loadaddr} serial# ethaddr " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 128 | "board_type panel;" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 129 | "env default -a;" \ |
| 130 | "env import -t ${loadaddr}\0" \ |
| 131 | "loadbootscript=" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 132 | "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \ |
| 133 | "${script};\0" \ |
| 134 | "loadbootscriptUSB=" \ |
| 135 | "ext4load usb 0 ${loadaddr} ${script};\0" \ |
| 136 | "loadbootscriptUSBf=" \ |
| 137 | "fatload usb 0 ${loadaddr} ${script};\0" \ |
| 138 | "bootscriptUSB=echo Running bootscript from usb-stick ...; " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 139 | "source \0" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 140 | "bootscript=echo Running bootscript from mmc ...; " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 141 | "source \0" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 142 | "mmcpart=1\0" \ |
| 143 | "mmcdev=0\0" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 144 | "emmcpart=1\0" \ |
| 145 | "emmcdev=1\0" \ |
| 146 | "sysnum=1\0" \ |
| 147 | "rescue_sysnum=0\0" \ |
| 148 | "rreason=18\0" \ |
| 149 | "mainboot=echo Booting from eMMC ...; " \ |
| 150 | "run mainargs addmtd addmisc;" \ |
| 151 | "run boot_board_type;" \ |
| 152 | "bootm ${fit_addr_r}\0" \ |
| 153 | "mainargs=setenv bootargs console=${console},${baudrate} " \ |
| 154 | "root=${emmcroot} rootfstype=ext4\0 " \ |
| 155 | "main_load_fit=run mk_fitfile_path; " \ |
| 156 | "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \ |
| 157 | "${fit_file}; " \ |
| 158 | "imi ${fit_addr_r}\0 " \ |
| 159 | "rescue_load_fit=run mk_rescue_fitfile_path; " \ |
| 160 | "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \ |
| 161 | "${rescue_fit_file}; " \ |
| 162 | "imi ${fit_addr_r}\0" \ |
| 163 | "main_load_pubkey=run mk_pubkey_path; " \ |
| 164 | "setenv hab_check_filetype \"PCR.pem\";" \ |
| 165 | "env set check_addr ${loadaddr};" \ |
| 166 | "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \ |
| 167 | "${pubkey}\0" \ |
| 168 | "rescue_load_pubkey=run mk_rescue_pubkey_path; " \ |
| 169 | "setenv hab_check_filetype \"PCR.pem\";" \ |
| 170 | "env set check_addr ${loadaddr};" \ |
| 171 | "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \ |
| 172 | "${pubkey}\0" \ |
| 173 | "mainRargs=setenv bootargs console=${console},${baudrate} " \ |
| 174 | "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \ |
Peng Fan | adfaa42 | 2022-04-15 12:23:41 +0800 | [diff] [blame] | 175 | "mmcroot=/dev/mmcblk0p1 rootwait rw\0" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 176 | "mmcargs=setenv bootargs console=${console},${baudrate} " \ |
| 177 | "root=${mmcroot}\0" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 178 | "mmcRargs=setenv bootargs console=${console},${baudrate} " \ |
| 179 | "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 180 | "mmcboot=echo Booting from mmc ...; " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 181 | "run mmcargs addmtd addmisc;" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 182 | "run boot_board_type;" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 183 | "bootm ${fit_addr_r}\0" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 184 | "mmc_load_fit=run mk_fitfile_path; " \ |
| 185 | "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 186 | "${fit_file}\0" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 187 | "imi ${fit_addr_r}\0" \ |
| 188 | "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \ |
| 189 | "ext4load mmc ${mmcdev}:${mmcpart} " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 190 | "${fit_addr_r} ${rescue_fit_file}\0" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 191 | "imi ${fit_addr_r}\0" \ |
| 192 | "mmc_load_uboot=run mk_uboot_path; " \ |
| 193 | "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \ |
| 194 | "${uboot}\0" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 195 | "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \ |
| 196 | "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \ |
| 197 | "setexpr uboot_maxsize ${uboot_sz} - 400;" \ |
| 198 | "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \ |
| 199 | "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \ |
| 200 | "sf write ${loadaddr} 400 ${filesize};" \ |
| 201 | "sf read ${cmp_buf} 400 ${uboot_sz};" \ |
| 202 | "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 203 | "mmc_load_pubkey=run mk_pubkey_path; " \ |
| 204 | "setenv hab_check_filetype \"PCR.pem\";" \ |
| 205 | "env set check_addr ${loadaddr};" \ |
| 206 | "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \ |
| 207 | "${pubkey}\0" \ |
| 208 | "mmc_rescue_load_pubkey=run mk_rescue_pubkey_path; " \ |
| 209 | "setenv hab_check_filetype \"PCR.pem\";" \ |
| 210 | "env set check_addr ${loadaddr};" \ |
| 211 | "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \ |
| 212 | "${pubkey}\0" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 213 | "rescueboot=echo Booting rescue system ...; " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 214 | "run addmtd addmisc;" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 215 | "if test -n ${rescue_reason}; then run rescue_reason;fi;" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 216 | "run boot_board_type;" \ |
| 217 | "if bootm ${fit_addr_r}; then ; " \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 218 | "else " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 219 | "run dead; " \ |
| 220 | "fi; \0" \ |
| 221 | "r_reason_syserr=setenv rescue_reason setenv bootargs " \ |
| 222 | "\\\\${bootargs} " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 223 | "rescueReason=$rreason\0 " \ |
| 224 | "usb_load_fit=run mk_fitfile_path; " \ |
| 225 | "ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \ |
| 226 | "usb_load_fitf=run mk_fitfile_path; " \ |
| 227 | "fatload usb 0 ${fit_addr_r} ${fit_file}\0" \ |
| 228 | "usb_load_rescuefit=run mk_rescue_fitfile_path; " \ |
| 229 | "ext4load usb 0 ${fit_addr_r} " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 230 | "${rescue_fit_file}\0" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 231 | "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \ |
| 232 | "fatload usb 0 ${fit_addr_r} " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 233 | "${rescue_fit_file}\0" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 234 | "usb_load_pubkey=run mk_pubkey_path; " \ |
| 235 | "setenv hab_check_filetype \"PCR.pem\";" \ |
| 236 | "env set check_addr ${loadaddr};" \ |
| 237 | "ext4load usb 0 ${loadaddr} ${pubkey}\0" \ |
| 238 | "usb_rescue_load_pubkey=run mk_rescue_pubkey_path; " \ |
| 239 | "setenv hab_check_filetype \"PCR.pem\";" \ |
| 240 | "env set check_addr ${loadaddr};" \ |
| 241 | "ext4load usb 0 ${loadaddr} ${pubkey}\0" \ |
| 242 | "usb_load_pubkeyf=run mk_pubkey_path; " \ |
| 243 | "setenv hab_check_filetype \"PCR.pem\";" \ |
| 244 | "env set check_addr ${loadaddr};" \ |
| 245 | "fatload usb 0 ${loadaddr} ${pubkey}\0" \ |
| 246 | "usb_rescue_load_pubkeyf=run mk_rescue_pubkey_path; " \ |
| 247 | "setenv hab_check_filetype \"PCR.pem\";" \ |
| 248 | "env set check_addr ${loadaddr};" \ |
| 249 | "fatload usb 0 ${loadaddr} ${pubkey}\0" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 250 | "usbroot=/dev/sda1 rootwait rw\0" \ |
| 251 | "usbboot=echo Booting from usb-stick ...; " \ |
| 252 | "run usbargs addmtd addmisc;" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 253 | "run boot_board_type;" \ |
| 254 | "bootm ${fit_addr_r}\0" \ |
| 255 | "usbargs=setenv bootargs console=${console},${baudrate} " \ |
| 256 | "root=${usbroot}\0" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 257 | "usbRargs=setenv bootargs console=${console},${baudrate} " \ |
| 258 | "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 259 | "mmc_rescue_boot=" \ |
| 260 | "run r_reason_syserr;" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 261 | "if run mmc_rescue_load_pubkey hab_check_addr " \ |
| 262 | "mmc_rescue_load_fit hab_check_file_fit; then " \ |
| 263 | "run mmcRargs; run rescueboot; " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 264 | "else " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 265 | "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 266 | "run dead; " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 267 | "fi;\0" \ |
| 268 | "main_rescue_boot=" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 269 | "if run main_load_pubkey hab_check_addr " \ |
| 270 | "main_load_fit hab_check_flash_fit; then " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 271 | "if run mainboot; then ; " \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 272 | "else " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 273 | "run r_reason_syserr;" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 274 | "if run rescue_load_pubkey hab_check_addr " \ |
| 275 | "rescue_load_fit hab_check_file_fit; then " \ |
| 276 | "run mainRargs; run rescueboot; " \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 277 | "else " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 278 | "echo RESCUE SYSTEM BOOT FAILURE;" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 279 | "run dead; " \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 280 | "fi; " \ |
| 281 | "fi; " \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 282 | "else " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 283 | "run r_reason_syserr;" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 284 | "if run rescue_load_pubkey hab_check_addr " \ |
| 285 | "rescue_load_fit hab_check_file_fit; then " \ |
| 286 | "run mainRargs; run rescueboot; " \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 287 | "else " \ |
| 288 | "echo RESCUE SYSTEM BOOT FAILURE;" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 289 | "run dead; " \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 290 | "fi; " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 291 | "fi;\0" \ |
| 292 | "usb_mmc_rescue_boot=" \ |
| 293 | "usb start;" \ |
| 294 | "if usb storage; then " \ |
| 295 | "if run loadbootscriptUSB " \ |
| 296 | "hab_check_file_bootscript;" \ |
| 297 | "then run bootscriptUSB; " \ |
| 298 | "fi; " \ |
| 299 | "if run loadbootscriptUSBf " \ |
| 300 | "hab_check_file_bootscript;" \ |
| 301 | "then run bootscriptUSB; " \ |
| 302 | "fi; " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 303 | "if run usb_load_pubkey hab_check_addr " \ |
| 304 | "usb_load_fit hab_check_file_fit; then " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 305 | "run usbboot; " \ |
| 306 | "fi; " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 307 | "if run usb_load_pubkeyf hab_check_addr " \ |
| 308 | "usb_load_fitf hab_check_file_fit; then " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 309 | "run usbboot; " \ |
| 310 | "fi; "\ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 311 | "if run usb_rescue_load_pubkey hab_check_addr " \ |
| 312 | "usb_load_rescuefit hab_check_file_fit; then " \ |
| 313 | "run r_reason_syserr usbRargs; run rescueboot;" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 314 | "fi; " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 315 | "if run usb_rescue_load_pubkeyf hab_check_addr " \ |
| 316 | "usb_load_rescuefitf hab_check_file_fit; then " \ |
| 317 | "run r_reason_syserr usbRargs; run rescueboot;" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 318 | "fi; " \ |
| 319 | "run mmc_rescue_boot;" \ |
| 320 | "fi; "\ |
| 321 | "run mmc_rescue_boot;\0" \ |
| 322 | "rescue_xload_boot=" \ |
| 323 | "run r_reason_syserr;" \ |
| 324 | "if test ${bootmode} -ne 0 ; then " \ |
| 325 | "mmc dev ${mmcdev};" \ |
| 326 | "if mmc rescan; then " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 327 | "if run mmc_rescue_load_pubkey " \ |
| 328 | "hab_check_addr " \ |
| 329 | "mmc_rescue_load_fit " \ |
| 330 | "hab_check_file_fit; then " \ |
| 331 | "run mmcRargs; run rescueboot; " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 332 | "else " \ |
| 333 | "usb start;" \ |
| 334 | "if usb storage; then " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 335 | "if run usb_rescue_load_pubkey " \ |
| 336 | "hab_check_addr " \ |
| 337 | "usb_load_rescuefit " \ |
| 338 | "hab_check_file_fit; then " \ |
| 339 | "run usbRargs; run rescueboot;" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 340 | "fi; " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 341 | "if run usb_rescue_load_pubkeyf " \ |
| 342 | "hab_check_addr " \ |
| 343 | "usb_load_rescuefitf " \ |
| 344 | "hab_check_file_fit; then " \ |
| 345 | "run usbRargs; run rescueboot;" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 346 | "fi; " \ |
| 347 | "fi;" \ |
| 348 | "fi;" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 349 | "echo RESCUE SYSTEM ON SD OR " \ |
| 350 | "USB BOOT FAILURE;" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 351 | "run dead; " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 352 | "else " \ |
| 353 | "usb start;" \ |
| 354 | "if usb storage; then " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 355 | "if run usb_rescue_load_pubkey " \ |
| 356 | "hab_check_addr " \ |
| 357 | "usb_load_rescuefit " \ |
| 358 | "hab_check_file_fit; then " \ |
| 359 | "run usbRargs; run rescueboot;" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 360 | "fi; " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 361 | "if run usb_rescue_load_pubkeyf " \ |
| 362 | "hab_check_addr " \ |
| 363 | "usb_load_rescuefitf " \ |
| 364 | "hab_check_file_fit; then " \ |
| 365 | "run usbRargs; run rescueboot;" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 366 | "fi; " \ |
| 367 | "fi;" \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 368 | "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 369 | "run dead; " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 370 | "fi; " \ |
| 371 | "else "\ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 372 | "if run rescue_load_pubkey hab_check_addr " \ |
| 373 | "rescue_load_fit hab_check_file_fit; then " \ |
| 374 | "run mainRargs; run rescueboot; " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 375 | "else " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 376 | "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 377 | "run dead; " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 378 | "fi; " \ |
| 379 | "fi;\0" \ |
| 380 | "ari_boot=if test ${bootmode} -ne 0 ; then " \ |
| 381 | "mmc dev ${mmcdev};" \ |
| 382 | "if mmc rescan; then " \ |
| 383 | "if run loadbootscript hab_check_file_bootscript;" \ |
| 384 | "then run bootscript; " \ |
| 385 | "fi; " \ |
Heiko Schocher | 3cf02f5 | 2020-11-30 20:46:02 +0100 | [diff] [blame] | 386 | "if run mmc_load_pubkey hab_check_addr " \ |
| 387 | "mmc_load_fit hab_check_file_fit; then " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 388 | "if run mmcboot; then ; " \ |
| 389 | "else " \ |
| 390 | "run mmc_rescue_boot;" \ |
| 391 | "fi; " \ |
| 392 | "else " \ |
| 393 | "run usb_mmc_rescue_boot;" \ |
| 394 | "fi; " \ |
| 395 | "else " \ |
| 396 | "run usb_mmc_rescue_boot;" \ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 397 | "fi; " \ |
Heiko Schocher | 70be2fc | 2019-12-01 11:23:28 +0100 | [diff] [blame] | 398 | "else "\ |
| 399 | "run main_rescue_boot;" \ |
| 400 | "fi; \0"\ |
Heiko Schocher | 1c9c464 | 2019-12-01 11:23:29 +0100 | [diff] [blame] | 401 | HAB_EXTRA_SETTINGS \ |
Tom Rini | eb7d30e | 2021-08-10 17:34:20 -0400 | [diff] [blame] | 402 | EXTRA_ENV_BOARD_SETTINGS |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 403 | |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 404 | /* Physical Memory Map */ |
| 405 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
| 406 | |
Tom Rini | aa6e94d | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 407 | #define CFG_SYS_SDRAM_BASE PHYS_SDRAM |
Tom Rini | 65cc0e2 | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 408 | #define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 409 | #define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 410 | |
Tom Rini | 6cc0454 | 2022-10-28 20:27:13 -0400 | [diff] [blame] | 411 | #define CFG_SYS_FSL_USDHC_NUM 2 |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 412 | |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 413 | /* DMA stuff, needed for GPMI/MXS NAND support */ |
| 414 | |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 415 | /* USB Configs */ |
Heiko Schocher | 0f1130b | 2019-12-01 11:23:11 +0100 | [diff] [blame] | 416 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 417 | #define CONFIG_MXC_USB_FLAGS 0 |
| 418 | |
| 419 | /* UBI support */ |
| 420 | |
Tom Rini | acf29d8 | 2022-12-04 10:03:40 -0500 | [diff] [blame] | 421 | #define CFG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \ |
Heiko Schocher | 7a8d18d | 2020-11-30 20:46:05 +0100 | [diff] [blame] | 422 | "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw" |
| 423 | |
Heiko Schocher | 7254d92 | 2015-05-18 13:32:31 +0200 | [diff] [blame] | 424 | #endif /* __ARISTAINETOS2_CONFIG_H */ |