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