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 CONSOLE_DEV "ttymxc1"
18 #elif (CONFIG_SYS_BOARD_VERSION == 6)
19 #define CONSOLE_DEV "ttymxc0"
23 #define CONFIG_SYS_LDB_CLOCK 28341000
25 #include "mx6_common.h"
29 #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
31 #define CONFIG_FEC_MXC_PHYADDR 0
33 #define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
36 #define HAB_EXTRA_SETTINGS \
38 "if hab_auth_img ${check_addr} ${filesize} ; then " \
41 "echo \"HAB checks ${hab_check_filetype} " \
45 "hab_check_file_fit=" \
46 "if env exists enable_hab_check && test " \
47 "${enable_hab_check} -eq 1 ; then " \
48 "setenv hab_check_filetype \"FIT file on SD card " \
50 "env set check_addr ${fit_addr_r};" \
51 "run hab_check_addr;" \
55 "hab_check_file_bootscript=" \
56 "if env exists enable_hab_check && test " \
57 "${enable_hab_check} -eq 1 ; then " \
58 "setenv hab_check_filetype \"Bootscript file\";" \
59 "env set check_addr ${loadaddr};" \
60 "run hab_check_addr;" \
64 "hab_check_flash_fit=" \
65 "if env exists enable_hab_check && test " \
66 "${enable_hab_check} -eq 1 ; then " \
67 "setenv hab_check_filetype \"FIT files on flash\";" \
68 "env set check_addr ${fit_addr_r};" \
69 "run hab_check_addr;" \
73 "enable_hab_check=1\0"
75 #define HAB_EXTRA_SETTINGS \
76 "hab_check_addr=echo HAB check addr always returns " \
78 "hab_check_file_fit=echo HAB check FIT file always returns " \
80 "hab_check_flash_fit=echo HAB check flash FIT always returns " \
82 "hab_check_file_bootscript=echo HAB check bootscript always " \
83 "returns true;true\0" \
84 "enable_hab_check=0\0"
87 #if (CONFIG_SYS_BOARD_VERSION == 5)
88 #define EXTRA_ENV_BOARD_SETTINGS \
89 "dead=while true; do; " \
90 "led led_red on; sleep 1;" \
91 "led led_red off; sleep 1;" \
93 #elif (CONFIG_SYS_BOARD_VERSION == 6)
94 #define EXTRA_ENV_BOARD_SETTINGS \
95 "dead=while true; do; " \
96 "led led_red on; led led_red2 on; sleep 1;" \
97 "led led_red off; led led_red2 off;; sleep 1;" \
101 #define CONFIG_EXTRA_ENV_SETTINGS \
102 "disable_giga=yes\0" \
103 "usb_pgood_delay=2000\0" \
104 "nor_bootdelay=-2\0" \
105 "script=u-boot.scr\0" \
106 "loadaddr=0x12000000\0" \
107 "fit_addr_r=0x14000000\0" \
111 "console=" CONSOLE_DEV "\0" \
112 "emmcroot=/dev/mmcblk1p1 rootwait rw\0" \
113 "mtdids=nor0=spi0.0\0" \
114 "mtdparts=mtdparts=spi0.0:832k(u-boot),64k(env),64k(env-red)," \
116 "mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \
117 "mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \
118 "mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \
119 "mk_pubkey_path=setenv pubkey /${sysnum}/PCR.pem\0" \
120 "mk_rescue_pubkey_path=setenv pubkey /${rescue_sysnum}/PCR.pem\0" \
121 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
122 "bootmode=${bootmode} rng_core.default_quality=1000 " \
123 "mmcpart=${mmcpart} emmcpart=${emmcpart} sysnum=${sysnum}\0" \
124 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
125 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
126 "get_env=mw ${loadaddr} 0 0x20000;" \
128 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
129 "env import -t ${loadaddr}\0" \
130 "default_env=gpio set wp_spi_nor.gpio-hog;" \
132 "sf protect unlock 0 0x1000000;" \
133 "mw ${loadaddr} 0 0x20000;" \
134 "env export -t ${loadaddr} serial# ethaddr " \
135 "board_type panel;" \
137 "env import -t ${loadaddr}\0" \
139 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
141 "loadbootscriptUSB=" \
142 "ext4load usb 0 ${loadaddr} ${script};\0" \
143 "loadbootscriptUSBf=" \
144 "fatload usb 0 ${loadaddr} ${script};\0" \
145 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
147 "bootscript=echo Running bootscript from mmc ...; " \
154 "rescue_sysnum=0\0" \
156 "mainboot=echo Booting from eMMC ...; " \
157 "run mainargs addmtd addmisc;" \
158 "run boot_board_type;" \
159 "bootm ${fit_addr_r}\0" \
160 "mainargs=setenv bootargs console=${console},${baudrate} " \
161 "root=${emmcroot} rootfstype=ext4\0 " \
162 "main_load_fit=run mk_fitfile_path; " \
163 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
165 "imi ${fit_addr_r}\0 " \
166 "rescue_load_fit=run mk_rescue_fitfile_path; " \
167 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
168 "${rescue_fit_file}; " \
169 "imi ${fit_addr_r}\0" \
170 "main_load_pubkey=run mk_pubkey_path; " \
171 "setenv hab_check_filetype \"PCR.pem\";" \
172 "env set check_addr ${loadaddr};" \
173 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
175 "rescue_load_pubkey=run mk_rescue_pubkey_path; " \
176 "setenv hab_check_filetype \"PCR.pem\";" \
177 "env set check_addr ${loadaddr};" \
178 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
180 "mainRargs=setenv bootargs console=${console},${baudrate} " \
181 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
182 "mmcroot=/dev/mmcblk0p1 rootwait rw\0" \
183 "mmcargs=setenv bootargs console=${console},${baudrate} " \
184 "root=${mmcroot}\0" \
185 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
186 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
187 "mmcboot=echo Booting from mmc ...; " \
188 "run mmcargs addmtd addmisc;" \
189 "run boot_board_type;" \
190 "bootm ${fit_addr_r}\0" \
191 "mmc_load_fit=run mk_fitfile_path; " \
192 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
194 "imi ${fit_addr_r}\0" \
195 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
196 "ext4load mmc ${mmcdev}:${mmcpart} " \
197 "${fit_addr_r} ${rescue_fit_file}\0" \
198 "imi ${fit_addr_r}\0" \
199 "mmc_load_uboot=run mk_uboot_path; " \
200 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
202 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
203 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
204 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
205 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
206 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
207 "sf write ${loadaddr} 400 ${filesize};" \
208 "sf read ${cmp_buf} 400 ${uboot_sz};" \
209 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
210 "mmc_load_pubkey=run mk_pubkey_path; " \
211 "setenv hab_check_filetype \"PCR.pem\";" \
212 "env set check_addr ${loadaddr};" \
213 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
215 "mmc_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
216 "setenv hab_check_filetype \"PCR.pem\";" \
217 "env set check_addr ${loadaddr};" \
218 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
220 "rescueboot=echo Booting rescue system ...; " \
221 "run addmtd addmisc;" \
222 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
223 "run boot_board_type;" \
224 "if bootm ${fit_addr_r}; then ; " \
228 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
230 "rescueReason=$rreason\0 " \
231 "usb_load_fit=run mk_fitfile_path; " \
232 "ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
233 "usb_load_fitf=run mk_fitfile_path; " \
234 "fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
235 "usb_load_rescuefit=run mk_rescue_fitfile_path; " \
236 "ext4load usb 0 ${fit_addr_r} " \
237 "${rescue_fit_file}\0" \
238 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
239 "fatload usb 0 ${fit_addr_r} " \
240 "${rescue_fit_file}\0" \
241 "usb_load_pubkey=run mk_pubkey_path; " \
242 "setenv hab_check_filetype \"PCR.pem\";" \
243 "env set check_addr ${loadaddr};" \
244 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
245 "usb_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
246 "setenv hab_check_filetype \"PCR.pem\";" \
247 "env set check_addr ${loadaddr};" \
248 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
249 "usb_load_pubkeyf=run mk_pubkey_path; " \
250 "setenv hab_check_filetype \"PCR.pem\";" \
251 "env set check_addr ${loadaddr};" \
252 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
253 "usb_rescue_load_pubkeyf=run mk_rescue_pubkey_path; " \
254 "setenv hab_check_filetype \"PCR.pem\";" \
255 "env set check_addr ${loadaddr};" \
256 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
257 "usbroot=/dev/sda1 rootwait rw\0" \
258 "usbboot=echo Booting from usb-stick ...; " \
259 "run usbargs addmtd addmisc;" \
260 "run boot_board_type;" \
261 "bootm ${fit_addr_r}\0" \
262 "usbargs=setenv bootargs console=${console},${baudrate} " \
263 "root=${usbroot}\0" \
264 "usbRargs=setenv bootargs console=${console},${baudrate} " \
265 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
267 "run r_reason_syserr;" \
268 "if run mmc_rescue_load_pubkey hab_check_addr " \
269 "mmc_rescue_load_fit hab_check_file_fit; then " \
270 "run mmcRargs; run rescueboot; " \
272 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
275 "main_rescue_boot=" \
276 "if run main_load_pubkey hab_check_addr " \
277 "main_load_fit hab_check_flash_fit; then " \
278 "if run mainboot; then ; " \
280 "run r_reason_syserr;" \
281 "if run rescue_load_pubkey hab_check_addr " \
282 "rescue_load_fit hab_check_file_fit; then " \
283 "run mainRargs; run rescueboot; " \
285 "echo RESCUE SYSTEM BOOT FAILURE;" \
290 "run r_reason_syserr;" \
291 "if run rescue_load_pubkey hab_check_addr " \
292 "rescue_load_fit hab_check_file_fit; then " \
293 "run mainRargs; run rescueboot; " \
295 "echo RESCUE SYSTEM BOOT FAILURE;" \
299 "usb_mmc_rescue_boot=" \
301 "if usb storage; then " \
302 "if run loadbootscriptUSB " \
303 "hab_check_file_bootscript;" \
304 "then run bootscriptUSB; " \
306 "if run loadbootscriptUSBf " \
307 "hab_check_file_bootscript;" \
308 "then run bootscriptUSB; " \
310 "if run usb_load_pubkey hab_check_addr " \
311 "usb_load_fit hab_check_file_fit; then " \
314 "if run usb_load_pubkeyf hab_check_addr " \
315 "usb_load_fitf hab_check_file_fit; then " \
318 "if run usb_rescue_load_pubkey hab_check_addr " \
319 "usb_load_rescuefit hab_check_file_fit; then " \
320 "run r_reason_syserr usbRargs; run rescueboot;" \
322 "if run usb_rescue_load_pubkeyf hab_check_addr " \
323 "usb_load_rescuefitf hab_check_file_fit; then " \
324 "run r_reason_syserr usbRargs; run rescueboot;" \
326 "run mmc_rescue_boot;" \
328 "run mmc_rescue_boot;\0" \
329 "rescue_xload_boot=" \
330 "run r_reason_syserr;" \
331 "if test ${bootmode} -ne 0 ; then " \
332 "mmc dev ${mmcdev};" \
333 "if mmc rescan; then " \
334 "if run mmc_rescue_load_pubkey " \
336 "mmc_rescue_load_fit " \
337 "hab_check_file_fit; then " \
338 "run mmcRargs; run rescueboot; " \
341 "if usb storage; then " \
342 "if run usb_rescue_load_pubkey " \
344 "usb_load_rescuefit " \
345 "hab_check_file_fit; then " \
346 "run usbRargs; run rescueboot;" \
348 "if run usb_rescue_load_pubkeyf " \
350 "usb_load_rescuefitf " \
351 "hab_check_file_fit; then " \
352 "run usbRargs; run rescueboot;" \
356 "echo RESCUE SYSTEM ON SD OR " \
357 "USB BOOT FAILURE;" \
361 "if usb storage; then " \
362 "if run usb_rescue_load_pubkey " \
364 "usb_load_rescuefit " \
365 "hab_check_file_fit; then " \
366 "run usbRargs; run rescueboot;" \
368 "if run usb_rescue_load_pubkeyf " \
370 "usb_load_rescuefitf " \
371 "hab_check_file_fit; then " \
372 "run usbRargs; run rescueboot;" \
375 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
379 "if run rescue_load_pubkey hab_check_addr " \
380 "rescue_load_fit hab_check_file_fit; then " \
381 "run mainRargs; run rescueboot; " \
383 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
387 "ari_boot=if test ${bootmode} -ne 0 ; then " \
388 "mmc dev ${mmcdev};" \
389 "if mmc rescan; then " \
390 "if run loadbootscript hab_check_file_bootscript;" \
391 "then run bootscript; " \
393 "if run mmc_load_pubkey hab_check_addr " \
394 "mmc_load_fit hab_check_file_fit; then " \
395 "if run mmcboot; then ; " \
397 "run mmc_rescue_boot;" \
400 "run usb_mmc_rescue_boot;" \
403 "run usb_mmc_rescue_boot;" \
406 "run main_rescue_boot;" \
409 EXTRA_ENV_BOARD_SETTINGS
411 /* Physical Memory Map */
412 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
414 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
415 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
416 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
418 #define CONFIG_SYS_FSL_USDHC_NUM 2
420 /* DMA stuff, needed for GPMI/MXS NAND support */
423 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
424 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
425 #define CONFIG_MXC_USB_FLAGS 0
430 /* check this console not needed, after test remove it */
431 #define CONFIG_IMX_VIDEO_SKIP
433 #define CONFIG_IMX6_PWM_PER_CLK 66000000
435 #define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
436 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
438 #endif /* __ARISTAINETOS2_CONFIG_H */