xref: /openbmc/u-boot/include/configs/titanium.h (revision 60570df1)
1 /*
2  * Copyright (C) 2013 Stefan Roese <sr@denx.de>
3  *
4  * Configuration settings for the ProjectionDesign / Barco
5  * Titanium board.
6  *
7  * Based on mx6qsabrelite.h which is:
8  * Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
9  *
10  * SPDX-License-Identifier:	GPL-2.0+
11  */
12 
13 #ifndef __CONFIG_H
14 #define __CONFIG_H
15 
16 #include "mx6_common.h"
17 #include <asm/arch/imx-regs.h>
18 #include <asm/imx-common/gpio.h>
19 
20 #define CONFIG_MX6
21 #define CONFIG_MX6Q
22 #define CONFIG_DISPLAY_CPUINFO
23 #define CONFIG_DISPLAY_BOARDINFO
24 
25 #define MACH_TYPE_TITANIUM		3769
26 #define CONFIG_MACH_TYPE		MACH_TYPE_TITANIUM
27 
28 #define CONFIG_CMDLINE_TAG
29 #define CONFIG_SETUP_MEMORY_TAGS
30 #define CONFIG_INITRD_TAG
31 #define CONFIG_REVISION_TAG
32 
33 /* Size of malloc() pool */
34 #define CONFIG_SYS_MALLOC_LEN		(2 * 1024 * 1024)
35 
36 #define CONFIG_BOARD_EARLY_INIT_F
37 #define CONFIG_MISC_INIT_R
38 #define CONFIG_MXC_GPIO
39 
40 #define CONFIG_MXC_UART
41 #define CONFIG_MXC_UART_BASE		UART1_BASE
42 
43 /* I2C Configs */
44 #define CONFIG_CMD_I2C
45 #define CONFIG_SYS_I2C
46 #define CONFIG_SYS_I2C_MXC
47 #define CONFIG_SYS_I2C_MXC_I2C3		/* enable I2C bus 3 */
48 #define CONFIG_SYS_I2C_SPEED		100000
49 
50 /* MMC Configs */
51 #define CONFIG_FSL_ESDHC
52 #define CONFIG_FSL_USDHC
53 #define CONFIG_SYS_FSL_ESDHC_ADDR	0
54 #define CONFIG_SYS_FSL_USDHC_NUM	1
55 
56 #define CONFIG_MMC
57 #define CONFIG_CMD_MMC
58 #define CONFIG_GENERIC_MMC
59 #define CONFIG_BOUNCE_BUFFER
60 #define CONFIG_CMD_EXT2
61 #define CONFIG_CMD_FAT
62 #define CONFIG_DOS_PARTITION
63 
64 #define CONFIG_CMD_PING
65 #define CONFIG_CMD_DHCP
66 #define CONFIG_CMD_MII
67 #define CONFIG_CMD_NET
68 #define CONFIG_FEC_MXC
69 #define CONFIG_MII
70 #define IMX_FEC_BASE			ENET_BASE_ADDR
71 #define CONFIG_FEC_XCV_TYPE		RGMII
72 #define CONFIG_FEC_MXC_PHYADDR		4
73 #define CONFIG_PHYLIB
74 #define CONFIG_PHY_MICREL
75 #define CONFIG_PHY_MICREL_KSZ9021
76 
77 /* USB Configs */
78 #define CONFIG_CMD_USB
79 #define CONFIG_CMD_FAT
80 #define CONFIG_USB_EHCI
81 #define CONFIG_USB_EHCI_MX6
82 #define CONFIG_USB_STORAGE
83 #define CONFIG_MXC_USB_PORT	1
84 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
85 #define CONFIG_MXC_USB_FLAGS	0
86 
87 /* Miscellaneous commands */
88 #define CONFIG_CMD_BMODE
89 
90 /* allow to overwrite serial and ethaddr */
91 #define CONFIG_ENV_OVERWRITE
92 #define CONFIG_CONS_INDEX		1
93 #define CONFIG_BAUDRATE			115200
94 
95 /* Command definition */
96 #include <config_cmd_default.h>
97 
98 #undef CONFIG_CMD_IMLS
99 
100 #define CONFIG_BOOTDELAY		3
101 
102 #define CONFIG_LOADADDR			0x12000000
103 #define CONFIG_SYS_TEXT_BASE		0x17800000
104 
105 #define CONFIG_SYS_MEMTEST_START	0x10000000
106 #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + (500 << 20))
107 
108 #define CONFIG_HOSTNAME			titanium
109 #define CONFIG_UBI_PART			ubi
110 #define CONFIG_UBIFS_VOLUME		rootfs0
111 
112 #define MTDIDS_DEFAULT		"nand0=gpmi-nand"
113 #define MTDPARTS_DEFAULT	"mtdparts=gpmi-nand:16M(uboot),512k(env1)," \
114 				"512k(env2),-(ubi)"
115 
116 #define CONFIG_EXTRA_ENV_SETTINGS \
117 	"kernel=" __stringify(CONFIG_HOSTNAME) "/uImage\0"		\
118 	"kernel_fs=/boot/uImage\0"					\
119 	"kernel_addr=11000000\0"					\
120 	"dtb=" __stringify(CONFIG_HOSTNAME) "/"				\
121 		__stringify(CONFIG_HOSTNAME) ".dtb\0"			\
122 	"dtb_fs=/boot/" __stringify(CONFIG_HOSTNAME) ".dtb\0"		\
123 	"dtb_addr=12800000\0"						\
124 	"script=boot.scr\0" \
125 	"uimage=uImage\0" \
126 	"console=ttymxc0\0" \
127 	"baudrate=115200\0" \
128 	"fdt_high=0xffffffff\0"	  \
129 	"initrd_high=0xffffffff\0" \
130 	"mmcdev=0\0" \
131 	"mmcpart=1\0" \
132 	"uimage=uImage\0" \
133 	"loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr}" \
134 		" ${script}\0" \
135 	"bootscript=echo Running bootscript from mmc ...; source\0" \
136 	"loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
137 	"mmcroot=/dev/mmcblk0p2\0" \
138 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
139 		"root=${mmcroot} rootwait rw\0" \
140 	"bootmmc=run mmcargs; fatload mmc ${mmcdev}:${mmcpart} ${loadaddr}" \
141 		" ${uimage}; bootm\0" \
142 	"addip=setenv bootargs ${bootargs} "				\
143 		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"	\
144 		":${hostname}:${netdev}:off panic=1\0"			\
145 	"addcon=setenv bootargs ${bootargs} console=ttymxc0,"		\
146 		"${baudrate}\0"						\
147 	"addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"		\
148 	"rootpath=/opt/eldk-5.3/armv7a/rootfs-minimal-mtdutils\0"	\
149 	"nfsargs=setenv bootargs root=/dev/nfs rw "			\
150 		"nfsroot=${serverip}:${rootpath}\0"			\
151 	"ubifs=" __stringify(CONFIG_HOSTNAME) "/ubifs.img\0"		\
152 	"part=" __stringify(CONFIG_UBI_PART) "\0"			\
153 	"boot_vol=0\0"							\
154 	"vol=" __stringify(CONFIG_UBIFS_VOLUME) "\0"			\
155 	"load_ubifs=tftp ${kernel_addr} ${ubifs}\0"			\
156 	"update_ubifs=ubi part ${part};ubi write ${kernel_addr} ${vol}"	\
157 		" ${filesize}\0"					\
158 	"upd_ubifs=run load_ubifs update_ubifs\0"			\
159 	"init_ubi=nand erase.part ubi;ubi part ${part};"		\
160 		"ubi create ${vol} c800000\0"				\
161 	"mtdids=" MTDIDS_DEFAULT "\0"					\
162 	"mtdparts=" MTDPARTS_DEFAULT "\0"				\
163 	"nand_ubifs=run ubifs_mount ubifs_load ubifsargs addip"		\
164 		" addcon addmtd;"					\
165 		"bootm ${kernel_addr} - ${dtb_addr}\0"			\
166 	"ubifsargs=set bootargs ubi.mtd=ubi "				\
167 		"root=ubi:rootfs${boot_vol} rootfstype=ubifs\0"		\
168 	"ubifs_mount=ubi part ubi;ubifsmount ubi:rootfs${boot_vol}\0"	\
169 	"ubifs_load=ubifsload ${kernel_addr} ${kernel_fs};"		\
170 		"ubifsload ${dtb_addr} ${dtb_fs};\0"			\
171 	"nand_ubifs=run ubifs_mount ubifs_load ubifsargs addip addcon "	\
172 		"addmtd;bootm ${kernel_addr} - ${dtb_addr}\0"		\
173 	"load_kernel=tftp ${kernel_addr} ${kernel}\0"			\
174 	"load_dtb=tftp ${dtb_addr} ${dtb}\0"				\
175 	"net_nfs=run load_dtb load_kernel; "				\
176 		"run nfsargs addip addcon addmtd;"			\
177 		"bootm ${kernel_addr} - ${dtb_addr}\0"			\
178 	"delenv=env default -a -f; saveenv; reset\0"
179 
180 #define CONFIG_BOOTCOMMAND		"run nand_ubifs"
181 
182 /* Miscellaneous configurable options */
183 #define CONFIG_SYS_LONGHELP
184 #define CONFIG_SYS_HUSH_PARSER
185 #define CONFIG_SYS_PROMPT		"Titanium > "
186 #define CONFIG_AUTO_COMPLETE
187 #define CONFIG_CMDLINE_EDITING
188 #define CONFIG_SYS_CONSOLE_INFO_QUIET	/* don't print console @ startup */
189 
190 #define CONFIG_SYS_CBSIZE		256
191 
192 /* Print Buffer Size */
193 #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
194 					 sizeof(CONFIG_SYS_PROMPT) + 16)
195 #define CONFIG_SYS_MAXARGS		16
196 #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
197 
198 #define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
199 
200 /* Physical Memory Map */
201 #define CONFIG_NR_DRAM_BANKS		1
202 #define PHYS_SDRAM			MMDC0_ARB_BASE_ADDR
203 #define PHYS_SDRAM_SIZE			(512 << 20)
204 
205 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
206 #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
207 #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
208 
209 #define CONFIG_SYS_INIT_SP_OFFSET \
210 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
211 #define CONFIG_SYS_INIT_SP_ADDR \
212 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
213 
214 /* FLASH and environment organization */
215 #define CONFIG_SYS_NO_FLASH
216 
217 /* Enable NAND support */
218 #define CONFIG_CMD_NAND
219 #define CONFIG_CMD_NAND_TRIMFFS
220 #define CONFIG_CMD_TIME
221 
222 #ifdef CONFIG_CMD_NAND
223 
224 /* NAND stuff */
225 #define CONFIG_NAND_MXS
226 #define CONFIG_SYS_MAX_NAND_DEVICE	1
227 #define CONFIG_SYS_NAND_BASE		0x40000000
228 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
229 #define CONFIG_SYS_NAND_ONFI_DETECTION
230 
231 /* DMA stuff, needed for GPMI/MXS NAND support */
232 #define CONFIG_APBH_DMA
233 #define CONFIG_APBH_DMA_BURST
234 #define CONFIG_APBH_DMA_BURST8
235 
236 /* Environment in NAND */
237 #define CONFIG_ENV_IS_IN_NAND
238 #define CONFIG_ENV_OFFSET		(16 << 20)
239 #define CONFIG_ENV_SECT_SIZE		(128 << 10)
240 #define CONFIG_ENV_SIZE			CONFIG_ENV_SECT_SIZE
241 #define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + (512 << 10))
242 #define CONFIG_ENV_SIZE_REDUND		CONFIG_ENV_SIZE
243 
244 #else /* CONFIG_CMD_NAND */
245 
246 /* Environment in MMC */
247 #define CONFIG_ENV_SIZE			(8 << 10)
248 #define CONFIG_ENV_IS_IN_MMC
249 #define CONFIG_ENV_OFFSET		(6 * 64 * 1024)
250 #define CONFIG_SYS_MMC_ENV_DEV		0
251 
252 #endif /* CONFIG_CMD_NAND */
253 
254 /* UBI/UBIFS config options */
255 #define CONFIG_LZO
256 #define CONFIG_MTD_DEVICE
257 #define CONFIG_MTD_PARTITIONS
258 #define CONFIG_RBTREE
259 #define CONFIG_CMD_MTDPARTS
260 #define CONFIG_CMD_UBI
261 #define CONFIG_CMD_UBIFS
262 
263 #define CONFIG_OF_LIBFDT
264 #define CONFIG_CMD_BOOTZ
265 
266 #ifndef CONFIG_SYS_DCACHE_OFF
267 #define CONFIG_CMD_CACHE
268 #endif
269 
270 #endif			       /* __CONFIG_H */
271