blob: 286435d6f84cf6a505853236a12ac1ff94a460da [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
26/* MMC Configs */
Tom Rini376b88a2022-10-28 20:27:13 -040027#define CFG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
Heiko Schochera051ee92019-12-01 11:23:11 +010028
Tom Rini4e3c8a62022-12-04 10:03:53 -050029#define CFG_FEC_MXC_PHYADDR 0
Heiko Schochera051ee92019-12-01 11:23:11 +010030
Heiko Schocher19c3cd92019-12-01 11:23:29 +010031#ifdef CONFIG_IMX_HAB
32#define HAB_EXTRA_SETTINGS \
33 "hab_check_addr=" \
34 "if hab_auth_img ${check_addr} ${filesize} ; then " \
35 "true;" \
36 "else " \
37 "echo \"HAB checks ${hab_check_filetype} " \
38 "failed!\"; " \
39 "false; " \
40 "fi;\0" \
41 "hab_check_file_fit=" \
42 "if env exists enable_hab_check && test " \
43 "${enable_hab_check} -eq 1 ; then " \
44 "setenv hab_check_filetype \"FIT file on SD card " \
45 "or eMMC\";" \
46 "env set check_addr ${fit_addr_r};" \
47 "run hab_check_addr;" \
48 "else " \
49 "true; "\
50 "fi;\0" \
51 "hab_check_file_bootscript=" \
52 "if env exists enable_hab_check && test " \
53 "${enable_hab_check} -eq 1 ; then " \
54 "setenv hab_check_filetype \"Bootscript file\";" \
55 "env set check_addr ${loadaddr};" \
56 "run hab_check_addr;" \
57 "else " \
58 "true; "\
59 "fi;\0" \
60 "hab_check_flash_fit=" \
61 "if env exists enable_hab_check && test " \
62 "${enable_hab_check} -eq 1 ; then " \
63 "setenv hab_check_filetype \"FIT files on flash\";" \
64 "env set check_addr ${fit_addr_r};" \
65 "run hab_check_addr;" \
66 "else " \
67 "true; "\
68 "fi;\0" \
69 "enable_hab_check=1\0"
70#else
71#define HAB_EXTRA_SETTINGS \
Heiko Schocher5a0baf42020-11-30 20:46:02 +010072 "hab_check_addr=echo HAB check addr always returns " \
73 "true;true\0" \
Heiko Schocher19c3cd92019-12-01 11:23:29 +010074 "hab_check_file_fit=echo HAB check FIT file always returns " \
75 "true;true\0" \
76 "hab_check_flash_fit=echo HAB check flash FIT always returns " \
77 "true;true\0" \
78 "hab_check_file_bootscript=echo HAB check bootscript always " \
79 "returns true;true\0" \
80 "enable_hab_check=0\0"
81#endif
82
Heiko Schocher5a0baf42020-11-30 20:46:02 +010083#if (CONFIG_SYS_BOARD_VERSION == 5)
Tom Rinicc3b0032021-08-10 17:34:20 -040084#define EXTRA_ENV_BOARD_SETTINGS \
Heiko Schocher5a0baf42020-11-30 20:46:02 +010085 "dead=while true; do; " \
86 "led led_red on; sleep 1;" \
87 "led led_red off; sleep 1;" \
88 "done\0"
Heiko Schocherb43a1d72020-11-30 20:46:03 +010089#elif (CONFIG_SYS_BOARD_VERSION == 6)
Tom Rinicc3b0032021-08-10 17:34:20 -040090#define EXTRA_ENV_BOARD_SETTINGS \
Heiko Schocherb43a1d72020-11-30 20:46:03 +010091 "dead=while true; do; " \
92 "led led_red on; led led_red2 on; sleep 1;" \
93 "led led_red off; led led_red2 off;; sleep 1;" \
94 "done\0"
Heiko Schocher57c4aad2019-12-01 11:23:30 +010095#endif
Heiko Schocher9eca4612019-12-01 11:23:28 +010096
Tom Rinic9edebe2022-12-04 10:03:50 -050097#define CFG_EXTRA_ENV_SETTINGS \
Heiko Schochera051ee92019-12-01 11:23:11 +010098 "disable_giga=yes\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +010099 "usb_pgood_delay=2000\0" \
100 "nor_bootdelay=-2\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100101 "script=u-boot.scr\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100102 "loadaddr=0x12000000\0" \
103 "fit_addr_r=0x14000000\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100104 "uboot_sz=d0000\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100105 "panel=lb07wv8\0" \
106 "splashpos=m,m\0" \
107 "console=" CONSOLE_DEV "\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100108 "emmcroot=/dev/mmcblk1p1 rootwait rw\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100109 "mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \
110 "mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \
111 "mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \
112 "mk_pubkey_path=setenv pubkey /${sysnum}/PCR.pem\0" \
113 "mk_rescue_pubkey_path=setenv pubkey /${rescue_sysnum}/PCR.pem\0" \
114 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
115 "bootmode=${bootmode} rng_core.default_quality=1000 " \
116 "mmcpart=${mmcpart} emmcpart=${emmcpart} sysnum=${sysnum}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100117 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100118 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100119 "get_env=mw ${loadaddr} 0 0x20000;" \
120 "mmc rescan;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100121 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100122 "env import -t ${loadaddr}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100123 "default_env=gpio set wp_spi_nor.gpio-hog;" \
124 "sf probe;" \
125 "sf protect unlock 0 0x1000000;" \
126 "mw ${loadaddr} 0 0x20000;" \
127 "env export -t ${loadaddr} serial# ethaddr " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100128 "board_type panel;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100129 "env default -a;" \
130 "env import -t ${loadaddr}\0" \
131 "loadbootscript=" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100132 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
133 "${script};\0" \
134 "loadbootscriptUSB=" \
135 "ext4load usb 0 ${loadaddr} ${script};\0" \
136 "loadbootscriptUSBf=" \
137 "fatload usb 0 ${loadaddr} ${script};\0" \
138 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100139 "source \0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100140 "bootscript=echo Running bootscript from mmc ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100141 "source \0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100142 "mmcpart=1\0" \
143 "mmcdev=0\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100144 "emmcpart=1\0" \
145 "emmcdev=1\0" \
146 "sysnum=1\0" \
147 "rescue_sysnum=0\0" \
148 "rreason=18\0" \
149 "mainboot=echo Booting from eMMC ...; " \
150 "run mainargs addmtd addmisc;" \
151 "run boot_board_type;" \
152 "bootm ${fit_addr_r}\0" \
153 "mainargs=setenv bootargs console=${console},${baudrate} " \
154 "root=${emmcroot} rootfstype=ext4\0 " \
155 "main_load_fit=run mk_fitfile_path; " \
156 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
157 "${fit_file}; " \
158 "imi ${fit_addr_r}\0 " \
159 "rescue_load_fit=run mk_rescue_fitfile_path; " \
160 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
161 "${rescue_fit_file}; " \
162 "imi ${fit_addr_r}\0" \
163 "main_load_pubkey=run mk_pubkey_path; " \
164 "setenv hab_check_filetype \"PCR.pem\";" \
165 "env set check_addr ${loadaddr};" \
166 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
167 "${pubkey}\0" \
168 "rescue_load_pubkey=run mk_rescue_pubkey_path; " \
169 "setenv hab_check_filetype \"PCR.pem\";" \
170 "env set check_addr ${loadaddr};" \
171 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
172 "${pubkey}\0" \
173 "mainRargs=setenv bootargs console=${console},${baudrate} " \
174 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
Peng Fanbb4bb582022-04-15 12:23:41 +0800175 "mmcroot=/dev/mmcblk0p1 rootwait rw\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100176 "mmcargs=setenv bootargs console=${console},${baudrate} " \
177 "root=${mmcroot}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100178 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
179 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100180 "mmcboot=echo Booting from mmc ...; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100181 "run mmcargs addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100182 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100183 "bootm ${fit_addr_r}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100184 "mmc_load_fit=run mk_fitfile_path; " \
185 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100186 "${fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100187 "imi ${fit_addr_r}\0" \
188 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
189 "ext4load mmc ${mmcdev}:${mmcpart} " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100190 "${fit_addr_r} ${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100191 "imi ${fit_addr_r}\0" \
192 "mmc_load_uboot=run mk_uboot_path; " \
193 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
194 "${uboot}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100195 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
196 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
197 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
198 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
199 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
200 "sf write ${loadaddr} 400 ${filesize};" \
201 "sf read ${cmp_buf} 400 ${uboot_sz};" \
202 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100203 "mmc_load_pubkey=run mk_pubkey_path; " \
204 "setenv hab_check_filetype \"PCR.pem\";" \
205 "env set check_addr ${loadaddr};" \
206 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
207 "${pubkey}\0" \
208 "mmc_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
209 "setenv hab_check_filetype \"PCR.pem\";" \
210 "env set check_addr ${loadaddr};" \
211 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
212 "${pubkey}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100213 "rescueboot=echo Booting rescue system ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100214 "run addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100215 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100216 "run boot_board_type;" \
217 "if bootm ${fit_addr_r}; then ; " \
218 "else " \
219 "run dead; " \
220 "fi; \0" \
221 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
222 "\\\\${bootargs} " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100223 "rescueReason=$rreason\0 " \
224 "usb_load_fit=run mk_fitfile_path; " \
225 "ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
226 "usb_load_fitf=run mk_fitfile_path; " \
227 "fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
228 "usb_load_rescuefit=run mk_rescue_fitfile_path; " \
229 "ext4load usb 0 ${fit_addr_r} " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100230 "${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100231 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
232 "fatload usb 0 ${fit_addr_r} " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100233 "${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100234 "usb_load_pubkey=run mk_pubkey_path; " \
235 "setenv hab_check_filetype \"PCR.pem\";" \
236 "env set check_addr ${loadaddr};" \
237 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
238 "usb_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
239 "setenv hab_check_filetype \"PCR.pem\";" \
240 "env set check_addr ${loadaddr};" \
241 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
242 "usb_load_pubkeyf=run mk_pubkey_path; " \
243 "setenv hab_check_filetype \"PCR.pem\";" \
244 "env set check_addr ${loadaddr};" \
245 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
246 "usb_rescue_load_pubkeyf=run mk_rescue_pubkey_path; " \
247 "setenv hab_check_filetype \"PCR.pem\";" \
248 "env set check_addr ${loadaddr};" \
249 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100250 "usbroot=/dev/sda1 rootwait rw\0" \
251 "usbboot=echo Booting from usb-stick ...; " \
252 "run usbargs addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100253 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100254 "bootm ${fit_addr_r}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100255 "usbargs=setenv bootargs console=${console},${baudrate} " \
256 "root=${usbroot}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100257 "usbRargs=setenv bootargs console=${console},${baudrate} " \
258 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100259 "mmc_rescue_boot=" \
260 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100261 "if run mmc_rescue_load_pubkey hab_check_addr " \
262 "mmc_rescue_load_fit hab_check_file_fit; then " \
263 "run mmcRargs; run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100264 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100265 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100266 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100267 "fi;\0" \
268 "main_rescue_boot=" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100269 "if run main_load_pubkey hab_check_addr " \
270 "main_load_fit hab_check_flash_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100271 "if run mainboot; then ; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100272 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100273 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100274 "if run rescue_load_pubkey hab_check_addr " \
275 "rescue_load_fit hab_check_file_fit; then " \
276 "run mainRargs; run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100277 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100278 "echo RESCUE SYSTEM BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100279 "run dead; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100280 "fi; " \
281 "fi; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100282 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100283 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100284 "if run rescue_load_pubkey hab_check_addr " \
285 "rescue_load_fit hab_check_file_fit; then " \
286 "run mainRargs; run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100287 "else " \
288 "echo RESCUE SYSTEM BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100289 "run dead; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100290 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100291 "fi;\0" \
292 "usb_mmc_rescue_boot=" \
293 "usb start;" \
294 "if usb storage; then " \
295 "if run loadbootscriptUSB " \
296 "hab_check_file_bootscript;" \
297 "then run bootscriptUSB; " \
298 "fi; " \
299 "if run loadbootscriptUSBf " \
300 "hab_check_file_bootscript;" \
301 "then run bootscriptUSB; " \
302 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100303 "if run usb_load_pubkey hab_check_addr " \
304 "usb_load_fit hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100305 "run usbboot; " \
306 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100307 "if run usb_load_pubkeyf hab_check_addr " \
308 "usb_load_fitf hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100309 "run usbboot; " \
310 "fi; "\
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100311 "if run usb_rescue_load_pubkey hab_check_addr " \
312 "usb_load_rescuefit hab_check_file_fit; then " \
313 "run r_reason_syserr usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100314 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100315 "if run usb_rescue_load_pubkeyf hab_check_addr " \
316 "usb_load_rescuefitf hab_check_file_fit; then " \
317 "run r_reason_syserr usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100318 "fi; " \
319 "run mmc_rescue_boot;" \
320 "fi; "\
321 "run mmc_rescue_boot;\0" \
322 "rescue_xload_boot=" \
323 "run r_reason_syserr;" \
324 "if test ${bootmode} -ne 0 ; then " \
325 "mmc dev ${mmcdev};" \
326 "if mmc rescan; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100327 "if run mmc_rescue_load_pubkey " \
328 "hab_check_addr " \
329 "mmc_rescue_load_fit " \
330 "hab_check_file_fit; then " \
331 "run mmcRargs; run rescueboot; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100332 "else " \
333 "usb start;" \
334 "if usb storage; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100335 "if run usb_rescue_load_pubkey " \
336 "hab_check_addr " \
337 "usb_load_rescuefit " \
338 "hab_check_file_fit; then " \
339 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100340 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100341 "if run usb_rescue_load_pubkeyf " \
342 "hab_check_addr " \
343 "usb_load_rescuefitf " \
344 "hab_check_file_fit; then " \
345 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100346 "fi; " \
347 "fi;" \
348 "fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100349 "echo RESCUE SYSTEM ON SD OR " \
350 "USB BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100351 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100352 "else " \
353 "usb start;" \
354 "if usb storage; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100355 "if run usb_rescue_load_pubkey " \
356 "hab_check_addr " \
357 "usb_load_rescuefit " \
358 "hab_check_file_fit; then " \
359 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100360 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100361 "if run usb_rescue_load_pubkeyf " \
362 "hab_check_addr " \
363 "usb_load_rescuefitf " \
364 "hab_check_file_fit; then " \
365 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100366 "fi; " \
367 "fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100368 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100369 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100370 "fi; " \
371 "else "\
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100372 "if run rescue_load_pubkey hab_check_addr " \
373 "rescue_load_fit hab_check_file_fit; then " \
374 "run mainRargs; run rescueboot; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100375 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100376 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100377 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100378 "fi; " \
379 "fi;\0" \
380 "ari_boot=if test ${bootmode} -ne 0 ; then " \
381 "mmc dev ${mmcdev};" \
382 "if mmc rescan; then " \
383 "if run loadbootscript hab_check_file_bootscript;" \
384 "then run bootscript; " \
385 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100386 "if run mmc_load_pubkey hab_check_addr " \
387 "mmc_load_fit hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100388 "if run mmcboot; then ; " \
389 "else " \
390 "run mmc_rescue_boot;" \
391 "fi; " \
392 "else " \
393 "run usb_mmc_rescue_boot;" \
394 "fi; " \
395 "else " \
396 "run usb_mmc_rescue_boot;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100397 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100398 "else "\
399 "run main_rescue_boot;" \
400 "fi; \0"\
Heiko Schocher19c3cd92019-12-01 11:23:29 +0100401 HAB_EXTRA_SETTINGS \
Tom Rinicc3b0032021-08-10 17:34:20 -0400402 EXTRA_ENV_BOARD_SETTINGS
Heiko Schochera051ee92019-12-01 11:23:11 +0100403
Heiko Schochera051ee92019-12-01 11:23:11 +0100404/* Physical Memory Map */
405#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
406
Tom Rinibb4dd962022-11-16 13:10:37 -0500407#define CFG_SYS_SDRAM_BASE PHYS_SDRAM
Tom Rini6a5dccc2022-11-16 13:10:41 -0500408#define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
409#define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE
Heiko Schochera051ee92019-12-01 11:23:11 +0100410
Tom Rini376b88a2022-10-28 20:27:13 -0400411#define CFG_SYS_FSL_USDHC_NUM 2
Heiko Schochera051ee92019-12-01 11:23:11 +0100412
Heiko Schochera051ee92019-12-01 11:23:11 +0100413/* DMA stuff, needed for GPMI/MXS NAND support */
414
Heiko Schochera051ee92019-12-01 11:23:11 +0100415/* USB Configs */
Tom Rinib9796e82022-12-04 10:04:56 -0500416#define CFG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
417#define CFG_MXC_USB_FLAGS 0
Heiko Schochera051ee92019-12-01 11:23:11 +0100418
419/* UBI support */
420
Tom Rini0297e5f2022-12-04 10:03:40 -0500421#define CFG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
Heiko Schocherab77bef2020-11-30 20:46:05 +0100422 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
423
Heiko Schocher05729822015-05-18 13:32:31 +0200424#endif /* __ARISTAINETOS2_CONFIG_H */