blob: 9d4a4bbdf43ca21fd7b9e2c58ac325941ecc9ef7 [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
Heiko Schocher5a0baf42020-11-30 20:46:02 +010014#if (CONFIG_SYS_BOARD_VERSION == 5)
Simon Glass4694a742016-10-17 20:12:39 -060015#define CONSOLE_DEV "ttymxc1"
Heiko Schocherb43a1d72020-11-30 20:46:03 +010016#elif (CONFIG_SYS_BOARD_VERSION == 6)
Heiko Schocherb43a1d72020-11-30 20:46:03 +010017#define CONSOLE_DEV "ttymxc0"
Heiko Schocher5a0baf42020-11-30 20:46:02 +010018#endif
Heiko Schocher05729822015-05-18 13:32:31 +020019
Heiko Schocher05729822015-05-18 13:32:31 +020020/* Framebuffer */
Tom Rini6a5dccc2022-11-16 13:10:41 -050021#define CFG_SYS_LDB_CLOCK 28341000
Heiko Schocher05729822015-05-18 13:32:31 +020022
Heiko Schochera051ee92019-12-01 11:23:11 +010023#include "mx6_common.h"
24
Heiko Schochera051ee92019-12-01 11:23:11 +010025/* MMC Configs */
Tom Rini376b88a2022-10-28 20:27:13 -040026#define CFG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
Heiko Schochera051ee92019-12-01 11:23:11 +010027
Tom Rini4e3c8a62022-12-04 10:03:53 -050028#define CFG_FEC_MXC_PHYADDR 0
Heiko Schochera051ee92019-12-01 11:23:11 +010029
Heiko Schocher19c3cd92019-12-01 11:23:29 +010030#ifdef CONFIG_IMX_HAB
31#define HAB_EXTRA_SETTINGS \
32 "hab_check_addr=" \
33 "if hab_auth_img ${check_addr} ${filesize} ; then " \
34 "true;" \
35 "else " \
36 "echo \"HAB checks ${hab_check_filetype} " \
37 "failed!\"; " \
38 "false; " \
39 "fi;\0" \
40 "hab_check_file_fit=" \
41 "if env exists enable_hab_check && test " \
42 "${enable_hab_check} -eq 1 ; then " \
43 "setenv hab_check_filetype \"FIT file on SD card " \
44 "or eMMC\";" \
45 "env set check_addr ${fit_addr_r};" \
46 "run hab_check_addr;" \
47 "else " \
48 "true; "\
49 "fi;\0" \
50 "hab_check_file_bootscript=" \
51 "if env exists enable_hab_check && test " \
52 "${enable_hab_check} -eq 1 ; then " \
53 "setenv hab_check_filetype \"Bootscript file\";" \
54 "env set check_addr ${loadaddr};" \
55 "run hab_check_addr;" \
56 "else " \
57 "true; "\
58 "fi;\0" \
59 "hab_check_flash_fit=" \
60 "if env exists enable_hab_check && test " \
61 "${enable_hab_check} -eq 1 ; then " \
62 "setenv hab_check_filetype \"FIT files on flash\";" \
63 "env set check_addr ${fit_addr_r};" \
64 "run hab_check_addr;" \
65 "else " \
66 "true; "\
67 "fi;\0" \
68 "enable_hab_check=1\0"
69#else
70#define HAB_EXTRA_SETTINGS \
Heiko Schocher5a0baf42020-11-30 20:46:02 +010071 "hab_check_addr=echo HAB check addr always returns " \
72 "true;true\0" \
Heiko Schocher19c3cd92019-12-01 11:23:29 +010073 "hab_check_file_fit=echo HAB check FIT file always returns " \
74 "true;true\0" \
75 "hab_check_flash_fit=echo HAB check flash FIT always returns " \
76 "true;true\0" \
77 "hab_check_file_bootscript=echo HAB check bootscript always " \
78 "returns true;true\0" \
79 "enable_hab_check=0\0"
80#endif
81
Heiko Schocher5a0baf42020-11-30 20:46:02 +010082#if (CONFIG_SYS_BOARD_VERSION == 5)
Tom Rinicc3b0032021-08-10 17:34:20 -040083#define EXTRA_ENV_BOARD_SETTINGS \
Heiko Schocher5a0baf42020-11-30 20:46:02 +010084 "dead=while true; do; " \
85 "led led_red on; sleep 1;" \
86 "led led_red off; sleep 1;" \
87 "done\0"
Heiko Schocherb43a1d72020-11-30 20:46:03 +010088#elif (CONFIG_SYS_BOARD_VERSION == 6)
Tom Rinicc3b0032021-08-10 17:34:20 -040089#define EXTRA_ENV_BOARD_SETTINGS \
Heiko Schocherb43a1d72020-11-30 20:46:03 +010090 "dead=while true; do; " \
91 "led led_red on; led led_red2 on; sleep 1;" \
92 "led led_red off; led led_red2 off;; sleep 1;" \
93 "done\0"
Heiko Schocher57c4aad2019-12-01 11:23:30 +010094#endif
Heiko Schocher9eca4612019-12-01 11:23:28 +010095
Tom Rinic9edebe2022-12-04 10:03:50 -050096#define CFG_EXTRA_ENV_SETTINGS \
Heiko Schochera051ee92019-12-01 11:23:11 +010097 "disable_giga=yes\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +010098 "usb_pgood_delay=2000\0" \
99 "nor_bootdelay=-2\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100100 "script=u-boot.scr\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100101 "loadaddr=0x12000000\0" \
102 "fit_addr_r=0x14000000\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100103 "uboot_sz=d0000\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100104 "panel=lb07wv8\0" \
105 "splashpos=m,m\0" \
106 "console=" CONSOLE_DEV "\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100107 "emmcroot=/dev/mmcblk1p1 rootwait rw\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100108 "mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \
109 "mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \
110 "mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \
111 "mk_pubkey_path=setenv pubkey /${sysnum}/PCR.pem\0" \
112 "mk_rescue_pubkey_path=setenv pubkey /${rescue_sysnum}/PCR.pem\0" \
113 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
114 "bootmode=${bootmode} rng_core.default_quality=1000 " \
115 "mmcpart=${mmcpart} emmcpart=${emmcpart} sysnum=${sysnum}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100116 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100117 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100118 "get_env=mw ${loadaddr} 0 0x20000;" \
119 "mmc rescan;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100120 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100121 "env import -t ${loadaddr}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100122 "default_env=gpio set wp_spi_nor.gpio-hog;" \
123 "sf probe;" \
124 "sf protect unlock 0 0x1000000;" \
125 "mw ${loadaddr} 0 0x20000;" \
126 "env export -t ${loadaddr} serial# ethaddr " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100127 "board_type panel;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100128 "env default -a;" \
129 "env import -t ${loadaddr}\0" \
130 "loadbootscript=" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100131 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
132 "${script};\0" \
133 "loadbootscriptUSB=" \
134 "ext4load usb 0 ${loadaddr} ${script};\0" \
135 "loadbootscriptUSBf=" \
136 "fatload usb 0 ${loadaddr} ${script};\0" \
137 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100138 "source \0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100139 "bootscript=echo Running bootscript from mmc ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100140 "source \0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100141 "mmcpart=1\0" \
142 "mmcdev=0\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100143 "emmcpart=1\0" \
144 "emmcdev=1\0" \
145 "sysnum=1\0" \
146 "rescue_sysnum=0\0" \
147 "rreason=18\0" \
148 "mainboot=echo Booting from eMMC ...; " \
149 "run mainargs addmtd addmisc;" \
150 "run boot_board_type;" \
151 "bootm ${fit_addr_r}\0" \
152 "mainargs=setenv bootargs console=${console},${baudrate} " \
153 "root=${emmcroot} rootfstype=ext4\0 " \
154 "main_load_fit=run mk_fitfile_path; " \
155 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
156 "${fit_file}; " \
157 "imi ${fit_addr_r}\0 " \
158 "rescue_load_fit=run mk_rescue_fitfile_path; " \
159 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
160 "${rescue_fit_file}; " \
161 "imi ${fit_addr_r}\0" \
162 "main_load_pubkey=run mk_pubkey_path; " \
163 "setenv hab_check_filetype \"PCR.pem\";" \
164 "env set check_addr ${loadaddr};" \
165 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
166 "${pubkey}\0" \
167 "rescue_load_pubkey=run mk_rescue_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 "mainRargs=setenv bootargs console=${console},${baudrate} " \
173 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
Peng Fanbb4bb582022-04-15 12:23:41 +0800174 "mmcroot=/dev/mmcblk0p1 rootwait rw\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100175 "mmcargs=setenv bootargs console=${console},${baudrate} " \
176 "root=${mmcroot}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100177 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
178 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100179 "mmcboot=echo Booting from mmc ...; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100180 "run mmcargs addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100181 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100182 "bootm ${fit_addr_r}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100183 "mmc_load_fit=run mk_fitfile_path; " \
184 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100185 "${fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100186 "imi ${fit_addr_r}\0" \
187 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
188 "ext4load mmc ${mmcdev}:${mmcpart} " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100189 "${fit_addr_r} ${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100190 "imi ${fit_addr_r}\0" \
191 "mmc_load_uboot=run mk_uboot_path; " \
192 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
193 "${uboot}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100194 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
195 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
196 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
197 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
198 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
199 "sf write ${loadaddr} 400 ${filesize};" \
200 "sf read ${cmp_buf} 400 ${uboot_sz};" \
201 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100202 "mmc_load_pubkey=run mk_pubkey_path; " \
203 "setenv hab_check_filetype \"PCR.pem\";" \
204 "env set check_addr ${loadaddr};" \
205 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
206 "${pubkey}\0" \
207 "mmc_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
208 "setenv hab_check_filetype \"PCR.pem\";" \
209 "env set check_addr ${loadaddr};" \
210 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
211 "${pubkey}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100212 "rescueboot=echo Booting rescue system ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100213 "run addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100214 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100215 "run boot_board_type;" \
216 "if bootm ${fit_addr_r}; then ; " \
217 "else " \
218 "run dead; " \
219 "fi; \0" \
220 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
221 "\\\\${bootargs} " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100222 "rescueReason=$rreason\0 " \
223 "usb_load_fit=run mk_fitfile_path; " \
224 "ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
225 "usb_load_fitf=run mk_fitfile_path; " \
226 "fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
227 "usb_load_rescuefit=run mk_rescue_fitfile_path; " \
228 "ext4load usb 0 ${fit_addr_r} " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100229 "${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100230 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
231 "fatload usb 0 ${fit_addr_r} " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100232 "${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100233 "usb_load_pubkey=run mk_pubkey_path; " \
234 "setenv hab_check_filetype \"PCR.pem\";" \
235 "env set check_addr ${loadaddr};" \
236 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
237 "usb_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
238 "setenv hab_check_filetype \"PCR.pem\";" \
239 "env set check_addr ${loadaddr};" \
240 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
241 "usb_load_pubkeyf=run mk_pubkey_path; " \
242 "setenv hab_check_filetype \"PCR.pem\";" \
243 "env set check_addr ${loadaddr};" \
244 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
245 "usb_rescue_load_pubkeyf=run mk_rescue_pubkey_path; " \
246 "setenv hab_check_filetype \"PCR.pem\";" \
247 "env set check_addr ${loadaddr};" \
248 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100249 "usbroot=/dev/sda1 rootwait rw\0" \
250 "usbboot=echo Booting from usb-stick ...; " \
251 "run usbargs addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100252 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100253 "bootm ${fit_addr_r}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100254 "usbargs=setenv bootargs console=${console},${baudrate} " \
255 "root=${usbroot}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100256 "usbRargs=setenv bootargs console=${console},${baudrate} " \
257 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100258 "mmc_rescue_boot=" \
259 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100260 "if run mmc_rescue_load_pubkey hab_check_addr " \
261 "mmc_rescue_load_fit hab_check_file_fit; then " \
262 "run mmcRargs; run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100263 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100264 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100265 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100266 "fi;\0" \
267 "main_rescue_boot=" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100268 "if run main_load_pubkey hab_check_addr " \
269 "main_load_fit hab_check_flash_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100270 "if run mainboot; then ; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100271 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100272 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100273 "if run rescue_load_pubkey hab_check_addr " \
274 "rescue_load_fit hab_check_file_fit; then " \
275 "run mainRargs; run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100276 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100277 "echo RESCUE SYSTEM BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100278 "run dead; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100279 "fi; " \
280 "fi; " \
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 " \
287 "echo RESCUE SYSTEM BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100288 "run dead; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100289 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100290 "fi;\0" \
291 "usb_mmc_rescue_boot=" \
292 "usb start;" \
293 "if usb storage; then " \
294 "if run loadbootscriptUSB " \
295 "hab_check_file_bootscript;" \
296 "then run bootscriptUSB; " \
297 "fi; " \
298 "if run loadbootscriptUSBf " \
299 "hab_check_file_bootscript;" \
300 "then run bootscriptUSB; " \
301 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100302 "if run usb_load_pubkey hab_check_addr " \
303 "usb_load_fit hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100304 "run usbboot; " \
305 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100306 "if run usb_load_pubkeyf hab_check_addr " \
307 "usb_load_fitf hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100308 "run usbboot; " \
309 "fi; "\
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100310 "if run usb_rescue_load_pubkey hab_check_addr " \
311 "usb_load_rescuefit hab_check_file_fit; then " \
312 "run r_reason_syserr usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100313 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100314 "if run usb_rescue_load_pubkeyf hab_check_addr " \
315 "usb_load_rescuefitf hab_check_file_fit; then " \
316 "run r_reason_syserr usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100317 "fi; " \
318 "run mmc_rescue_boot;" \
319 "fi; "\
320 "run mmc_rescue_boot;\0" \
321 "rescue_xload_boot=" \
322 "run r_reason_syserr;" \
323 "if test ${bootmode} -ne 0 ; then " \
324 "mmc dev ${mmcdev};" \
325 "if mmc rescan; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100326 "if run mmc_rescue_load_pubkey " \
327 "hab_check_addr " \
328 "mmc_rescue_load_fit " \
329 "hab_check_file_fit; then " \
330 "run mmcRargs; run rescueboot; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100331 "else " \
332 "usb start;" \
333 "if usb storage; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100334 "if run usb_rescue_load_pubkey " \
335 "hab_check_addr " \
336 "usb_load_rescuefit " \
337 "hab_check_file_fit; then " \
338 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100339 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100340 "if run usb_rescue_load_pubkeyf " \
341 "hab_check_addr " \
342 "usb_load_rescuefitf " \
343 "hab_check_file_fit; then " \
344 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100345 "fi; " \
346 "fi;" \
347 "fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100348 "echo RESCUE SYSTEM ON SD OR " \
349 "USB BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100350 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100351 "else " \
352 "usb start;" \
353 "if usb storage; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100354 "if run usb_rescue_load_pubkey " \
355 "hab_check_addr " \
356 "usb_load_rescuefit " \
357 "hab_check_file_fit; then " \
358 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100359 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100360 "if run usb_rescue_load_pubkeyf " \
361 "hab_check_addr " \
362 "usb_load_rescuefitf " \
363 "hab_check_file_fit; then " \
364 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100365 "fi; " \
366 "fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100367 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100368 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100369 "fi; " \
370 "else "\
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100371 "if run rescue_load_pubkey hab_check_addr " \
372 "rescue_load_fit hab_check_file_fit; then " \
373 "run mainRargs; run rescueboot; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100374 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100375 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100376 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100377 "fi; " \
378 "fi;\0" \
379 "ari_boot=if test ${bootmode} -ne 0 ; then " \
380 "mmc dev ${mmcdev};" \
381 "if mmc rescan; then " \
382 "if run loadbootscript hab_check_file_bootscript;" \
383 "then run bootscript; " \
384 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100385 "if run mmc_load_pubkey hab_check_addr " \
386 "mmc_load_fit hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100387 "if run mmcboot; then ; " \
388 "else " \
389 "run mmc_rescue_boot;" \
390 "fi; " \
391 "else " \
392 "run usb_mmc_rescue_boot;" \
393 "fi; " \
394 "else " \
395 "run usb_mmc_rescue_boot;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100396 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100397 "else "\
398 "run main_rescue_boot;" \
399 "fi; \0"\
Heiko Schocher19c3cd92019-12-01 11:23:29 +0100400 HAB_EXTRA_SETTINGS \
Tom Rinicc3b0032021-08-10 17:34:20 -0400401 EXTRA_ENV_BOARD_SETTINGS
Heiko Schochera051ee92019-12-01 11:23:11 +0100402
Heiko Schochera051ee92019-12-01 11:23:11 +0100403/* Physical Memory Map */
404#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
405
Tom Rinibb4dd962022-11-16 13:10:37 -0500406#define CFG_SYS_SDRAM_BASE PHYS_SDRAM
Tom Rini6a5dccc2022-11-16 13:10:41 -0500407#define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
408#define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE
Heiko Schochera051ee92019-12-01 11:23:11 +0100409
Tom Rini376b88a2022-10-28 20:27:13 -0400410#define CFG_SYS_FSL_USDHC_NUM 2
Heiko Schochera051ee92019-12-01 11:23:11 +0100411
Heiko Schochera051ee92019-12-01 11:23:11 +0100412/* DMA stuff, needed for GPMI/MXS NAND support */
413
Heiko Schochera051ee92019-12-01 11:23:11 +0100414/* USB Configs */
Tom Rinib9796e82022-12-04 10:04:56 -0500415#define CFG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
416#define CFG_MXC_USB_FLAGS 0
Heiko Schochera051ee92019-12-01 11:23:11 +0100417
418/* UBI support */
419
Tom Rini0297e5f2022-12-04 10:03:40 -0500420#define CFG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
Heiko Schocherab77bef2020-11-30 20:46:05 +0100421 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
422
Heiko Schocher05729822015-05-18 13:32:31 +0200423#endif /* __ARISTAINETOS2_CONFIG_H */