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