1 /*
2  * Copyright (C) 2014 Eukréa Electromatique
3  * Author: Eric Bénard <eric@eukrea.com>
4  *
5  * Configuration settings for the Embest RIoTboard
6  *
7  * based on mx6*sabre*.h which are :
8  * Copyright (C) 2012 Freescale Semiconductor, Inc.
9  *
10  * SPDX-License-Identifier:	GPL-2.0+
11  */
12 
13 #ifndef __RIOTBOARD_CONFIG_H
14 #define __RIOTBOARD_CONFIG_H
15 
16 #include <asm/arch/imx-regs.h>
17 #include <asm/imx-common/gpio.h>
18 
19 #include "mx6_common.h"
20 #include <linux/sizes.h>
21 
22 #define CONFIG_SYS_GENERIC_BOARD
23 
24 #define CONFIG_MXC_UART_BASE		UART2_BASE
25 #define CONFIG_CONSOLE_DEV		"ttymxc1"
26 #define CONFIG_MMCROOT			"/dev/mmcblk1p2"
27 
28 #define PHYS_SDRAM_SIZE		(1u * 1024 * 1024 * 1024)
29 
30 #define CONFIG_MX6
31 
32 #define CONFIG_DISPLAY_CPUINFO
33 #define CONFIG_DISPLAY_BOARDINFO
34 
35 #define CONFIG_CMDLINE_TAG
36 #define CONFIG_SETUP_MEMORY_TAGS
37 #define CONFIG_INITRD_TAG
38 #define CONFIG_REVISION_TAG
39 
40 /* Size of malloc() pool */
41 #define CONFIG_SYS_MALLOC_LEN		(10 * SZ_1M)
42 
43 #define CONFIG_BOARD_EARLY_INIT_F
44 #define CONFIG_BOARD_LATE_INIT
45 #define CONFIG_MXC_GPIO
46 
47 #define CONFIG_MXC_UART
48 
49 #define CONFIG_CMD_FUSE
50 #ifdef CONFIG_CMD_FUSE
51 #define CONFIG_MXC_OCOTP
52 #endif
53 
54 /* I2C Configs */
55 #define CONFIG_CMD_I2C
56 #define CONFIG_SYS_I2C
57 #define CONFIG_SYS_I2C_MXC
58 #define CONFIG_SYS_I2C_MXC_I2C3		/* enable I2C bus 3 */
59 #define CONFIG_SYS_I2C_SPEED		100000
60 
61 /* USB Configs */
62 #define CONFIG_CMD_USB
63 #define CONFIG_USB_EHCI
64 #define CONFIG_USB_EHCI_MX6
65 #define CONFIG_USB_STORAGE
66 #define CONFIG_USB_HOST_ETHER
67 #define CONFIG_USB_ETHER_ASIX
68 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
69 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET	/* For OTG port */
70 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
71 #define CONFIG_MXC_USB_FLAGS	0
72 
73 /* MMC Configs */
74 #define CONFIG_FSL_ESDHC
75 #define CONFIG_FSL_USDHC
76 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
77 
78 #define CONFIG_MMC
79 #define CONFIG_CMD_MMC
80 #define CONFIG_GENERIC_MMC
81 #define CONFIG_BOUNCE_BUFFER
82 
83 #define CONFIG_FEC_MXC
84 #define CONFIG_MII
85 #define IMX_FEC_BASE			ENET_BASE_ADDR
86 #define CONFIG_FEC_XCV_TYPE		RGMII
87 #define CONFIG_ETHPRIME			"FEC"
88 #define CONFIG_FEC_MXC_PHYADDR		4
89 
90 #define CONFIG_PHYLIB
91 #define CONFIG_PHY_ATHEROS
92 
93 #define CONFIG_CMD_SF
94 #ifdef CONFIG_CMD_SF
95 #define CONFIG_SPI_FLASH
96 #define CONFIG_SPI_FLASH_SST
97 #define CONFIG_MXC_SPI
98 #define CONFIG_SF_DEFAULT_BUS		0
99 #define CONFIG_SF_DEFAULT_CS		0
100 #define CONFIG_SF_DEFAULT_SPEED		20000000
101 #define CONFIG_SF_DEFAULT_MODE		SPI_MODE_0
102 #endif
103 
104 /* allow to overwrite serial and ethaddr */
105 #define CONFIG_ENV_OVERWRITE
106 #define CONFIG_CONS_INDEX              1
107 #define CONFIG_BAUDRATE                        115200
108 
109 /* Command definition */
110 #include <config_cmd_default.h>
111 #undef CONFIG_CMD_FPGA
112 
113 #define CONFIG_CMD_BMODE
114 #define CONFIG_CMD_SETEXPR
115 #undef CONFIG_CMD_IMLS
116 
117 #define CONFIG_LOADADDR                        0x12000000
118 #define CONFIG_SYS_TEXT_BASE           0x17800000
119 
120 #define CONFIG_ARP_TIMEOUT     200UL
121 
122 /* Miscellaneous configurable options */
123 #define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
124 #define CONFIG_SYS_CBSIZE              256
125 
126 /* Print Buffer Size */
127 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
128 #define CONFIG_SYS_MAXARGS             16
129 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
130 
131 #define CONFIG_SYS_MEMTEST_START       0x10000000
132 #define CONFIG_SYS_MEMTEST_END         0x10010000
133 #define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
134 
135 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
136 
137 #define CONFIG_STACKSIZE               (128 * 1024)
138 
139 /* Physical Memory Map */
140 #define CONFIG_NR_DRAM_BANKS           1
141 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
142 
143 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
144 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
145 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
146 
147 #define CONFIG_SYS_INIT_SP_OFFSET \
148 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
149 #define CONFIG_SYS_INIT_SP_ADDR \
150 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
151 
152 /* FLASH and environment organization */
153 #define CONFIG_SYS_NO_FLASH
154 
155 #define CONFIG_ENV_SIZE			(8 * 1024)
156 
157 #if defined(CONFIG_ENV_IS_IN_MMC)
158 /* RiOTboard */
159 #define CONFIG_FDTFILE	"imx6dl-riotboard.dtb"
160 #define CONFIG_SYS_FSL_USDHC_NUM	3
161 #define CONFIG_SYS_MMC_ENV_DEV		2	/* SDHC4 */
162 #define CONFIG_ENV_OFFSET		(6 * 64 * 1024)
163 #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
164 #elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
165 /* MarSBoard */
166 #define CONFIG_FDTFILE	"imx6q-marsboard.dtb"
167 #define CONFIG_SYS_FSL_USDHC_NUM	2
168 #define CONFIG_ENV_OFFSET		(768 * 1024)
169 #define CONFIG_ENV_SECT_SIZE		(8 * 1024)
170 #define CONFIG_ENV_SPI_BUS		CONFIG_SF_DEFAULT_BUS
171 #define CONFIG_ENV_SPI_CS		CONFIG_SF_DEFAULT_CS
172 #define CONFIG_ENV_SPI_MODE		CONFIG_SF_DEFAULT_MODE
173 #define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
174 #endif
175 
176 #ifndef CONFIG_SYS_DCACHE_OFF
177 #define CONFIG_CMD_CACHE
178 #endif
179 
180 /* Framebuffer */
181 #define CONFIG_VIDEO
182 #define CONFIG_VIDEO_IPUV3
183 #define CONFIG_CFB_CONSOLE
184 #define CONFIG_VGA_AS_SINGLE_DEVICE
185 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
186 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
187 #define CONFIG_VIDEO_BMP_RLE8
188 #define CONFIG_SPLASH_SCREEN
189 #define CONFIG_SPLASH_SCREEN_ALIGN
190 #define CONFIG_BMP_16BPP
191 #define CONFIG_VIDEO_LOGO
192 #define CONFIG_VIDEO_BMP_LOGO
193 #define CONFIG_IPUV3_CLK 260000000
194 #define CONFIG_IMX_HDMI
195 #define CONFIG_IMX_VIDEO_SKIP
196 
197 #include <config_distro_defaults.h>
198 
199 /* 256M RAM (minimum), 32M uncompressed kernel, 16M compressed kernel, 1M fdt,
200  * 1M script, 1M pxe and the ramdisk at the end */
201 #define MEM_LAYOUT_ENV_SETTINGS \
202 	"bootm_size=0x10000000\0" \
203 	"kernel_addr_r=0x12000000\0" \
204 	"fdt_addr_r=0x13000000\0" \
205 	"scriptaddr=0x13100000\0" \
206 	"pxefile_addr_r=0x13200000\0" \
207 	"ramdisk_addr_r=0x13300000\0"
208 
209 #define BOOT_TARGET_DEVICES(func) \
210 	func(MMC, mmc, 0) \
211 	func(MMC, mmc, 1) \
212 	func(MMC, mmc, 2) \
213 	func(USB, usb, 0) \
214 	func(PXE, pxe, na) \
215 	func(DHCP, dhcp, na)
216 
217 #include <config_distro_bootcmd.h>
218 
219 #define CONSOLE_STDIN_SETTINGS \
220 	"stdin=serial\0"
221 
222 #define CONSOLE_STDOUT_SETTINGS \
223 	"stdout=serial\0" \
224 	"stderr=serial\0"
225 
226 #define CONSOLE_ENV_SETTINGS \
227 	CONSOLE_STDIN_SETTINGS \
228 	CONSOLE_STDOUT_SETTINGS
229 
230 #define CONFIG_EXTRA_ENV_SETTINGS \
231 	CONSOLE_ENV_SETTINGS \
232 	MEM_LAYOUT_ENV_SETTINGS \
233 	"fdtfile=" CONFIG_FDTFILE "\0" \
234 	BOOTENV
235 
236 #endif                         /* __RIOTBOARD_CONFIG_H */
237