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"
31 #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
33 #define CONFIG_FEC_MXC_PHYADDR 0
35 #define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
38 #define HAB_EXTRA_SETTINGS \
40 "if hab_auth_img ${check_addr} ${filesize} ; then " \
43 "echo \"HAB checks ${hab_check_filetype} " \
47 "hab_check_file_fit=" \
48 "if env exists enable_hab_check && test " \
49 "${enable_hab_check} -eq 1 ; then " \
50 "setenv hab_check_filetype \"FIT file on SD card " \
52 "env set check_addr ${fit_addr_r};" \
53 "run hab_check_addr;" \
57 "hab_check_file_bootscript=" \
58 "if env exists enable_hab_check && test " \
59 "${enable_hab_check} -eq 1 ; then " \
60 "setenv hab_check_filetype \"Bootscript file\";" \
61 "env set check_addr ${loadaddr};" \
62 "run hab_check_addr;" \
66 "hab_check_flash_fit=" \
67 "if env exists enable_hab_check && test " \
68 "${enable_hab_check} -eq 1 ; then " \
69 "setenv hab_check_filetype \"FIT files on flash\";" \
70 "env set check_addr ${fit_addr_r};" \
71 "run hab_check_addr;" \
75 "enable_hab_check=1\0"
77 #define HAB_EXTRA_SETTINGS \
78 "hab_check_addr=echo HAB check addr always returns " \
80 "hab_check_file_fit=echo HAB check FIT file always returns " \
82 "hab_check_flash_fit=echo HAB check flash FIT always returns " \
84 "hab_check_file_bootscript=echo HAB check bootscript always " \
85 "returns true;true\0" \
86 "enable_hab_check=0\0"
89 #if (CONFIG_SYS_BOARD_VERSION == 5)
90 #define EXTRA_ENV_BOARD_SETTINGS \
91 "dead=while true; do; " \
92 "led led_red on; sleep 1;" \
93 "led led_red off; sleep 1;" \
95 #elif (CONFIG_SYS_BOARD_VERSION == 6)
96 #define EXTRA_ENV_BOARD_SETTINGS \
97 "dead=while true; do; " \
98 "led led_red on; led led_red2 on; sleep 1;" \
99 "led led_red off; led led_red2 off;; sleep 1;" \
103 #define CONFIG_EXTRA_ENV_SETTINGS \
104 "disable_giga=yes\0" \
105 "usb_pgood_delay=2000\0" \
106 "nor_bootdelay=-2\0" \
107 "script=u-boot.scr\0" \
108 "loadaddr=0x12000000\0" \
109 "fit_addr_r=0x14000000\0" \
113 "console=" CONSOLE_DEV "\0" \
114 "emmcroot=/dev/mmcblk1p1 rootwait rw\0" \
115 "mtdids=nor0=spi0.0\0" \
116 "mtdparts=mtdparts=spi0.0:832k(u-boot),64k(env),64k(env-red)," \
118 "mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \
119 "mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \
120 "mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \
121 "mk_pubkey_path=setenv pubkey /${sysnum}/PCR.pem\0" \
122 "mk_rescue_pubkey_path=setenv pubkey /${rescue_sysnum}/PCR.pem\0" \
123 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
124 "bootmode=${bootmode} rng_core.default_quality=1000 " \
125 "mmcpart=${mmcpart} emmcpart=${emmcpart} sysnum=${sysnum}\0" \
126 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
127 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
128 "get_env=mw ${loadaddr} 0 0x20000;" \
130 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
131 "env import -t ${loadaddr}\0" \
132 "default_env=gpio set wp_spi_nor.gpio-hog;" \
134 "sf protect unlock 0 0x1000000;" \
135 "mw ${loadaddr} 0 0x20000;" \
136 "env export -t ${loadaddr} serial# ethaddr " \
137 "board_type panel;" \
139 "env import -t ${loadaddr}\0" \
141 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
143 "loadbootscriptUSB=" \
144 "ext4load usb 0 ${loadaddr} ${script};\0" \
145 "loadbootscriptUSBf=" \
146 "fatload usb 0 ${loadaddr} ${script};\0" \
147 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
149 "bootscript=echo Running bootscript from mmc ...; " \
156 "rescue_sysnum=0\0" \
158 "mainboot=echo Booting from eMMC ...; " \
159 "run mainargs addmtd addmisc;" \
160 "run boot_board_type;" \
161 "bootm ${fit_addr_r}\0" \
162 "mainargs=setenv bootargs console=${console},${baudrate} " \
163 "root=${emmcroot} rootfstype=ext4\0 " \
164 "main_load_fit=run mk_fitfile_path; " \
165 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
167 "imi ${fit_addr_r}\0 " \
168 "rescue_load_fit=run mk_rescue_fitfile_path; " \
169 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
170 "${rescue_fit_file}; " \
171 "imi ${fit_addr_r}\0" \
172 "main_load_pubkey=run mk_pubkey_path; " \
173 "setenv hab_check_filetype \"PCR.pem\";" \
174 "env set check_addr ${loadaddr};" \
175 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
177 "rescue_load_pubkey=run mk_rescue_pubkey_path; " \
178 "setenv hab_check_filetype \"PCR.pem\";" \
179 "env set check_addr ${loadaddr};" \
180 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
182 "mainRargs=setenv bootargs console=${console},${baudrate} " \
183 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
184 "mmcroot=/dev/mmcblk0p1 rootwait rw\0" \
185 "mmcargs=setenv bootargs console=${console},${baudrate} " \
186 "root=${mmcroot}\0" \
187 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
188 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
189 "mmcboot=echo Booting from mmc ...; " \
190 "run mmcargs addmtd addmisc;" \
191 "run boot_board_type;" \
192 "bootm ${fit_addr_r}\0" \
193 "mmc_load_fit=run mk_fitfile_path; " \
194 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
196 "imi ${fit_addr_r}\0" \
197 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
198 "ext4load mmc ${mmcdev}:${mmcpart} " \
199 "${fit_addr_r} ${rescue_fit_file}\0" \
200 "imi ${fit_addr_r}\0" \
201 "mmc_load_uboot=run mk_uboot_path; " \
202 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
204 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
205 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
206 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
207 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
208 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
209 "sf write ${loadaddr} 400 ${filesize};" \
210 "sf read ${cmp_buf} 400 ${uboot_sz};" \
211 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
212 "mmc_load_pubkey=run mk_pubkey_path; " \
213 "setenv hab_check_filetype \"PCR.pem\";" \
214 "env set check_addr ${loadaddr};" \
215 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
217 "mmc_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
218 "setenv hab_check_filetype \"PCR.pem\";" \
219 "env set check_addr ${loadaddr};" \
220 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
222 "rescueboot=echo Booting rescue system ...; " \
223 "run addmtd addmisc;" \
224 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
225 "run boot_board_type;" \
226 "if bootm ${fit_addr_r}; then ; " \
230 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
232 "rescueReason=$rreason\0 " \
233 "usb_load_fit=run mk_fitfile_path; " \
234 "ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
235 "usb_load_fitf=run mk_fitfile_path; " \
236 "fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
237 "usb_load_rescuefit=run mk_rescue_fitfile_path; " \
238 "ext4load usb 0 ${fit_addr_r} " \
239 "${rescue_fit_file}\0" \
240 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
241 "fatload usb 0 ${fit_addr_r} " \
242 "${rescue_fit_file}\0" \
243 "usb_load_pubkey=run mk_pubkey_path; " \
244 "setenv hab_check_filetype \"PCR.pem\";" \
245 "env set check_addr ${loadaddr};" \
246 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
247 "usb_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
248 "setenv hab_check_filetype \"PCR.pem\";" \
249 "env set check_addr ${loadaddr};" \
250 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
251 "usb_load_pubkeyf=run mk_pubkey_path; " \
252 "setenv hab_check_filetype \"PCR.pem\";" \
253 "env set check_addr ${loadaddr};" \
254 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
255 "usb_rescue_load_pubkeyf=run mk_rescue_pubkey_path; " \
256 "setenv hab_check_filetype \"PCR.pem\";" \
257 "env set check_addr ${loadaddr};" \
258 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
259 "usbroot=/dev/sda1 rootwait rw\0" \
260 "usbboot=echo Booting from usb-stick ...; " \
261 "run usbargs addmtd addmisc;" \
262 "run boot_board_type;" \
263 "bootm ${fit_addr_r}\0" \
264 "usbargs=setenv bootargs console=${console},${baudrate} " \
265 "root=${usbroot}\0" \
266 "usbRargs=setenv bootargs console=${console},${baudrate} " \
267 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
269 "run r_reason_syserr;" \
270 "if run mmc_rescue_load_pubkey hab_check_addr " \
271 "mmc_rescue_load_fit hab_check_file_fit; then " \
272 "run mmcRargs; run rescueboot; " \
274 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
277 "main_rescue_boot=" \
278 "if run main_load_pubkey hab_check_addr " \
279 "main_load_fit hab_check_flash_fit; then " \
280 "if run mainboot; then ; " \
282 "run r_reason_syserr;" \
283 "if run rescue_load_pubkey hab_check_addr " \
284 "rescue_load_fit hab_check_file_fit; then " \
285 "run mainRargs; run rescueboot; " \
287 "echo RESCUE SYSTEM BOOT FAILURE;" \
292 "run r_reason_syserr;" \
293 "if run rescue_load_pubkey hab_check_addr " \
294 "rescue_load_fit hab_check_file_fit; then " \
295 "run mainRargs; run rescueboot; " \
297 "echo RESCUE SYSTEM BOOT FAILURE;" \
301 "usb_mmc_rescue_boot=" \
303 "if usb storage; then " \
304 "if run loadbootscriptUSB " \
305 "hab_check_file_bootscript;" \
306 "then run bootscriptUSB; " \
308 "if run loadbootscriptUSBf " \
309 "hab_check_file_bootscript;" \
310 "then run bootscriptUSB; " \
312 "if run usb_load_pubkey hab_check_addr " \
313 "usb_load_fit hab_check_file_fit; then " \
316 "if run usb_load_pubkeyf hab_check_addr " \
317 "usb_load_fitf hab_check_file_fit; then " \
320 "if run usb_rescue_load_pubkey hab_check_addr " \
321 "usb_load_rescuefit hab_check_file_fit; then " \
322 "run r_reason_syserr usbRargs; run rescueboot;" \
324 "if run usb_rescue_load_pubkeyf hab_check_addr " \
325 "usb_load_rescuefitf hab_check_file_fit; then " \
326 "run r_reason_syserr usbRargs; run rescueboot;" \
328 "run mmc_rescue_boot;" \
330 "run mmc_rescue_boot;\0" \
331 "rescue_xload_boot=" \
332 "run r_reason_syserr;" \
333 "if test ${bootmode} -ne 0 ; then " \
334 "mmc dev ${mmcdev};" \
335 "if mmc rescan; then " \
336 "if run mmc_rescue_load_pubkey " \
338 "mmc_rescue_load_fit " \
339 "hab_check_file_fit; then " \
340 "run mmcRargs; run rescueboot; " \
343 "if usb storage; then " \
344 "if run usb_rescue_load_pubkey " \
346 "usb_load_rescuefit " \
347 "hab_check_file_fit; then " \
348 "run usbRargs; run rescueboot;" \
350 "if run usb_rescue_load_pubkeyf " \
352 "usb_load_rescuefitf " \
353 "hab_check_file_fit; then " \
354 "run usbRargs; run rescueboot;" \
358 "echo RESCUE SYSTEM ON SD OR " \
359 "USB BOOT FAILURE;" \
363 "if usb storage; then " \
364 "if run usb_rescue_load_pubkey " \
366 "usb_load_rescuefit " \
367 "hab_check_file_fit; then " \
368 "run usbRargs; run rescueboot;" \
370 "if run usb_rescue_load_pubkeyf " \
372 "usb_load_rescuefitf " \
373 "hab_check_file_fit; then " \
374 "run usbRargs; run rescueboot;" \
377 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
381 "if run rescue_load_pubkey hab_check_addr " \
382 "rescue_load_fit hab_check_file_fit; then " \
383 "run mainRargs; run rescueboot; " \
385 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
389 "ari_boot=if test ${bootmode} -ne 0 ; then " \
390 "mmc dev ${mmcdev};" \
391 "if mmc rescan; then " \
392 "if run loadbootscript hab_check_file_bootscript;" \
393 "then run bootscript; " \
395 "if run mmc_load_pubkey hab_check_addr " \
396 "mmc_load_fit hab_check_file_fit; then " \
397 "if run mmcboot; then ; " \
399 "run mmc_rescue_boot;" \
402 "run usb_mmc_rescue_boot;" \
405 "run usb_mmc_rescue_boot;" \
408 "run main_rescue_boot;" \
411 EXTRA_ENV_BOARD_SETTINGS
413 /* Physical Memory Map */
414 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
416 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
417 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
418 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
420 #define CONFIG_SYS_FSL_USDHC_NUM 2
422 /* DMA stuff, needed for GPMI/MXS NAND support */
425 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
426 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
427 #define CONFIG_MXC_USB_FLAGS 0
432 /* check this console not needed, after test remove it */
433 #define CONFIG_IMX_VIDEO_SKIP
435 #define CONFIG_IMX6_PWM_PER_CLK 66000000
437 #define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
438 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
440 #endif /* __ARISTAINETOS2_CONFIG_H */