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_MACH_TYPE 4501
32 #define CONFIG_MMCROOT "/dev/mmcblk0p1"
35 #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
37 #define IMX_FEC_BASE ENET_BASE_ADDR
38 #define CONFIG_ETHPRIME "FEC"
39 #define CONFIG_FEC_MXC_PHYADDR 0
41 #define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
44 #define HAB_EXTRA_SETTINGS \
46 "if hab_auth_img ${check_addr} ${filesize} ; then " \
49 "echo \"HAB checks ${hab_check_filetype} " \
53 "hab_check_file_fit=" \
54 "if env exists enable_hab_check && test " \
55 "${enable_hab_check} -eq 1 ; then " \
56 "setenv hab_check_filetype \"FIT file on SD card " \
58 "env set check_addr ${fit_addr_r};" \
59 "run hab_check_addr;" \
63 "hab_check_file_bootscript=" \
64 "if env exists enable_hab_check && test " \
65 "${enable_hab_check} -eq 1 ; then " \
66 "setenv hab_check_filetype \"Bootscript file\";" \
67 "env set check_addr ${loadaddr};" \
68 "run hab_check_addr;" \
72 "hab_check_flash_fit=" \
73 "if env exists enable_hab_check && test " \
74 "${enable_hab_check} -eq 1 ; then " \
75 "setenv hab_check_filetype \"FIT files on flash\";" \
76 "env set check_addr ${fit_addr_r};" \
77 "run hab_check_addr;" \
81 "enable_hab_check=1\0"
83 #define HAB_EXTRA_SETTINGS \
84 "hab_check_addr=echo HAB check addr always returns " \
86 "hab_check_file_fit=echo HAB check FIT file always returns " \
88 "hab_check_flash_fit=echo HAB check flash FIT always returns " \
90 "hab_check_file_bootscript=echo HAB check bootscript always " \
91 "returns true;true\0" \
92 "enable_hab_check=0\0"
95 #if (CONFIG_SYS_BOARD_VERSION == 5)
96 #define EXTRA_ENV_BOARD_SETTINGS \
97 "dead=while true; do; " \
98 "led led_red on; sleep 1;" \
99 "led led_red off; sleep 1;" \
101 #elif (CONFIG_SYS_BOARD_VERSION == 6)
102 #define EXTRA_ENV_BOARD_SETTINGS \
103 "dead=while true; do; " \
104 "led led_red on; led led_red2 on; sleep 1;" \
105 "led led_red off; led led_red2 off;; sleep 1;" \
109 #define CONFIG_EXTRA_ENV_SETTINGS \
110 "disable_giga=yes\0" \
111 "usb_pgood_delay=2000\0" \
112 "nor_bootdelay=-2\0" \
113 "script=u-boot.scr\0" \
114 "loadaddr=0x12000000\0" \
115 "fit_addr_r=0x14000000\0" \
119 "console=" CONSOLE_DEV "\0" \
120 "emmcroot=/dev/mmcblk1p1 rootwait rw\0" \
121 "mtdids=nor0=spi0.0\0" \
122 "mtdparts=mtdparts=spi0.0:832k(u-boot),64k(env),64k(env-red)," \
124 "mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \
125 "mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \
126 "mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \
127 "mk_pubkey_path=setenv pubkey /${sysnum}/PCR.pem\0" \
128 "mk_rescue_pubkey_path=setenv pubkey /${rescue_sysnum}/PCR.pem\0" \
129 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
130 "bootmode=${bootmode} rng_core.default_quality=1000 " \
131 "mmcpart=${mmcpart} emmcpart=${emmcpart} sysnum=${sysnum}\0" \
132 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
133 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
134 "get_env=mw ${loadaddr} 0 0x20000;" \
136 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
137 "env import -t ${loadaddr}\0" \
138 "default_env=gpio set wp_spi_nor.gpio-hog;" \
140 "sf protect unlock 0 0x1000000;" \
141 "mw ${loadaddr} 0 0x20000;" \
142 "env export -t ${loadaddr} serial# ethaddr " \
143 "board_type panel;" \
145 "env import -t ${loadaddr}\0" \
147 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
149 "loadbootscriptUSB=" \
150 "ext4load usb 0 ${loadaddr} ${script};\0" \
151 "loadbootscriptUSBf=" \
152 "fatload usb 0 ${loadaddr} ${script};\0" \
153 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
155 "bootscript=echo Running bootscript from mmc ...; " \
162 "rescue_sysnum=0\0" \
164 "mainboot=echo Booting from eMMC ...; " \
165 "run mainargs addmtd addmisc;" \
166 "run boot_board_type;" \
167 "bootm ${fit_addr_r}\0" \
168 "mainargs=setenv bootargs console=${console},${baudrate} " \
169 "root=${emmcroot} rootfstype=ext4\0 " \
170 "main_load_fit=run mk_fitfile_path; " \
171 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
173 "imi ${fit_addr_r}\0 " \
174 "rescue_load_fit=run mk_rescue_fitfile_path; " \
175 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
176 "${rescue_fit_file}; " \
177 "imi ${fit_addr_r}\0" \
178 "main_load_pubkey=run mk_pubkey_path; " \
179 "setenv hab_check_filetype \"PCR.pem\";" \
180 "env set check_addr ${loadaddr};" \
181 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
183 "rescue_load_pubkey=run mk_rescue_pubkey_path; " \
184 "setenv hab_check_filetype \"PCR.pem\";" \
185 "env set check_addr ${loadaddr};" \
186 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
188 "mainRargs=setenv bootargs console=${console},${baudrate} " \
189 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
190 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
191 "mmcargs=setenv bootargs console=${console},${baudrate} " \
192 "root=${mmcroot}\0" \
193 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
194 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
195 "mmcboot=echo Booting from mmc ...; " \
196 "run mmcargs addmtd addmisc;" \
197 "run boot_board_type;" \
198 "bootm ${fit_addr_r}\0" \
199 "mmc_load_fit=run mk_fitfile_path; " \
200 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
202 "imi ${fit_addr_r}\0" \
203 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
204 "ext4load mmc ${mmcdev}:${mmcpart} " \
205 "${fit_addr_r} ${rescue_fit_file}\0" \
206 "imi ${fit_addr_r}\0" \
207 "mmc_load_uboot=run mk_uboot_path; " \
208 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
210 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
211 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
212 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
213 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
214 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
215 "sf write ${loadaddr} 400 ${filesize};" \
216 "sf read ${cmp_buf} 400 ${uboot_sz};" \
217 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
218 "mmc_load_pubkey=run mk_pubkey_path; " \
219 "setenv hab_check_filetype \"PCR.pem\";" \
220 "env set check_addr ${loadaddr};" \
221 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
223 "mmc_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
224 "setenv hab_check_filetype \"PCR.pem\";" \
225 "env set check_addr ${loadaddr};" \
226 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
228 "rescueboot=echo Booting rescue system ...; " \
229 "run addmtd addmisc;" \
230 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
231 "run boot_board_type;" \
232 "if bootm ${fit_addr_r}; then ; " \
236 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
238 "rescueReason=$rreason\0 " \
239 "usb_load_fit=run mk_fitfile_path; " \
240 "ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
241 "usb_load_fitf=run mk_fitfile_path; " \
242 "fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
243 "usb_load_rescuefit=run mk_rescue_fitfile_path; " \
244 "ext4load usb 0 ${fit_addr_r} " \
245 "${rescue_fit_file}\0" \
246 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
247 "fatload usb 0 ${fit_addr_r} " \
248 "${rescue_fit_file}\0" \
249 "usb_load_pubkey=run mk_pubkey_path; " \
250 "setenv hab_check_filetype \"PCR.pem\";" \
251 "env set check_addr ${loadaddr};" \
252 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
253 "usb_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
254 "setenv hab_check_filetype \"PCR.pem\";" \
255 "env set check_addr ${loadaddr};" \
256 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
257 "usb_load_pubkeyf=run mk_pubkey_path; " \
258 "setenv hab_check_filetype \"PCR.pem\";" \
259 "env set check_addr ${loadaddr};" \
260 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
261 "usb_rescue_load_pubkeyf=run mk_rescue_pubkey_path; " \
262 "setenv hab_check_filetype \"PCR.pem\";" \
263 "env set check_addr ${loadaddr};" \
264 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
265 "usbroot=/dev/sda1 rootwait rw\0" \
266 "usbboot=echo Booting from usb-stick ...; " \
267 "run usbargs addmtd addmisc;" \
268 "run boot_board_type;" \
269 "bootm ${fit_addr_r}\0" \
270 "usbargs=setenv bootargs console=${console},${baudrate} " \
271 "root=${usbroot}\0" \
272 "usbRargs=setenv bootargs console=${console},${baudrate} " \
273 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
275 "run r_reason_syserr;" \
276 "if run mmc_rescue_load_pubkey hab_check_addr " \
277 "mmc_rescue_load_fit hab_check_file_fit; then " \
278 "run mmcRargs; run rescueboot; " \
280 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
283 "main_rescue_boot=" \
284 "if run main_load_pubkey hab_check_addr " \
285 "main_load_fit hab_check_flash_fit; then " \
286 "if run mainboot; then ; " \
288 "run r_reason_syserr;" \
289 "if run rescue_load_pubkey hab_check_addr " \
290 "rescue_load_fit hab_check_file_fit; then " \
291 "run mainRargs; run rescueboot; " \
293 "echo RESCUE SYSTEM BOOT FAILURE;" \
298 "run r_reason_syserr;" \
299 "if run rescue_load_pubkey hab_check_addr " \
300 "rescue_load_fit hab_check_file_fit; then " \
301 "run mainRargs; run rescueboot; " \
303 "echo RESCUE SYSTEM BOOT FAILURE;" \
307 "usb_mmc_rescue_boot=" \
309 "if usb storage; then " \
310 "if run loadbootscriptUSB " \
311 "hab_check_file_bootscript;" \
312 "then run bootscriptUSB; " \
314 "if run loadbootscriptUSBf " \
315 "hab_check_file_bootscript;" \
316 "then run bootscriptUSB; " \
318 "if run usb_load_pubkey hab_check_addr " \
319 "usb_load_fit hab_check_file_fit; then " \
322 "if run usb_load_pubkeyf hab_check_addr " \
323 "usb_load_fitf hab_check_file_fit; then " \
326 "if run usb_rescue_load_pubkey hab_check_addr " \
327 "usb_load_rescuefit hab_check_file_fit; then " \
328 "run r_reason_syserr usbRargs; run rescueboot;" \
330 "if run usb_rescue_load_pubkeyf hab_check_addr " \
331 "usb_load_rescuefitf hab_check_file_fit; then " \
332 "run r_reason_syserr usbRargs; run rescueboot;" \
334 "run mmc_rescue_boot;" \
336 "run mmc_rescue_boot;\0" \
337 "rescue_xload_boot=" \
338 "run r_reason_syserr;" \
339 "if test ${bootmode} -ne 0 ; then " \
340 "mmc dev ${mmcdev};" \
341 "if mmc rescan; then " \
342 "if run mmc_rescue_load_pubkey " \
344 "mmc_rescue_load_fit " \
345 "hab_check_file_fit; then " \
346 "run mmcRargs; run rescueboot; " \
349 "if usb storage; then " \
350 "if run usb_rescue_load_pubkey " \
352 "usb_load_rescuefit " \
353 "hab_check_file_fit; then " \
354 "run usbRargs; run rescueboot;" \
356 "if run usb_rescue_load_pubkeyf " \
358 "usb_load_rescuefitf " \
359 "hab_check_file_fit; then " \
360 "run usbRargs; run rescueboot;" \
364 "echo RESCUE SYSTEM ON SD OR " \
365 "USB BOOT FAILURE;" \
369 "if usb storage; then " \
370 "if run usb_rescue_load_pubkey " \
372 "usb_load_rescuefit " \
373 "hab_check_file_fit; then " \
374 "run usbRargs; run rescueboot;" \
376 "if run usb_rescue_load_pubkeyf " \
378 "usb_load_rescuefitf " \
379 "hab_check_file_fit; then " \
380 "run usbRargs; run rescueboot;" \
383 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
387 "if run rescue_load_pubkey hab_check_addr " \
388 "rescue_load_fit hab_check_file_fit; then " \
389 "run mainRargs; run rescueboot; " \
391 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
395 "ari_boot=if test ${bootmode} -ne 0 ; then " \
396 "mmc dev ${mmcdev};" \
397 "if mmc rescan; then " \
398 "if run loadbootscript hab_check_file_bootscript;" \
399 "then run bootscript; " \
401 "if run mmc_load_pubkey hab_check_addr " \
402 "mmc_load_fit hab_check_file_fit; then " \
403 "if run mmcboot; then ; " \
405 "run mmc_rescue_boot;" \
408 "run usb_mmc_rescue_boot;" \
411 "run usb_mmc_rescue_boot;" \
414 "run main_rescue_boot;" \
417 EXTRA_ENV_BOARD_SETTINGS
419 #define CONFIG_ARP_TIMEOUT 200UL
421 /* Physical Memory Map */
422 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
424 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
425 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
426 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
428 #define CONFIG_SYS_INIT_SP_OFFSET \
429 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
430 #define CONFIG_SYS_INIT_SP_ADDR \
431 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
433 #define CONFIG_SYS_FSL_USDHC_NUM 2
435 /* DMA stuff, needed for GPMI/MXS NAND support */
438 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
439 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
440 #define CONFIG_MXC_USB_FLAGS 0
445 /* check this console not needed, after test remove it */
446 #define CONFIG_IMX_VIDEO_SKIP
447 #define CONFIG_VIDEO_LOGO
448 #define CONFIG_VIDEO_BMP_LOGO
450 #define CONFIG_IMX6_PWM_PER_CLK 66000000
452 #define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
453 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
455 #endif /* __ARISTAINETOS2_CONFIG_H */