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 "mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \
114 "mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \
115 "mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \
116 "mk_pubkey_path=setenv pubkey /${sysnum}/PCR.pem\0" \
117 "mk_rescue_pubkey_path=setenv pubkey /${rescue_sysnum}/PCR.pem\0" \
118 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
119 "bootmode=${bootmode} rng_core.default_quality=1000 " \
120 "mmcpart=${mmcpart} emmcpart=${emmcpart} sysnum=${sysnum}\0" \
121 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
122 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
123 "get_env=mw ${loadaddr} 0 0x20000;" \
125 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
126 "env import -t ${loadaddr}\0" \
127 "default_env=gpio set wp_spi_nor.gpio-hog;" \
129 "sf protect unlock 0 0x1000000;" \
130 "mw ${loadaddr} 0 0x20000;" \
131 "env export -t ${loadaddr} serial# ethaddr " \
132 "board_type panel;" \
134 "env import -t ${loadaddr}\0" \
136 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
138 "loadbootscriptUSB=" \
139 "ext4load usb 0 ${loadaddr} ${script};\0" \
140 "loadbootscriptUSBf=" \
141 "fatload usb 0 ${loadaddr} ${script};\0" \
142 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
144 "bootscript=echo Running bootscript from mmc ...; " \
151 "rescue_sysnum=0\0" \
153 "mainboot=echo Booting from eMMC ...; " \
154 "run mainargs addmtd addmisc;" \
155 "run boot_board_type;" \
156 "bootm ${fit_addr_r}\0" \
157 "mainargs=setenv bootargs console=${console},${baudrate} " \
158 "root=${emmcroot} rootfstype=ext4\0 " \
159 "main_load_fit=run mk_fitfile_path; " \
160 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
162 "imi ${fit_addr_r}\0 " \
163 "rescue_load_fit=run mk_rescue_fitfile_path; " \
164 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
165 "${rescue_fit_file}; " \
166 "imi ${fit_addr_r}\0" \
167 "main_load_pubkey=run mk_pubkey_path; " \
168 "setenv hab_check_filetype \"PCR.pem\";" \
169 "env set check_addr ${loadaddr};" \
170 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
172 "rescue_load_pubkey=run mk_rescue_pubkey_path; " \
173 "setenv hab_check_filetype \"PCR.pem\";" \
174 "env set check_addr ${loadaddr};" \
175 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
177 "mainRargs=setenv bootargs console=${console},${baudrate} " \
178 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
179 "mmcroot=/dev/mmcblk0p1 rootwait rw\0" \
180 "mmcargs=setenv bootargs console=${console},${baudrate} " \
181 "root=${mmcroot}\0" \
182 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
183 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
184 "mmcboot=echo Booting from mmc ...; " \
185 "run mmcargs addmtd addmisc;" \
186 "run boot_board_type;" \
187 "bootm ${fit_addr_r}\0" \
188 "mmc_load_fit=run mk_fitfile_path; " \
189 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
191 "imi ${fit_addr_r}\0" \
192 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
193 "ext4load mmc ${mmcdev}:${mmcpart} " \
194 "${fit_addr_r} ${rescue_fit_file}\0" \
195 "imi ${fit_addr_r}\0" \
196 "mmc_load_uboot=run mk_uboot_path; " \
197 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
199 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
200 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
201 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
202 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
203 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
204 "sf write ${loadaddr} 400 ${filesize};" \
205 "sf read ${cmp_buf} 400 ${uboot_sz};" \
206 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
207 "mmc_load_pubkey=run mk_pubkey_path; " \
208 "setenv hab_check_filetype \"PCR.pem\";" \
209 "env set check_addr ${loadaddr};" \
210 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
212 "mmc_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
213 "setenv hab_check_filetype \"PCR.pem\";" \
214 "env set check_addr ${loadaddr};" \
215 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
217 "rescueboot=echo Booting rescue system ...; " \
218 "run addmtd addmisc;" \
219 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
220 "run boot_board_type;" \
221 "if bootm ${fit_addr_r}; then ; " \
225 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
227 "rescueReason=$rreason\0 " \
228 "usb_load_fit=run mk_fitfile_path; " \
229 "ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
230 "usb_load_fitf=run mk_fitfile_path; " \
231 "fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
232 "usb_load_rescuefit=run mk_rescue_fitfile_path; " \
233 "ext4load usb 0 ${fit_addr_r} " \
234 "${rescue_fit_file}\0" \
235 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
236 "fatload usb 0 ${fit_addr_r} " \
237 "${rescue_fit_file}\0" \
238 "usb_load_pubkey=run mk_pubkey_path; " \
239 "setenv hab_check_filetype \"PCR.pem\";" \
240 "env set check_addr ${loadaddr};" \
241 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
242 "usb_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
243 "setenv hab_check_filetype \"PCR.pem\";" \
244 "env set check_addr ${loadaddr};" \
245 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
246 "usb_load_pubkeyf=run mk_pubkey_path; " \
247 "setenv hab_check_filetype \"PCR.pem\";" \
248 "env set check_addr ${loadaddr};" \
249 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
250 "usb_rescue_load_pubkeyf=run mk_rescue_pubkey_path; " \
251 "setenv hab_check_filetype \"PCR.pem\";" \
252 "env set check_addr ${loadaddr};" \
253 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
254 "usbroot=/dev/sda1 rootwait rw\0" \
255 "usbboot=echo Booting from usb-stick ...; " \
256 "run usbargs addmtd addmisc;" \
257 "run boot_board_type;" \
258 "bootm ${fit_addr_r}\0" \
259 "usbargs=setenv bootargs console=${console},${baudrate} " \
260 "root=${usbroot}\0" \
261 "usbRargs=setenv bootargs console=${console},${baudrate} " \
262 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
264 "run r_reason_syserr;" \
265 "if run mmc_rescue_load_pubkey hab_check_addr " \
266 "mmc_rescue_load_fit hab_check_file_fit; then " \
267 "run mmcRargs; run rescueboot; " \
269 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
272 "main_rescue_boot=" \
273 "if run main_load_pubkey hab_check_addr " \
274 "main_load_fit hab_check_flash_fit; then " \
275 "if run mainboot; then ; " \
277 "run r_reason_syserr;" \
278 "if run rescue_load_pubkey hab_check_addr " \
279 "rescue_load_fit hab_check_file_fit; then " \
280 "run mainRargs; run rescueboot; " \
282 "echo RESCUE SYSTEM BOOT FAILURE;" \
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;" \
296 "usb_mmc_rescue_boot=" \
298 "if usb storage; then " \
299 "if run loadbootscriptUSB " \
300 "hab_check_file_bootscript;" \
301 "then run bootscriptUSB; " \
303 "if run loadbootscriptUSBf " \
304 "hab_check_file_bootscript;" \
305 "then run bootscriptUSB; " \
307 "if run usb_load_pubkey hab_check_addr " \
308 "usb_load_fit hab_check_file_fit; then " \
311 "if run usb_load_pubkeyf hab_check_addr " \
312 "usb_load_fitf hab_check_file_fit; then " \
315 "if run usb_rescue_load_pubkey hab_check_addr " \
316 "usb_load_rescuefit hab_check_file_fit; then " \
317 "run r_reason_syserr usbRargs; run rescueboot;" \
319 "if run usb_rescue_load_pubkeyf hab_check_addr " \
320 "usb_load_rescuefitf hab_check_file_fit; then " \
321 "run r_reason_syserr usbRargs; run rescueboot;" \
323 "run mmc_rescue_boot;" \
325 "run mmc_rescue_boot;\0" \
326 "rescue_xload_boot=" \
327 "run r_reason_syserr;" \
328 "if test ${bootmode} -ne 0 ; then " \
329 "mmc dev ${mmcdev};" \
330 "if mmc rescan; then " \
331 "if run mmc_rescue_load_pubkey " \
333 "mmc_rescue_load_fit " \
334 "hab_check_file_fit; then " \
335 "run mmcRargs; run rescueboot; " \
338 "if usb storage; then " \
339 "if run usb_rescue_load_pubkey " \
341 "usb_load_rescuefit " \
342 "hab_check_file_fit; then " \
343 "run usbRargs; run rescueboot;" \
345 "if run usb_rescue_load_pubkeyf " \
347 "usb_load_rescuefitf " \
348 "hab_check_file_fit; then " \
349 "run usbRargs; run rescueboot;" \
353 "echo RESCUE SYSTEM ON SD OR " \
354 "USB BOOT FAILURE;" \
358 "if usb storage; then " \
359 "if run usb_rescue_load_pubkey " \
361 "usb_load_rescuefit " \
362 "hab_check_file_fit; then " \
363 "run usbRargs; run rescueboot;" \
365 "if run usb_rescue_load_pubkeyf " \
367 "usb_load_rescuefitf " \
368 "hab_check_file_fit; then " \
369 "run usbRargs; run rescueboot;" \
372 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
376 "if run rescue_load_pubkey hab_check_addr " \
377 "rescue_load_fit hab_check_file_fit; then " \
378 "run mainRargs; run rescueboot; " \
380 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
384 "ari_boot=if test ${bootmode} -ne 0 ; then " \
385 "mmc dev ${mmcdev};" \
386 "if mmc rescan; then " \
387 "if run loadbootscript hab_check_file_bootscript;" \
388 "then run bootscript; " \
390 "if run mmc_load_pubkey hab_check_addr " \
391 "mmc_load_fit hab_check_file_fit; then " \
392 "if run mmcboot; then ; " \
394 "run mmc_rescue_boot;" \
397 "run usb_mmc_rescue_boot;" \
400 "run usb_mmc_rescue_boot;" \
403 "run main_rescue_boot;" \
406 EXTRA_ENV_BOARD_SETTINGS
408 /* Physical Memory Map */
409 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
411 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
412 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
413 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
415 #define CONFIG_SYS_FSL_USDHC_NUM 2
417 /* DMA stuff, needed for GPMI/MXS NAND support */
420 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
421 #define CONFIG_MXC_USB_FLAGS 0
426 /* check this console not needed, after test remove it */
427 #define CONFIG_IMX_VIDEO_SKIP
429 #define CONFIG_IMX6_PWM_PER_CLK 66000000
431 #define CONFIG_ENV_FLAGS_LIST_STATIC "ethaddr:mw,serial#:sw,board_type:sw," \
432 "sysnum:dw,panel:sw,ipaddr:iw,serverip:iw"
434 #endif /* __ARISTAINETOS2_CONFIG_H */