xref: /rk3399_rockchip-uboot/include/configs/tqma6.h (revision 468fb1e4dfa805a86ff46b3875d9f6a08b34dbf8)
1cb07d74eSMarkus Niebel /*
2*468fb1e4SMarkus Niebel  * Copyright (C) 2013, 2014, 2017 Markus Niebel <Markus.Niebel@tq-group.com>
3cb07d74eSMarkus Niebel  *
4*468fb1e4SMarkus Niebel  * Configuration settings for the TQ Systems TQMa6<Q,D,DL,S> module.
5cb07d74eSMarkus Niebel  *
6cb07d74eSMarkus Niebel  * SPDX-License-Identifier:	GPL-2.0+
7cb07d74eSMarkus Niebel  */
8cb07d74eSMarkus Niebel 
9cb07d74eSMarkus Niebel #ifndef __CONFIG_H
10cb07d74eSMarkus Niebel #define __CONFIG_H
11cb07d74eSMarkus Niebel 
1266cacc9dSMarkus Niebel #include <linux/kconfig.h>
131719d49cSMarkus Niebel /* SPL */
141719d49cSMarkus Niebel /* #if defined(CONFIG_SPL_BUILD) */
151719d49cSMarkus Niebel /* common IMX6 SPL configuration */
161719d49cSMarkus Niebel #include "imx6_spl.h"
171719d49cSMarkus Niebel 
181719d49cSMarkus Niebel /* #endif */
191719d49cSMarkus Niebel 
20cd6ddc48SFabio Estevam /* place code in last 4 MiB of RAM */
21d4b349e4SMarkus Niebel #if defined(CONFIG_TQMA6S)
22cd6ddc48SFabio Estevam #define CONFIG_SYS_TEXT_BASE		0x2fc00000
23*468fb1e4SMarkus Niebel #elif defined(CONFIG_TQMA6Q) || defined(CONFIG_TQMA6DL)
24cd6ddc48SFabio Estevam #define CONFIG_SYS_TEXT_BASE		0x4fc00000
25cd6ddc48SFabio Estevam #endif
26cd6ddc48SFabio Estevam 
27cb07d74eSMarkus Niebel #include "mx6_common.h"
28cb07d74eSMarkus Niebel 
29d4b349e4SMarkus Niebel #if defined(CONFIG_TQMA6S)
30cb07d74eSMarkus Niebel #define PHYS_SDRAM_SIZE			(512u * SZ_1M)
31*468fb1e4SMarkus Niebel #elif defined(CONFIG_TQMA6DL)
32*468fb1e4SMarkus Niebel #define PHYS_SDRAM_SIZE			(SZ_1G)
33d4b349e4SMarkus Niebel #elif defined(CONFIG_TQMA6Q)
34*468fb1e4SMarkus Niebel #define PHYS_SDRAM_SIZE			(SZ_1G)
35cb07d74eSMarkus Niebel #endif
36cb07d74eSMarkus Niebel 
37cb07d74eSMarkus Niebel #define CONFIG_MXC_UART
38cb07d74eSMarkus Niebel 
39cb07d74eSMarkus Niebel /* SPI */
40cb07d74eSMarkus Niebel #define CONFIG_MXC_SPI
41cb07d74eSMarkus Niebel 
42cb07d74eSMarkus Niebel /* SPI Flash */
43cb07d74eSMarkus Niebel 
4452835468SMarkus Niebel #define TQMA6_SPI_FLASH_SECTOR_SIZE	SZ_64K
4552835468SMarkus Niebel 
46cb07d74eSMarkus Niebel #define CONFIG_SF_DEFAULT_BUS	0
471719d49cSMarkus Niebel #define CONFIG_SF_DEFAULT_CS	0
48cb07d74eSMarkus Niebel #define CONFIG_SF_DEFAULT_SPEED	50000000
49cb07d74eSMarkus Niebel #define CONFIG_SF_DEFAULT_MODE	(SPI_MODE_0)
50cb07d74eSMarkus Niebel 
51cb07d74eSMarkus Niebel /* I2C Configs */
52cb07d74eSMarkus Niebel #define CONFIG_SYS_I2C
53cb07d74eSMarkus Niebel #define CONFIG_SYS_I2C_MXC
5403544c66SAlbert ARIBAUD \\(3ADEV\\) #define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 1 */
5503544c66SAlbert ARIBAUD \\(3ADEV\\) #define CONFIG_SYS_I2C_MXC_I2C2		/* enable I2C bus 2 */
56f8cb101eSYork Sun #define CONFIG_SYS_I2C_MXC_I2C3		/* enable I2C bus 3 */
57cb07d74eSMarkus Niebel #define CONFIG_I2C_MULTI_BUS
58cb07d74eSMarkus Niebel #define CONFIG_SYS_I2C_SPEED		100000
59cb07d74eSMarkus Niebel 
60cb07d74eSMarkus Niebel /* I2C SYSMON (LM75) */
61cb07d74eSMarkus Niebel #define CONFIG_DTT_LM75
62cb07d74eSMarkus Niebel #define CONFIG_DTT_MAX_TEMP		70
63cb07d74eSMarkus Niebel #define CONFIG_DTT_MIN_TEMP		-30
64cb07d74eSMarkus Niebel #define CONFIG_DTT_HYSTERESIS	3
65cb07d74eSMarkus Niebel #define CONFIG_CMD_DTT
66cb07d74eSMarkus Niebel 
67cb07d74eSMarkus Niebel /* I2C EEPROM (M24C64) */
68cb07d74eSMarkus Niebel #define CONFIG_SYS_I2C_EEPROM_ADDR			0x50
69cb07d74eSMarkus Niebel #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN			2
70cb07d74eSMarkus Niebel #define CONFIG_SYS_I2C_EEPROM_PAGE_WRITE_BITS		5 /* 32 Bytes */
71cb07d74eSMarkus Niebel #define CONFIG_SYS_I2C_EEPROM_PAGE_WRITE_DELAY_MS	20
72cb07d74eSMarkus Niebel #define CONFIG_CMD_EEPROM
73cb07d74eSMarkus Niebel 
74cb07d74eSMarkus Niebel #define CONFIG_POWER
75cb07d74eSMarkus Niebel #define CONFIG_POWER_I2C
76cb07d74eSMarkus Niebel #define CONFIG_POWER_PFUZE100
77cb07d74eSMarkus Niebel #define CONFIG_POWER_PFUZE100_I2C_ADDR	0x08
78cb07d74eSMarkus Niebel #define TQMA6_PFUZE100_I2C_BUS		2
79cb07d74eSMarkus Niebel 
80cb07d74eSMarkus Niebel /* MMC Configs */
81cb07d74eSMarkus Niebel #define CONFIG_SYS_FSL_ESDHC_ADDR	0
82cb07d74eSMarkus Niebel 
83cb07d74eSMarkus Niebel /* USB Configs */
84cb07d74eSMarkus Niebel #define CONFIG_USB_EHCI
85cb07d74eSMarkus Niebel #define CONFIG_USB_EHCI_MX6
86cb07d74eSMarkus Niebel #define CONFIG_USB_HOST_ETHER
87cb07d74eSMarkus Niebel #define CONFIG_USB_ETHER_SMSC95XX
88cb07d74eSMarkus Niebel #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
89911b5ea5SStefan Roese #define CONFIG_USB_MAX_CONTROLLER_COUNT	2
90911b5ea5SStefan Roese #define CONFIG_EHCI_HCD_INIT_AFTER_RESET	/* For OTG port */
91cb07d74eSMarkus Niebel 
92cb07d74eSMarkus Niebel #define CONFIG_FEC_MXC
93cb07d74eSMarkus Niebel #define IMX_FEC_BASE			ENET_BASE_ADDR
94cb07d74eSMarkus Niebel #define CONFIG_PHYLIB
95cb07d74eSMarkus Niebel #define CONFIG_MII
96cb07d74eSMarkus Niebel 
97cb07d74eSMarkus Niebel #define CONFIG_ARP_TIMEOUT		200UL
98cb07d74eSMarkus Niebel 
99cb07d74eSMarkus Niebel /* Command definition */
100cb07d74eSMarkus Niebel #define CONFIG_CMD_BMODE
101cb07d74eSMarkus Niebel 
102cb07d74eSMarkus Niebel #define CONFIG_ENV_SIZE			(SZ_8K)
103cb07d74eSMarkus Niebel /* Size of malloc() pool */
104cb07d74eSMarkus Niebel #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 2 * SZ_1M)
105cb07d74eSMarkus Niebel 
106cb07d74eSMarkus Niebel #if defined(CONFIG_TQMA6X_MMC_BOOT)
107cb07d74eSMarkus Niebel 
108cb07d74eSMarkus Niebel #define CONFIG_ENV_IS_IN_MMC
109cb07d74eSMarkus Niebel #define TQMA6_UBOOT_OFFSET		SZ_1K
110cb07d74eSMarkus Niebel #define TQMA6_UBOOT_SECTOR_START	0x2
111cb07d74eSMarkus Niebel #define TQMA6_UBOOT_SECTOR_COUNT	0x7fe
112cb07d74eSMarkus Niebel 
113cb07d74eSMarkus Niebel #define CONFIG_ENV_OFFSET		SZ_1M
114cb07d74eSMarkus Niebel #define CONFIG_SYS_MMC_ENV_DEV		0
115cb07d74eSMarkus Niebel 
116cb07d74eSMarkus Niebel #define TQMA6_FDT_OFFSET		(2 * SZ_1M)
117cb07d74eSMarkus Niebel #define TQMA6_FDT_SECTOR_START		0x1000
118cb07d74eSMarkus Niebel #define TQMA6_FDT_SECTOR_COUNT		0x800
119cb07d74eSMarkus Niebel 
120cb07d74eSMarkus Niebel #define TQMA6_KERNEL_SECTOR_START	0x2000
121cb07d74eSMarkus Niebel #define TQMA6_KERNEL_SECTOR_COUNT	0x2000
122cb07d74eSMarkus Niebel 
123cb07d74eSMarkus Niebel #define TQMA6_EXTRA_BOOTDEV_ENV_SETTINGS                                       \
124cb07d74eSMarkus Niebel 	"uboot_start="__stringify(TQMA6_UBOOT_SECTOR_START)"\0"                \
125cb07d74eSMarkus Niebel 	"uboot_size="__stringify(TQMA6_UBOOT_SECTOR_COUNT)"\0"                 \
126cb07d74eSMarkus Niebel 	"fdt_start="__stringify(TQMA6_FDT_SECTOR_START)"\0"                    \
127cb07d74eSMarkus Niebel 	"fdt_size="__stringify(TQMA6_FDT_SECTOR_COUNT)"\0"                     \
128cb07d74eSMarkus Niebel 	"kernel_start="__stringify(TQMA6_KERNEL_SECTOR_START)"\0"              \
129cb07d74eSMarkus Niebel 	"kernel_size="__stringify(TQMA6_KERNEL_SECTOR_COUNT)"\0"               \
130cb07d74eSMarkus Niebel 	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0"                       \
131cb07d74eSMarkus Niebel 	"loadimage=mmc dev ${mmcdev}; "                                        \
132cb07d74eSMarkus Niebel 		"mmc read ${loadaddr} ${kernel_start} ${kernel_size};\0"       \
133cb07d74eSMarkus Niebel 	"loadfdt=mmc dev ${mmcdev}; "                                          \
134cb07d74eSMarkus Niebel 		"mmc read ${fdt_addr} ${fdt_start} ${fdt_size};\0"             \
135cb07d74eSMarkus Niebel 	"update_uboot=if tftp ${uboot}; then "                                 \
136cb07d74eSMarkus Niebel 		"if itest ${filesize} > 0; then "                              \
137cb07d74eSMarkus Niebel 			"mmc dev ${mmcdev}; mmc rescan; "                      \
138e7203d77SMarkus Niebel 			"setexpr blkc ${filesize} + 0x1ff; "                   \
139e7203d77SMarkus Niebel 			"setexpr blkc ${blkc} / 0x200; "                       \
140cb07d74eSMarkus Niebel 			"if itest ${blkc} <= ${uboot_size}; then "             \
141cb07d74eSMarkus Niebel 				"mmc write ${loadaddr} ${uboot_start} "        \
142cb07d74eSMarkus Niebel 					"${blkc}; "                            \
143cb07d74eSMarkus Niebel 			"fi; "                                                 \
144cb07d74eSMarkus Niebel 		"fi; fi; "                                                     \
145cb07d74eSMarkus Niebel 		"setenv filesize; setenv blkc \0"                              \
146cb07d74eSMarkus Niebel 	"update_kernel=run kernel_name; "                                      \
147cb07d74eSMarkus Niebel 		"if tftp ${kernel}; then "                                     \
148cb07d74eSMarkus Niebel 			"if itest ${filesize} > 0; then "                      \
149cb07d74eSMarkus Niebel 				"mmc dev ${mmcdev}; mmc rescan; "              \
150e7203d77SMarkus Niebel 				"setexpr blkc ${filesize} + 0x1ff; "           \
151e7203d77SMarkus Niebel 				"setexpr blkc ${blkc} / 0x200; "               \
152cb07d74eSMarkus Niebel 				"if itest ${blkc} <= ${kernel_size}; then "    \
153cb07d74eSMarkus Niebel 					"mmc write ${loadaddr} "               \
154cb07d74eSMarkus Niebel 						"${kernel_start} ${blkc}; "    \
155cb07d74eSMarkus Niebel 				"fi; "                                         \
156cb07d74eSMarkus Niebel 			"fi; "                                                 \
157cb07d74eSMarkus Niebel 		"fi; "                                                         \
158cb07d74eSMarkus Niebel 		"setenv filesize; setenv blkc \0"                              \
159cb07d74eSMarkus Niebel 	"update_fdt=if tftp ${fdt_file}; then "                                \
160cb07d74eSMarkus Niebel 		"if itest ${filesize} > 0; then "                              \
161cb07d74eSMarkus Niebel 			"mmc dev ${mmcdev}; mmc rescan; "                      \
162e7203d77SMarkus Niebel 			"setexpr blkc ${filesize} + 0x1ff; "                   \
163e7203d77SMarkus Niebel 			"setexpr blkc ${blkc} / 0x200; "                       \
164cb07d74eSMarkus Niebel 			"if itest ${blkc} <= ${fdt_size}; then "               \
165cb07d74eSMarkus Niebel 				"mmc write ${loadaddr} ${fdt_start} ${blkc}; " \
166cb07d74eSMarkus Niebel 			"fi; "                                                 \
167cb07d74eSMarkus Niebel 		"fi; fi; "                                                     \
168cb07d74eSMarkus Niebel 		"setenv filesize; setenv blkc \0"                              \
169cb07d74eSMarkus Niebel 
170cb07d74eSMarkus Niebel #define CONFIG_BOOTCOMMAND \
171cb07d74eSMarkus Niebel 	"run mmcboot; run netboot; run panicboot"
172cb07d74eSMarkus Niebel 
173cb07d74eSMarkus Niebel #elif defined(CONFIG_TQMA6X_SPI_BOOT)
174cb07d74eSMarkus Niebel 
175cb07d74eSMarkus Niebel #define TQMA6_UBOOT_OFFSET		0x400
176cb07d74eSMarkus Niebel #define TQMA6_UBOOT_SECTOR_START	0x0
177cb07d74eSMarkus Niebel /* max u-boot size: 512k */
17852835468SMarkus Niebel #define TQMA6_UBOOT_SECTOR_SIZE		TQMA6_SPI_FLASH_SECTOR_SIZE
179cb07d74eSMarkus Niebel #define TQMA6_UBOOT_SECTOR_COUNT	0x8
180cb07d74eSMarkus Niebel #define TQMA6_UBOOT_SIZE		(TQMA6_UBOOT_SECTOR_SIZE * \
181cb07d74eSMarkus Niebel 					 TQMA6_UBOOT_SECTOR_COUNT)
182cb07d74eSMarkus Niebel 
183cb07d74eSMarkus Niebel #define CONFIG_ENV_IS_IN_SPI_FLASH
184cb07d74eSMarkus Niebel #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
185cb07d74eSMarkus Niebel #define CONFIG_ENV_OFFSET		(TQMA6_UBOOT_SIZE)
18652835468SMarkus Niebel #define CONFIG_ENV_SECT_SIZE		TQMA6_SPI_FLASH_SECTOR_SIZE
187cb07d74eSMarkus Niebel #define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + \
188cb07d74eSMarkus Niebel 					 CONFIG_ENV_SECT_SIZE)
189cb07d74eSMarkus Niebel 
190cb07d74eSMarkus Niebel #define CONFIG_ENV_SPI_BUS		(CONFIG_SF_DEFAULT_BUS)
191cb07d74eSMarkus Niebel #define CONFIG_ENV_SPI_CS		(CONFIG_SF_DEFAULT_CS)
192cb07d74eSMarkus Niebel #define CONFIG_ENV_SPI_MAX_HZ		(CONFIG_SF_DEFAULT_SPEED)
193cb07d74eSMarkus Niebel #define CONFIG_ENV_SPI_MODE		(CONFIG_SF_DEFAULT_MODE)
194cb07d74eSMarkus Niebel 
195cb07d74eSMarkus Niebel #define TQMA6_FDT_OFFSET		(CONFIG_ENV_OFFSET_REDUND + \
196cb07d74eSMarkus Niebel 					 CONFIG_ENV_SECT_SIZE)
19752835468SMarkus Niebel #define TQMA6_FDT_SECT_SIZE		(TQMA6_SPI_FLASH_SECTOR_SIZE)
198cb07d74eSMarkus Niebel 
199cb07d74eSMarkus Niebel #define TQMA6_FDT_SECTOR_START		0x0a /* 8 Sector u-boot, 2 Sector env */
200cb07d74eSMarkus Niebel #define TQMA6_FDT_SECTOR_COUNT		0x01
201cb07d74eSMarkus Niebel 
202cb07d74eSMarkus Niebel #define TQMA6_KERNEL_SECTOR_START	0x10
203cb07d74eSMarkus Niebel #define TQMA6_KERNEL_SECTOR_COUNT	0x60
204cb07d74eSMarkus Niebel 
205cb07d74eSMarkus Niebel #define TQMA6_EXTRA_BOOTDEV_ENV_SETTINGS                                       \
206cb07d74eSMarkus Niebel 	"mmcblkdev=0\0"                                                        \
207cb07d74eSMarkus Niebel 	"uboot_offset="__stringify(TQMA6_UBOOT_OFFSET)"\0"                     \
208cb07d74eSMarkus Niebel 	"uboot_sectors="__stringify(TQMA6_UBOOT_SECTOR_COUNT)"\0"              \
209cb07d74eSMarkus Niebel 	"fdt_start="__stringify(TQMA6_FDT_SECTOR_START)"\0"                    \
210cb07d74eSMarkus Niebel 	"fdt_sectors="__stringify(TQMA6_FDT_SECTOR_COUNT)"\0"                  \
211cb07d74eSMarkus Niebel 	"kernel_start="__stringify(TQMA6_KERNEL_SECTOR_START)"\0"              \
212cb07d74eSMarkus Niebel 	"kernel_sectors="__stringify(TQMA6_KERNEL_SECTOR_COUNT)"\0"            \
213cb07d74eSMarkus Niebel 	"update_uboot=if tftp ${uboot}; then "                                 \
214cb07d74eSMarkus Niebel 		"if itest ${filesize} > 0; then "                              \
215cb07d74eSMarkus Niebel 			"setexpr blkc ${filesize} + "                          \
216cb07d74eSMarkus Niebel 				__stringify(TQMA6_UBOOT_OFFSET) "; "           \
217cb07d74eSMarkus Niebel 			"setexpr size ${uboot_sectors} * "                     \
21852835468SMarkus Niebel 				__stringify(TQMA6_SPI_FLASH_SECTOR_SIZE)"; "   \
219cb07d74eSMarkus Niebel 			"if itest ${blkc} <= ${size}; then "                   \
220cb07d74eSMarkus Niebel 				"sf probe; "                                   \
221cb07d74eSMarkus Niebel 				"sf erase 0 ${size}; "                         \
222cb07d74eSMarkus Niebel 				"sf write ${loadaddr} ${uboot_offset} "        \
223cb07d74eSMarkus Niebel 					"${filesize}; "                        \
224cb07d74eSMarkus Niebel 			"fi; "                                                 \
225cb07d74eSMarkus Niebel 		"fi; fi; "                                                     \
226cb07d74eSMarkus Niebel 		"setenv filesize 0; setenv blkc; setenv size \0"               \
227cb07d74eSMarkus Niebel 	"update_kernel=run kernel_name; if tftp ${kernel}; then "              \
228cb07d74eSMarkus Niebel 		"if itest ${filesize} > 0; then "                              \
229cb07d74eSMarkus Niebel 			"setexpr size ${kernel_sectors} * "                    \
23052835468SMarkus Niebel 				__stringify(TQMA6_SPI_FLASH_SECTOR_SIZE)"; "   \
231cb07d74eSMarkus Niebel 			"setexpr offset ${kernel_start} * "                    \
23252835468SMarkus Niebel 				__stringify(TQMA6_SPI_FLASH_SECTOR_SIZE)"; "   \
233cb07d74eSMarkus Niebel 			"if itest ${filesize} <= ${size}; then "               \
234cb07d74eSMarkus Niebel 				"sf probe; "                                   \
235cb07d74eSMarkus Niebel 				"sf erase ${offset} ${size}; "                 \
236cb07d74eSMarkus Niebel 				"sf write ${loadaddr} ${offset} "              \
237cb07d74eSMarkus Niebel 					"${filesize}; "                        \
238cb07d74eSMarkus Niebel 			"fi; "                                                 \
239cb07d74eSMarkus Niebel 		"fi; fi; "                                                     \
240cb07d74eSMarkus Niebel 		"setenv filesize 0; setenv size ; setenv offset\0"             \
241cb07d74eSMarkus Niebel 	"update_fdt=if tftp ${fdt_file}; then "                                \
242cb07d74eSMarkus Niebel 		"if itest ${filesize} > 0; then "                              \
243cb07d74eSMarkus Niebel 			"setexpr size ${fdt_sectors} * "                       \
24452835468SMarkus Niebel 				__stringify(TQMA6_SPI_FLASH_SECTOR_SIZE)"; "   \
245cb07d74eSMarkus Niebel 			"setexpr offset ${fdt_start} * "                       \
24652835468SMarkus Niebel 				__stringify(TQMA6_SPI_FLASH_SECTOR_SIZE)"; "   \
247cb07d74eSMarkus Niebel 			"if itest ${filesize} <= ${size}; then "               \
248cb07d74eSMarkus Niebel 				"sf probe; "                                   \
249cb07d74eSMarkus Niebel 				"sf erase ${offset} ${size}; "                 \
250cb07d74eSMarkus Niebel 				"sf write ${loadaddr} ${offset} "              \
251cb07d74eSMarkus Niebel 					"${filesize}; "                        \
252cb07d74eSMarkus Niebel 			"fi; "                                                 \
253cb07d74eSMarkus Niebel 		"fi; fi; "                                                     \
254cb07d74eSMarkus Niebel 		"setenv filesize 0; setenv size ; setenv offset\0"             \
255cb07d74eSMarkus Niebel 	"loadimage=sf probe; "                                                 \
256cb07d74eSMarkus Niebel 		"setexpr size ${kernel_sectors} * "                            \
25752835468SMarkus Niebel 			__stringify(TQMA6_SPI_FLASH_SECTOR_SIZE)"; "           \
258cb07d74eSMarkus Niebel 		"setexpr offset ${kernel_start} * "                            \
25952835468SMarkus Niebel 			__stringify(TQMA6_SPI_FLASH_SECTOR_SIZE)"; "           \
260cb07d74eSMarkus Niebel 		"sf read ${loadaddr} ${offset} ${size}; "                      \
261cb07d74eSMarkus Niebel 		"setenv size ; setenv offset\0"                                \
262cb07d74eSMarkus Niebel 	"loadfdt=sf probe; "                                                   \
263cb07d74eSMarkus Niebel 		"setexpr size ${fdt_sectors} * "                               \
26452835468SMarkus Niebel 			__stringify(TQMA6_SPI_FLASH_SECTOR_SIZE)"; "           \
265cb07d74eSMarkus Niebel 		"setexpr offset ${fdt_start} * "                               \
26652835468SMarkus Niebel 			__stringify(TQMA6_SPI_FLASH_SECTOR_SIZE)"; "           \
2670b14f1a6SMarkus Niebel 		"sf read ${fdt_addr} ${offset} ${size}; "                      \
268cb07d74eSMarkus Niebel 		"setenv size ; setenv offset\0"                                \
269cb07d74eSMarkus Niebel 
270cb07d74eSMarkus Niebel #define CONFIG_BOOTCOMMAND                                                     \
271cb07d74eSMarkus Niebel 	"sf probe; run mmcboot; run netboot; run panicboot"                    \
272cb07d74eSMarkus Niebel 
273cb07d74eSMarkus Niebel #else
274cb07d74eSMarkus Niebel 
275cb07d74eSMarkus Niebel #error "need to define boot source"
276cb07d74eSMarkus Niebel 
277cb07d74eSMarkus Niebel #endif
278cb07d74eSMarkus Niebel 
279cb07d74eSMarkus Niebel /* 128 MiB offset as in ARM related docu for linux suggested */
280cb07d74eSMarkus Niebel #define TQMA6_FDT_ADDRESS		0x18000000
281cb07d74eSMarkus Niebel 
2829e9846a4SMarkus Niebel /* set to a resonable value, changeable by user */
2839e9846a4SMarkus Niebel #define TQMA6_CMA_SIZE                 160M
2849e9846a4SMarkus Niebel 
285cb07d74eSMarkus Niebel #define CONFIG_EXTRA_ENV_SETTINGS                                              \
286cb07d74eSMarkus Niebel 	"board=tqma6\0"                                                        \
287cb07d74eSMarkus Niebel 	"uimage=uImage\0"                                                      \
288cb07d74eSMarkus Niebel 	"zimage=zImage\0"                                                      \
289cb07d74eSMarkus Niebel 	"boot_type=bootz\0"                                                    \
290cb07d74eSMarkus Niebel 	"kernel_name=if test \"${boot_type}\" != bootz; then "                 \
291cb07d74eSMarkus Niebel 		"setenv kernel ${uimage}; "                                    \
292cb07d74eSMarkus Niebel 		"else setenv kernel ${zimage}; fi\0"                           \
293cb07d74eSMarkus Niebel 	"uboot=u-boot.imx\0"                                                   \
294cb07d74eSMarkus Niebel 	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0"                               \
295cb07d74eSMarkus Niebel 	"fdt_addr="__stringify(TQMA6_FDT_ADDRESS)"\0"                          \
29612ca05a3SSimon Glass 	"console=" CONSOLE_DEV "\0"                                            \
2979e9846a4SMarkus Niebel 	"cma_size="__stringify(TQMA6_CMA_SIZE)"\0"                             \
298cb07d74eSMarkus Niebel 	"fdt_high=0xffffffff\0"                                                \
299cb07d74eSMarkus Niebel 	"initrd_high=0xffffffff\0"                                             \
30034713901SMarkus Niebel 	"rootfsmode=ro\0"                                                      \
3019e9846a4SMarkus Niebel 	"addcma=setenv bootargs ${bootargs} cma=${cma_size}\0"                 \
302cb07d74eSMarkus Niebel 	"addtty=setenv bootargs ${bootargs} console=${console},${baudrate}\0"  \
303cb07d74eSMarkus Niebel 	"addfb=setenv bootargs ${bootargs} "                                   \
304cb07d74eSMarkus Niebel 		"imx-fbdev.legacyfb_depth=32 consoleblank=0\0"                 \
305cb07d74eSMarkus Niebel 	"mmcpart=2\0"                                                          \
306cb07d74eSMarkus Niebel 	"mmcblkdev=0\0"                                                        \
3079e9846a4SMarkus Niebel 	"mmcargs=run addmmc addtty addfb addcma\0"                             \
308cb07d74eSMarkus Niebel 	"addmmc=setenv bootargs ${bootargs} "                                  \
30934713901SMarkus Niebel 		"root=/dev/mmcblk${mmcblkdev}p${mmcpart} ${rootfsmode} "       \
31034713901SMarkus Niebel 		"rootwait\0"                                                   \
311cb07d74eSMarkus Niebel 	"mmcboot=echo Booting from mmc ...; "                                  \
312cb07d74eSMarkus Niebel 		"setenv bootargs; "                                            \
313cb07d74eSMarkus Niebel 		"run mmcargs; "                                                \
314cb07d74eSMarkus Niebel 		"run loadimage; "                                              \
315cb07d74eSMarkus Niebel 		"if run loadfdt; then "                                        \
316cb07d74eSMarkus Niebel 			"echo boot device tree kernel ...; "                   \
317cb07d74eSMarkus Niebel 			"${boot_type} ${loadaddr} - ${fdt_addr}; "             \
318cb07d74eSMarkus Niebel 		"else "                                                        \
319cb07d74eSMarkus Niebel 			"${boot_type}; "                                       \
320cb07d74eSMarkus Niebel 		"fi;\0"                                                        \
321cb07d74eSMarkus Niebel 		"setenv bootargs \0"                                           \
322cb07d74eSMarkus Niebel 	"netdev=eth0\0"                                                        \
323cb07d74eSMarkus Niebel 	"rootpath=/srv/nfs/tqma6\0"                                            \
324cb07d74eSMarkus Niebel 	"ipmode=static\0"                                                      \
3259e9846a4SMarkus Niebel 	"netargs=run addnfs addip addtty addfb addcma\0"                       \
326cb07d74eSMarkus Niebel 	"addnfs=setenv bootargs ${bootargs} "                                  \
327cb07d74eSMarkus Niebel 		"root=/dev/nfs rw "                                            \
328cb07d74eSMarkus Niebel 		"nfsroot=${serverip}:${rootpath},v3,tcp;\0"                    \
329cb07d74eSMarkus Niebel 	"addip_static=setenv bootargs ${bootargs} "                            \
330cb07d74eSMarkus Niebel 		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"            \
331cb07d74eSMarkus Niebel 		"${hostname}:${netdev}:off\0"                                  \
332cb07d74eSMarkus Niebel 	"addip_dynamic=setenv bootargs ${bootargs} ip=dhcp\0"                  \
333cb07d74eSMarkus Niebel 	"addip=if test \"${ipmode}\" != static; then "                         \
334cb07d74eSMarkus Niebel 		"run addip_dynamic; else run addip_static; fi\0"               \
335cb07d74eSMarkus Niebel 	"set_getcmd=if test \"${ipmode}\" != static; then "                    \
336cb07d74eSMarkus Niebel 		"setenv getcmd dhcp; setenv autoload yes; "                    \
337cb07d74eSMarkus Niebel 		"else setenv getcmd tftp; setenv autoload no; fi\0"            \
338cb07d74eSMarkus Niebel 	"netboot=echo Booting from net ...; "                                  \
339cb07d74eSMarkus Niebel 		"run kernel_name; "                                            \
340cb07d74eSMarkus Niebel 		"run set_getcmd; "                                             \
341cb07d74eSMarkus Niebel 		"setenv bootargs; "                                            \
342cb07d74eSMarkus Niebel 		"run netargs; "                                                \
343cb07d74eSMarkus Niebel 		"if ${getcmd} ${kernel}; then "                                \
344cb07d74eSMarkus Niebel 			"if ${getcmd} ${fdt_addr} ${fdt_file}; then "          \
345cb07d74eSMarkus Niebel 				"${boot_type} ${loadaddr} - ${fdt_addr}; "     \
346cb07d74eSMarkus Niebel 			"fi; "                                                 \
347cb07d74eSMarkus Niebel 		"fi; "                                                         \
348cb07d74eSMarkus Niebel 		"echo ... failed\0"                                            \
349cb07d74eSMarkus Niebel 	"panicboot=echo No boot device !!! reset\0"                            \
350cb07d74eSMarkus Niebel 	TQMA6_EXTRA_BOOTDEV_ENV_SETTINGS                                      \
351cb07d74eSMarkus Niebel 
352cb07d74eSMarkus Niebel #define CONFIG_STACKSIZE		(128u * SZ_1K)
353cb07d74eSMarkus Niebel 
354cb07d74eSMarkus Niebel /* Physical Memory Map */
355cb07d74eSMarkus Niebel #define CONFIG_NR_DRAM_BANKS		1
356cb07d74eSMarkus Niebel #define PHYS_SDRAM			MMDC0_ARB_BASE_ADDR
357cb07d74eSMarkus Niebel 
358cb07d74eSMarkus Niebel #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
359cb07d74eSMarkus Niebel #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
360cb07d74eSMarkus Niebel #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
361cb07d74eSMarkus Niebel 
362cb07d74eSMarkus Niebel #define CONFIG_SYS_INIT_SP_OFFSET \
363cb07d74eSMarkus Niebel 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
364cb07d74eSMarkus Niebel #define CONFIG_SYS_INIT_SP_ADDR \
365cb07d74eSMarkus Niebel 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
366cb07d74eSMarkus Niebel 
3676b396b31SStefan Roese /*
3686b396b31SStefan Roese  * All the defines above are for the TQMa6 SoM
3696b396b31SStefan Roese  *
3706b396b31SStefan Roese  * Now include the baseboard specific configuration
3716b396b31SStefan Roese  */
3726b396b31SStefan Roese #ifdef CONFIG_MBA6
3736b396b31SStefan Roese #include "tqma6_mba6.h"
374452308c0SStefan Roese #elif CONFIG_WRU4
375452308c0SStefan Roese #include "tqma6_wru4.h"
3766b396b31SStefan Roese #else
3776b396b31SStefan Roese #error "No baseboard for the TQMa6 defined!"
3786b396b31SStefan Roese #endif
3796b396b31SStefan Roese 
3806b396b31SStefan Roese /* Support at least the sensor on TQMa6 SOM */
3816b396b31SStefan Roese #if !defined(CONFIG_DTT_SENSORS)
3826b396b31SStefan Roese #define CONFIG_DTT_SENSORS		{ 0 }
3836b396b31SStefan Roese #endif
3846b396b31SStefan Roese 
385cb07d74eSMarkus Niebel #endif /* __CONFIG_H */
386