blob: 8ee97f1d4e35ec7d71cc0faf8b17fe4af56ce13d [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
Heiko Schocher05729822015-05-18 13:32:31 +020024/* Framebuffer */
Heiko Schocher8f4a1b92019-12-01 11:23:19 +010025#define CONFIG_SYS_LDB_CLOCK 28341000
Heiko Schocher05729822015-05-18 13:32:31 +020026
Heiko Schochera051ee92019-12-01 11:23:11 +010027#include "mx6_common.h"
28
Heiko Schochera051ee92019-12-01 11:23:11 +010029
30/* MMC Configs */
Heiko Schocher7344de12019-12-01 11:23:14 +010031#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
Heiko Schochera051ee92019-12-01 11:23:11 +010032
Heiko Schochera051ee92019-12-01 11:23:11 +010033#define CONFIG_FEC_MXC_PHYADDR 0
34
35#define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
36
Heiko Schocher19c3cd92019-12-01 11:23:29 +010037#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 Schocher5a0baf42020-11-30 20:46:02 +010078 "hab_check_addr=echo HAB check addr always returns " \
79 "true;true\0" \
Heiko Schocher19c3cd92019-12-01 11:23:29 +010080 "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 Schocher5a0baf42020-11-30 20:46:02 +010089#if (CONFIG_SYS_BOARD_VERSION == 5)
Tom Rinicc3b0032021-08-10 17:34:20 -040090#define EXTRA_ENV_BOARD_SETTINGS \
Heiko Schocher5a0baf42020-11-30 20:46:02 +010091 "dead=while true; do; " \
92 "led led_red on; sleep 1;" \
93 "led led_red off; sleep 1;" \
94 "done\0"
Heiko Schocherb43a1d72020-11-30 20:46:03 +010095#elif (CONFIG_SYS_BOARD_VERSION == 6)
Tom Rinicc3b0032021-08-10 17:34:20 -040096#define EXTRA_ENV_BOARD_SETTINGS \
Heiko Schocherb43a1d72020-11-30 20:46:03 +010097 "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 Schocher57c4aad2019-12-01 11:23:30 +0100101#endif
Heiko Schocher9eca4612019-12-01 11:23:28 +0100102
Heiko Schochera051ee92019-12-01 11:23:11 +0100103#define CONFIG_EXTRA_ENV_SETTINGS \
104 "disable_giga=yes\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100105 "usb_pgood_delay=2000\0" \
106 "nor_bootdelay=-2\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100107 "script=u-boot.scr\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100108 "loadaddr=0x12000000\0" \
109 "fit_addr_r=0x14000000\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100110 "uboot_sz=d0000\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100111 "panel=lb07wv8\0" \
112 "splashpos=m,m\0" \
113 "console=" CONSOLE_DEV "\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100114 "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 Schochera051ee92019-12-01 11:23:11 +0100126 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100127 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100128 "get_env=mw ${loadaddr} 0 0x20000;" \
129 "mmc rescan;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100130 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100131 "env import -t ${loadaddr}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100132 "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 Schocher5a0baf42020-11-30 20:46:02 +0100137 "board_type panel;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100138 "env default -a;" \
139 "env import -t ${loadaddr}\0" \
140 "loadbootscript=" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100141 "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 Schocher5a0baf42020-11-30 20:46:02 +0100148 "source \0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100149 "bootscript=echo Running bootscript from mmc ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100150 "source \0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100151 "mmcpart=1\0" \
152 "mmcdev=0\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100153 "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 Fanbb4bb582022-04-15 12:23:41 +0800184 "mmcroot=/dev/mmcblk0p1 rootwait rw\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100185 "mmcargs=setenv bootargs console=${console},${baudrate} " \
186 "root=${mmcroot}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100187 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
188 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100189 "mmcboot=echo Booting from mmc ...; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100190 "run mmcargs addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100191 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100192 "bootm ${fit_addr_r}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100193 "mmc_load_fit=run mk_fitfile_path; " \
194 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100195 "${fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100196 "imi ${fit_addr_r}\0" \
197 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
198 "ext4load mmc ${mmcdev}:${mmcpart} " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100199 "${fit_addr_r} ${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100200 "imi ${fit_addr_r}\0" \
201 "mmc_load_uboot=run mk_uboot_path; " \
202 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
203 "${uboot}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100204 "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 Schocher5a0baf42020-11-30 20:46:02 +0100212 "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 Schocher9eca4612019-12-01 11:23:28 +0100222 "rescueboot=echo Booting rescue system ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100223 "run addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100224 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100225 "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 Schocher5a0baf42020-11-30 20:46:02 +0100232 "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 Schocher9eca4612019-12-01 11:23:28 +0100239 "${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100240 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
241 "fatload usb 0 ${fit_addr_r} " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100242 "${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100243 "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 Schocher9eca4612019-12-01 11:23:28 +0100259 "usbroot=/dev/sda1 rootwait rw\0" \
260 "usbboot=echo Booting from usb-stick ...; " \
261 "run usbargs addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100262 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100263 "bootm ${fit_addr_r}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100264 "usbargs=setenv bootargs console=${console},${baudrate} " \
265 "root=${usbroot}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100266 "usbRargs=setenv bootargs console=${console},${baudrate} " \
267 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100268 "mmc_rescue_boot=" \
269 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100270 "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 Schochera051ee92019-12-01 11:23:11 +0100273 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100274 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100275 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100276 "fi;\0" \
277 "main_rescue_boot=" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100278 "if run main_load_pubkey hab_check_addr " \
279 "main_load_fit hab_check_flash_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100280 "if run mainboot; then ; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100281 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100282 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100283 "if run rescue_load_pubkey hab_check_addr " \
284 "rescue_load_fit hab_check_file_fit; then " \
285 "run mainRargs; run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100286 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100287 "echo RESCUE SYSTEM BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100288 "run dead; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100289 "fi; " \
290 "fi; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100291 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100292 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100293 "if run rescue_load_pubkey hab_check_addr " \
294 "rescue_load_fit hab_check_file_fit; then " \
295 "run mainRargs; run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100296 "else " \
297 "echo RESCUE SYSTEM BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100298 "run dead; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100299 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100300 "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 Schocher5a0baf42020-11-30 20:46:02 +0100312 "if run usb_load_pubkey hab_check_addr " \
313 "usb_load_fit hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100314 "run usbboot; " \
315 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100316 "if run usb_load_pubkeyf hab_check_addr " \
317 "usb_load_fitf hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100318 "run usbboot; " \
319 "fi; "\
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100320 "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 Schocher9eca4612019-12-01 11:23:28 +0100323 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100324 "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 Schocher9eca4612019-12-01 11:23:28 +0100327 "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 Schocher5a0baf42020-11-30 20:46:02 +0100336 "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 Schocher9eca4612019-12-01 11:23:28 +0100341 "else " \
342 "usb start;" \
343 "if usb storage; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100344 "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 Schocher9eca4612019-12-01 11:23:28 +0100349 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100350 "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 Schocher9eca4612019-12-01 11:23:28 +0100355 "fi; " \
356 "fi;" \
357 "fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100358 "echo RESCUE SYSTEM ON SD OR " \
359 "USB BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100360 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100361 "else " \
362 "usb start;" \
363 "if usb storage; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100364 "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 Schocher9eca4612019-12-01 11:23:28 +0100369 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100370 "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 Schocher9eca4612019-12-01 11:23:28 +0100375 "fi; " \
376 "fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100377 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100378 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100379 "fi; " \
380 "else "\
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100381 "if run rescue_load_pubkey hab_check_addr " \
382 "rescue_load_fit hab_check_file_fit; then " \
383 "run mainRargs; run rescueboot; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100384 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100385 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100386 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100387 "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 Schocher5a0baf42020-11-30 20:46:02 +0100395 "if run mmc_load_pubkey hab_check_addr " \
396 "mmc_load_fit hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100397 "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 Schochera051ee92019-12-01 11:23:11 +0100406 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100407 "else "\
408 "run main_rescue_boot;" \
409 "fi; \0"\
Heiko Schocher19c3cd92019-12-01 11:23:29 +0100410 HAB_EXTRA_SETTINGS \
Tom Rinicc3b0032021-08-10 17:34:20 -0400411 EXTRA_ENV_BOARD_SETTINGS
Heiko Schochera051ee92019-12-01 11:23:11 +0100412
Heiko Schochera051ee92019-12-01 11:23:11 +0100413/* 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 Schochera051ee92019-12-01 11:23:11 +0100427/* DMA stuff, needed for GPMI/MXS NAND support */
428
Heiko Schochera051ee92019-12-01 11:23:11 +0100429/* USB Configs */
Heiko Schochera051ee92019-12-01 11:23:11 +0100430#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 Schocher8f4a1b92019-12-01 11:23:19 +0100438#define CONFIG_IMX_VIDEO_SKIP
Heiko Schochera051ee92019-12-01 11:23:11 +0100439
440#define CONFIG_IMX6_PWM_PER_CLK 66000000
441
Heiko Schocherab77bef2020-11-30 20:46:05 +0100442#define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
443 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
444
Heiko Schocher05729822015-05-18 13:32:31 +0200445#endif /* __ARISTAINETOS2_CONFIG_H */