blob: 611b6d724e13ee801426c90b3a296fb4977ef812 [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#define CONFIG_MMCROOT "/dev/mmcblk0p1"
30
31/* MMC Configs */
Heiko Schocher7344de12019-12-01 11:23:14 +010032#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
Heiko Schochera051ee92019-12-01 11:23:11 +010033
34#define IMX_FEC_BASE ENET_BASE_ADDR
Heiko Schochera051ee92019-12-01 11:23:11 +010035#define CONFIG_FEC_MXC_PHYADDR 0
36
37#define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
38
Heiko Schocher19c3cd92019-12-01 11:23:29 +010039#ifdef CONFIG_IMX_HAB
40#define HAB_EXTRA_SETTINGS \
41 "hab_check_addr=" \
42 "if hab_auth_img ${check_addr} ${filesize} ; then " \
43 "true;" \
44 "else " \
45 "echo \"HAB checks ${hab_check_filetype} " \
46 "failed!\"; " \
47 "false; " \
48 "fi;\0" \
49 "hab_check_file_fit=" \
50 "if env exists enable_hab_check && test " \
51 "${enable_hab_check} -eq 1 ; then " \
52 "setenv hab_check_filetype \"FIT file on SD card " \
53 "or eMMC\";" \
54 "env set check_addr ${fit_addr_r};" \
55 "run hab_check_addr;" \
56 "else " \
57 "true; "\
58 "fi;\0" \
59 "hab_check_file_bootscript=" \
60 "if env exists enable_hab_check && test " \
61 "${enable_hab_check} -eq 1 ; then " \
62 "setenv hab_check_filetype \"Bootscript file\";" \
63 "env set check_addr ${loadaddr};" \
64 "run hab_check_addr;" \
65 "else " \
66 "true; "\
67 "fi;\0" \
68 "hab_check_flash_fit=" \
69 "if env exists enable_hab_check && test " \
70 "${enable_hab_check} -eq 1 ; then " \
71 "setenv hab_check_filetype \"FIT files on flash\";" \
72 "env set check_addr ${fit_addr_r};" \
73 "run hab_check_addr;" \
74 "else " \
75 "true; "\
76 "fi;\0" \
77 "enable_hab_check=1\0"
78#else
79#define HAB_EXTRA_SETTINGS \
Heiko Schocher5a0baf42020-11-30 20:46:02 +010080 "hab_check_addr=echo HAB check addr always returns " \
81 "true;true\0" \
Heiko Schocher19c3cd92019-12-01 11:23:29 +010082 "hab_check_file_fit=echo HAB check FIT file always returns " \
83 "true;true\0" \
84 "hab_check_flash_fit=echo HAB check flash FIT always returns " \
85 "true;true\0" \
86 "hab_check_file_bootscript=echo HAB check bootscript always " \
87 "returns true;true\0" \
88 "enable_hab_check=0\0"
89#endif
90
Heiko Schocher5a0baf42020-11-30 20:46:02 +010091#if (CONFIG_SYS_BOARD_VERSION == 5)
Tom Rinicc3b0032021-08-10 17:34:20 -040092#define EXTRA_ENV_BOARD_SETTINGS \
Heiko Schocher5a0baf42020-11-30 20:46:02 +010093 "dead=while true; do; " \
94 "led led_red on; sleep 1;" \
95 "led led_red off; sleep 1;" \
96 "done\0"
Heiko Schocherb43a1d72020-11-30 20:46:03 +010097#elif (CONFIG_SYS_BOARD_VERSION == 6)
Tom Rinicc3b0032021-08-10 17:34:20 -040098#define EXTRA_ENV_BOARD_SETTINGS \
Heiko Schocherb43a1d72020-11-30 20:46:03 +010099 "dead=while true; do; " \
100 "led led_red on; led led_red2 on; sleep 1;" \
101 "led led_red off; led led_red2 off;; sleep 1;" \
102 "done\0"
Heiko Schocher57c4aad2019-12-01 11:23:30 +0100103#endif
Heiko Schocher9eca4612019-12-01 11:23:28 +0100104
Heiko Schochera051ee92019-12-01 11:23:11 +0100105#define CONFIG_EXTRA_ENV_SETTINGS \
106 "disable_giga=yes\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100107 "usb_pgood_delay=2000\0" \
108 "nor_bootdelay=-2\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100109 "script=u-boot.scr\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100110 "loadaddr=0x12000000\0" \
111 "fit_addr_r=0x14000000\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100112 "uboot_sz=d0000\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100113 "panel=lb07wv8\0" \
114 "splashpos=m,m\0" \
115 "console=" CONSOLE_DEV "\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100116 "emmcroot=/dev/mmcblk1p1 rootwait rw\0" \
117 "mtdids=nor0=spi0.0\0" \
118 "mtdparts=mtdparts=spi0.0:832k(u-boot),64k(env),64k(env-red)," \
119 "-(ubi-nor)\0" \
120 "mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \
121 "mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \
122 "mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \
123 "mk_pubkey_path=setenv pubkey /${sysnum}/PCR.pem\0" \
124 "mk_rescue_pubkey_path=setenv pubkey /${rescue_sysnum}/PCR.pem\0" \
125 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
126 "bootmode=${bootmode} rng_core.default_quality=1000 " \
127 "mmcpart=${mmcpart} emmcpart=${emmcpart} sysnum=${sysnum}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100128 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100129 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100130 "get_env=mw ${loadaddr} 0 0x20000;" \
131 "mmc rescan;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100132 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100133 "env import -t ${loadaddr}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100134 "default_env=gpio set wp_spi_nor.gpio-hog;" \
135 "sf probe;" \
136 "sf protect unlock 0 0x1000000;" \
137 "mw ${loadaddr} 0 0x20000;" \
138 "env export -t ${loadaddr} serial# ethaddr " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100139 "board_type panel;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100140 "env default -a;" \
141 "env import -t ${loadaddr}\0" \
142 "loadbootscript=" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100143 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
144 "${script};\0" \
145 "loadbootscriptUSB=" \
146 "ext4load usb 0 ${loadaddr} ${script};\0" \
147 "loadbootscriptUSBf=" \
148 "fatload usb 0 ${loadaddr} ${script};\0" \
149 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100150 "source \0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100151 "bootscript=echo Running bootscript from mmc ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100152 "source \0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100153 "mmcpart=1\0" \
154 "mmcdev=0\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100155 "emmcpart=1\0" \
156 "emmcdev=1\0" \
157 "sysnum=1\0" \
158 "rescue_sysnum=0\0" \
159 "rreason=18\0" \
160 "mainboot=echo Booting from eMMC ...; " \
161 "run mainargs addmtd addmisc;" \
162 "run boot_board_type;" \
163 "bootm ${fit_addr_r}\0" \
164 "mainargs=setenv bootargs console=${console},${baudrate} " \
165 "root=${emmcroot} rootfstype=ext4\0 " \
166 "main_load_fit=run mk_fitfile_path; " \
167 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
168 "${fit_file}; " \
169 "imi ${fit_addr_r}\0 " \
170 "rescue_load_fit=run mk_rescue_fitfile_path; " \
171 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
172 "${rescue_fit_file}; " \
173 "imi ${fit_addr_r}\0" \
174 "main_load_pubkey=run mk_pubkey_path; " \
175 "setenv hab_check_filetype \"PCR.pem\";" \
176 "env set check_addr ${loadaddr};" \
177 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
178 "${pubkey}\0" \
179 "rescue_load_pubkey=run mk_rescue_pubkey_path; " \
180 "setenv hab_check_filetype \"PCR.pem\";" \
181 "env set check_addr ${loadaddr};" \
182 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
183 "${pubkey}\0" \
184 "mainRargs=setenv bootargs console=${console},${baudrate} " \
185 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100186 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
187 "mmcargs=setenv bootargs console=${console},${baudrate} " \
188 "root=${mmcroot}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100189 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
190 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100191 "mmcboot=echo Booting from mmc ...; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100192 "run mmcargs addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100193 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100194 "bootm ${fit_addr_r}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100195 "mmc_load_fit=run mk_fitfile_path; " \
196 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100197 "${fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100198 "imi ${fit_addr_r}\0" \
199 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
200 "ext4load mmc ${mmcdev}:${mmcpart} " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100201 "${fit_addr_r} ${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100202 "imi ${fit_addr_r}\0" \
203 "mmc_load_uboot=run mk_uboot_path; " \
204 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
205 "${uboot}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100206 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
207 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
208 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
209 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
210 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
211 "sf write ${loadaddr} 400 ${filesize};" \
212 "sf read ${cmp_buf} 400 ${uboot_sz};" \
213 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100214 "mmc_load_pubkey=run mk_pubkey_path; " \
215 "setenv hab_check_filetype \"PCR.pem\";" \
216 "env set check_addr ${loadaddr};" \
217 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
218 "${pubkey}\0" \
219 "mmc_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
220 "setenv hab_check_filetype \"PCR.pem\";" \
221 "env set check_addr ${loadaddr};" \
222 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
223 "${pubkey}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100224 "rescueboot=echo Booting rescue system ...; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100225 "run addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100226 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100227 "run boot_board_type;" \
228 "if bootm ${fit_addr_r}; then ; " \
229 "else " \
230 "run dead; " \
231 "fi; \0" \
232 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
233 "\\\\${bootargs} " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100234 "rescueReason=$rreason\0 " \
235 "usb_load_fit=run mk_fitfile_path; " \
236 "ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
237 "usb_load_fitf=run mk_fitfile_path; " \
238 "fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
239 "usb_load_rescuefit=run mk_rescue_fitfile_path; " \
240 "ext4load usb 0 ${fit_addr_r} " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100241 "${rescue_fit_file}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100242 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
243 "fatload 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_pubkey=run mk_pubkey_path; " \
246 "setenv hab_check_filetype \"PCR.pem\";" \
247 "env set check_addr ${loadaddr};" \
248 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
249 "usb_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
250 "setenv hab_check_filetype \"PCR.pem\";" \
251 "env set check_addr ${loadaddr};" \
252 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
253 "usb_load_pubkeyf=run mk_pubkey_path; " \
254 "setenv hab_check_filetype \"PCR.pem\";" \
255 "env set check_addr ${loadaddr};" \
256 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
257 "usb_rescue_load_pubkeyf=run mk_rescue_pubkey_path; " \
258 "setenv hab_check_filetype \"PCR.pem\";" \
259 "env set check_addr ${loadaddr};" \
260 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100261 "usbroot=/dev/sda1 rootwait rw\0" \
262 "usbboot=echo Booting from usb-stick ...; " \
263 "run usbargs addmtd addmisc;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100264 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100265 "bootm ${fit_addr_r}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100266 "usbargs=setenv bootargs console=${console},${baudrate} " \
267 "root=${usbroot}\0" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100268 "usbRargs=setenv bootargs console=${console},${baudrate} " \
269 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100270 "mmc_rescue_boot=" \
271 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100272 "if run mmc_rescue_load_pubkey hab_check_addr " \
273 "mmc_rescue_load_fit hab_check_file_fit; then " \
274 "run mmcRargs; run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100275 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100276 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100277 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100278 "fi;\0" \
279 "main_rescue_boot=" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100280 "if run main_load_pubkey hab_check_addr " \
281 "main_load_fit hab_check_flash_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100282 "if run mainboot; then ; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100283 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100284 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100285 "if run rescue_load_pubkey hab_check_addr " \
286 "rescue_load_fit hab_check_file_fit; then " \
287 "run mainRargs; run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100288 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100289 "echo RESCUE SYSTEM BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100290 "run dead; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100291 "fi; " \
292 "fi; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100293 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100294 "run r_reason_syserr;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100295 "if run rescue_load_pubkey hab_check_addr " \
296 "rescue_load_fit hab_check_file_fit; then " \
297 "run mainRargs; run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100298 "else " \
299 "echo RESCUE SYSTEM BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100300 "run dead; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100301 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100302 "fi;\0" \
303 "usb_mmc_rescue_boot=" \
304 "usb start;" \
305 "if usb storage; then " \
306 "if run loadbootscriptUSB " \
307 "hab_check_file_bootscript;" \
308 "then run bootscriptUSB; " \
309 "fi; " \
310 "if run loadbootscriptUSBf " \
311 "hab_check_file_bootscript;" \
312 "then run bootscriptUSB; " \
313 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100314 "if run usb_load_pubkey hab_check_addr " \
315 "usb_load_fit hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100316 "run usbboot; " \
317 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100318 "if run usb_load_pubkeyf hab_check_addr " \
319 "usb_load_fitf hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100320 "run usbboot; " \
321 "fi; "\
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100322 "if run usb_rescue_load_pubkey hab_check_addr " \
323 "usb_load_rescuefit hab_check_file_fit; then " \
324 "run r_reason_syserr usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100325 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100326 "if run usb_rescue_load_pubkeyf hab_check_addr " \
327 "usb_load_rescuefitf hab_check_file_fit; then " \
328 "run r_reason_syserr usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100329 "fi; " \
330 "run mmc_rescue_boot;" \
331 "fi; "\
332 "run mmc_rescue_boot;\0" \
333 "rescue_xload_boot=" \
334 "run r_reason_syserr;" \
335 "if test ${bootmode} -ne 0 ; then " \
336 "mmc dev ${mmcdev};" \
337 "if mmc rescan; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100338 "if run mmc_rescue_load_pubkey " \
339 "hab_check_addr " \
340 "mmc_rescue_load_fit " \
341 "hab_check_file_fit; then " \
342 "run mmcRargs; run rescueboot; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100343 "else " \
344 "usb start;" \
345 "if usb storage; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100346 "if run usb_rescue_load_pubkey " \
347 "hab_check_addr " \
348 "usb_load_rescuefit " \
349 "hab_check_file_fit; then " \
350 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100351 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100352 "if run usb_rescue_load_pubkeyf " \
353 "hab_check_addr " \
354 "usb_load_rescuefitf " \
355 "hab_check_file_fit; then " \
356 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100357 "fi; " \
358 "fi;" \
359 "fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100360 "echo RESCUE SYSTEM ON SD OR " \
361 "USB BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100362 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100363 "else " \
364 "usb start;" \
365 "if usb storage; then " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100366 "if run usb_rescue_load_pubkey " \
367 "hab_check_addr " \
368 "usb_load_rescuefit " \
369 "hab_check_file_fit; then " \
370 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100371 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100372 "if run usb_rescue_load_pubkeyf " \
373 "hab_check_addr " \
374 "usb_load_rescuefitf " \
375 "hab_check_file_fit; then " \
376 "run usbRargs; run rescueboot;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100377 "fi; " \
378 "fi;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100379 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100380 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100381 "fi; " \
382 "else "\
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100383 "if run rescue_load_pubkey hab_check_addr " \
384 "rescue_load_fit hab_check_file_fit; then " \
385 "run mainRargs; run rescueboot; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100386 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100387 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100388 "run dead; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100389 "fi; " \
390 "fi;\0" \
391 "ari_boot=if test ${bootmode} -ne 0 ; then " \
392 "mmc dev ${mmcdev};" \
393 "if mmc rescan; then " \
394 "if run loadbootscript hab_check_file_bootscript;" \
395 "then run bootscript; " \
396 "fi; " \
Heiko Schocher5a0baf42020-11-30 20:46:02 +0100397 "if run mmc_load_pubkey hab_check_addr " \
398 "mmc_load_fit hab_check_file_fit; then " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100399 "if run mmcboot; then ; " \
400 "else " \
401 "run mmc_rescue_boot;" \
402 "fi; " \
403 "else " \
404 "run usb_mmc_rescue_boot;" \
405 "fi; " \
406 "else " \
407 "run usb_mmc_rescue_boot;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100408 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100409 "else "\
410 "run main_rescue_boot;" \
411 "fi; \0"\
Heiko Schocher19c3cd92019-12-01 11:23:29 +0100412 HAB_EXTRA_SETTINGS \
Tom Rinicc3b0032021-08-10 17:34:20 -0400413 EXTRA_ENV_BOARD_SETTINGS
Heiko Schochera051ee92019-12-01 11:23:11 +0100414
Heiko Schochera051ee92019-12-01 11:23:11 +0100415/* Physical Memory Map */
416#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
417
418#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
419#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
420#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
421
422#define CONFIG_SYS_INIT_SP_OFFSET \
423 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
424#define CONFIG_SYS_INIT_SP_ADDR \
425 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
426
427#define CONFIG_SYS_FSL_USDHC_NUM 2
428
Heiko Schochera051ee92019-12-01 11:23:11 +0100429/* DMA stuff, needed for GPMI/MXS NAND support */
430
Heiko Schochera051ee92019-12-01 11:23:11 +0100431/* USB Configs */
Heiko Schochera051ee92019-12-01 11:23:11 +0100432#define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
433#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
434#define CONFIG_MXC_USB_FLAGS 0
435
436/* UBI support */
437
438/* Framebuffer */
439/* check this console not needed, after test remove it */
Heiko Schocher8f4a1b92019-12-01 11:23:19 +0100440#define CONFIG_IMX_VIDEO_SKIP
Heiko Schochera051ee92019-12-01 11:23:11 +0100441
442#define CONFIG_IMX6_PWM_PER_CLK 66000000
443
Heiko Schocherab77bef2020-11-30 20:46:05 +0100444#define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
445 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
446
Heiko Schocher05729822015-05-18 13:32:31 +0200447#endif /* __ARISTAINETOS2_CONFIG_H */