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 #define CONFIG_MXC_UART_BASE UART2_BASE
17 #define CONSOLE_DEV "ttymxc1"
19 #define CONFIG_FEC_XCV_TYPE RGMII
22 #define CONFIG_SYS_LDB_CLOCK 28341000
25 #include "mx6_common.h"
27 #define CONFIG_MACH_TYPE 4501
28 #define CONFIG_MMCROOT "/dev/mmcblk0p1"
31 #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
33 #define IMX_FEC_BASE ENET_BASE_ADDR
34 #define CONFIG_ETHPRIME "FEC"
35 #define CONFIG_FEC_MXC_PHYADDR 0
37 #define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
40 #define HAB_EXTRA_SETTINGS \
42 "if hab_auth_img ${check_addr} ${filesize} ; then " \
45 "echo \"HAB checks ${hab_check_filetype} " \
49 "hab_check_file_fit=" \
50 "if env exists enable_hab_check && test " \
51 "${enable_hab_check} -eq 1 ; then " \
52 "setenv hab_check_filetype \"FIT file on SD card " \
54 "env set check_addr ${fit_addr_r};" \
55 "run hab_check_addr;" \
59 "hab_check_file_bootscript=" \
60 "if env exists enable_hab_check && test " \
61 "${enable_hab_check} -eq 1 ; then " \
62 "setenv hab_check_filetype \"Bootscript file\";" \
63 "env set check_addr ${loadaddr};" \
64 "run hab_check_addr;" \
68 "hab_check_flash_fit=" \
69 "if env exists enable_hab_check && test " \
70 "${enable_hab_check} -eq 1 ; then " \
71 "setenv hab_check_filetype \"FIT files on flash\";" \
72 "env set check_addr ${fit_addr_r};" \
73 "run hab_check_addr;" \
77 "enable_hab_check=1\0"
79 #define HAB_EXTRA_SETTINGS \
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 == 3)
90 #define CONFIG_EXTRA_ENV_BOARD_SETTINGS \
91 "dead=led led_red on\0" \
92 "mtdids=nand0=gpmi-nand,nor0=spi0.0\0" \
93 "mtdparts=mtdparts=spi0.0:832k(u-boot),64k(env),64k(env-red)," \
94 "-(ubi-nor);gpmi-nand:-(ubi)\0" \
95 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
96 "bootmode=${bootmode} mmcpart=${mmcpart}\0" \
97 "mainboot=echo Booting from SD-card ...; " \
98 "run mainargs addmtd addmisc;" \
99 "if test -n ${addmiscM}; then run addmiscM;fi;" \
100 "if test -n ${addmiscC}; then run addmiscC;fi;" \
101 "if test -n ${addmiscD}; then run addmiscD;fi;" \
102 "run boot_board_type;" \
103 "bootm ${fit_addr_r}\0" \
104 "mainargs=setenv bootargs console=${console},${baudrate} " \
105 "root=${mmcroot}\0" \
106 "main_load_fit=ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
108 "rescue_load_fit=ext4load mmc ${mmcdev}:${mmcrescuepart} " \
109 "${fit_addr_r} ${rescue_fit_file}\0"
110 #elif (CONFIG_SYS_BOARD_VERSION == 4)
111 #define CONFIG_EXTRA_ENV_BOARD_SETTINGS \
112 "dead=led led_red on;led led_red2 on;\0" \
113 "mtdids=nand0=gpmi-nand,nor0=spi0.0\0" \
114 "mtdparts=mtdparts=spi0.0:832k(u-boot),64k(env),64k(env-red)," \
115 "-(ubi-nor);gpmi-nand:-(ubi)\0" \
116 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
117 "bootmode=${bootmode} mmcpart=${mmcpart}\0" \
118 "mainboot=echo Booting from SD-card ...; " \
119 "run mainargs addmtd addmisc;" \
120 "if test -n ${addmiscM}; then run addmiscM;fi;" \
121 "if test -n ${addmiscC}; then run addmiscC;fi;" \
122 "if test -n ${addmiscD}; then run addmiscD;fi;" \
123 "run boot_board_type;" \
124 "bootm ${fit_addr_r}\0" \
125 "mainargs=setenv bootargs console=${console},${baudrate} " \
126 "root=${mmcroot}\0" \
127 "main_load_fit=ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
129 "rescue_load_fit=ext4load mmc ${mmcdev}:${mmcrescuepart} " \
130 "${fit_addr_r} ${rescue_fit_file}\0"
132 #define CONFIG_EXTRA_ENV_BOARD_SETTINGS \
133 "dead=led led_red on\0" \
134 "mtdids=nand0=gpmi-nand,nor0=spi3.1\0" \
135 "mtdparts=mtdparts=spi3.1:832k(u-boot),64k(env),64k(env-red)," \
136 "-(ubi-nor);gpmi-nand:-(ubi)\0" \
137 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
138 "bootmode=${bootmode} mmcpart=${mmcpart}\0" \
139 "mainboot=echo Booting from SD-card ...; " \
140 "run mainargs addmtd addmisc;" \
141 "if test -n ${addmiscM}; then run addmiscM;fi;" \
142 "if test -n ${addmiscC}; then run addmiscC;fi;" \
143 "if test -n ${addmiscD}; then run addmiscD;fi;" \
144 "run boot_board_type;" \
145 "bootm ${fit_addr_r}\0" \
146 "mainargs=setenv bootargs console=${console},${baudrate} " \
147 "root=${mmcroot}\0" \
148 "main_load_fit=ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
150 "rescue_load_fit=ext4load mmc ${mmcdev}:${mmcrescuepart} " \
151 "${fit_addr_r} ${rescue_fit_file}\0"
154 #define CONFIG_EXTRA_ENV_SETTINGS \
155 "disable_giga=yes\0" \
156 "usb_pgood_delay=2000\0" \
157 "nor_bootdelay=-2\0" \
158 "script=u-boot.scr\0" \
159 "fit_file=/boot/system.itb\0" \
160 "rescue_fit_file=/boot/rescue.itb\0" \
161 "loadaddr=0x12000000\0" \
162 "fit_addr_r=0x14000000\0" \
163 "uboot=/boot/u-boot.imx\0" \
167 "console=" CONSOLE_DEV "\0" \
168 "fdt_high=0xffffffff\0" \
169 "initrd_high=0xffffffff\0" \
170 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
171 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
172 "get_env=mw ${loadaddr} 0 0x20000;" \
174 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
175 "env import -t ${loadaddr}\0" \
176 "default_env=gpio set wp_spi_nor.gpio-hog;" \
178 "sf protect unlock 0 0x1000000;" \
179 "mw ${loadaddr} 0 0x20000;" \
180 "env export -t ${loadaddr} serial# ethaddr " \
181 "board_type panel addmisc addmiscM addmiscC addmiscD;" \
183 "env import -t ${loadaddr}\0" \
185 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
187 "loadbootscriptUSB=" \
188 "ext4load usb 0 ${loadaddr} ${script};\0" \
189 "loadbootscriptUSBf=" \
190 "fatload usb 0 ${loadaddr} ${script};\0" \
191 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
193 "bootscript=echo Running bootscript from mmc ...; " \
196 "mmcrescuepart=3\0" \
198 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
199 "mmcargs=setenv bootargs console=${console},${baudrate} " \
200 "root=${mmcroot}\0" \
201 "mmcboot=echo Booting from mmc ...; " \
202 "run mmcargs addmtd addmisc;" \
203 "if test -n ${addmiscM}; then run addmiscM;fi;" \
204 "if test -n ${addmiscC}; then run addmiscC;fi;" \
205 "if test -n ${addmiscD}; then run addmiscD;fi;" \
206 "run boot_board_type;" \
207 "bootm ${fit_addr_r}\0" \
208 "mmc_load_fit=ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
210 "mmc_load_uboot=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
212 "mmc_rescue_load_fit=ext4load mmc ${mmcdev}:${mmcrescuepart} " \
213 "${fit_addr_r} ${rescue_fit_file}\0" \
214 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
215 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
216 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
217 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
218 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
219 "sf write ${loadaddr} 400 ${filesize};" \
220 "sf read ${cmp_buf} 400 ${uboot_sz};" \
221 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
222 "rescueargs=setenv bootargs console=${console},${baudrate} " \
223 "root=/dev/ram rw\0 " \
224 "rescueboot=echo Booting rescue system ...; " \
225 "run rescueargs addmtd addmisc;" \
226 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
227 "if test -n ${addmiscM}; then run addmiscM;fi;" \
228 "if test -n ${addmiscC}; then run addmiscC;fi;" \
229 "if test -n ${addmiscD}; then run addmiscD;fi;" \
230 "run boot_board_type;" \
231 "if bootm ${fit_addr_r}; then ; " \
235 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
237 "rescueReason=18\0 " \
238 "usb_load_fit=ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
239 "usb_load_fitf=fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
240 "usb_load_rescuefit=ext4load usb 0 ${fit_addr_r} " \
241 "${rescue_fit_file}\0" \
242 "usb_load_rescuefitf=fatload usb 0 ${fit_addr_r} " \
243 "${rescue_fit_file}\0" \
244 "usbroot=/dev/sda1 rootwait rw\0" \
245 "usbboot=echo Booting from usb-stick ...; " \
246 "run usbargs addmtd addmisc;" \
247 "if test -n ${addmiscM}; then run addmiscM;fi;" \
248 "if test -n ${addmiscC}; then run addmiscC;fi;" \
249 "if test -n ${addmiscD}; then run addmiscD;fi;" \
250 "run boot_board_type;" \
251 "bootm ${fit_addr_r}\0" \
252 "usbargs=setenv bootargs console=${console},${baudrate} " \
253 "root=${usbroot}\0" \
255 "run r_reason_syserr;" \
256 "if run mmc_rescue_load_fit hab_check_file_fit; then " \
260 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
262 "main_rescue_boot=" \
263 "if run main_load_fit hab_check_flash_fit; then " \
264 "if run mainboot; then ; " \
266 "run r_reason_syserr;" \
267 "if run rescue_load_fit hab_check_file_fit;" \
268 "then run rescueboot; " \
271 "echo RESCUE SYSTEM BOOT FAILURE;" \
275 "run r_reason_syserr;" \
276 "if run rescue_load_fit hab_check_file_fit; then " \
280 "echo RESCUE SYSTEM BOOT FAILURE;" \
283 "usb_mmc_rescue_boot=" \
285 "if usb storage; then " \
286 "if run loadbootscriptUSB " \
287 "hab_check_file_bootscript;" \
288 "then run bootscriptUSB; " \
290 "if run loadbootscriptUSBf " \
291 "hab_check_file_bootscript;" \
292 "then run bootscriptUSB; " \
294 "if run usb_load_fit hab_check_file_fit; then " \
297 "if run usb_load_fitf hab_check_file_fit; then " \
300 "if run usb_load_rescuefit hab_check_file_fit;" \
301 "then run r_reason_syserr rescueboot;" \
303 "if run usb_load_rescuefitf hab_check_file_fit;" \
304 "then run r_reason_syserr rescueboot;" \
306 "run mmc_rescue_boot;" \
308 "run mmc_rescue_boot;\0" \
309 "rescue_xload_boot=" \
310 "run r_reason_syserr;" \
311 "if test ${bootmode} -ne 0 ; then " \
312 "mmc dev ${mmcdev};" \
313 "if mmc rescan; then " \
314 "if run mmc_rescue_load_fit " \
315 "hab_check_file_fit; then " \
319 "if usb storage; then " \
320 "if run usb_load_rescuefit " \
321 "hab_check_file_fit;"\
325 "if run usb_load_rescuefitf "\
326 "hab_check_file_fit;"\
333 "echo RESCUE SYSTEM ON SD OR " \
334 "USB BOOT FAILURE;" \
337 "if usb storage; then " \
338 "if run usb_load_rescuefit " \
339 "hab_check_file_fit; then " \
342 "if run usb_load_rescuefitf " \
343 "hab_check_file_fit; then " \
348 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
351 "if run rescue_load_fit hab_check_file_fit; then " \
355 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
358 "ari_boot=if test ${bootmode} -ne 0 ; then " \
359 "mmc dev ${mmcdev};" \
360 "if mmc rescan; then " \
361 "if run loadbootscript hab_check_file_bootscript;" \
362 "then run bootscript; " \
364 "if run mmc_load_fit hab_check_file_fit; then " \
365 "if run mmcboot; then ; " \
367 "run mmc_rescue_boot;" \
370 "run usb_mmc_rescue_boot;" \
373 "run usb_mmc_rescue_boot;" \
376 "run main_rescue_boot;" \
379 CONFIG_EXTRA_ENV_BOARD_SETTINGS
381 #define CONFIG_ARP_TIMEOUT 200UL
383 #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM
384 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x100000)
385 #define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
387 /* Physical Memory Map */
388 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
390 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
391 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
392 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
394 #define CONFIG_SYS_INIT_SP_OFFSET \
395 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
396 #define CONFIG_SYS_INIT_SP_ADDR \
397 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
399 #define CONFIG_SYS_FSL_USDHC_NUM 2
402 #define CONFIG_SYS_MAX_NAND_DEVICE 1
403 #define CONFIG_SYS_NAND_BASE 0x40000000
404 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
405 #define CONFIG_SYS_NAND_ONFI_DETECTION
407 /* DMA stuff, needed for GPMI/MXS NAND support */
410 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
411 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
412 #define CONFIG_MXC_USB_FLAGS 0
417 /* check this console not needed, after test remove it */
418 #define CONFIG_SPLASH_SCREEN
419 #define CONFIG_SPLASH_SCREEN_ALIGN
420 #define CONFIG_IMX_VIDEO_SKIP
421 #define CONFIG_VIDEO_LOGO
422 #define CONFIG_VIDEO_BMP_LOGO
423 #define CONFIG_BMP_16BPP
424 #define CONFIG_VIDEO_BMP_RLE8
426 #define CONFIG_IMX6_PWM_PER_CLK 66000000
428 #endif /* __ARISTAINETOS2_CONFIG_H */