xref: /rk3399_rockchip-uboot/include/configs/vct.h (revision 577968e5669858e1d5bcb651ab28d60d20166252)
1ae691e57SStefan Roese /*
2ae691e57SStefan Roese  * (C) Copyright 2008 Stefan Roese <sr@denx.de>, DENX Software Engineering
3ae691e57SStefan Roese  *
4*1a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
5ae691e57SStefan Roese  */
6ae691e57SStefan Roese 
7ae691e57SStefan Roese /*
8ae691e57SStefan Roese  * This file contains the configuration parameters for the VCT board
9ae691e57SStefan Roese  * family:
10ae691e57SStefan Roese  *
11ae691e57SStefan Roese  * vct_premium
12ae691e57SStefan Roese  * vct_premium_small
13ae691e57SStefan Roese  * vct_premium_onenand
14ae691e57SStefan Roese  * vct_premium_onenand_small
15ae691e57SStefan Roese  * vct_platinum
16ae691e57SStefan Roese  * vct_platinum_small
17ae691e57SStefan Roese  * vct_platinum_onenand
18ae691e57SStefan Roese  * vct_platinum_onenand_small
19ae691e57SStefan Roese  * vct_platinumavc
20ae691e57SStefan Roese  * vct_platinumavc_small
21ae691e57SStefan Roese  * vct_platinumavc_onenand
22ae691e57SStefan Roese  * vct_platinumavc_onenand_small
23ae691e57SStefan Roese  */
24ae691e57SStefan Roese 
25ae691e57SStefan Roese #ifndef __CONFIG_H
26ae691e57SStefan Roese #define __CONFIG_H
27ae691e57SStefan Roese 
28ae691e57SStefan Roese #define CPU_CLOCK_RATE			324000000 /* Clock for the MIPS core */
29ae691e57SStefan Roese #define CONFIG_SYS_MIPS_TIMER_FREQ	(CPU_CLOCK_RATE / 2)
30ae691e57SStefan Roese 
31ae691e57SStefan Roese #define CONFIG_SKIP_LOWLEVEL_INIT	/* SDRAM is initialized by the bootstrap code */
32ae691e57SStefan Roese 
3314d0a02aSWolfgang Denk #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_TEXT_BASE
34ae691e57SStefan Roese #define CONFIG_SYS_MONITOR_LEN		(256 << 10)
35ae691e57SStefan Roese #define CONFIG_SYS_MALLOC_LEN		(1 << 20)
36ae691e57SStefan Roese #define CONFIG_SYS_BOOTPARAMS_LEN	(128 << 10)
37ae691e57SStefan Roese #define CONFIG_SYS_INIT_SP_OFFSET	0x400000
38ae691e57SStefan Roese 
39ae691e57SStefan Roese #if !defined(CONFIG_VCT_NAND) && !defined(CONFIG_VCT_ONENAND)
40ae691e57SStefan Roese #define CONFIG_VCT_NOR
41ae691e57SStefan Roese #endif
42ae691e57SStefan Roese 
43ae691e57SStefan Roese /*
44ae691e57SStefan Roese  * UART
45ae691e57SStefan Roese  */
46294f10caSDetlev Zundel #ifdef CONFIG_VCT_PLATINUMAVC
47294f10caSDetlev Zundel #define UART_1_BASE		0xBDC30000
48294f10caSDetlev Zundel #else
49294f10caSDetlev Zundel #define UART_1_BASE		0xBF89C000
50294f10caSDetlev Zundel #endif
51294f10caSDetlev Zundel 
52294f10caSDetlev Zundel #define CONFIG_SYS_NS16550_SERIAL
53294f10caSDetlev Zundel #define CONFIG_SYS_NS16550_REG_SIZE	-4
54294f10caSDetlev Zundel #define CONFIG_SYS_NS16550_COM1		UART_1_BASE
55294f10caSDetlev Zundel #define CONFIG_CONS_INDEX		1
56294f10caSDetlev Zundel #define CONFIG_SYS_NS16550_CLK		921600
57ae691e57SStefan Roese 
58ae691e57SStefan Roese /*
59ae691e57SStefan Roese  * SDRAM
60ae691e57SStefan Roese  */
61ae691e57SStefan Roese #define CONFIG_SYS_SDRAM_BASE		0x80000000
62ae691e57SStefan Roese #define CONFIG_SYS_MBYTES_SDRAM		128
63ae691e57SStefan Roese #define CONFIG_SYS_MEMTEST_START	0x80200000
64ae691e57SStefan Roese #define CONFIG_SYS_MEMTEST_END		0x80400000
65ae691e57SStefan Roese #define CONFIG_SYS_LOAD_ADDR		0x80400000	/* default load address */
66ae691e57SStefan Roese 
67ae691e57SStefan Roese #if defined(CONFIG_VCT_PREMIUM) || defined(CONFIG_VCT_PLATINUM)
68ae691e57SStefan Roese /*
69ae691e57SStefan Roese  * SMSC91C11x Network Card
70ae691e57SStefan Roese  */
71736fead8SBen Warren #define CONFIG_SMC911X
72736fead8SBen Warren #define CONFIG_SMC911X_BASE	0x00000000
73736fead8SBen Warren #define CONFIG_SMC911X_32_BIT
74ae691e57SStefan Roese #define CONFIG_NET_RETRY_COUNT		20
75ae691e57SStefan Roese #endif
76ae691e57SStefan Roese 
77ae691e57SStefan Roese /*
78ae691e57SStefan Roese  * Commands
79ae691e57SStefan Roese  */
80ae691e57SStefan Roese 
81ae691e57SStefan Roese /*
82ae691e57SStefan Roese  * Only Premium/Platinum have ethernet support right now
83ae691e57SStefan Roese  */
84383015b2SDaniel Schwierzeck #if (defined(CONFIG_VCT_PREMIUM) || defined(CONFIG_VCT_PLATINUM)) && \
85383015b2SDaniel Schwierzeck 	!defined(CONFIG_VCT_SMALL_IMAGE)
86ae691e57SStefan Roese #endif
87ae691e57SStefan Roese 
88ae691e57SStefan Roese /*
89ae691e57SStefan Roese  * Only Premium/Platinum have USB-EHCI support right now
90ae691e57SStefan Roese  */
91383015b2SDaniel Schwierzeck #if (defined(CONFIG_VCT_PREMIUM) || defined(CONFIG_VCT_PLATINUM)) && \
92383015b2SDaniel Schwierzeck 	!defined(CONFIG_VCT_SMALL_IMAGE)
93ae691e57SStefan Roese #endif
94ae691e57SStefan Roese 
95ae691e57SStefan Roese #if defined(CONFIG_CMD_USB)
96ae691e57SStefan Roese #define CONFIG_SUPPORT_VFAT
97ae691e57SStefan Roese 
98ae691e57SStefan Roese /*
99ae691e57SStefan Roese  * USB/EHCI
100ae691e57SStefan Roese  */
101ae691e57SStefan Roese #define CONFIG_USB_EHCI_VCT		/* on VCT platform		*/
102ae691e57SStefan Roese #define CONFIG_EHCI_MMIO_BIG_ENDIAN
103ae691e57SStefan Roese #define CONFIG_EHCI_DESC_BIG_ENDIAN
104ae691e57SStefan Roese #define CONFIG_EHCI_IS_TDI
105ae691e57SStefan Roese #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* re-init HCD after CMD_RESET */
106ae691e57SStefan Roese #endif /* CONFIG_CMD_USB */
107ae691e57SStefan Roese 
108ae691e57SStefan Roese /*
109ae691e57SStefan Roese  * BOOTP options
110ae691e57SStefan Roese  */
111ae691e57SStefan Roese #define CONFIG_BOOTP_BOOTFILESIZE
112ae691e57SStefan Roese #define CONFIG_BOOTP_BOOTPATH
113ae691e57SStefan Roese #define CONFIG_BOOTP_GATEWAY
114ae691e57SStefan Roese #define CONFIG_BOOTP_HOSTNAME
115ae691e57SStefan Roese #define CONFIG_BOOTP_SUBNETMASK
116ae691e57SStefan Roese 
117ae691e57SStefan Roese /*
118ae691e57SStefan Roese  * Miscellaneous configurable options
119ae691e57SStefan Roese  */
120ae691e57SStefan Roese #define CONFIG_SYS_LONGHELP			/* undef to save memory		*/
121ae691e57SStefan Roese #define CONFIG_SYS_CBSIZE	512		/* Console I/O Buffer Size	*/
122ae691e57SStefan Roese #define CONFIG_TIMESTAMP			/* Print image info with timestamp */
123ae691e57SStefan Roese #define CONFIG_CMDLINE_EDITING			/* add command line history	*/
124ae691e57SStefan Roese 
125ae691e57SStefan Roese /*
126ae691e57SStefan Roese  * FLASH and environment organization
127ae691e57SStefan Roese  */
128ae691e57SStefan Roese #if defined(CONFIG_VCT_NOR)
129ae691e57SStefan Roese #define CONFIG_FLASH_NOT_MEM_MAPPED
130ae691e57SStefan Roese 
131ae691e57SStefan Roese /*
132ae691e57SStefan Roese  * We need special accessor functions for the CFI FLASH driver. This
133ae691e57SStefan Roese  * can be enabled via the CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS option.
134ae691e57SStefan Roese  */
135ae691e57SStefan Roese #define CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS
136ae691e57SStefan Roese 
137ae691e57SStefan Roese /*
138ae691e57SStefan Roese  * For the non-memory-mapped NOR FLASH, we need to define the
139ae691e57SStefan Roese  * NOR FLASH area. This can't be detected via the addr2info()
140ae691e57SStefan Roese  * function, since we check for flash access in the very early
141ae691e57SStefan Roese  * U-Boot code, before the NOR FLASH is detected.
142ae691e57SStefan Roese  */
143ae691e57SStefan Roese #define CONFIG_FLASH_BASE		0xb0000000
144ae691e57SStefan Roese #define CONFIG_FLASH_END		0xbfffffff
145ae691e57SStefan Roese 
146ae691e57SStefan Roese /*
147ae691e57SStefan Roese  * CFI driver settings
148ae691e57SStefan Roese  */
149ae691e57SStefan Roese #define CONFIG_SYS_FLASH_CFI			/* The flash is CFI compatible	*/
150ae691e57SStefan Roese #define CONFIG_FLASH_CFI_DRIVER		/* Use common CFI driver	*/
151ae691e57SStefan Roese #define CONFIG_SYS_FLASH_CFI_AMD_RESET	1	/* Use AMD (Spansion) reset cmd */
152ae691e57SStefan Roese #define CONFIG_SYS_FLASH_CFI_WIDTH	FLASH_CFI_16BIT	/* no byte writes on IXP4xx	*/
153ae691e57SStefan Roese 
154ae691e57SStefan Roese #define CONFIG_SYS_FLASH_BASE		0xb0000000
155ae691e57SStefan Roese #define CONFIG_SYS_FLASH_BANKS_LIST    { CONFIG_SYS_FLASH_BASE }
156ae691e57SStefan Roese #define CONFIG_SYS_MAX_FLASH_BANKS	1	/* max number of memory banks		*/
157ae691e57SStefan Roese #define CONFIG_SYS_MAX_FLASH_SECT	512	/* max number of sectors on one chip	*/
158ae691e57SStefan Roese 
159ae691e57SStefan Roese #define CONFIG_SYS_FLASH_ERASE_TOUT	120000	/* Timeout for Flash Erase (in ms)	*/
160ae691e57SStefan Roese #define CONFIG_SYS_FLASH_WRITE_TOUT	500	/* Timeout for Flash Write (in ms)	*/
161ae691e57SStefan Roese 
162ae691e57SStefan Roese #ifdef CONFIG_ENV_IS_IN_FLASH
163ae691e57SStefan Roese #define CONFIG_ENV_SECT_SIZE	0x10000		/* size of one complete sector	*/
164ae691e57SStefan Roese #define CONFIG_ENV_ADDR		(CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
165ae691e57SStefan Roese #define	CONFIG_ENV_SIZE		0x4000	/* Total Size of Environment Sector	*/
166ae691e57SStefan Roese 
167ae691e57SStefan Roese /* Address and size of Redundant Environment Sector	*/
168ae691e57SStefan Roese #define CONFIG_ENV_ADDR_REDUND	(CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
169ae691e57SStefan Roese #define CONFIG_ENV_SIZE_REDUND	(CONFIG_ENV_SIZE)
170ae691e57SStefan Roese #endif /* CONFIG_ENV_IS_IN_FLASH */
171ae691e57SStefan Roese #endif /* CONFIG_VCT_NOR */
172ae691e57SStefan Roese 
173ae691e57SStefan Roese #if defined(CONFIG_VCT_ONENAND)
174ae691e57SStefan Roese #define CONFIG_USE_ONENAND_BOARD_INIT
175ae691e57SStefan Roese #define	CONFIG_SYS_ONENAND_BASE		0x00000000	/* this is not real address */
176ae691e57SStefan Roese #define CONFIG_SYS_FLASH_BASE		0x00000000
177ae691e57SStefan Roese #define CONFIG_ENV_ADDR			(128 << 10)	/* after compr. U-Boot image */
178ae691e57SStefan Roese #define	CONFIG_ENV_SIZE			(128 << 10)	/* erase size */
179ae691e57SStefan Roese #endif /* CONFIG_VCT_ONENAND */
180ae691e57SStefan Roese 
181ae691e57SStefan Roese /*
182ae691e57SStefan Roese  * I2C/EEPROM
183ae691e57SStefan Roese  */
184ea818dbbSHeiko Schocher #define CONFIG_SYS_I2C
185ea818dbbSHeiko Schocher #define CONFIG_SYS_I2C_SOFT		/* I2C bit-banged */
186ea818dbbSHeiko Schocher #define CONFIG_SYS_I2C_SOFT_SPEED	83000	/* 83 kHz is supposed to work */
187ea818dbbSHeiko Schocher #define CONFIG_SYS_I2C_SOFT_SLAVE	0x7f
188ae691e57SStefan Roese 
189ae691e57SStefan Roese /*
190ae691e57SStefan Roese  * Software (bit-bang) I2C driver configuration
191ae691e57SStefan Roese  */
192ae691e57SStefan Roese #define CONFIG_SYS_GPIO_I2C_SCL		11
193ae691e57SStefan Roese #define CONFIG_SYS_GPIO_I2C_SDA		10
194ae691e57SStefan Roese 
195ae691e57SStefan Roese #ifndef __ASSEMBLY__
196ae691e57SStefan Roese int vct_gpio_dir(int pin, int dir);
197ae691e57SStefan Roese void vct_gpio_set(int pin, int val);
198ae691e57SStefan Roese int vct_gpio_get(int pin);
199ae691e57SStefan Roese #endif
200ae691e57SStefan Roese 
201ae691e57SStefan Roese #define I2C_INIT	vct_gpio_dir(CONFIG_SYS_GPIO_I2C_SCL, 1)
202ae691e57SStefan Roese #define I2C_ACTIVE	vct_gpio_dir(CONFIG_SYS_GPIO_I2C_SDA, 1)
203ae691e57SStefan Roese #define I2C_TRISTATE	vct_gpio_dir(CONFIG_SYS_GPIO_I2C_SDA, 0)
204ae691e57SStefan Roese #define I2C_READ	vct_gpio_get(CONFIG_SYS_GPIO_I2C_SDA)
205ae691e57SStefan Roese #define I2C_SDA(bit)	vct_gpio_set(CONFIG_SYS_GPIO_I2C_SDA, bit)
206ae691e57SStefan Roese #define I2C_SCL(bit)	vct_gpio_set(CONFIG_SYS_GPIO_I2C_SCL, bit)
207ae691e57SStefan Roese #define I2C_DELAY	udelay(5)	/* 1/4 I2C clock duration */
208ae691e57SStefan Roese 
209ae691e57SStefan Roese #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50
210ae691e57SStefan Roese /* CAT24WC32 */
211ae691e57SStefan Roese #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	2	/* Bytes of address		*/
212ae691e57SStefan Roese #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 5	/* The Catalyst CAT24WC32 has	*/
213ae691e57SStefan Roese 					/* 32 byte page write mode using*/
214ae691e57SStefan Roese 					/* last 5 bits of the address	*/
215ae691e57SStefan Roese #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	10   /* and takes up to 10 msec */
216ae691e57SStefan Roese 
217ae691e57SStefan Roese #define CONFIG_BOOTCOMMAND	"run test3"
218ae691e57SStefan Roese 
219ae691e57SStefan Roese /*
220ae691e57SStefan Roese  * UBI configuration
221ae691e57SStefan Roese  */
222ae691e57SStefan Roese 
223ae691e57SStefan Roese /*
224ae691e57SStefan Roese  * We need a small, stripped down image to fit into the first 128k OneNAND
225ae691e57SStefan Roese  * erase block (gzipped). This image only needs basic commands for FLASH
226ae691e57SStefan Roese  * (NOR/OneNAND) usage and Linux kernel booting.
227ae691e57SStefan Roese  */
228ae691e57SStefan Roese #if defined(CONFIG_VCT_SMALL_IMAGE)
229736fead8SBen Warren #undef CONFIG_SMC911X
230ea818dbbSHeiko Schocher #undef CONFIG_SYS_I2C_SOFT
23174de7aefSWolfgang Denk #undef CONFIG_SOURCE
232ae691e57SStefan Roese #undef CONFIG_SYS_LONGHELP
233ae691e57SStefan Roese #undef CONFIG_TIMESTAMP
234ae691e57SStefan Roese #endif /* CONFIG_VCT_SMALL_IMAGE */
235ae691e57SStefan Roese 
236ae691e57SStefan Roese #endif  /* __CONFIG_H */
237