1 /* SPDX-License-Identifier: GPL-2.0+ */
4 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
7 * Copyright (C) 2012 Freescale Semiconductor, Inc.
9 * Configuration settings for the Freescale i.MX6DL aristainetos2 board.
11 #ifndef __ARISTAINETOS2_CONFIG_H
12 #define __ARISTAINETOS2_CONFIG_H
14 #define CONFIG_HOSTNAME "aristainetos2"
16 #if (CONFIG_SYS_BOARD_VERSION == 5)
17 #define CONSOLE_DEV "ttymxc1"
18 #elif (CONFIG_SYS_BOARD_VERSION == 6)
19 #define CONSOLE_DEV "ttymxc0"
23 #define CFG_SYS_LDB_CLOCK 28341000
25 #include "mx6_common.h"
29 #define CFG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
31 #define CONFIG_FEC_MXC_PHYADDR 0
34 #define HAB_EXTRA_SETTINGS \
36 "if hab_auth_img ${check_addr} ${filesize} ; then " \
39 "echo \"HAB checks ${hab_check_filetype} " \
43 "hab_check_file_fit=" \
44 "if env exists enable_hab_check && test " \
45 "${enable_hab_check} -eq 1 ; then " \
46 "setenv hab_check_filetype \"FIT file on SD card " \
48 "env set check_addr ${fit_addr_r};" \
49 "run hab_check_addr;" \
53 "hab_check_file_bootscript=" \
54 "if env exists enable_hab_check && test " \
55 "${enable_hab_check} -eq 1 ; then " \
56 "setenv hab_check_filetype \"Bootscript file\";" \
57 "env set check_addr ${loadaddr};" \
58 "run hab_check_addr;" \
62 "hab_check_flash_fit=" \
63 "if env exists enable_hab_check && test " \
64 "${enable_hab_check} -eq 1 ; then " \
65 "setenv hab_check_filetype \"FIT files on flash\";" \
66 "env set check_addr ${fit_addr_r};" \
67 "run hab_check_addr;" \
71 "enable_hab_check=1\0"
73 #define HAB_EXTRA_SETTINGS \
74 "hab_check_addr=echo HAB check addr always returns " \
76 "hab_check_file_fit=echo HAB check FIT file always returns " \
78 "hab_check_flash_fit=echo HAB check flash FIT always returns " \
80 "hab_check_file_bootscript=echo HAB check bootscript always " \
81 "returns true;true\0" \
82 "enable_hab_check=0\0"
85 #if (CONFIG_SYS_BOARD_VERSION == 5)
86 #define EXTRA_ENV_BOARD_SETTINGS \
87 "dead=while true; do; " \
88 "led led_red on; sleep 1;" \
89 "led led_red off; sleep 1;" \
91 #elif (CONFIG_SYS_BOARD_VERSION == 6)
92 #define EXTRA_ENV_BOARD_SETTINGS \
93 "dead=while true; do; " \
94 "led led_red on; led led_red2 on; sleep 1;" \
95 "led led_red off; led led_red2 off;; sleep 1;" \
99 #define CONFIG_EXTRA_ENV_SETTINGS \
100 "disable_giga=yes\0" \
101 "usb_pgood_delay=2000\0" \
102 "nor_bootdelay=-2\0" \
103 "script=u-boot.scr\0" \
104 "loadaddr=0x12000000\0" \
105 "fit_addr_r=0x14000000\0" \
109 "console=" CONSOLE_DEV "\0" \
110 "emmcroot=/dev/mmcblk1p1 rootwait rw\0" \
111 "mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \
112 "mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \
113 "mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \
114 "mk_pubkey_path=setenv pubkey /${sysnum}/PCR.pem\0" \
115 "mk_rescue_pubkey_path=setenv pubkey /${rescue_sysnum}/PCR.pem\0" \
116 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
117 "bootmode=${bootmode} rng_core.default_quality=1000 " \
118 "mmcpart=${mmcpart} emmcpart=${emmcpart} sysnum=${sysnum}\0" \
119 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
120 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
121 "get_env=mw ${loadaddr} 0 0x20000;" \
123 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
124 "env import -t ${loadaddr}\0" \
125 "default_env=gpio set wp_spi_nor.gpio-hog;" \
127 "sf protect unlock 0 0x1000000;" \
128 "mw ${loadaddr} 0 0x20000;" \
129 "env export -t ${loadaddr} serial# ethaddr " \
130 "board_type panel;" \
132 "env import -t ${loadaddr}\0" \
134 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
136 "loadbootscriptUSB=" \
137 "ext4load usb 0 ${loadaddr} ${script};\0" \
138 "loadbootscriptUSBf=" \
139 "fatload usb 0 ${loadaddr} ${script};\0" \
140 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
142 "bootscript=echo Running bootscript from mmc ...; " \
149 "rescue_sysnum=0\0" \
151 "mainboot=echo Booting from eMMC ...; " \
152 "run mainargs addmtd addmisc;" \
153 "run boot_board_type;" \
154 "bootm ${fit_addr_r}\0" \
155 "mainargs=setenv bootargs console=${console},${baudrate} " \
156 "root=${emmcroot} rootfstype=ext4\0 " \
157 "main_load_fit=run mk_fitfile_path; " \
158 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
160 "imi ${fit_addr_r}\0 " \
161 "rescue_load_fit=run mk_rescue_fitfile_path; " \
162 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
163 "${rescue_fit_file}; " \
164 "imi ${fit_addr_r}\0" \
165 "main_load_pubkey=run mk_pubkey_path; " \
166 "setenv hab_check_filetype \"PCR.pem\";" \
167 "env set check_addr ${loadaddr};" \
168 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
170 "rescue_load_pubkey=run mk_rescue_pubkey_path; " \
171 "setenv hab_check_filetype \"PCR.pem\";" \
172 "env set check_addr ${loadaddr};" \
173 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
175 "mainRargs=setenv bootargs console=${console},${baudrate} " \
176 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
177 "mmcroot=/dev/mmcblk0p1 rootwait rw\0" \
178 "mmcargs=setenv bootargs console=${console},${baudrate} " \
179 "root=${mmcroot}\0" \
180 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
181 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
182 "mmcboot=echo Booting from mmc ...; " \
183 "run mmcargs addmtd addmisc;" \
184 "run boot_board_type;" \
185 "bootm ${fit_addr_r}\0" \
186 "mmc_load_fit=run mk_fitfile_path; " \
187 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
189 "imi ${fit_addr_r}\0" \
190 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
191 "ext4load mmc ${mmcdev}:${mmcpart} " \
192 "${fit_addr_r} ${rescue_fit_file}\0" \
193 "imi ${fit_addr_r}\0" \
194 "mmc_load_uboot=run mk_uboot_path; " \
195 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
197 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
198 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
199 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
200 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
201 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
202 "sf write ${loadaddr} 400 ${filesize};" \
203 "sf read ${cmp_buf} 400 ${uboot_sz};" \
204 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
205 "mmc_load_pubkey=run mk_pubkey_path; " \
206 "setenv hab_check_filetype \"PCR.pem\";" \
207 "env set check_addr ${loadaddr};" \
208 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
210 "mmc_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
211 "setenv hab_check_filetype \"PCR.pem\";" \
212 "env set check_addr ${loadaddr};" \
213 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
215 "rescueboot=echo Booting rescue system ...; " \
216 "run addmtd addmisc;" \
217 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
218 "run boot_board_type;" \
219 "if bootm ${fit_addr_r}; then ; " \
223 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
225 "rescueReason=$rreason\0 " \
226 "usb_load_fit=run mk_fitfile_path; " \
227 "ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
228 "usb_load_fitf=run mk_fitfile_path; " \
229 "fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
230 "usb_load_rescuefit=run mk_rescue_fitfile_path; " \
231 "ext4load usb 0 ${fit_addr_r} " \
232 "${rescue_fit_file}\0" \
233 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
234 "fatload usb 0 ${fit_addr_r} " \
235 "${rescue_fit_file}\0" \
236 "usb_load_pubkey=run mk_pubkey_path; " \
237 "setenv hab_check_filetype \"PCR.pem\";" \
238 "env set check_addr ${loadaddr};" \
239 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
240 "usb_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
241 "setenv hab_check_filetype \"PCR.pem\";" \
242 "env set check_addr ${loadaddr};" \
243 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
244 "usb_load_pubkeyf=run mk_pubkey_path; " \
245 "setenv hab_check_filetype \"PCR.pem\";" \
246 "env set check_addr ${loadaddr};" \
247 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
248 "usb_rescue_load_pubkeyf=run mk_rescue_pubkey_path; " \
249 "setenv hab_check_filetype \"PCR.pem\";" \
250 "env set check_addr ${loadaddr};" \
251 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
252 "usbroot=/dev/sda1 rootwait rw\0" \
253 "usbboot=echo Booting from usb-stick ...; " \
254 "run usbargs addmtd addmisc;" \
255 "run boot_board_type;" \
256 "bootm ${fit_addr_r}\0" \
257 "usbargs=setenv bootargs console=${console},${baudrate} " \
258 "root=${usbroot}\0" \
259 "usbRargs=setenv bootargs console=${console},${baudrate} " \
260 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
262 "run r_reason_syserr;" \
263 "if run mmc_rescue_load_pubkey hab_check_addr " \
264 "mmc_rescue_load_fit hab_check_file_fit; then " \
265 "run mmcRargs; run rescueboot; " \
267 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
270 "main_rescue_boot=" \
271 "if run main_load_pubkey hab_check_addr " \
272 "main_load_fit hab_check_flash_fit; then " \
273 "if run mainboot; then ; " \
275 "run r_reason_syserr;" \
276 "if run rescue_load_pubkey hab_check_addr " \
277 "rescue_load_fit hab_check_file_fit; then " \
278 "run mainRargs; run rescueboot; " \
280 "echo RESCUE SYSTEM BOOT FAILURE;" \
285 "run r_reason_syserr;" \
286 "if run rescue_load_pubkey hab_check_addr " \
287 "rescue_load_fit hab_check_file_fit; then " \
288 "run mainRargs; run rescueboot; " \
290 "echo RESCUE SYSTEM BOOT FAILURE;" \
294 "usb_mmc_rescue_boot=" \
296 "if usb storage; then " \
297 "if run loadbootscriptUSB " \
298 "hab_check_file_bootscript;" \
299 "then run bootscriptUSB; " \
301 "if run loadbootscriptUSBf " \
302 "hab_check_file_bootscript;" \
303 "then run bootscriptUSB; " \
305 "if run usb_load_pubkey hab_check_addr " \
306 "usb_load_fit hab_check_file_fit; then " \
309 "if run usb_load_pubkeyf hab_check_addr " \
310 "usb_load_fitf hab_check_file_fit; then " \
313 "if run usb_rescue_load_pubkey hab_check_addr " \
314 "usb_load_rescuefit hab_check_file_fit; then " \
315 "run r_reason_syserr usbRargs; run rescueboot;" \
317 "if run usb_rescue_load_pubkeyf hab_check_addr " \
318 "usb_load_rescuefitf hab_check_file_fit; then " \
319 "run r_reason_syserr usbRargs; run rescueboot;" \
321 "run mmc_rescue_boot;" \
323 "run mmc_rescue_boot;\0" \
324 "rescue_xload_boot=" \
325 "run r_reason_syserr;" \
326 "if test ${bootmode} -ne 0 ; then " \
327 "mmc dev ${mmcdev};" \
328 "if mmc rescan; then " \
329 "if run mmc_rescue_load_pubkey " \
331 "mmc_rescue_load_fit " \
332 "hab_check_file_fit; then " \
333 "run mmcRargs; run rescueboot; " \
336 "if usb storage; then " \
337 "if run usb_rescue_load_pubkey " \
339 "usb_load_rescuefit " \
340 "hab_check_file_fit; then " \
341 "run usbRargs; run rescueboot;" \
343 "if run usb_rescue_load_pubkeyf " \
345 "usb_load_rescuefitf " \
346 "hab_check_file_fit; then " \
347 "run usbRargs; run rescueboot;" \
351 "echo RESCUE SYSTEM ON SD OR " \
352 "USB BOOT FAILURE;" \
356 "if usb storage; then " \
357 "if run usb_rescue_load_pubkey " \
359 "usb_load_rescuefit " \
360 "hab_check_file_fit; then " \
361 "run usbRargs; run rescueboot;" \
363 "if run usb_rescue_load_pubkeyf " \
365 "usb_load_rescuefitf " \
366 "hab_check_file_fit; then " \
367 "run usbRargs; run rescueboot;" \
370 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
374 "if run rescue_load_pubkey hab_check_addr " \
375 "rescue_load_fit hab_check_file_fit; then " \
376 "run mainRargs; run rescueboot; " \
378 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
382 "ari_boot=if test ${bootmode} -ne 0 ; then " \
383 "mmc dev ${mmcdev};" \
384 "if mmc rescan; then " \
385 "if run loadbootscript hab_check_file_bootscript;" \
386 "then run bootscript; " \
388 "if run mmc_load_pubkey hab_check_addr " \
389 "mmc_load_fit hab_check_file_fit; then " \
390 "if run mmcboot; then ; " \
392 "run mmc_rescue_boot;" \
395 "run usb_mmc_rescue_boot;" \
398 "run usb_mmc_rescue_boot;" \
401 "run main_rescue_boot;" \
404 EXTRA_ENV_BOARD_SETTINGS
406 /* Physical Memory Map */
407 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
409 #define CFG_SYS_SDRAM_BASE PHYS_SDRAM
410 #define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
411 #define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE
413 #define CFG_SYS_FSL_USDHC_NUM 2
415 /* DMA stuff, needed for GPMI/MXS NAND support */
418 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
419 #define CONFIG_MXC_USB_FLAGS 0
424 /* check this console not needed, after test remove it */
425 #define CONFIG_IMX_VIDEO_SKIP
427 #define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
428 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
430 #endif /* __ARISTAINETOS2_CONFIG_H */