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"
24 #define CONFIG_FEC_XCV_TYPE RGMII
27 #define CONFIG_SYS_LDB_CLOCK 28341000
29 #include "mx6_common.h"
31 #define CONFIG_MMCROOT "/dev/mmcblk0p1"
34 #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
36 #define IMX_FEC_BASE ENET_BASE_ADDR
37 #define CONFIG_ETHPRIME "FEC"
38 #define CONFIG_FEC_MXC_PHYADDR 0
40 #define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
43 #define HAB_EXTRA_SETTINGS \
45 "if hab_auth_img ${check_addr} ${filesize} ; then " \
48 "echo \"HAB checks ${hab_check_filetype} " \
52 "hab_check_file_fit=" \
53 "if env exists enable_hab_check && test " \
54 "${enable_hab_check} -eq 1 ; then " \
55 "setenv hab_check_filetype \"FIT file on SD card " \
57 "env set check_addr ${fit_addr_r};" \
58 "run hab_check_addr;" \
62 "hab_check_file_bootscript=" \
63 "if env exists enable_hab_check && test " \
64 "${enable_hab_check} -eq 1 ; then " \
65 "setenv hab_check_filetype \"Bootscript file\";" \
66 "env set check_addr ${loadaddr};" \
67 "run hab_check_addr;" \
71 "hab_check_flash_fit=" \
72 "if env exists enable_hab_check && test " \
73 "${enable_hab_check} -eq 1 ; then " \
74 "setenv hab_check_filetype \"FIT files on flash\";" \
75 "env set check_addr ${fit_addr_r};" \
76 "run hab_check_addr;" \
80 "enable_hab_check=1\0"
82 #define HAB_EXTRA_SETTINGS \
83 "hab_check_addr=echo HAB check addr always returns " \
85 "hab_check_file_fit=echo HAB check FIT file always returns " \
87 "hab_check_flash_fit=echo HAB check flash FIT always returns " \
89 "hab_check_file_bootscript=echo HAB check bootscript always " \
90 "returns true;true\0" \
91 "enable_hab_check=0\0"
94 #if (CONFIG_SYS_BOARD_VERSION == 5)
95 #define EXTRA_ENV_BOARD_SETTINGS \
96 "dead=while true; do; " \
97 "led led_red on; sleep 1;" \
98 "led led_red off; sleep 1;" \
100 #elif (CONFIG_SYS_BOARD_VERSION == 6)
101 #define EXTRA_ENV_BOARD_SETTINGS \
102 "dead=while true; do; " \
103 "led led_red on; led led_red2 on; sleep 1;" \
104 "led led_red off; led led_red2 off;; sleep 1;" \
108 #define CONFIG_EXTRA_ENV_SETTINGS \
109 "disable_giga=yes\0" \
110 "usb_pgood_delay=2000\0" \
111 "nor_bootdelay=-2\0" \
112 "script=u-boot.scr\0" \
113 "loadaddr=0x12000000\0" \
114 "fit_addr_r=0x14000000\0" \
118 "console=" CONSOLE_DEV "\0" \
119 "emmcroot=/dev/mmcblk1p1 rootwait rw\0" \
120 "mtdids=nor0=spi0.0\0" \
121 "mtdparts=mtdparts=spi0.0:832k(u-boot),64k(env),64k(env-red)," \
123 "mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \
124 "mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \
125 "mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \
126 "mk_pubkey_path=setenv pubkey /${sysnum}/PCR.pem\0" \
127 "mk_rescue_pubkey_path=setenv pubkey /${rescue_sysnum}/PCR.pem\0" \
128 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
129 "bootmode=${bootmode} rng_core.default_quality=1000 " \
130 "mmcpart=${mmcpart} emmcpart=${emmcpart} sysnum=${sysnum}\0" \
131 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
132 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
133 "get_env=mw ${loadaddr} 0 0x20000;" \
135 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
136 "env import -t ${loadaddr}\0" \
137 "default_env=gpio set wp_spi_nor.gpio-hog;" \
139 "sf protect unlock 0 0x1000000;" \
140 "mw ${loadaddr} 0 0x20000;" \
141 "env export -t ${loadaddr} serial# ethaddr " \
142 "board_type panel;" \
144 "env import -t ${loadaddr}\0" \
146 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
148 "loadbootscriptUSB=" \
149 "ext4load usb 0 ${loadaddr} ${script};\0" \
150 "loadbootscriptUSBf=" \
151 "fatload usb 0 ${loadaddr} ${script};\0" \
152 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
154 "bootscript=echo Running bootscript from mmc ...; " \
161 "rescue_sysnum=0\0" \
163 "mainboot=echo Booting from eMMC ...; " \
164 "run mainargs addmtd addmisc;" \
165 "run boot_board_type;" \
166 "bootm ${fit_addr_r}\0" \
167 "mainargs=setenv bootargs console=${console},${baudrate} " \
168 "root=${emmcroot} rootfstype=ext4\0 " \
169 "main_load_fit=run mk_fitfile_path; " \
170 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
172 "imi ${fit_addr_r}\0 " \
173 "rescue_load_fit=run mk_rescue_fitfile_path; " \
174 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
175 "${rescue_fit_file}; " \
176 "imi ${fit_addr_r}\0" \
177 "main_load_pubkey=run mk_pubkey_path; " \
178 "setenv hab_check_filetype \"PCR.pem\";" \
179 "env set check_addr ${loadaddr};" \
180 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
182 "rescue_load_pubkey=run mk_rescue_pubkey_path; " \
183 "setenv hab_check_filetype \"PCR.pem\";" \
184 "env set check_addr ${loadaddr};" \
185 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
187 "mainRargs=setenv bootargs console=${console},${baudrate} " \
188 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
189 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
190 "mmcargs=setenv bootargs console=${console},${baudrate} " \
191 "root=${mmcroot}\0" \
192 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
193 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
194 "mmcboot=echo Booting from mmc ...; " \
195 "run mmcargs addmtd addmisc;" \
196 "run boot_board_type;" \
197 "bootm ${fit_addr_r}\0" \
198 "mmc_load_fit=run mk_fitfile_path; " \
199 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
201 "imi ${fit_addr_r}\0" \
202 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
203 "ext4load mmc ${mmcdev}:${mmcpart} " \
204 "${fit_addr_r} ${rescue_fit_file}\0" \
205 "imi ${fit_addr_r}\0" \
206 "mmc_load_uboot=run mk_uboot_path; " \
207 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
209 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
210 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
211 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
212 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
213 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
214 "sf write ${loadaddr} 400 ${filesize};" \
215 "sf read ${cmp_buf} 400 ${uboot_sz};" \
216 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
217 "mmc_load_pubkey=run mk_pubkey_path; " \
218 "setenv hab_check_filetype \"PCR.pem\";" \
219 "env set check_addr ${loadaddr};" \
220 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
222 "mmc_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
223 "setenv hab_check_filetype \"PCR.pem\";" \
224 "env set check_addr ${loadaddr};" \
225 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
227 "rescueboot=echo Booting rescue system ...; " \
228 "run addmtd addmisc;" \
229 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
230 "run boot_board_type;" \
231 "if bootm ${fit_addr_r}; then ; " \
235 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
237 "rescueReason=$rreason\0 " \
238 "usb_load_fit=run mk_fitfile_path; " \
239 "ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
240 "usb_load_fitf=run mk_fitfile_path; " \
241 "fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
242 "usb_load_rescuefit=run mk_rescue_fitfile_path; " \
243 "ext4load usb 0 ${fit_addr_r} " \
244 "${rescue_fit_file}\0" \
245 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
246 "fatload usb 0 ${fit_addr_r} " \
247 "${rescue_fit_file}\0" \
248 "usb_load_pubkey=run mk_pubkey_path; " \
249 "setenv hab_check_filetype \"PCR.pem\";" \
250 "env set check_addr ${loadaddr};" \
251 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
252 "usb_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
253 "setenv hab_check_filetype \"PCR.pem\";" \
254 "env set check_addr ${loadaddr};" \
255 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
256 "usb_load_pubkeyf=run mk_pubkey_path; " \
257 "setenv hab_check_filetype \"PCR.pem\";" \
258 "env set check_addr ${loadaddr};" \
259 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
260 "usb_rescue_load_pubkeyf=run mk_rescue_pubkey_path; " \
261 "setenv hab_check_filetype \"PCR.pem\";" \
262 "env set check_addr ${loadaddr};" \
263 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
264 "usbroot=/dev/sda1 rootwait rw\0" \
265 "usbboot=echo Booting from usb-stick ...; " \
266 "run usbargs addmtd addmisc;" \
267 "run boot_board_type;" \
268 "bootm ${fit_addr_r}\0" \
269 "usbargs=setenv bootargs console=${console},${baudrate} " \
270 "root=${usbroot}\0" \
271 "usbRargs=setenv bootargs console=${console},${baudrate} " \
272 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
274 "run r_reason_syserr;" \
275 "if run mmc_rescue_load_pubkey hab_check_addr " \
276 "mmc_rescue_load_fit hab_check_file_fit; then " \
277 "run mmcRargs; run rescueboot; " \
279 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
282 "main_rescue_boot=" \
283 "if run main_load_pubkey hab_check_addr " \
284 "main_load_fit hab_check_flash_fit; then " \
285 "if run mainboot; then ; " \
287 "run r_reason_syserr;" \
288 "if run rescue_load_pubkey hab_check_addr " \
289 "rescue_load_fit hab_check_file_fit; then " \
290 "run mainRargs; run rescueboot; " \
292 "echo RESCUE SYSTEM BOOT FAILURE;" \
297 "run r_reason_syserr;" \
298 "if run rescue_load_pubkey hab_check_addr " \
299 "rescue_load_fit hab_check_file_fit; then " \
300 "run mainRargs; run rescueboot; " \
302 "echo RESCUE SYSTEM BOOT FAILURE;" \
306 "usb_mmc_rescue_boot=" \
308 "if usb storage; then " \
309 "if run loadbootscriptUSB " \
310 "hab_check_file_bootscript;" \
311 "then run bootscriptUSB; " \
313 "if run loadbootscriptUSBf " \
314 "hab_check_file_bootscript;" \
315 "then run bootscriptUSB; " \
317 "if run usb_load_pubkey hab_check_addr " \
318 "usb_load_fit hab_check_file_fit; then " \
321 "if run usb_load_pubkeyf hab_check_addr " \
322 "usb_load_fitf hab_check_file_fit; then " \
325 "if run usb_rescue_load_pubkey hab_check_addr " \
326 "usb_load_rescuefit hab_check_file_fit; then " \
327 "run r_reason_syserr usbRargs; run rescueboot;" \
329 "if run usb_rescue_load_pubkeyf hab_check_addr " \
330 "usb_load_rescuefitf hab_check_file_fit; then " \
331 "run r_reason_syserr usbRargs; run rescueboot;" \
333 "run mmc_rescue_boot;" \
335 "run mmc_rescue_boot;\0" \
336 "rescue_xload_boot=" \
337 "run r_reason_syserr;" \
338 "if test ${bootmode} -ne 0 ; then " \
339 "mmc dev ${mmcdev};" \
340 "if mmc rescan; then " \
341 "if run mmc_rescue_load_pubkey " \
343 "mmc_rescue_load_fit " \
344 "hab_check_file_fit; then " \
345 "run mmcRargs; run rescueboot; " \
348 "if usb storage; then " \
349 "if run usb_rescue_load_pubkey " \
351 "usb_load_rescuefit " \
352 "hab_check_file_fit; then " \
353 "run usbRargs; run rescueboot;" \
355 "if run usb_rescue_load_pubkeyf " \
357 "usb_load_rescuefitf " \
358 "hab_check_file_fit; then " \
359 "run usbRargs; run rescueboot;" \
363 "echo RESCUE SYSTEM ON SD OR " \
364 "USB BOOT FAILURE;" \
368 "if usb storage; then " \
369 "if run usb_rescue_load_pubkey " \
371 "usb_load_rescuefit " \
372 "hab_check_file_fit; then " \
373 "run usbRargs; run rescueboot;" \
375 "if run usb_rescue_load_pubkeyf " \
377 "usb_load_rescuefitf " \
378 "hab_check_file_fit; then " \
379 "run usbRargs; run rescueboot;" \
382 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
386 "if run rescue_load_pubkey hab_check_addr " \
387 "rescue_load_fit hab_check_file_fit; then " \
388 "run mainRargs; run rescueboot; " \
390 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
394 "ari_boot=if test ${bootmode} -ne 0 ; then " \
395 "mmc dev ${mmcdev};" \
396 "if mmc rescan; then " \
397 "if run loadbootscript hab_check_file_bootscript;" \
398 "then run bootscript; " \
400 "if run mmc_load_pubkey hab_check_addr " \
401 "mmc_load_fit hab_check_file_fit; then " \
402 "if run mmcboot; then ; " \
404 "run mmc_rescue_boot;" \
407 "run usb_mmc_rescue_boot;" \
410 "run usb_mmc_rescue_boot;" \
413 "run main_rescue_boot;" \
416 EXTRA_ENV_BOARD_SETTINGS
418 /* Physical Memory Map */
419 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
421 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
422 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
423 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
425 #define CONFIG_SYS_INIT_SP_OFFSET \
426 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
427 #define CONFIG_SYS_INIT_SP_ADDR \
428 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
430 #define CONFIG_SYS_FSL_USDHC_NUM 2
432 /* DMA stuff, needed for GPMI/MXS NAND support */
435 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
436 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
437 #define CONFIG_MXC_USB_FLAGS 0
442 /* check this console not needed, after test remove it */
443 #define CONFIG_IMX_VIDEO_SKIP
444 #define CONFIG_VIDEO_BMP_LOGO
446 #define CONFIG_IMX6_PWM_PER_CLK 66000000
448 #define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
449 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
451 #endif /* __ARISTAINETOS2_CONFIG_H */