blob: d2646d26da8655eb21dc4c18e7c8b086c6958466 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Heiko Schocher05729822015-05-18 13:32:31 +02002/*
3 * (C) Copyright 2015
4 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
5 *
6 * Based on:
7 * Copyright (C) 2012 Freescale Semiconductor, Inc.
8 *
9 * Configuration settings for the Freescale i.MX6DL aristainetos2 board.
Heiko Schocher05729822015-05-18 13:32:31 +020010 */
11#ifndef __ARISTAINETOS2_CONFIG_H
12#define __ARISTAINETOS2_CONFIG_H
13
Mario Six790d8442018-03-28 14:38:20 +020014#define CONFIG_HOSTNAME "aristainetos2"
Heiko Schocher05729822015-05-18 13:32:31 +020015
Heiko Schocher05729822015-05-18 13:32:31 +020016#define CONFIG_MXC_UART_BASE UART2_BASE
Simon Glass4694a742016-10-17 20:12:39 -060017#define CONSOLE_DEV "ttymxc1"
Heiko Schocher05729822015-05-18 13:32:31 +020018
19#define CONFIG_FEC_XCV_TYPE RGMII
Heiko Schocher05729822015-05-18 13:32:31 +020020
Heiko Schocher05729822015-05-18 13:32:31 +020021/* Framebuffer */
Heiko Schocher8f4a1b92019-12-01 11:23:19 +010022#define CONFIG_SYS_LDB_CLOCK 28341000
Heiko Schocher05729822015-05-18 13:32:31 +020023#define CONFIG_LG4573
Heiko Schocher05729822015-05-18 13:32:31 +020024
Heiko Schochera051ee92019-12-01 11:23:11 +010025#include "mx6_common.h"
26
27#define CONFIG_MACH_TYPE 4501
28#define CONFIG_MMCROOT "/dev/mmcblk0p1"
29
30/* MMC Configs */
Heiko Schocher7344de12019-12-01 11:23:14 +010031#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
Heiko Schochera051ee92019-12-01 11:23:11 +010032
33#define IMX_FEC_BASE ENET_BASE_ADDR
34#define CONFIG_ETHPRIME "FEC"
35#define CONFIG_FEC_MXC_PHYADDR 0
36
37#define CONFIG_SYS_SPI_ST_ENABLE_WP_PIN
38
Heiko Schocher19c3cd92019-12-01 11:23:29 +010039#ifdef CONFIG_IMX_HAB
40#define HAB_EXTRA_SETTINGS \
41 "hab_check_addr=" \
42 "if hab_auth_img ${check_addr} ${filesize} ; then " \
43 "true;" \
44 "else " \
45 "echo \"HAB checks ${hab_check_filetype} " \
46 "failed!\"; " \
47 "false; " \
48 "fi;\0" \
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 " \
53 "or eMMC\";" \
54 "env set check_addr ${fit_addr_r};" \
55 "run hab_check_addr;" \
56 "else " \
57 "true; "\
58 "fi;\0" \
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;" \
65 "else " \
66 "true; "\
67 "fi;\0" \
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;" \
74 "else " \
75 "true; "\
76 "fi;\0" \
77 "enable_hab_check=1\0"
78#else
79#define HAB_EXTRA_SETTINGS \
80 "hab_check_file_fit=echo HAB check FIT file always returns " \
81 "true;true\0" \
82 "hab_check_flash_fit=echo HAB check flash FIT always returns " \
83 "true;true\0" \
84 "hab_check_file_bootscript=echo HAB check bootscript always " \
85 "returns true;true\0" \
86 "enable_hab_check=0\0"
87#endif
88
Heiko Schocher57c4aad2019-12-01 11:23:30 +010089#if (CONFIG_SYS_BOARD_VERSION == 3)
Heiko Schocher9eca4612019-12-01 11:23:28 +010090#define CONFIG_EXTRA_ENV_BOARD_SETTINGS \
91 "dead=led led_red on\0" \
Heiko Schocher57c4aad2019-12-01 11:23:30 +010092 "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} " \
107 "${fit_file}\0" \
108 "rescue_load_fit=ext4load mmc ${mmcdev}:${mmcrescuepart} " \
109 "${fit_addr_r} ${rescue_fit_file}\0"
110#else
111#define CONFIG_EXTRA_ENV_BOARD_SETTINGS \
112 "dead=led led_red on\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100113 "mtdids=nand0=gpmi-nand,nor0=spi3.1\0" \
114 "mtdparts=mtdparts=spi3.1: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} " \
128 "${fit_file}\0" \
129 "rescue_load_fit=ext4load mmc ${mmcdev}:${mmcrescuepart} " \
130 "${fit_addr_r} ${rescue_fit_file}\0"
Heiko Schocher57c4aad2019-12-01 11:23:30 +0100131#endif
Heiko Schocher9eca4612019-12-01 11:23:28 +0100132
Heiko Schochera051ee92019-12-01 11:23:11 +0100133#define CONFIG_EXTRA_ENV_SETTINGS \
134 "disable_giga=yes\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100135 "usb_pgood_delay=2000\0" \
136 "nor_bootdelay=-2\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100137 "script=u-boot.scr\0" \
138 "fit_file=/boot/system.itb\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100139 "rescue_fit_file=/boot/rescue.itb\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100140 "loadaddr=0x12000000\0" \
141 "fit_addr_r=0x14000000\0" \
142 "uboot=/boot/u-boot.imx\0" \
143 "uboot_sz=d0000\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100144 "panel=lb07wv8\0" \
145 "splashpos=m,m\0" \
146 "console=" CONSOLE_DEV "\0" \
147 "fdt_high=0xffffffff\0" \
148 "initrd_high=0xffffffff\0" \
149 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100150 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100151 "get_env=mw ${loadaddr} 0 0x20000;" \
152 "mmc rescan;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100153 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100154 "env import -t ${loadaddr}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100155 "default_env=gpio set wp_spi_nor.gpio-hog;" \
156 "sf probe;" \
157 "sf protect unlock 0 0x1000000;" \
158 "mw ${loadaddr} 0 0x20000;" \
159 "env export -t ${loadaddr} serial# ethaddr " \
160 "board_type panel addmisc addmiscM addmiscC addmiscD;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100161 "env default -a;" \
162 "env import -t ${loadaddr}\0" \
163 "loadbootscript=" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100164 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
165 "${script};\0" \
166 "loadbootscriptUSB=" \
167 "ext4load usb 0 ${loadaddr} ${script};\0" \
168 "loadbootscriptUSBf=" \
169 "fatload usb 0 ${loadaddr} ${script};\0" \
170 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
171 "source\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100172 "bootscript=echo Running bootscript from mmc ...; " \
173 "source\0" \
174 "mmcpart=1\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100175 "mmcrescuepart=3\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100176 "mmcdev=0\0" \
177 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
178 "mmcargs=setenv bootargs console=${console},${baudrate} " \
179 "root=${mmcroot}\0" \
180 "mmcboot=echo Booting from mmc ...; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100181 "run mmcargs addmtd addmisc;" \
182 "if test -n ${addmiscM}; then run addmiscM;fi;" \
183 "if test -n ${addmiscC}; then run addmiscC;fi;" \
184 "if test -n ${addmiscD}; then run addmiscD;fi;" \
185 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100186 "bootm ${fit_addr_r}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100187 "mmc_load_fit=ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100188 "${fit_file}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100189 "mmc_load_uboot=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100190 "${uboot}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100191 "mmc_rescue_load_fit=ext4load mmc ${mmcdev}:${mmcrescuepart} " \
192 "${fit_addr_r} ${rescue_fit_file}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100193 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
194 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
195 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
196 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
197 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
198 "sf write ${loadaddr} 400 ${filesize};" \
199 "sf read ${cmp_buf} 400 ${uboot_sz};" \
200 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100201 "rescueargs=setenv bootargs console=${console},${baudrate} " \
202 "root=/dev/ram rw\0 " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100203 "rescueboot=echo Booting rescue system ...; " \
204 "run rescueargs addmtd addmisc;" \
205 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
206 "if test -n ${addmiscM}; then run addmiscM;fi;" \
207 "if test -n ${addmiscC}; then run addmiscC;fi;" \
208 "if test -n ${addmiscD}; then run addmiscD;fi;" \
209 "run boot_board_type;" \
210 "if bootm ${fit_addr_r}; then ; " \
211 "else " \
212 "run dead; " \
213 "fi; \0" \
214 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
215 "\\\\${bootargs} " \
216 "rescueReason=18\0 " \
217 "usb_load_fit=ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
218 "usb_load_fitf=fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
219 "usb_load_rescuefit=ext4load usb 0 ${fit_addr_r} " \
220 "${rescue_fit_file}\0" \
221 "usb_load_rescuefitf=fatload usb 0 ${fit_addr_r} " \
222 "${rescue_fit_file}\0" \
223 "usbroot=/dev/sda1 rootwait rw\0" \
224 "usbboot=echo Booting from usb-stick ...; " \
225 "run usbargs addmtd addmisc;" \
226 "if test -n ${addmiscM}; then run addmiscM;fi;" \
227 "if test -n ${addmiscC}; then run addmiscC;fi;" \
228 "if test -n ${addmiscD}; then run addmiscD;fi;" \
229 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100230 "bootm ${fit_addr_r}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100231 "usbargs=setenv bootargs console=${console},${baudrate} " \
232 "root=${usbroot}\0" \
233 "mmc_rescue_boot=" \
234 "run r_reason_syserr;" \
235 "if run mmc_rescue_load_fit hab_check_file_fit; then " \
236 "run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100237 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100238 "run dead; " \
239 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
240 "fi;\0" \
241 "main_rescue_boot=" \
242 "if run main_load_fit hab_check_flash_fit; then " \
243 "if run mainboot; then ; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100244 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100245 "run r_reason_syserr;" \
246 "if run rescue_load_fit hab_check_file_fit;" \
247 "then run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100248 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100249 "run dead; " \
250 "echo RESCUE SYSTEM BOOT FAILURE;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100251 "fi; " \
252 "fi; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100253 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100254 "run r_reason_syserr;" \
255 "if run rescue_load_fit hab_check_file_fit; then " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100256 "run rescueboot; " \
257 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100258 "run dead; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100259 "echo RESCUE SYSTEM BOOT FAILURE;" \
260 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100261 "fi;\0" \
262 "usb_mmc_rescue_boot=" \
263 "usb start;" \
264 "if usb storage; then " \
265 "if run loadbootscriptUSB " \
266 "hab_check_file_bootscript;" \
267 "then run bootscriptUSB; " \
268 "fi; " \
269 "if run loadbootscriptUSBf " \
270 "hab_check_file_bootscript;" \
271 "then run bootscriptUSB; " \
272 "fi; " \
273 "if run usb_load_fit hab_check_file_fit; then " \
274 "run usbboot; " \
275 "fi; " \
276 "if run usb_load_fitf hab_check_file_fit; then " \
277 "run usbboot; " \
278 "fi; "\
279 "if run usb_load_rescuefit hab_check_file_fit;" \
280 "then run r_reason_syserr rescueboot;" \
281 "fi; " \
282 "if run usb_load_rescuefitf hab_check_file_fit;" \
283 "then run r_reason_syserr rescueboot;" \
284 "fi; " \
285 "run mmc_rescue_boot;" \
286 "fi; "\
287 "run mmc_rescue_boot;\0" \
288 "rescue_xload_boot=" \
289 "run r_reason_syserr;" \
290 "if test ${bootmode} -ne 0 ; then " \
291 "mmc dev ${mmcdev};" \
292 "if mmc rescan; then " \
293 "if run mmc_rescue_load_fit " \
294 "hab_check_file_fit; then " \
295 "run rescueboot; " \
296 "else " \
297 "usb start;" \
298 "if usb storage; then " \
299 "if run usb_load_rescuefit " \
300 "hab_check_file_fit;"\
301 "then " \
302 "run rescueboot;" \
303 "fi; " \
304 "if run usb_load_rescuefitf "\
305 "hab_check_file_fit;"\
306 "then " \
307 "run rescueboot;" \
308 "fi; " \
309 "fi;" \
310 "fi;" \
311 "run dead; " \
312 "echo RESCUE SYSTEM ON SD OR " \
313 "USB BOOT FAILURE;" \
314 "else " \
315 "usb start;" \
316 "if usb storage; then " \
317 "if run usb_load_rescuefit " \
318 "hab_check_file_fit; then " \
319 "run rescueboot;" \
320 "fi; " \
321 "if run usb_load_rescuefitf " \
322 "hab_check_file_fit; then " \
323 "run rescueboot;" \
324 "fi; " \
325 "fi;" \
326 "run dead; " \
327 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
328 "fi; " \
329 "else "\
330 "if run rescue_load_fit hab_check_file_fit; then " \
331 "run rescueboot; " \
332 "else " \
333 "run dead; " \
334 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
335 "fi; " \
336 "fi;\0" \
337 "ari_boot=if test ${bootmode} -ne 0 ; then " \
338 "mmc dev ${mmcdev};" \
339 "if mmc rescan; then " \
340 "if run loadbootscript hab_check_file_bootscript;" \
341 "then run bootscript; " \
342 "fi; " \
343 "if run mmc_load_fit hab_check_file_fit; then " \
344 "if run mmcboot; then ; " \
345 "else " \
346 "run mmc_rescue_boot;" \
347 "fi; " \
348 "else " \
349 "run usb_mmc_rescue_boot;" \
350 "fi; " \
351 "else " \
352 "run usb_mmc_rescue_boot;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100353 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100354 "else "\
355 "run main_rescue_boot;" \
356 "fi; \0"\
Heiko Schocher19c3cd92019-12-01 11:23:29 +0100357 HAB_EXTRA_SETTINGS \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100358 CONFIG_EXTRA_ENV_BOARD_SETTINGS
Heiko Schochera051ee92019-12-01 11:23:11 +0100359
360#define CONFIG_ARP_TIMEOUT 200UL
361
362#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM
363#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x100000)
364#define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
365
366/* Physical Memory Map */
367#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
368
369#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
370#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
371#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
372
373#define CONFIG_SYS_INIT_SP_OFFSET \
374 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
375#define CONFIG_SYS_INIT_SP_ADDR \
376 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
377
378#define CONFIG_SYS_FSL_USDHC_NUM 2
379
Heiko Schochera051ee92019-12-01 11:23:11 +0100380/* NAND stuff */
381#define CONFIG_SYS_MAX_NAND_DEVICE 1
382#define CONFIG_SYS_NAND_BASE 0x40000000
383#define CONFIG_SYS_NAND_5_ADDR_CYCLE
384#define CONFIG_SYS_NAND_ONFI_DETECTION
385
386/* DMA stuff, needed for GPMI/MXS NAND support */
387
Heiko Schochera051ee92019-12-01 11:23:11 +0100388/* USB Configs */
Heiko Schochera051ee92019-12-01 11:23:11 +0100389#define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
390#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
391#define CONFIG_MXC_USB_FLAGS 0
392
393/* UBI support */
394
395/* Framebuffer */
396/* check this console not needed, after test remove it */
Heiko Schochera051ee92019-12-01 11:23:11 +0100397#define CONFIG_SPLASH_SCREEN
398#define CONFIG_SPLASH_SCREEN_ALIGN
Heiko Schocher8f4a1b92019-12-01 11:23:19 +0100399#define CONFIG_IMX_VIDEO_SKIP
Heiko Schochera051ee92019-12-01 11:23:11 +0100400#define CONFIG_VIDEO_LOGO
401#define CONFIG_VIDEO_BMP_LOGO
Heiko Schocher8f4a1b92019-12-01 11:23:19 +0100402#define CONFIG_BMP_16BPP
403#define CONFIG_VIDEO_BMP_RLE8
Heiko Schochera051ee92019-12-01 11:23:11 +0100404
405#define CONFIG_IMX6_PWM_PER_CLK 66000000
406
Heiko Schocher05729822015-05-18 13:32:31 +0200407#endif /* __ARISTAINETOS2_CONFIG_H */