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 #if (CONFIG_SYS_BOARD_VERSION == 5)
15 #define CONSOLE_DEV "ttymxc1"
16 #elif (CONFIG_SYS_BOARD_VERSION == 6)
17 #define CONSOLE_DEV "ttymxc0"
21 #define CFG_SYS_LDB_CLOCK 28341000
23 #include "mx6_common.h"
27 #define CFG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
29 #define CONFIG_FEC_MXC_PHYADDR 0
32 #define HAB_EXTRA_SETTINGS \
34 "if hab_auth_img ${check_addr} ${filesize} ; then " \
37 "echo \"HAB checks ${hab_check_filetype} " \
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 " \
46 "env set check_addr ${fit_addr_r};" \
47 "run hab_check_addr;" \
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;" \
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;" \
69 "enable_hab_check=1\0"
71 #define HAB_EXTRA_SETTINGS \
72 "hab_check_addr=echo HAB check addr always returns " \
74 "hab_check_file_fit=echo HAB check FIT file always returns " \
76 "hab_check_flash_fit=echo HAB check flash FIT always returns " \
78 "hab_check_file_bootscript=echo HAB check bootscript always " \
79 "returns true;true\0" \
80 "enable_hab_check=0\0"
83 #if (CONFIG_SYS_BOARD_VERSION == 5)
84 #define EXTRA_ENV_BOARD_SETTINGS \
85 "dead=while true; do; " \
86 "led led_red on; sleep 1;" \
87 "led led_red off; sleep 1;" \
89 #elif (CONFIG_SYS_BOARD_VERSION == 6)
90 #define EXTRA_ENV_BOARD_SETTINGS \
91 "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;" \
97 #define CONFIG_EXTRA_ENV_SETTINGS \
98 "disable_giga=yes\0" \
99 "usb_pgood_delay=2000\0" \
100 "nor_bootdelay=-2\0" \
101 "script=u-boot.scr\0" \
102 "loadaddr=0x12000000\0" \
103 "fit_addr_r=0x14000000\0" \
107 "console=" CONSOLE_DEV "\0" \
108 "emmcroot=/dev/mmcblk1p1 rootwait rw\0" \
109 "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" \
117 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
118 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
119 "get_env=mw ${loadaddr} 0 0x20000;" \
121 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
122 "env import -t ${loadaddr}\0" \
123 "default_env=gpio set wp_spi_nor.gpio-hog;" \
125 "sf protect unlock 0 0x1000000;" \
126 "mw ${loadaddr} 0 0x20000;" \
127 "env export -t ${loadaddr} serial# ethaddr " \
128 "board_type panel;" \
130 "env import -t ${loadaddr}\0" \
132 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
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 ...; " \
140 "bootscript=echo Running bootscript from mmc ...; " \
147 "rescue_sysnum=0\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} " \
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} " \
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} " \
173 "mainRargs=setenv bootargs console=${console},${baudrate} " \
174 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
175 "mmcroot=/dev/mmcblk0p1 rootwait rw\0" \
176 "mmcargs=setenv bootargs console=${console},${baudrate} " \
177 "root=${mmcroot}\0" \
178 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
179 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
180 "mmcboot=echo Booting from mmc ...; " \
181 "run mmcargs addmtd addmisc;" \
182 "run boot_board_type;" \
183 "bootm ${fit_addr_r}\0" \
184 "mmc_load_fit=run mk_fitfile_path; " \
185 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
187 "imi ${fit_addr_r}\0" \
188 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
189 "ext4load mmc ${mmcdev}:${mmcpart} " \
190 "${fit_addr_r} ${rescue_fit_file}\0" \
191 "imi ${fit_addr_r}\0" \
192 "mmc_load_uboot=run mk_uboot_path; " \
193 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
195 "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" \
203 "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} " \
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} " \
213 "rescueboot=echo Booting rescue system ...; " \
214 "run addmtd addmisc;" \
215 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
216 "run boot_board_type;" \
217 "if bootm ${fit_addr_r}; then ; " \
221 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
223 "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} " \
230 "${rescue_fit_file}\0" \
231 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
232 "fatload usb 0 ${fit_addr_r} " \
233 "${rescue_fit_file}\0" \
234 "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" \
250 "usbroot=/dev/sda1 rootwait rw\0" \
251 "usbboot=echo Booting from usb-stick ...; " \
252 "run usbargs addmtd addmisc;" \
253 "run boot_board_type;" \
254 "bootm ${fit_addr_r}\0" \
255 "usbargs=setenv bootargs console=${console},${baudrate} " \
256 "root=${usbroot}\0" \
257 "usbRargs=setenv bootargs console=${console},${baudrate} " \
258 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
260 "run r_reason_syserr;" \
261 "if run mmc_rescue_load_pubkey hab_check_addr " \
262 "mmc_rescue_load_fit hab_check_file_fit; then " \
263 "run mmcRargs; run rescueboot; " \
265 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
268 "main_rescue_boot=" \
269 "if run main_load_pubkey hab_check_addr " \
270 "main_load_fit hab_check_flash_fit; then " \
271 "if run mainboot; then ; " \
273 "run r_reason_syserr;" \
274 "if run rescue_load_pubkey hab_check_addr " \
275 "rescue_load_fit hab_check_file_fit; then " \
276 "run mainRargs; run rescueboot; " \
278 "echo RESCUE SYSTEM BOOT FAILURE;" \
283 "run r_reason_syserr;" \
284 "if run rescue_load_pubkey hab_check_addr " \
285 "rescue_load_fit hab_check_file_fit; then " \
286 "run mainRargs; run rescueboot; " \
288 "echo RESCUE SYSTEM BOOT FAILURE;" \
292 "usb_mmc_rescue_boot=" \
294 "if usb storage; then " \
295 "if run loadbootscriptUSB " \
296 "hab_check_file_bootscript;" \
297 "then run bootscriptUSB; " \
299 "if run loadbootscriptUSBf " \
300 "hab_check_file_bootscript;" \
301 "then run bootscriptUSB; " \
303 "if run usb_load_pubkey hab_check_addr " \
304 "usb_load_fit hab_check_file_fit; then " \
307 "if run usb_load_pubkeyf hab_check_addr " \
308 "usb_load_fitf hab_check_file_fit; then " \
311 "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;" \
315 "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;" \
319 "run mmc_rescue_boot;" \
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 " \
327 "if run mmc_rescue_load_pubkey " \
329 "mmc_rescue_load_fit " \
330 "hab_check_file_fit; then " \
331 "run mmcRargs; run rescueboot; " \
334 "if usb storage; then " \
335 "if run usb_rescue_load_pubkey " \
337 "usb_load_rescuefit " \
338 "hab_check_file_fit; then " \
339 "run usbRargs; run rescueboot;" \
341 "if run usb_rescue_load_pubkeyf " \
343 "usb_load_rescuefitf " \
344 "hab_check_file_fit; then " \
345 "run usbRargs; run rescueboot;" \
349 "echo RESCUE SYSTEM ON SD OR " \
350 "USB BOOT FAILURE;" \
354 "if usb storage; then " \
355 "if run usb_rescue_load_pubkey " \
357 "usb_load_rescuefit " \
358 "hab_check_file_fit; then " \
359 "run usbRargs; run rescueboot;" \
361 "if run usb_rescue_load_pubkeyf " \
363 "usb_load_rescuefitf " \
364 "hab_check_file_fit; then " \
365 "run usbRargs; run rescueboot;" \
368 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
372 "if run rescue_load_pubkey hab_check_addr " \
373 "rescue_load_fit hab_check_file_fit; then " \
374 "run mainRargs; run rescueboot; " \
376 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
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; " \
386 "if run mmc_load_pubkey hab_check_addr " \
387 "mmc_load_fit hab_check_file_fit; then " \
388 "if run mmcboot; then ; " \
390 "run mmc_rescue_boot;" \
393 "run usb_mmc_rescue_boot;" \
396 "run usb_mmc_rescue_boot;" \
399 "run main_rescue_boot;" \
402 EXTRA_ENV_BOARD_SETTINGS
404 /* Physical Memory Map */
405 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
407 #define CFG_SYS_SDRAM_BASE PHYS_SDRAM
408 #define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
409 #define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE
411 #define CFG_SYS_FSL_USDHC_NUM 2
413 /* DMA stuff, needed for GPMI/MXS NAND support */
416 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
417 #define CONFIG_MXC_USB_FLAGS 0
421 #define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
422 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
424 #endif /* __ARISTAINETOS2_CONFIG_H */