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