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