blob: e6397378e4518eaad3a189dc99351e0972e6b907 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Heiko Schocher05729822015-05-18 13:32:31 +02002/*
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 Schocher05729822015-05-18 13:32:31 +020010 */
11#ifndef __ARISTAINETOS2_CONFIG_H
12#define __ARISTAINETOS2_CONFIG_H
13
Mario Six790d8442018-03-28 14:38:20 +020014#define CONFIG_HOSTNAME "aristainetos2"
Heiko Schocher05729822015-05-18 13:32:31 +020015
Heiko Schocher5a0baf42020-11-30 20:46:02 +010016#if (CONFIG_SYS_BOARD_VERSION == 5)
Heiko Schocher05729822015-05-18 13:32:31 +020017#define CONFIG_MXC_UART_BASE UART2_BASE
Simon Glass4694a742016-10-17 20:12:39 -060018#define CONSOLE_DEV "ttymxc1"
Heiko Schocherb43a1d72020-11-30 20:46:03 +010019#elif (CONFIG_SYS_BOARD_VERSION == 6)
20#define CONFIG_MXC_UART_BASE UART1_BASE
21#define CONSOLE_DEV "ttymxc0"
Heiko Schocher5a0baf42020-11-30 20:46:02 +010022#endif
Heiko Schocher05729822015-05-18 13:32:31 +020023
24#define CONFIG_FEC_XCV_TYPE RGMII
Heiko Schocher05729822015-05-18 13:32:31 +020025
Heiko Schocher05729822015-05-18 13:32:31 +020026/* Framebuffer */
Heiko Schocher8f4a1b92019-12-01 11:23:19 +010027#define CONFIG_SYS_LDB_CLOCK 28341000
Heiko Schocher05729822015-05-18 13:32:31 +020028
Heiko Schochera051ee92019-12-01 11:23:11 +010029#include "mx6_common.h"
30
Heiko Schochera051ee92019-12-01 11:23:11 +010031#define CONFIG_MMCROOT "/dev/mmcblk0p1"
32
33/* MMC Configs */
Heiko Schocher7344de12019-12-01 11:23:14 +010034#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
Heiko Schochera051ee92019-12-01 11:23:11 +010035
36#define IMX_FEC_BASE ENET_BASE_ADDR
37#define CONFIG_ETHPRIME "FEC"
38#define CONFIG_FEC_MXC_PHYADDR 0
39
40#define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
41
Heiko Schocher19c3cd92019-12-01 11:23:29 +010042#ifdef CONFIG_IMX_HAB
43#define HAB_EXTRA_SETTINGS \
44 "hab_check_addr=" \
45 "if hab_auth_img ${check_addr} ${filesize} ; then " \
46 "true;" \
47 "else " \
48 "echo \"HAB checks ${hab_check_filetype} " \
49 "failed!\"; " \
50 "false; " \
51 "fi;\0" \
52 "hab_check_file_fit=" \
53 "if env exists enable_hab_check && test " \
54 "${enable_hab_check} -eq 1 ; then " \
55 "setenv hab_check_filetype \"FIT file on SD card " \
56 "or eMMC\";" \
57 "env set check_addr ${fit_addr_r};" \
58 "run hab_check_addr;" \
59 "else " \
60 "true; "\
61 "fi;\0" \
62 "hab_check_file_bootscript=" \
63 "if env exists enable_hab_check && test " \
64 "${enable_hab_check} -eq 1 ; then " \
65 "setenv hab_check_filetype \"Bootscript file\";" \
66 "env set check_addr ${loadaddr};" \
67 "run hab_check_addr;" \
68 "else " \
69 "true; "\
70 "fi;\0" \
71 "hab_check_flash_fit=" \
72 "if env exists enable_hab_check && test " \
73 "${enable_hab_check} -eq 1 ; then " \
74 "setenv hab_check_filetype \"FIT files on flash\";" \
75 "env set check_addr ${fit_addr_r};" \
76 "run hab_check_addr;" \
77 "else " \
78 "true; "\
79 "fi;\0" \
80 "enable_hab_check=1\0"
81#else
82#define HAB_EXTRA_SETTINGS \
Heiko Schocher5a0baf42020-11-30 20:46:02 +010083 "hab_check_addr=echo HAB check addr always returns " \
84 "true;true\0" \
Heiko Schocher19c3cd92019-12-01 11:23:29 +010085 "hab_check_file_fit=echo HAB check FIT file always returns " \
86 "true;true\0" \
87 "hab_check_flash_fit=echo HAB check flash FIT always returns " \
88 "true;true\0" \
89 "hab_check_file_bootscript=echo HAB check bootscript always " \
90 "returns true;true\0" \
91 "enable_hab_check=0\0"
92#endif
93
Heiko Schocher5a0baf42020-11-30 20:46:02 +010094#if (CONFIG_SYS_BOARD_VERSION == 5)
Tom Rinicc3b0032021-08-10 17:34:20 -040095#define EXTRA_ENV_BOARD_SETTINGS \
Heiko Schocher5a0baf42020-11-30 20:46:02 +010096 "dead=while true; do; " \
97 "led led_red on; sleep 1;" \
98 "led led_red off; sleep 1;" \
99 "done\0"
Heiko Schocherb43a1d72020-11-30 20:46:03 +0100100#elif (CONFIG_SYS_BOARD_VERSION == 6)
Tom Rinicc3b0032021-08-10 17:34:20 -0400101#define EXTRA_ENV_BOARD_SETTINGS \
Heiko Schocherb43a1d72020-11-30 20:46:03 +0100102 "dead=while true; do; " \
103 "led led_red on; led led_red2 on; sleep 1;" \
104 "led led_red off; led led_red2 off;; sleep 1;" \
105 "done\0"
Heiko Schocher57c4aad2019-12-01 11:23:30 +0100106#endif
Heiko Schocher9eca4612019-12-01 11:23:28 +0100107
Heiko Schochera051ee92019-12-01 11:23:11 +0100108#define CONFIG_EXTRA_ENV_SETTINGS \
109 "disable_giga=yes\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100110 "usb_pgood_delay=2000\0" \
111 "nor_bootdelay=-2\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100112 "script=u-boot.scr\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100113 "loadaddr=0x12000000\0" \
114 "fit_addr_r=0x14000000\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100115 "uboot_sz=d0000\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100116 "panel=lb07wv8\0" \
117 "splashpos=m,m\0" \
118 "console=" CONSOLE_DEV "\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100119 "emmcroot=/dev/mmcblk1p1 rootwait rw\0" \
120 "mtdids=nor0=spi0.0\0" \
121 "mtdparts=mtdparts=spi0.0:832k(u-boot),64k(env),64k(env-red)," \
122 "-(ubi-nor)\0" \
123 "mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \
124 "mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \
125 "mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \
126 "mk_pubkey_path=setenv pubkey /${sysnum}/PCR.pem\0" \
127 "mk_rescue_pubkey_path=setenv pubkey /${rescue_sysnum}/PCR.pem\0" \
128 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
129 "bootmode=${bootmode} rng_core.default_quality=1000 " \
130 "mmcpart=${mmcpart} emmcpart=${emmcpart} sysnum=${sysnum}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100131 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100132 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100133 "get_env=mw ${loadaddr} 0 0x20000;" \
134 "mmc rescan;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100135 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100136 "env import -t ${loadaddr}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100137 "default_env=gpio set wp_spi_nor.gpio-hog;" \
138 "sf probe;" \
139 "sf protect unlock 0 0x1000000;" \
140 "mw ${loadaddr} 0 0x20000;" \
141 "env export -t ${loadaddr} serial# ethaddr " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100142 "board_type panel;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100143 "env default -a;" \
144 "env import -t ${loadaddr}\0" \
145 "loadbootscript=" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100146 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
147 "${script};\0" \
148 "loadbootscriptUSB=" \
149 "ext4load usb 0 ${loadaddr} ${script};\0" \
150 "loadbootscriptUSBf=" \
151 "fatload usb 0 ${loadaddr} ${script};\0" \
152 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100153 "source \0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100154 "bootscript=echo Running bootscript from mmc ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100155 "source \0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100156 "mmcpart=1\0" \
157 "mmcdev=0\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100158 "emmcpart=1\0" \
159 "emmcdev=1\0" \
160 "sysnum=1\0" \
161 "rescue_sysnum=0\0" \
162 "rreason=18\0" \
163 "mainboot=echo Booting from eMMC ...; " \
164 "run mainargs addmtd addmisc;" \
165 "run boot_board_type;" \
166 "bootm ${fit_addr_r}\0" \
167 "mainargs=setenv bootargs console=${console},${baudrate} " \
168 "root=${emmcroot} rootfstype=ext4\0 " \
169 "main_load_fit=run mk_fitfile_path; " \
170 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
171 "${fit_file}; " \
172 "imi ${fit_addr_r}\0 " \
173 "rescue_load_fit=run mk_rescue_fitfile_path; " \
174 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
175 "${rescue_fit_file}; " \
176 "imi ${fit_addr_r}\0" \
177 "main_load_pubkey=run mk_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 "rescue_load_pubkey=run mk_rescue_pubkey_path; " \
183 "setenv hab_check_filetype \"PCR.pem\";" \
184 "env set check_addr ${loadaddr};" \
185 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
186 "${pubkey}\0" \
187 "mainRargs=setenv bootargs console=${console},${baudrate} " \
188 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100189 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
190 "mmcargs=setenv bootargs console=${console},${baudrate} " \
191 "root=${mmcroot}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100192 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
193 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100194 "mmcboot=echo Booting from mmc ...; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100195 "run mmcargs addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100196 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100197 "bootm ${fit_addr_r}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100198 "mmc_load_fit=run mk_fitfile_path; " \
199 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100200 "${fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100201 "imi ${fit_addr_r}\0" \
202 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
203 "ext4load mmc ${mmcdev}:${mmcpart} " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100204 "${fit_addr_r} ${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100205 "imi ${fit_addr_r}\0" \
206 "mmc_load_uboot=run mk_uboot_path; " \
207 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
208 "${uboot}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100209 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
210 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
211 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
212 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
213 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
214 "sf write ${loadaddr} 400 ${filesize};" \
215 "sf read ${cmp_buf} 400 ${uboot_sz};" \
216 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100217 "mmc_load_pubkey=run mk_pubkey_path; " \
218 "setenv hab_check_filetype \"PCR.pem\";" \
219 "env set check_addr ${loadaddr};" \
220 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
221 "${pubkey}\0" \
222 "mmc_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
223 "setenv hab_check_filetype \"PCR.pem\";" \
224 "env set check_addr ${loadaddr};" \
225 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
226 "${pubkey}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100227 "rescueboot=echo Booting rescue system ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100228 "run addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100229 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100230 "run boot_board_type;" \
231 "if bootm ${fit_addr_r}; then ; " \
232 "else " \
233 "run dead; " \
234 "fi; \0" \
235 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
236 "\\\\${bootargs} " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100237 "rescueReason=$rreason\0 " \
238 "usb_load_fit=run mk_fitfile_path; " \
239 "ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
240 "usb_load_fitf=run mk_fitfile_path; " \
241 "fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
242 "usb_load_rescuefit=run mk_rescue_fitfile_path; " \
243 "ext4load usb 0 ${fit_addr_r} " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100244 "${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100245 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
246 "fatload usb 0 ${fit_addr_r} " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100247 "${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100248 "usb_load_pubkey=run mk_pubkey_path; " \
249 "setenv hab_check_filetype \"PCR.pem\";" \
250 "env set check_addr ${loadaddr};" \
251 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
252 "usb_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
253 "setenv hab_check_filetype \"PCR.pem\";" \
254 "env set check_addr ${loadaddr};" \
255 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
256 "usb_load_pubkeyf=run mk_pubkey_path; " \
257 "setenv hab_check_filetype \"PCR.pem\";" \
258 "env set check_addr ${loadaddr};" \
259 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
260 "usb_rescue_load_pubkeyf=run mk_rescue_pubkey_path; " \
261 "setenv hab_check_filetype \"PCR.pem\";" \
262 "env set check_addr ${loadaddr};" \
263 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100264 "usbroot=/dev/sda1 rootwait rw\0" \
265 "usbboot=echo Booting from usb-stick ...; " \
266 "run usbargs addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100267 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100268 "bootm ${fit_addr_r}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100269 "usbargs=setenv bootargs console=${console},${baudrate} " \
270 "root=${usbroot}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100271 "usbRargs=setenv bootargs console=${console},${baudrate} " \
272 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100273 "mmc_rescue_boot=" \
274 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100275 "if run mmc_rescue_load_pubkey hab_check_addr " \
276 "mmc_rescue_load_fit hab_check_file_fit; then " \
277 "run mmcRargs; run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100278 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100279 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100280 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100281 "fi;\0" \
282 "main_rescue_boot=" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100283 "if run main_load_pubkey hab_check_addr " \
284 "main_load_fit hab_check_flash_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100285 "if run mainboot; then ; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100286 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100287 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100288 "if run rescue_load_pubkey hab_check_addr " \
289 "rescue_load_fit hab_check_file_fit; then " \
290 "run mainRargs; run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100291 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100292 "echo RESCUE SYSTEM BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100293 "run dead; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100294 "fi; " \
295 "fi; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100296 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100297 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100298 "if run rescue_load_pubkey hab_check_addr " \
299 "rescue_load_fit hab_check_file_fit; then " \
300 "run mainRargs; run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100301 "else " \
302 "echo RESCUE SYSTEM BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100303 "run dead; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100304 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100305 "fi;\0" \
306 "usb_mmc_rescue_boot=" \
307 "usb start;" \
308 "if usb storage; then " \
309 "if run loadbootscriptUSB " \
310 "hab_check_file_bootscript;" \
311 "then run bootscriptUSB; " \
312 "fi; " \
313 "if run loadbootscriptUSBf " \
314 "hab_check_file_bootscript;" \
315 "then run bootscriptUSB; " \
316 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100317 "if run usb_load_pubkey hab_check_addr " \
318 "usb_load_fit hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100319 "run usbboot; " \
320 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100321 "if run usb_load_pubkeyf hab_check_addr " \
322 "usb_load_fitf hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100323 "run usbboot; " \
324 "fi; "\
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100325 "if run usb_rescue_load_pubkey hab_check_addr " \
326 "usb_load_rescuefit hab_check_file_fit; then " \
327 "run r_reason_syserr usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100328 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100329 "if run usb_rescue_load_pubkeyf hab_check_addr " \
330 "usb_load_rescuefitf hab_check_file_fit; then " \
331 "run r_reason_syserr usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100332 "fi; " \
333 "run mmc_rescue_boot;" \
334 "fi; "\
335 "run mmc_rescue_boot;\0" \
336 "rescue_xload_boot=" \
337 "run r_reason_syserr;" \
338 "if test ${bootmode} -ne 0 ; then " \
339 "mmc dev ${mmcdev};" \
340 "if mmc rescan; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100341 "if run mmc_rescue_load_pubkey " \
342 "hab_check_addr " \
343 "mmc_rescue_load_fit " \
344 "hab_check_file_fit; then " \
345 "run mmcRargs; run rescueboot; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100346 "else " \
347 "usb start;" \
348 "if usb storage; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100349 "if run usb_rescue_load_pubkey " \
350 "hab_check_addr " \
351 "usb_load_rescuefit " \
352 "hab_check_file_fit; then " \
353 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100354 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100355 "if run usb_rescue_load_pubkeyf " \
356 "hab_check_addr " \
357 "usb_load_rescuefitf " \
358 "hab_check_file_fit; then " \
359 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100360 "fi; " \
361 "fi;" \
362 "fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100363 "echo RESCUE SYSTEM ON SD OR " \
364 "USB BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100365 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100366 "else " \
367 "usb start;" \
368 "if usb storage; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100369 "if run usb_rescue_load_pubkey " \
370 "hab_check_addr " \
371 "usb_load_rescuefit " \
372 "hab_check_file_fit; then " \
373 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100374 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100375 "if run usb_rescue_load_pubkeyf " \
376 "hab_check_addr " \
377 "usb_load_rescuefitf " \
378 "hab_check_file_fit; then " \
379 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100380 "fi; " \
381 "fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100382 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100383 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100384 "fi; " \
385 "else "\
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100386 "if run rescue_load_pubkey hab_check_addr " \
387 "rescue_load_fit hab_check_file_fit; then " \
388 "run mainRargs; run rescueboot; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100389 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100390 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100391 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100392 "fi; " \
393 "fi;\0" \
394 "ari_boot=if test ${bootmode} -ne 0 ; then " \
395 "mmc dev ${mmcdev};" \
396 "if mmc rescan; then " \
397 "if run loadbootscript hab_check_file_bootscript;" \
398 "then run bootscript; " \
399 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100400 "if run mmc_load_pubkey hab_check_addr " \
401 "mmc_load_fit hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100402 "if run mmcboot; then ; " \
403 "else " \
404 "run mmc_rescue_boot;" \
405 "fi; " \
406 "else " \
407 "run usb_mmc_rescue_boot;" \
408 "fi; " \
409 "else " \
410 "run usb_mmc_rescue_boot;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100411 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100412 "else "\
413 "run main_rescue_boot;" \
414 "fi; \0"\
Heiko Schocher19c3cd92019-12-01 11:23:29 +0100415 HAB_EXTRA_SETTINGS \
Tom Rinicc3b0032021-08-10 17:34:20 -0400416 EXTRA_ENV_BOARD_SETTINGS
Heiko Schochera051ee92019-12-01 11:23:11 +0100417
418#define CONFIG_ARP_TIMEOUT 200UL
419
Heiko Schochera051ee92019-12-01 11:23:11 +0100420/* Physical Memory Map */
421#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
422
423#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
424#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
425#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
426
427#define CONFIG_SYS_INIT_SP_OFFSET \
428 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
429#define CONFIG_SYS_INIT_SP_ADDR \
430 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
431
432#define CONFIG_SYS_FSL_USDHC_NUM 2
433
Heiko Schochera051ee92019-12-01 11:23:11 +0100434/* DMA stuff, needed for GPMI/MXS NAND support */
435
Heiko Schochera051ee92019-12-01 11:23:11 +0100436/* USB Configs */
Heiko Schochera051ee92019-12-01 11:23:11 +0100437#define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
438#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
439#define CONFIG_MXC_USB_FLAGS 0
440
441/* UBI support */
442
443/* Framebuffer */
444/* check this console not needed, after test remove it */
Heiko Schocher8f4a1b92019-12-01 11:23:19 +0100445#define CONFIG_IMX_VIDEO_SKIP
Heiko Schochera051ee92019-12-01 11:23:11 +0100446#define CONFIG_VIDEO_BMP_LOGO
Heiko Schochera051ee92019-12-01 11:23:11 +0100447
448#define CONFIG_IMX6_PWM_PER_CLK 66000000
449
Heiko Schocherab77bef2020-11-30 20:46:05 +0100450#define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
451 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
452
Heiko Schocher05729822015-05-18 13:32:31 +0200453#endif /* __ARISTAINETOS2_CONFIG_H */