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 CONFIG_MXC_UART_BASE UART2_BASE
18 #define CONSOLE_DEV "ttymxc1"
19 #elif (CONFIG_SYS_BOARD_VERSION == 6)
20 #define CONFIG_MXC_UART_BASE UART1_BASE
21 #define CONSOLE_DEV "ttymxc0"
25 #define CONFIG_SYS_LDB_CLOCK 28341000
27 #include "mx6_common.h"
29 #define CONFIG_MMCROOT "/dev/mmcblk0p1"
32 #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
34 #define IMX_FEC_BASE ENET_BASE_ADDR
35 #define CONFIG_FEC_MXC_PHYADDR 0
37 #define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
40 #define HAB_EXTRA_SETTINGS \
42 "if hab_auth_img ${check_addr} ${filesize} ; then " \
45 "echo \"HAB checks ${hab_check_filetype} " \
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 " \
54 "env set check_addr ${fit_addr_r};" \
55 "run hab_check_addr;" \
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;" \
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;" \
77 "enable_hab_check=1\0"
79 #define HAB_EXTRA_SETTINGS \
80 "hab_check_addr=echo HAB check addr always returns " \
82 "hab_check_file_fit=echo HAB check FIT file always returns " \
84 "hab_check_flash_fit=echo HAB check flash FIT always returns " \
86 "hab_check_file_bootscript=echo HAB check bootscript always " \
87 "returns true;true\0" \
88 "enable_hab_check=0\0"
91 #if (CONFIG_SYS_BOARD_VERSION == 5)
92 #define EXTRA_ENV_BOARD_SETTINGS \
93 "dead=while true; do; " \
94 "led led_red on; sleep 1;" \
95 "led led_red off; sleep 1;" \
97 #elif (CONFIG_SYS_BOARD_VERSION == 6)
98 #define EXTRA_ENV_BOARD_SETTINGS \
99 "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;" \
105 #define CONFIG_EXTRA_ENV_SETTINGS \
106 "disable_giga=yes\0" \
107 "usb_pgood_delay=2000\0" \
108 "nor_bootdelay=-2\0" \
109 "script=u-boot.scr\0" \
110 "loadaddr=0x12000000\0" \
111 "fit_addr_r=0x14000000\0" \
115 "console=" CONSOLE_DEV "\0" \
116 "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)," \
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" \
128 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
129 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
130 "get_env=mw ${loadaddr} 0 0x20000;" \
132 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
133 "env import -t ${loadaddr}\0" \
134 "default_env=gpio set wp_spi_nor.gpio-hog;" \
136 "sf protect unlock 0 0x1000000;" \
137 "mw ${loadaddr} 0 0x20000;" \
138 "env export -t ${loadaddr} serial# ethaddr " \
139 "board_type panel;" \
141 "env import -t ${loadaddr}\0" \
143 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
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 ...; " \
151 "bootscript=echo Running bootscript from mmc ...; " \
158 "rescue_sysnum=0\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} " \
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} " \
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} " \
184 "mainRargs=setenv bootargs console=${console},${baudrate} " \
185 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
186 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
187 "mmcargs=setenv bootargs console=${console},${baudrate} " \
188 "root=${mmcroot}\0" \
189 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
190 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
191 "mmcboot=echo Booting from mmc ...; " \
192 "run mmcargs addmtd addmisc;" \
193 "run boot_board_type;" \
194 "bootm ${fit_addr_r}\0" \
195 "mmc_load_fit=run mk_fitfile_path; " \
196 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
198 "imi ${fit_addr_r}\0" \
199 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
200 "ext4load mmc ${mmcdev}:${mmcpart} " \
201 "${fit_addr_r} ${rescue_fit_file}\0" \
202 "imi ${fit_addr_r}\0" \
203 "mmc_load_uboot=run mk_uboot_path; " \
204 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
206 "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" \
214 "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} " \
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} " \
224 "rescueboot=echo Booting rescue system ...; " \
225 "run addmtd addmisc;" \
226 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
227 "run boot_board_type;" \
228 "if bootm ${fit_addr_r}; then ; " \
232 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
234 "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} " \
241 "${rescue_fit_file}\0" \
242 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
243 "fatload usb 0 ${fit_addr_r} " \
244 "${rescue_fit_file}\0" \
245 "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" \
261 "usbroot=/dev/sda1 rootwait rw\0" \
262 "usbboot=echo Booting from usb-stick ...; " \
263 "run usbargs addmtd addmisc;" \
264 "run boot_board_type;" \
265 "bootm ${fit_addr_r}\0" \
266 "usbargs=setenv bootargs console=${console},${baudrate} " \
267 "root=${usbroot}\0" \
268 "usbRargs=setenv bootargs console=${console},${baudrate} " \
269 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
271 "run r_reason_syserr;" \
272 "if run mmc_rescue_load_pubkey hab_check_addr " \
273 "mmc_rescue_load_fit hab_check_file_fit; then " \
274 "run mmcRargs; run rescueboot; " \
276 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
279 "main_rescue_boot=" \
280 "if run main_load_pubkey hab_check_addr " \
281 "main_load_fit hab_check_flash_fit; then " \
282 "if run mainboot; then ; " \
284 "run r_reason_syserr;" \
285 "if run rescue_load_pubkey hab_check_addr " \
286 "rescue_load_fit hab_check_file_fit; then " \
287 "run mainRargs; run rescueboot; " \
289 "echo RESCUE SYSTEM BOOT FAILURE;" \
294 "run r_reason_syserr;" \
295 "if run rescue_load_pubkey hab_check_addr " \
296 "rescue_load_fit hab_check_file_fit; then " \
297 "run mainRargs; run rescueboot; " \
299 "echo RESCUE SYSTEM BOOT FAILURE;" \
303 "usb_mmc_rescue_boot=" \
305 "if usb storage; then " \
306 "if run loadbootscriptUSB " \
307 "hab_check_file_bootscript;" \
308 "then run bootscriptUSB; " \
310 "if run loadbootscriptUSBf " \
311 "hab_check_file_bootscript;" \
312 "then run bootscriptUSB; " \
314 "if run usb_load_pubkey hab_check_addr " \
315 "usb_load_fit hab_check_file_fit; then " \
318 "if run usb_load_pubkeyf hab_check_addr " \
319 "usb_load_fitf hab_check_file_fit; then " \
322 "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;" \
326 "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;" \
330 "run mmc_rescue_boot;" \
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 " \
338 "if run mmc_rescue_load_pubkey " \
340 "mmc_rescue_load_fit " \
341 "hab_check_file_fit; then " \
342 "run mmcRargs; run rescueboot; " \
345 "if usb storage; then " \
346 "if run usb_rescue_load_pubkey " \
348 "usb_load_rescuefit " \
349 "hab_check_file_fit; then " \
350 "run usbRargs; run rescueboot;" \
352 "if run usb_rescue_load_pubkeyf " \
354 "usb_load_rescuefitf " \
355 "hab_check_file_fit; then " \
356 "run usbRargs; run rescueboot;" \
360 "echo RESCUE SYSTEM ON SD OR " \
361 "USB BOOT FAILURE;" \
365 "if usb storage; then " \
366 "if run usb_rescue_load_pubkey " \
368 "usb_load_rescuefit " \
369 "hab_check_file_fit; then " \
370 "run usbRargs; run rescueboot;" \
372 "if run usb_rescue_load_pubkeyf " \
374 "usb_load_rescuefitf " \
375 "hab_check_file_fit; then " \
376 "run usbRargs; run rescueboot;" \
379 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
383 "if run rescue_load_pubkey hab_check_addr " \
384 "rescue_load_fit hab_check_file_fit; then " \
385 "run mainRargs; run rescueboot; " \
387 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
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; " \
397 "if run mmc_load_pubkey hab_check_addr " \
398 "mmc_load_fit hab_check_file_fit; then " \
399 "if run mmcboot; then ; " \
401 "run mmc_rescue_boot;" \
404 "run usb_mmc_rescue_boot;" \
407 "run usb_mmc_rescue_boot;" \
410 "run main_rescue_boot;" \
413 EXTRA_ENV_BOARD_SETTINGS
415 /* Physical Memory Map */
416 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
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
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)
427 #define CONFIG_SYS_FSL_USDHC_NUM 2
429 /* DMA stuff, needed for GPMI/MXS NAND support */
432 #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
439 /* check this console not needed, after test remove it */
440 #define CONFIG_IMX_VIDEO_SKIP
441 #define CONFIG_VIDEO_BMP_LOGO
443 #define CONFIG_IMX6_PWM_PER_CLK 66000000
445 #define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
446 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
448 #endif /* __ARISTAINETOS2_CONFIG_H */