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"
21 #define CONFIG_FEC_XCV_TYPE RGMII
24 #define CONFIG_SYS_LDB_CLOCK 28341000
26 #include "mx6_common.h"
28 #define CONFIG_MACH_TYPE 4501
29 #define CONFIG_MMCROOT "/dev/mmcblk0p1"
32 #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
34 #define IMX_FEC_BASE ENET_BASE_ADDR
35 #define CONFIG_ETHPRIME "FEC"
36 #define CONFIG_FEC_MXC_PHYADDR 0
38 #define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
41 #define HAB_EXTRA_SETTINGS \
43 "if hab_auth_img ${check_addr} ${filesize} ; then " \
46 "echo \"HAB checks ${hab_check_filetype} " \
50 "hab_check_file_fit=" \
51 "if env exists enable_hab_check && test " \
52 "${enable_hab_check} -eq 1 ; then " \
53 "setenv hab_check_filetype \"FIT file on SD card " \
55 "env set check_addr ${fit_addr_r};" \
56 "run hab_check_addr;" \
60 "hab_check_file_bootscript=" \
61 "if env exists enable_hab_check && test " \
62 "${enable_hab_check} -eq 1 ; then " \
63 "setenv hab_check_filetype \"Bootscript file\";" \
64 "env set check_addr ${loadaddr};" \
65 "run hab_check_addr;" \
69 "hab_check_flash_fit=" \
70 "if env exists enable_hab_check && test " \
71 "${enable_hab_check} -eq 1 ; then " \
72 "setenv hab_check_filetype \"FIT files on flash\";" \
73 "env set check_addr ${fit_addr_r};" \
74 "run hab_check_addr;" \
78 "enable_hab_check=1\0"
80 #define HAB_EXTRA_SETTINGS \
81 "hab_check_addr=echo HAB check addr always returns " \
83 "hab_check_file_fit=echo HAB check FIT file always returns " \
85 "hab_check_flash_fit=echo HAB check flash FIT always returns " \
87 "hab_check_file_bootscript=echo HAB check bootscript always " \
88 "returns true;true\0" \
89 "enable_hab_check=0\0"
92 #if (CONFIG_SYS_BOARD_VERSION == 5)
93 #define CONFIG_EXTRA_ENV_BOARD_SETTINGS \
94 "dead=while true; do; " \
95 "led led_red on; sleep 1;" \
96 "led led_red off; sleep 1;" \
100 #define CONFIG_EXTRA_ENV_SETTINGS \
101 "disable_giga=yes\0" \
102 "usb_pgood_delay=2000\0" \
103 "nor_bootdelay=-2\0" \
104 "script=u-boot.scr\0" \
105 "loadaddr=0x12000000\0" \
106 "fit_addr_r=0x14000000\0" \
110 "console=" CONSOLE_DEV "\0" \
111 "emmcroot=/dev/mmcblk1p1 rootwait rw\0" \
112 "mtdids=nor0=spi0.0\0" \
113 "mtdparts=mtdparts=spi0.0:832k(u-boot),64k(env),64k(env-red)," \
115 "mk_fitfile_path=setenv fit_file /${sysnum}/system.itb\0" \
116 "mk_rescue_fitfile_path=setenv rescue_fit_file /${rescue_sysnum}/system.itb\0" \
117 "mk_uboot_path=setenv uboot /${sysnum}/u-boot.imx\0" \
118 "mk_pubkey_path=setenv pubkey /${sysnum}/PCR.pem\0" \
119 "mk_rescue_pubkey_path=setenv pubkey /${rescue_sysnum}/PCR.pem\0" \
120 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
121 "bootmode=${bootmode} rng_core.default_quality=1000 " \
122 "mmcpart=${mmcpart} emmcpart=${emmcpart} sysnum=${sysnum}\0" \
123 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
124 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
125 "get_env=mw ${loadaddr} 0 0x20000;" \
127 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
128 "env import -t ${loadaddr}\0" \
129 "default_env=gpio set wp_spi_nor.gpio-hog;" \
131 "sf protect unlock 0 0x1000000;" \
132 "mw ${loadaddr} 0 0x20000;" \
133 "env export -t ${loadaddr} serial# ethaddr " \
134 "board_type panel;" \
136 "env import -t ${loadaddr}\0" \
138 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
140 "loadbootscriptUSB=" \
141 "ext4load usb 0 ${loadaddr} ${script};\0" \
142 "loadbootscriptUSBf=" \
143 "fatload usb 0 ${loadaddr} ${script};\0" \
144 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
146 "bootscript=echo Running bootscript from mmc ...; " \
153 "rescue_sysnum=0\0" \
155 "mainboot=echo Booting from eMMC ...; " \
156 "run mainargs addmtd addmisc;" \
157 "run boot_board_type;" \
158 "bootm ${fit_addr_r}\0" \
159 "mainargs=setenv bootargs console=${console},${baudrate} " \
160 "root=${emmcroot} rootfstype=ext4\0 " \
161 "main_load_fit=run mk_fitfile_path; " \
162 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
164 "imi ${fit_addr_r}\0 " \
165 "rescue_load_fit=run mk_rescue_fitfile_path; " \
166 "ext4load mmc ${emmcdev}:${emmcpart} ${fit_addr_r} " \
167 "${rescue_fit_file}; " \
168 "imi ${fit_addr_r}\0" \
169 "main_load_pubkey=run mk_pubkey_path; " \
170 "setenv hab_check_filetype \"PCR.pem\";" \
171 "env set check_addr ${loadaddr};" \
172 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
174 "rescue_load_pubkey=run mk_rescue_pubkey_path; " \
175 "setenv hab_check_filetype \"PCR.pem\";" \
176 "env set check_addr ${loadaddr};" \
177 "ext4load mmc ${emmcdev}:${emmcpart} ${loadaddr} " \
179 "mainRargs=setenv bootargs console=${console},${baudrate} " \
180 "rescue_sysnum=${rescue_sysnum} root=${emmcroot} rootfstype=ext4\0" \
181 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
182 "mmcargs=setenv bootargs console=${console},${baudrate} " \
183 "root=${mmcroot}\0" \
184 "mmcRargs=setenv bootargs console=${console},${baudrate} " \
185 "rescue_sysnum=${rescue_sysnum} root=${mmcroot}\0" \
186 "mmcboot=echo Booting from mmc ...; " \
187 "run mmcargs addmtd addmisc;" \
188 "run boot_board_type;" \
189 "bootm ${fit_addr_r}\0" \
190 "mmc_load_fit=run mk_fitfile_path; " \
191 "ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
193 "imi ${fit_addr_r}\0" \
194 "mmc_rescue_load_fit=run mk_rescue_fitfile_path; " \
195 "ext4load mmc ${mmcdev}:${mmcpart} " \
196 "${fit_addr_r} ${rescue_fit_file}\0" \
197 "imi ${fit_addr_r}\0" \
198 "mmc_load_uboot=run mk_uboot_path; " \
199 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
201 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
202 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
203 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
204 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
205 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
206 "sf write ${loadaddr} 400 ${filesize};" \
207 "sf read ${cmp_buf} 400 ${uboot_sz};" \
208 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
209 "mmc_load_pubkey=run mk_pubkey_path; " \
210 "setenv hab_check_filetype \"PCR.pem\";" \
211 "env set check_addr ${loadaddr};" \
212 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
214 "mmc_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
215 "setenv hab_check_filetype \"PCR.pem\";" \
216 "env set check_addr ${loadaddr};" \
217 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
219 "rescueboot=echo Booting rescue system ...; " \
220 "run addmtd addmisc;" \
221 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
222 "run boot_board_type;" \
223 "if bootm ${fit_addr_r}; then ; " \
227 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
229 "rescueReason=$rreason\0 " \
230 "usb_load_fit=run mk_fitfile_path; " \
231 "ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
232 "usb_load_fitf=run mk_fitfile_path; " \
233 "fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
234 "usb_load_rescuefit=run mk_rescue_fitfile_path; " \
235 "ext4load usb 0 ${fit_addr_r} " \
236 "${rescue_fit_file}\0" \
237 "usb_load_rescuefitf=run mk_rescue_fitfile_path; " \
238 "fatload usb 0 ${fit_addr_r} " \
239 "${rescue_fit_file}\0" \
240 "usb_load_pubkey=run mk_pubkey_path; " \
241 "setenv hab_check_filetype \"PCR.pem\";" \
242 "env set check_addr ${loadaddr};" \
243 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
244 "usb_rescue_load_pubkey=run mk_rescue_pubkey_path; " \
245 "setenv hab_check_filetype \"PCR.pem\";" \
246 "env set check_addr ${loadaddr};" \
247 "ext4load usb 0 ${loadaddr} ${pubkey}\0" \
248 "usb_load_pubkeyf=run mk_pubkey_path; " \
249 "setenv hab_check_filetype \"PCR.pem\";" \
250 "env set check_addr ${loadaddr};" \
251 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
252 "usb_rescue_load_pubkeyf=run mk_rescue_pubkey_path; " \
253 "setenv hab_check_filetype \"PCR.pem\";" \
254 "env set check_addr ${loadaddr};" \
255 "fatload usb 0 ${loadaddr} ${pubkey}\0" \
256 "usbroot=/dev/sda1 rootwait rw\0" \
257 "usbboot=echo Booting from usb-stick ...; " \
258 "run usbargs addmtd addmisc;" \
259 "run boot_board_type;" \
260 "bootm ${fit_addr_r}\0" \
261 "usbargs=setenv bootargs console=${console},${baudrate} " \
262 "root=${usbroot}\0" \
263 "usbRargs=setenv bootargs console=${console},${baudrate} " \
264 "rescue_sysnum=${rescue_sysnum} root=${usbroot} rw\0 " \
266 "run r_reason_syserr;" \
267 "if run mmc_rescue_load_pubkey hab_check_addr " \
268 "mmc_rescue_load_fit hab_check_file_fit; then " \
269 "run mmcRargs; run rescueboot; " \
271 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
274 "main_rescue_boot=" \
275 "if run main_load_pubkey hab_check_addr " \
276 "main_load_fit hab_check_flash_fit; then " \
277 "if run mainboot; then ; " \
279 "run r_reason_syserr;" \
280 "if run rescue_load_pubkey hab_check_addr " \
281 "rescue_load_fit hab_check_file_fit; then " \
282 "run mainRargs; run rescueboot; " \
284 "echo RESCUE SYSTEM BOOT FAILURE;" \
289 "run r_reason_syserr;" \
290 "if run rescue_load_pubkey hab_check_addr " \
291 "rescue_load_fit hab_check_file_fit; then " \
292 "run mainRargs; run rescueboot; " \
294 "echo RESCUE SYSTEM BOOT FAILURE;" \
298 "usb_mmc_rescue_boot=" \
300 "if usb storage; then " \
301 "if run loadbootscriptUSB " \
302 "hab_check_file_bootscript;" \
303 "then run bootscriptUSB; " \
305 "if run loadbootscriptUSBf " \
306 "hab_check_file_bootscript;" \
307 "then run bootscriptUSB; " \
309 "if run usb_load_pubkey hab_check_addr " \
310 "usb_load_fit hab_check_file_fit; then " \
313 "if run usb_load_pubkeyf hab_check_addr " \
314 "usb_load_fitf hab_check_file_fit; then " \
317 "if run usb_rescue_load_pubkey hab_check_addr " \
318 "usb_load_rescuefit hab_check_file_fit; then " \
319 "run r_reason_syserr usbRargs; run rescueboot;" \
321 "if run usb_rescue_load_pubkeyf hab_check_addr " \
322 "usb_load_rescuefitf hab_check_file_fit; then " \
323 "run r_reason_syserr usbRargs; run rescueboot;" \
325 "run mmc_rescue_boot;" \
327 "run mmc_rescue_boot;\0" \
328 "rescue_xload_boot=" \
329 "run r_reason_syserr;" \
330 "if test ${bootmode} -ne 0 ; then " \
331 "mmc dev ${mmcdev};" \
332 "if mmc rescan; then " \
333 "if run mmc_rescue_load_pubkey " \
335 "mmc_rescue_load_fit " \
336 "hab_check_file_fit; then " \
337 "run mmcRargs; run rescueboot; " \
340 "if usb storage; then " \
341 "if run usb_rescue_load_pubkey " \
343 "usb_load_rescuefit " \
344 "hab_check_file_fit; then " \
345 "run usbRargs; run rescueboot;" \
347 "if run usb_rescue_load_pubkeyf " \
349 "usb_load_rescuefitf " \
350 "hab_check_file_fit; then " \
351 "run usbRargs; run rescueboot;" \
355 "echo RESCUE SYSTEM ON SD OR " \
356 "USB BOOT FAILURE;" \
360 "if usb storage; then " \
361 "if run usb_rescue_load_pubkey " \
363 "usb_load_rescuefit " \
364 "hab_check_file_fit; then " \
365 "run usbRargs; run rescueboot;" \
367 "if run usb_rescue_load_pubkeyf " \
369 "usb_load_rescuefitf " \
370 "hab_check_file_fit; then " \
371 "run usbRargs; run rescueboot;" \
374 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
378 "if run rescue_load_pubkey hab_check_addr " \
379 "rescue_load_fit hab_check_file_fit; then " \
380 "run mainRargs; run rescueboot; " \
382 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
386 "ari_boot=if test ${bootmode} -ne 0 ; then " \
387 "mmc dev ${mmcdev};" \
388 "if mmc rescan; then " \
389 "if run loadbootscript hab_check_file_bootscript;" \
390 "then run bootscript; " \
392 "if run mmc_load_pubkey hab_check_addr " \
393 "mmc_load_fit hab_check_file_fit; then " \
394 "if run mmcboot; then ; " \
396 "run mmc_rescue_boot;" \
399 "run usb_mmc_rescue_boot;" \
402 "run usb_mmc_rescue_boot;" \
405 "run main_rescue_boot;" \
408 CONFIG_EXTRA_ENV_BOARD_SETTINGS
410 #define CONFIG_ARP_TIMEOUT 200UL
412 /* Physical Memory Map */
413 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
415 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
416 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
417 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
419 #define CONFIG_SYS_INIT_SP_OFFSET \
420 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
421 #define CONFIG_SYS_INIT_SP_ADDR \
422 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
424 #define CONFIG_SYS_FSL_USDHC_NUM 2
426 /* DMA stuff, needed for GPMI/MXS NAND support */
429 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
430 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
431 #define CONFIG_MXC_USB_FLAGS 0
436 /* check this console not needed, after test remove it */
437 #define CONFIG_IMX_VIDEO_SKIP
438 #define CONFIG_VIDEO_LOGO
439 #define CONFIG_VIDEO_BMP_LOGO
441 #define CONFIG_IMX6_PWM_PER_CLK 66000000
443 #endif /* __ARISTAINETOS2_CONFIG_H */