blob: fba26d01516380b1588fd06a90f82c3897afd767 [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 Schocher9eca4612019-12-01 11:23:28 +010039#define CONFIG_EXTRA_ENV_BOARD_SETTINGS \
40 "dead=led led_red on\0" \
41 "mtdids=nand0=gpmi-nand,nor0=spi3.1\0" \
42 "mtdparts=mtdparts=spi3.1:832k(u-boot),64k(env),64k(env-red)," \
43 "-(ubi-nor);gpmi-nand:-(ubi)\0" \
44 "addmisc=setenv bootargs ${bootargs} net.ifnames=0 consoleblank=0 " \
45 "bootmode=${bootmode} mmcpart=${mmcpart}\0" \
46 "mainboot=echo Booting from SD-card ...; " \
47 "run mainargs addmtd addmisc;" \
48 "if test -n ${addmiscM}; then run addmiscM;fi;" \
49 "if test -n ${addmiscC}; then run addmiscC;fi;" \
50 "if test -n ${addmiscD}; then run addmiscD;fi;" \
51 "run boot_board_type;" \
52 "bootm ${fit_addr_r}\0" \
53 "mainargs=setenv bootargs console=${console},${baudrate} " \
54 "root=${mmcroot}\0" \
55 "main_load_fit=ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
56 "${fit_file}\0" \
57 "rescue_load_fit=ext4load mmc ${mmcdev}:${mmcrescuepart} " \
58 "${fit_addr_r} ${rescue_fit_file}\0"
59
Heiko Schochera051ee92019-12-01 11:23:11 +010060#define CONFIG_EXTRA_ENV_SETTINGS \
61 "disable_giga=yes\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +010062 "usb_pgood_delay=2000\0" \
63 "nor_bootdelay=-2\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +010064 "script=u-boot.scr\0" \
65 "fit_file=/boot/system.itb\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +010066 "rescue_fit_file=/boot/rescue.itb\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +010067 "loadaddr=0x12000000\0" \
68 "fit_addr_r=0x14000000\0" \
69 "uboot=/boot/u-boot.imx\0" \
70 "uboot_sz=d0000\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +010071 "panel=lb07wv8\0" \
72 "splashpos=m,m\0" \
73 "console=" CONSOLE_DEV "\0" \
74 "fdt_high=0xffffffff\0" \
75 "initrd_high=0xffffffff\0" \
76 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +010077 "boot_board_type=bootm ${fit_addr_r}#${board_type}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +010078 "get_env=mw ${loadaddr} 0 0x20000;" \
79 "mmc rescan;" \
Heiko Schocher9eca4612019-12-01 11:23:28 +010080 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} env.txt;" \
Heiko Schochera051ee92019-12-01 11:23:11 +010081 "env import -t ${loadaddr}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +010082 "default_env=gpio set wp_spi_nor.gpio-hog;" \
83 "sf probe;" \
84 "sf protect unlock 0 0x1000000;" \
85 "mw ${loadaddr} 0 0x20000;" \
86 "env export -t ${loadaddr} serial# ethaddr " \
87 "board_type panel addmisc addmiscM addmiscC addmiscD;" \
Heiko Schochera051ee92019-12-01 11:23:11 +010088 "env default -a;" \
89 "env import -t ${loadaddr}\0" \
90 "loadbootscript=" \
Heiko Schocher9eca4612019-12-01 11:23:28 +010091 "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
92 "${script};\0" \
93 "loadbootscriptUSB=" \
94 "ext4load usb 0 ${loadaddr} ${script};\0" \
95 "loadbootscriptUSBf=" \
96 "fatload usb 0 ${loadaddr} ${script};\0" \
97 "bootscriptUSB=echo Running bootscript from usb-stick ...; " \
98 "source\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +010099 "bootscript=echo Running bootscript from mmc ...; " \
100 "source\0" \
101 "mmcpart=1\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100102 "mmcrescuepart=3\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100103 "mmcdev=0\0" \
104 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
105 "mmcargs=setenv bootargs console=${console},${baudrate} " \
106 "root=${mmcroot}\0" \
107 "mmcboot=echo Booting from mmc ...; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100108 "run mmcargs addmtd addmisc;" \
109 "if test -n ${addmiscM}; then run addmiscM;fi;" \
110 "if test -n ${addmiscC}; then run addmiscC;fi;" \
111 "if test -n ${addmiscD}; then run addmiscD;fi;" \
112 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100113 "bootm ${fit_addr_r}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100114 "mmc_load_fit=ext4load mmc ${mmcdev}:${mmcpart} ${fit_addr_r} " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100115 "${fit_file}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100116 "mmc_load_uboot=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100117 "${uboot}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100118 "mmc_rescue_load_fit=ext4load mmc ${mmcdev}:${mmcrescuepart} " \
119 "${fit_addr_r} ${rescue_fit_file}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100120 "mmc_upd_uboot=mw.b ${loadaddr} 0xff ${uboot_sz};" \
121 "setexpr cmp_buf ${loadaddr} + ${uboot_sz};" \
122 "setexpr uboot_maxsize ${uboot_sz} - 400;" \
123 "mw.b ${cmp_buf} 0x00 ${uboot_sz};" \
124 "run mmc_load_uboot;sf probe;sf erase 0 ${uboot_sz};" \
125 "sf write ${loadaddr} 400 ${filesize};" \
126 "sf read ${cmp_buf} 400 ${uboot_sz};" \
127 "cmp.b ${loadaddr} ${cmp_buf} ${uboot_maxsize}\0" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100128 "rescueargs=setenv bootargs console=${console},${baudrate} " \
129 "root=/dev/ram rw\0 " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100130 "rescueboot=echo Booting rescue system ...; " \
131 "run rescueargs addmtd addmisc;" \
132 "if test -n ${rescue_reason}; then run rescue_reason;fi;" \
133 "if test -n ${addmiscM}; then run addmiscM;fi;" \
134 "if test -n ${addmiscC}; then run addmiscC;fi;" \
135 "if test -n ${addmiscD}; then run addmiscD;fi;" \
136 "run boot_board_type;" \
137 "if bootm ${fit_addr_r}; then ; " \
138 "else " \
139 "run dead; " \
140 "fi; \0" \
141 "r_reason_syserr=setenv rescue_reason setenv bootargs " \
142 "\\\\${bootargs} " \
143 "rescueReason=18\0 " \
144 "usb_load_fit=ext4load usb 0 ${fit_addr_r} ${fit_file}\0" \
145 "usb_load_fitf=fatload usb 0 ${fit_addr_r} ${fit_file}\0" \
146 "usb_load_rescuefit=ext4load usb 0 ${fit_addr_r} " \
147 "${rescue_fit_file}\0" \
148 "usb_load_rescuefitf=fatload usb 0 ${fit_addr_r} " \
149 "${rescue_fit_file}\0" \
150 "usbroot=/dev/sda1 rootwait rw\0" \
151 "usbboot=echo Booting from usb-stick ...; " \
152 "run usbargs addmtd addmisc;" \
153 "if test -n ${addmiscM}; then run addmiscM;fi;" \
154 "if test -n ${addmiscC}; then run addmiscC;fi;" \
155 "if test -n ${addmiscD}; then run addmiscD;fi;" \
156 "run boot_board_type;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100157 "bootm ${fit_addr_r}\0" \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100158 "usbargs=setenv bootargs console=${console},${baudrate} " \
159 "root=${usbroot}\0" \
160 "mmc_rescue_boot=" \
161 "run r_reason_syserr;" \
162 "if run mmc_rescue_load_fit hab_check_file_fit; then " \
163 "run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100164 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100165 "run dead; " \
166 "echo RESCUE SYSTEM FROM SD-CARD BOOT FAILURE;" \
167 "fi;\0" \
168 "main_rescue_boot=" \
169 "if run main_load_fit hab_check_flash_fit; then " \
170 "if run mainboot; then ; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100171 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100172 "run r_reason_syserr;" \
173 "if run rescue_load_fit hab_check_file_fit;" \
174 "then run rescueboot; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100175 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100176 "run dead; " \
177 "echo RESCUE SYSTEM BOOT FAILURE;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100178 "fi; " \
179 "fi; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100180 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100181 "run r_reason_syserr;" \
182 "if run rescue_load_fit hab_check_file_fit; then " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100183 "run rescueboot; " \
184 "else " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100185 "run dead; " \
Heiko Schochera051ee92019-12-01 11:23:11 +0100186 "echo RESCUE SYSTEM BOOT FAILURE;" \
187 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100188 "fi;\0" \
189 "usb_mmc_rescue_boot=" \
190 "usb start;" \
191 "if usb storage; then " \
192 "if run loadbootscriptUSB " \
193 "hab_check_file_bootscript;" \
194 "then run bootscriptUSB; " \
195 "fi; " \
196 "if run loadbootscriptUSBf " \
197 "hab_check_file_bootscript;" \
198 "then run bootscriptUSB; " \
199 "fi; " \
200 "if run usb_load_fit hab_check_file_fit; then " \
201 "run usbboot; " \
202 "fi; " \
203 "if run usb_load_fitf hab_check_file_fit; then " \
204 "run usbboot; " \
205 "fi; "\
206 "if run usb_load_rescuefit hab_check_file_fit;" \
207 "then run r_reason_syserr rescueboot;" \
208 "fi; " \
209 "if run usb_load_rescuefitf hab_check_file_fit;" \
210 "then run r_reason_syserr rescueboot;" \
211 "fi; " \
212 "run mmc_rescue_boot;" \
213 "fi; "\
214 "run mmc_rescue_boot;\0" \
215 "rescue_xload_boot=" \
216 "run r_reason_syserr;" \
217 "if test ${bootmode} -ne 0 ; then " \
218 "mmc dev ${mmcdev};" \
219 "if mmc rescan; then " \
220 "if run mmc_rescue_load_fit " \
221 "hab_check_file_fit; then " \
222 "run rescueboot; " \
223 "else " \
224 "usb start;" \
225 "if usb storage; then " \
226 "if run usb_load_rescuefit " \
227 "hab_check_file_fit;"\
228 "then " \
229 "run rescueboot;" \
230 "fi; " \
231 "if run usb_load_rescuefitf "\
232 "hab_check_file_fit;"\
233 "then " \
234 "run rescueboot;" \
235 "fi; " \
236 "fi;" \
237 "fi;" \
238 "run dead; " \
239 "echo RESCUE SYSTEM ON SD OR " \
240 "USB BOOT FAILURE;" \
241 "else " \
242 "usb start;" \
243 "if usb storage; then " \
244 "if run usb_load_rescuefit " \
245 "hab_check_file_fit; then " \
246 "run rescueboot;" \
247 "fi; " \
248 "if run usb_load_rescuefitf " \
249 "hab_check_file_fit; then " \
250 "run rescueboot;" \
251 "fi; " \
252 "fi;" \
253 "run dead; " \
254 "echo RESCUE SYSTEM ON USB BOOT FAILURE;" \
255 "fi; " \
256 "else "\
257 "if run rescue_load_fit hab_check_file_fit; then " \
258 "run rescueboot; " \
259 "else " \
260 "run dead; " \
261 "echo RESCUE SYSTEM ON BOARD BOOT FAILURE;" \
262 "fi; " \
263 "fi;\0" \
264 "ari_boot=if test ${bootmode} -ne 0 ; then " \
265 "mmc dev ${mmcdev};" \
266 "if mmc rescan; then " \
267 "if run loadbootscript hab_check_file_bootscript;" \
268 "then run bootscript; " \
269 "fi; " \
270 "if run mmc_load_fit hab_check_file_fit; then " \
271 "if run mmcboot; then ; " \
272 "else " \
273 "run mmc_rescue_boot;" \
274 "fi; " \
275 "else " \
276 "run usb_mmc_rescue_boot;" \
277 "fi; " \
278 "else " \
279 "run usb_mmc_rescue_boot;" \
Heiko Schochera051ee92019-12-01 11:23:11 +0100280 "fi; " \
Heiko Schocher9eca4612019-12-01 11:23:28 +0100281 "else "\
282 "run main_rescue_boot;" \
283 "fi; \0"\
284 CONFIG_EXTRA_ENV_BOARD_SETTINGS
Heiko Schochera051ee92019-12-01 11:23:11 +0100285
286#define CONFIG_ARP_TIMEOUT 200UL
287
288#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM
289#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x100000)
290#define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
291
292/* Physical Memory Map */
293#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
294
295#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
296#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
297#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
298
299#define CONFIG_SYS_INIT_SP_OFFSET \
300 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
301#define CONFIG_SYS_INIT_SP_ADDR \
302 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
303
304#define CONFIG_SYS_FSL_USDHC_NUM 2
305
Heiko Schochera051ee92019-12-01 11:23:11 +0100306/* NAND stuff */
307#define CONFIG_SYS_MAX_NAND_DEVICE 1
308#define CONFIG_SYS_NAND_BASE 0x40000000
309#define CONFIG_SYS_NAND_5_ADDR_CYCLE
310#define CONFIG_SYS_NAND_ONFI_DETECTION
311
312/* DMA stuff, needed for GPMI/MXS NAND support */
313
Heiko Schochera051ee92019-12-01 11:23:11 +0100314/* USB Configs */
Heiko Schochera051ee92019-12-01 11:23:11 +0100315#define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
316#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
317#define CONFIG_MXC_USB_FLAGS 0
318
319/* UBI support */
320
321/* Framebuffer */
322/* check this console not needed, after test remove it */
Heiko Schochera051ee92019-12-01 11:23:11 +0100323#define CONFIG_SPLASH_SCREEN
324#define CONFIG_SPLASH_SCREEN_ALIGN
Heiko Schocher8f4a1b92019-12-01 11:23:19 +0100325#define CONFIG_IMX_VIDEO_SKIP
Heiko Schochera051ee92019-12-01 11:23:11 +0100326#define CONFIG_VIDEO_LOGO
327#define CONFIG_VIDEO_BMP_LOGO
Heiko Schocher8f4a1b92019-12-01 11:23:19 +0100328#define CONFIG_BMP_16BPP
329#define CONFIG_VIDEO_BMP_RLE8
Heiko Schochera051ee92019-12-01 11:23:11 +0100330
331#define CONFIG_IMX6_PWM_PER_CLK 66000000
332
Heiko Schocher05729822015-05-18 13:32:31 +0200333#endif /* __ARISTAINETOS2_CONFIG_H */