xref: /rk3399_rockchip-uboot/include/configs/microblaze-generic.h (revision 52a822ed9c37a2ea0ed112a26d8ff5a6cb1c6f10)
1*52a822edSMichal Simek /*
2*52a822edSMichal Simek  * (C) Copyright 2007-2008 Michal Simek
3*52a822edSMichal Simek  *
4*52a822edSMichal Simek  * Michal SIMEK <monstr@monstr.eu>
5*52a822edSMichal Simek  *
6*52a822edSMichal Simek  * See file CREDITS for list of people who contributed to this
7*52a822edSMichal Simek  * project.
8*52a822edSMichal Simek  *
9*52a822edSMichal Simek  * This program is free software; you can redistribute it and/or
10*52a822edSMichal Simek  * modify it under the terms of the GNU General Public License as
11*52a822edSMichal Simek  * published by the Free Software Foundation; either version 2 of
12*52a822edSMichal Simek  * the License, or (at your option) any later version.
13*52a822edSMichal Simek  *
14*52a822edSMichal Simek  * This program is distributed in the hope that it will be useful,
15*52a822edSMichal Simek  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16*52a822edSMichal Simek  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17*52a822edSMichal Simek  * GNU General Public License for more details.
18*52a822edSMichal Simek  *
19*52a822edSMichal Simek  * You should have received a copy of the GNU General Public License
20*52a822edSMichal Simek  * along with this program; if not, write to the Free Software
21*52a822edSMichal Simek  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22*52a822edSMichal Simek  * MA 02111-1307 USA
23*52a822edSMichal Simek  */
24*52a822edSMichal Simek 
25*52a822edSMichal Simek #ifndef __CONFIG_H
26*52a822edSMichal Simek #define __CONFIG_H
27*52a822edSMichal Simek 
28*52a822edSMichal Simek #include "../board/xilinx/microblaze-generic/xparameters.h"
29*52a822edSMichal Simek 
30*52a822edSMichal Simek #define	CONFIG_MICROBLAZE	1	/* MicroBlaze CPU */
31*52a822edSMichal Simek #define	MICROBLAZE_V5		1
32*52a822edSMichal Simek 
33*52a822edSMichal Simek /* uart */
34*52a822edSMichal Simek #ifdef XILINX_UARTLITE_BASEADDR
35*52a822edSMichal Simek #define	CONFIG_XILINX_UARTLITE
36*52a822edSMichal Simek #define	CONFIG_SERIAL_BASE	XILINX_UARTLITE_BASEADDR
37*52a822edSMichal Simek #define	CONFIG_BAUDRATE		XILINX_UARTLITE_BAUDRATE
38*52a822edSMichal Simek #define	CONFIG_SYS_BAUDRATE_TABLE	{ CONFIG_BAUDRATE }
39*52a822edSMichal Simek #elif XILINX_UART16550_BASEADDR
40*52a822edSMichal Simek #define CONFIG_SYS_NS16550	1
41*52a822edSMichal Simek #define CONFIG_SYS_NS16550_SERIAL
42*52a822edSMichal Simek #define CONFIG_SYS_NS16550_REG_SIZE	-4
43*52a822edSMichal Simek #define CONFIG_CONS_INDEX	1
44*52a822edSMichal Simek #define CONFIG_SYS_NS16550_COM1	(XILINX_UART16550_BASEADDR + 0x1000 + 0x3)
45*52a822edSMichal Simek #define CONFIG_SYS_NS16550_CLK		XILINX_UART16550_CLOCK_HZ
46*52a822edSMichal Simek #define	CONFIG_BAUDRATE		115200
47*52a822edSMichal Simek 
48*52a822edSMichal Simek /* The following table includes the supported baudrates */
49*52a822edSMichal Simek #define CONFIG_SYS_BAUDRATE_TABLE  \
50*52a822edSMichal Simek 	{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
51*52a822edSMichal Simek #else
52*52a822edSMichal Simek #error Undefined uart
53*52a822edSMichal Simek #endif
54*52a822edSMichal Simek 
55*52a822edSMichal Simek /* setting reset address */
56*52a822edSMichal Simek /*#define	CONFIG_SYS_RESET_ADDRESS	TEXT_BASE*/
57*52a822edSMichal Simek 
58*52a822edSMichal Simek /* ethernet */
59*52a822edSMichal Simek #ifdef XILINX_EMAC_BASEADDR
60*52a822edSMichal Simek #define CONFIG_XILINX_EMAC	1
61*52a822edSMichal Simek #define CONFIG_SYS_ENET
62*52a822edSMichal Simek #else
63*52a822edSMichal Simek #ifdef XILINX_EMACLITE_BASEADDR
64*52a822edSMichal Simek #define CONFIG_XILINX_EMACLITE	1
65*52a822edSMichal Simek #define CONFIG_SYS_ENET
66*52a822edSMichal Simek #endif
67*52a822edSMichal Simek #endif
68*52a822edSMichal Simek #undef ET_DEBUG
69*52a822edSMichal Simek 
70*52a822edSMichal Simek /* gpio */
71*52a822edSMichal Simek #ifdef XILINX_GPIO_BASEADDR
72*52a822edSMichal Simek #define	CONFIG_SYS_GPIO_0		1
73*52a822edSMichal Simek #define	CONFIG_SYS_GPIO_0_ADDR		XILINX_GPIO_BASEADDR
74*52a822edSMichal Simek #endif
75*52a822edSMichal Simek 
76*52a822edSMichal Simek /* interrupt controller */
77*52a822edSMichal Simek #ifdef XILINX_INTC_BASEADDR
78*52a822edSMichal Simek #define	CONFIG_SYS_INTC_0		1
79*52a822edSMichal Simek #define	CONFIG_SYS_INTC_0_ADDR		XILINX_INTC_BASEADDR
80*52a822edSMichal Simek #define	CONFIG_SYS_INTC_0_NUM		XILINX_INTC_NUM_INTR_INPUTS
81*52a822edSMichal Simek #endif
82*52a822edSMichal Simek 
83*52a822edSMichal Simek /* timer */
84*52a822edSMichal Simek #ifdef XILINX_TIMER_BASEADDR
85*52a822edSMichal Simek #if (XILINX_TIMER_IRQ != -1)
86*52a822edSMichal Simek #define	CONFIG_SYS_TIMER_0		1
87*52a822edSMichal Simek #define	CONFIG_SYS_TIMER_0_ADDR	XILINX_TIMER_BASEADDR
88*52a822edSMichal Simek #define	CONFIG_SYS_TIMER_0_IRQ		XILINX_TIMER_IRQ
89*52a822edSMichal Simek #define	FREQUENCE		XILINX_CLOCK_FREQ
90*52a822edSMichal Simek #define	CONFIG_SYS_TIMER_0_PRELOAD	( FREQUENCE/1000 )
91*52a822edSMichal Simek #endif
92*52a822edSMichal Simek #else
93*52a822edSMichal Simek #ifdef XILINX_CLOCK_FREQ
94*52a822edSMichal Simek #define	CONFIG_XILINX_CLOCK_FREQ	XILINX_CLOCK_FREQ
95*52a822edSMichal Simek #else
96*52a822edSMichal Simek #error BAD CLOCK FREQ
97*52a822edSMichal Simek #endif
98*52a822edSMichal Simek #endif
99*52a822edSMichal Simek /* FSL */
100*52a822edSMichal Simek /* #define	CONFIG_SYS_FSL_2 */
101*52a822edSMichal Simek /* #define	FSL_INTR_2	1 */
102*52a822edSMichal Simek 
103*52a822edSMichal Simek /*
104*52a822edSMichal Simek  * memory layout - Example
105*52a822edSMichal Simek  * TEXT_BASE = 0x1200_0000;
106*52a822edSMichal Simek  * CONFIG_SYS_SRAM_BASE = 0x1000_0000;
107*52a822edSMichal Simek  * CONFIG_SYS_SRAM_SIZE = 0x0400_0000;
108*52a822edSMichal Simek  *
109*52a822edSMichal Simek  * CONFIG_SYS_GBL_DATA_OFFSET = 0x1000_0000 + 0x0400_0000 - 0x1000 = 0x13FF_F000
110*52a822edSMichal Simek  * CONFIG_SYS_MONITOR_BASE = 0x13FF_F000 - 0x40000 = 0x13FB_F000
111*52a822edSMichal Simek  * CONFIG_SYS_MALLOC_BASE = 0x13FB_F000 - 0x40000 = 0x13F7_F000
112*52a822edSMichal Simek  *
113*52a822edSMichal Simek  * 0x1000_0000	CONFIG_SYS_SDRAM_BASE
114*52a822edSMichal Simek  *					FREE
115*52a822edSMichal Simek  * 0x1200_0000	TEXT_BASE
116*52a822edSMichal Simek  *		U-BOOT code
117*52a822edSMichal Simek  * 0x1202_0000
118*52a822edSMichal Simek  *					FREE
119*52a822edSMichal Simek  *
120*52a822edSMichal Simek  *					STACK
121*52a822edSMichal Simek  * 0x13F7_F000	CONFIG_SYS_MALLOC_BASE
122*52a822edSMichal Simek  *					MALLOC_AREA	256kB	Alloc
123*52a822edSMichal Simek  * 0x11FB_F000	CONFIG_SYS_MONITOR_BASE
124*52a822edSMichal Simek  *					MONITOR_CODE	256kB	Env
125*52a822edSMichal Simek  * 0x13FF_F000	CONFIG_SYS_GBL_DATA_OFFSET
126*52a822edSMichal Simek  *					GLOBAL_DATA	4kB	bd, gd
127*52a822edSMichal Simek  * 0x1400_0000	CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_SDRAM_SIZE
128*52a822edSMichal Simek  */
129*52a822edSMichal Simek 
130*52a822edSMichal Simek /* ddr sdram - main memory */
131*52a822edSMichal Simek #define	CONFIG_SYS_SDRAM_BASE		XILINX_RAM_START
132*52a822edSMichal Simek #define	CONFIG_SYS_SDRAM_SIZE		XILINX_RAM_SIZE
133*52a822edSMichal Simek #define	CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
134*52a822edSMichal Simek #define	CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_SDRAM_BASE + 0x1000)
135*52a822edSMichal Simek 
136*52a822edSMichal Simek /* global pointer */
137*52a822edSMichal Simek #define	CONFIG_SYS_GBL_DATA_SIZE	0x1000	/* size of global data */
138*52a822edSMichal Simek /* start of global data */
139*52a822edSMichal Simek #define	CONFIG_SYS_GBL_DATA_OFFSET	(CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_SDRAM_SIZE - CONFIG_SYS_GBL_DATA_SIZE)
140*52a822edSMichal Simek 
141*52a822edSMichal Simek /* monitor code */
142*52a822edSMichal Simek #define	SIZE			0x40000
143*52a822edSMichal Simek #define	CONFIG_SYS_MONITOR_LEN		SIZE
144*52a822edSMichal Simek #define	CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_GBL_DATA_OFFSET - CONFIG_SYS_MONITOR_LEN)
145*52a822edSMichal Simek #define	CONFIG_SYS_MONITOR_END		(CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
146*52a822edSMichal Simek #define	CONFIG_SYS_MALLOC_LEN		SIZE
147*52a822edSMichal Simek #define	CONFIG_SYS_MALLOC_BASE		(CONFIG_SYS_MONITOR_BASE - CONFIG_SYS_MALLOC_LEN)
148*52a822edSMichal Simek 
149*52a822edSMichal Simek /* stack */
150*52a822edSMichal Simek #define	CONFIG_SYS_INIT_SP_OFFSET	CONFIG_SYS_MONITOR_BASE
151*52a822edSMichal Simek 
152*52a822edSMichal Simek /*#define	RAMENV */
153*52a822edSMichal Simek #define	FLASH
154*52a822edSMichal Simek 
155*52a822edSMichal Simek #ifdef FLASH
156*52a822edSMichal Simek 	#define	CONFIG_SYS_FLASH_BASE		XILINX_FLASH_START
157*52a822edSMichal Simek 	#define	CONFIG_SYS_FLASH_SIZE		XILINX_FLASH_SIZE
158*52a822edSMichal Simek 	#define	CONFIG_SYS_FLASH_CFI		1
159*52a822edSMichal Simek 	#define	CONFIG_FLASH_CFI_DRIVER	1
160*52a822edSMichal Simek 	#define	CONFIG_SYS_FLASH_EMPTY_INFO	1	/* ?empty sector */
161*52a822edSMichal Simek 	#define	CONFIG_SYS_MAX_FLASH_BANKS	1	/* max number of memory banks */
162*52a822edSMichal Simek 	#define	CONFIG_SYS_MAX_FLASH_SECT	128	/* max number of sectors on one chip */
163*52a822edSMichal Simek 	#define	CONFIG_SYS_FLASH_PROTECTION		/* hardware flash protection */
164*52a822edSMichal Simek 
165*52a822edSMichal Simek 	#ifdef	RAMENV
166*52a822edSMichal Simek 		#define	CONFIG_ENV_IS_NOWHERE	1
167*52a822edSMichal Simek 		#define	CONFIG_ENV_SIZE		0x1000
168*52a822edSMichal Simek 		#define	CONFIG_ENV_ADDR		(CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE)
169*52a822edSMichal Simek 
170*52a822edSMichal Simek 	#else	/* !RAMENV */
171*52a822edSMichal Simek 		#define	CONFIG_ENV_IS_IN_FLASH	1
172*52a822edSMichal Simek 		#define	CONFIG_ENV_SECT_SIZE	0x40000	/* 256K(one sector) for env */
173*52a822edSMichal Simek 		#define	CONFIG_ENV_ADDR		(CONFIG_SYS_FLASH_BASE + (2 * CONFIG_ENV_SECT_SIZE))
174*52a822edSMichal Simek 		#define	CONFIG_ENV_SIZE		0x40000
175*52a822edSMichal Simek 	#endif /* !RAMBOOT */
176*52a822edSMichal Simek #else /* !FLASH */
177*52a822edSMichal Simek 	/* ENV in RAM */
178*52a822edSMichal Simek 	#define	CONFIG_SYS_NO_FLASH		1
179*52a822edSMichal Simek 	#define	CONFIG_ENV_IS_NOWHERE	1
180*52a822edSMichal Simek 	#define	CONFIG_ENV_SIZE		0x1000
181*52a822edSMichal Simek 	#define	CONFIG_ENV_ADDR		(CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE)
182*52a822edSMichal Simek 	#define	CONFIG_SYS_FLASH_PROTECTION		/* hardware flash protection */
183*52a822edSMichal Simek #endif /* !FLASH */
184*52a822edSMichal Simek 
185*52a822edSMichal Simek /* system ace */
186*52a822edSMichal Simek #ifdef XILINX_SYSACE_BASEADDR
187*52a822edSMichal Simek 	#define	CONFIG_SYSTEMACE
188*52a822edSMichal Simek 	/* #define DEBUG_SYSTEMACE */
189*52a822edSMichal Simek 	#define	SYSTEMACE_CONFIG_FPGA
190*52a822edSMichal Simek 	#define	CONFIG_SYS_SYSTEMACE_BASE	XILINX_SYSACE_BASEADDR
191*52a822edSMichal Simek 	#define	CONFIG_SYS_SYSTEMACE_WIDTH	XILINX_SYSACE_MEM_WIDTH
192*52a822edSMichal Simek 	#define	CONFIG_DOS_PARTITION
193*52a822edSMichal Simek #endif
194*52a822edSMichal Simek 
195*52a822edSMichal Simek /*
196*52a822edSMichal Simek  * BOOTP options
197*52a822edSMichal Simek  */
198*52a822edSMichal Simek #define CONFIG_BOOTP_BOOTFILESIZE
199*52a822edSMichal Simek #define CONFIG_BOOTP_BOOTPATH
200*52a822edSMichal Simek #define CONFIG_BOOTP_GATEWAY
201*52a822edSMichal Simek #define CONFIG_BOOTP_HOSTNAME
202*52a822edSMichal Simek 
203*52a822edSMichal Simek /*
204*52a822edSMichal Simek  * Command line configuration.
205*52a822edSMichal Simek  */
206*52a822edSMichal Simek #include <config_cmd_default.h>
207*52a822edSMichal Simek 
208*52a822edSMichal Simek #define CONFIG_CMD_ASKENV
209*52a822edSMichal Simek #define CONFIG_CMD_CACHE
210*52a822edSMichal Simek #define CONFIG_CMD_IRQ
211*52a822edSMichal Simek #define CONFIG_CMD_MFSL
212*52a822edSMichal Simek 
213*52a822edSMichal Simek #ifndef CONFIG_SYS_ENET
214*52a822edSMichal Simek 	#undef CONFIG_CMD_NET
215*52a822edSMichal Simek #else
216*52a822edSMichal Simek 	#define CONFIG_CMD_PING
217*52a822edSMichal Simek #endif
218*52a822edSMichal Simek 
219*52a822edSMichal Simek #if defined(CONFIG_SYSTEMACE)
220*52a822edSMichal Simek 	#define CONFIG_CMD_EXT2
221*52a822edSMichal Simek 	#define CONFIG_CMD_FAT
222*52a822edSMichal Simek #endif
223*52a822edSMichal Simek 
224*52a822edSMichal Simek #if defined(FLASH)
225*52a822edSMichal Simek 	#define CONFIG_CMD_ECHO
226*52a822edSMichal Simek 	#define CONFIG_CMD_FLASH
227*52a822edSMichal Simek 	#define CONFIG_CMD_IMLS
228*52a822edSMichal Simek 	#define CONFIG_CMD_JFFS2
229*52a822edSMichal Simek 
230*52a822edSMichal Simek 	#if !defined(RAMENV)
231*52a822edSMichal Simek 		#define CONFIG_CMD_ENV
232*52a822edSMichal Simek 		#define CONFIG_CMD_SAVES
233*52a822edSMichal Simek 	#endif
234*52a822edSMichal Simek #else
235*52a822edSMichal Simek 	#undef CONFIG_CMD_FLASH
236*52a822edSMichal Simek #endif
237*52a822edSMichal Simek 
238*52a822edSMichal Simek #if defined(CONFIG_CMD_JFFS2)
239*52a822edSMichal Simek /* JFFS2 partitions */
240*52a822edSMichal Simek #define CONFIG_JFFS2_CMDLINE	/* mtdparts command line support */
241*52a822edSMichal Simek #define MTDIDS_DEFAULT		"nor0=ml401-0"
242*52a822edSMichal Simek 
243*52a822edSMichal Simek /* default mtd partition table */
244*52a822edSMichal Simek #define MTDPARTS_DEFAULT	"mtdparts=ml401-0:256k(u-boot),"\
245*52a822edSMichal Simek 				"256k(env),3m(kernel),1m(romfs),"\
246*52a822edSMichal Simek 				"1m(cramfs),-(jffs2)"
247*52a822edSMichal Simek #endif
248*52a822edSMichal Simek 
249*52a822edSMichal Simek /* Miscellaneous configurable options */
250*52a822edSMichal Simek #define	CONFIG_SYS_PROMPT	"U-Boot-mONStR> "
251*52a822edSMichal Simek #define	CONFIG_SYS_CBSIZE	512	/* size of console buffer */
252*52a822edSMichal Simek #define	CONFIG_SYS_PBSIZE	(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) /* print buffer size */
253*52a822edSMichal Simek #define	CONFIG_SYS_MAXARGS	15	/* max number of command args */
254*52a822edSMichal Simek #define	CONFIG_SYS_LONGHELP
255*52a822edSMichal Simek #define	CONFIG_SYS_LOAD_ADDR	0x12000000 /* default load address */
256*52a822edSMichal Simek 
257*52a822edSMichal Simek #define	CONFIG_BOOTDELAY	30
258*52a822edSMichal Simek #define	CONFIG_BOOTARGS		"root=romfs"
259*52a822edSMichal Simek #define	CONFIG_HOSTNAME		"ml401"
260*52a822edSMichal Simek #define	CONFIG_BOOTCOMMAND	"base 0;tftp 11000000 image.img;bootm"
261*52a822edSMichal Simek #define	CONFIG_IPADDR		192.168.0.3
262*52a822edSMichal Simek #define	CONFIG_SERVERIP		192.168.0.5
263*52a822edSMichal Simek #define	CONFIG_GATEWAYIP	192.168.0.1
264*52a822edSMichal Simek #define	CONFIG_ETHADDR		00:E0:0C:00:00:FD
265*52a822edSMichal Simek 
266*52a822edSMichal Simek /* architecture dependent code */
267*52a822edSMichal Simek #define	CONFIG_SYS_USR_EXCEP	/* user exception */
268*52a822edSMichal Simek #define CONFIG_SYS_HZ	1000
269*52a822edSMichal Simek 
270*52a822edSMichal Simek #define	CONFIG_PREBOOT		"echo U-BOOT for ML401;setenv preboot;echo"
271*52a822edSMichal Simek 
272*52a822edSMichal Simek #define	CONFIG_EXTRA_ENV_SETTINGS	"unlock=yes\0" /* hardware flash protection */\
273*52a822edSMichal Simek 					"nor0=ml401-0\0"\
274*52a822edSMichal Simek 					"mtdparts=mtdparts=ml401-0:"\
275*52a822edSMichal Simek 					"256k(u-boot),256k(env),3m(kernel),"\
276*52a822edSMichal Simek 					"1m(romfs),1m(cramfs),-(jffs2)\0"
277*52a822edSMichal Simek 
278*52a822edSMichal Simek #define CONFIG_CMDLINE_EDITING
279*52a822edSMichal Simek 
280*52a822edSMichal Simek #endif	/* __CONFIG_H */
281