xref: /rk3399_rockchip-uboot/include/configs/M53017EVB.h (revision bbf6bbffcaf694c03504c661e58fbd1aefe5bf64)
1536e7dacSTsiChung Liew /*
2536e7dacSTsiChung Liew  * Configuation settings for the Freescale MCF53017EVB.
3536e7dacSTsiChung Liew  *
4536e7dacSTsiChung Liew  * Copyright (C) 2004-2008 Freescale Semiconductor, Inc.
5536e7dacSTsiChung Liew  * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
6536e7dacSTsiChung Liew  *
7536e7dacSTsiChung Liew  * See file CREDITS for list of people who contributed to this
8536e7dacSTsiChung Liew  * project.
9536e7dacSTsiChung Liew  *
10536e7dacSTsiChung Liew  * This program is free software; you can redistribute it and/or
11536e7dacSTsiChung Liew  * modify it under the terms of the GNU General Public License as
12536e7dacSTsiChung Liew  * published by the Free Software Foundation; either version 2 of
13536e7dacSTsiChung Liew  * the License, or (at your option) any later version.
14536e7dacSTsiChung Liew  *
15536e7dacSTsiChung Liew  * This program is distributed in the hope that it will be useful,
16536e7dacSTsiChung Liew  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17536e7dacSTsiChung Liew  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
18536e7dacSTsiChung Liew  * GNU General Public License for more details.
19536e7dacSTsiChung Liew  *
20536e7dacSTsiChung Liew  * You should have received a copy of the GNU General Public License
21536e7dacSTsiChung Liew  * along with this program; if not, write to the Free Software
22536e7dacSTsiChung Liew  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23536e7dacSTsiChung Liew  * MA 02111-1307 USA
24536e7dacSTsiChung Liew  */
25536e7dacSTsiChung Liew 
26536e7dacSTsiChung Liew /*
27536e7dacSTsiChung Liew  * board/config.h - configuration options, board specific
28536e7dacSTsiChung Liew  */
29536e7dacSTsiChung Liew 
30536e7dacSTsiChung Liew #ifndef _M53017EVB_H
31536e7dacSTsiChung Liew #define _M53017EVB_H
32536e7dacSTsiChung Liew 
33536e7dacSTsiChung Liew /*
34536e7dacSTsiChung Liew  * High Level Configuration Options
35536e7dacSTsiChung Liew  * (easy to change)
36536e7dacSTsiChung Liew  */
37536e7dacSTsiChung Liew #define CONFIG_MCF5301x		/* define processor family */
38536e7dacSTsiChung Liew #define CONFIG_M53015		/* define processor type */
39536e7dacSTsiChung Liew 
40536e7dacSTsiChung Liew #define CONFIG_MCFUART
41536e7dacSTsiChung Liew #define CONFIG_SYS_UART_PORT		(0)
42536e7dacSTsiChung Liew #define CONFIG_BAUDRATE			115200
43536e7dacSTsiChung Liew #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600 , 19200 , 38400 , 57600, 115200 }
44536e7dacSTsiChung Liew 
45536e7dacSTsiChung Liew #undef CONFIG_WATCHDOG
46536e7dacSTsiChung Liew #define CONFIG_WATCHDOG_TIMEOUT		5000
47536e7dacSTsiChung Liew 
48536e7dacSTsiChung Liew /* Command line configuration */
49536e7dacSTsiChung Liew #include <config_cmd_default.h>
50536e7dacSTsiChung Liew 
51536e7dacSTsiChung Liew #define CONFIG_CMD_CACHE
52536e7dacSTsiChung Liew #define CONFIG_CMD_DATE
53536e7dacSTsiChung Liew #define CONFIG_CMD_ELF
54536e7dacSTsiChung Liew #define CONFIG_CMD_FLASH
55536e7dacSTsiChung Liew #undef CONFIG_CMD_I2C
56536e7dacSTsiChung Liew #define CONFIG_CMD_MEMORY
57536e7dacSTsiChung Liew #define CONFIG_CMD_MISC
58536e7dacSTsiChung Liew #define CONFIG_CMD_MII
59536e7dacSTsiChung Liew #define CONFIG_CMD_NET
60536e7dacSTsiChung Liew #define CONFIG_CMD_PING
61536e7dacSTsiChung Liew #define CONFIG_CMD_REGINFO
62536e7dacSTsiChung Liew 
63536e7dacSTsiChung Liew #define CONFIG_SYS_UNIFY_CACHE
64536e7dacSTsiChung Liew 
65536e7dacSTsiChung Liew #define CONFIG_MCFFEC
66536e7dacSTsiChung Liew #ifdef CONFIG_MCFFEC
67536e7dacSTsiChung Liew #	define CONFIG_NET_MULTI		1
68536e7dacSTsiChung Liew #	define CONFIG_MII		1
69536e7dacSTsiChung Liew #	define CONFIG_MII_INIT		1
70536e7dacSTsiChung Liew #	define CONFIG_SYS_DISCOVER_PHY
71536e7dacSTsiChung Liew #	define CONFIG_SYS_RX_ETH_BUFFER	8
72536e7dacSTsiChung Liew #	define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
73536e7dacSTsiChung Liew #	define CONFIG_HAS_ETH1
74536e7dacSTsiChung Liew 
75536e7dacSTsiChung Liew #	define CONFIG_SYS_FEC0_PINMUX	0
76536e7dacSTsiChung Liew #	define CONFIG_SYS_FEC0_MIIBASE	CONFIG_SYS_FEC0_IOBASE
77536e7dacSTsiChung Liew #	define CONFIG_SYS_FEC1_PINMUX	0
78536e7dacSTsiChung Liew #	define CONFIG_SYS_FEC1_MIIBASE	CONFIG_SYS_FEC1_IOBASE
79536e7dacSTsiChung Liew #	define MCFFEC_TOUT_LOOP		50000
80536e7dacSTsiChung Liew /* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */
81536e7dacSTsiChung Liew #	ifndef CONFIG_SYS_DISCOVER_PHY
82536e7dacSTsiChung Liew #		define FECDUPLEX	FULL
83536e7dacSTsiChung Liew #		define FECSPEED		_100BASET
84536e7dacSTsiChung Liew #	else
85536e7dacSTsiChung Liew #		ifndef CONFIG_SYS_FAULT_ECHO_LINK_DOWN
86536e7dacSTsiChung Liew #			define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
87536e7dacSTsiChung Liew #		endif
88536e7dacSTsiChung Liew #	endif			/* CONFIG_SYS_DISCOVER_PHY */
89536e7dacSTsiChung Liew #endif
90536e7dacSTsiChung Liew 
91536e7dacSTsiChung Liew #define CONFIG_MCFRTC
92536e7dacSTsiChung Liew #undef RTC_DEBUG
93536e7dacSTsiChung Liew #define CONFIG_SYS_RTC_CNT		(0x8000)
94536e7dacSTsiChung Liew #define CONFIG_SYS_RTC_SETUP		(RTC_OCEN_OSCBYP | RTC_OCEN_CLKEN)
95536e7dacSTsiChung Liew 
96536e7dacSTsiChung Liew /* Timer */
97536e7dacSTsiChung Liew #define CONFIG_MCFTMR
98536e7dacSTsiChung Liew #undef CONFIG_MCFPIT
99536e7dacSTsiChung Liew 
100536e7dacSTsiChung Liew /* I2C */
101536e7dacSTsiChung Liew #define CONFIG_FSL_I2C
102536e7dacSTsiChung Liew #define CONFIG_HARD_I2C			/* I2C with hw support */
103536e7dacSTsiChung Liew #undef CONFIG_SOFT_I2C			/* I2C bit-banged */
104536e7dacSTsiChung Liew #define CONFIG_SYS_I2C_SPEED		80000
105536e7dacSTsiChung Liew #define CONFIG_SYS_I2C_SLAVE		0x7F
106536e7dacSTsiChung Liew #define CONFIG_SYS_I2C_OFFSET		0x58000
107536e7dacSTsiChung Liew #define CONFIG_SYS_IMMR			CONFIG_SYS_MBAR
108536e7dacSTsiChung Liew 
109536e7dacSTsiChung Liew #define CONFIG_BOOTDELAY		1	/* autoboot after 5 seconds */
110536e7dacSTsiChung Liew #define CONFIG_UDP_CHECKSUM
111536e7dacSTsiChung Liew 
112536e7dacSTsiChung Liew #ifdef CONFIG_MCFFEC
113536e7dacSTsiChung Liew #	define CONFIG_ETHADDR	00:e0:0c:bc:e5:60
114536e7dacSTsiChung Liew #	define CONFIG_ETH1ADDR	00:e0:0c:bc:e5:61
115536e7dacSTsiChung Liew #	define CONFIG_IPADDR	192.162.1.2
116536e7dacSTsiChung Liew #	define CONFIG_NETMASK	255.255.255.0
117536e7dacSTsiChung Liew #	define CONFIG_SERVERIP	192.162.1.1
118536e7dacSTsiChung Liew #	define CONFIG_GATEWAYIP	192.162.1.1
119536e7dacSTsiChung Liew #	define CONFIG_OVERWRITE_ETHADDR_ONCE
120536e7dacSTsiChung Liew #endif				/* FEC_ENET */
121536e7dacSTsiChung Liew 
122536e7dacSTsiChung Liew #define CONFIG_HOSTNAME		M53017
123536e7dacSTsiChung Liew #define CONFIG_EXTRA_ENV_SETTINGS		\
124536e7dacSTsiChung Liew 	"netdev=eth0\0"				\
125536e7dacSTsiChung Liew 	"loadaddr=40010000\0"			\
126536e7dacSTsiChung Liew 	"u-boot=u-boot.bin\0"			\
127536e7dacSTsiChung Liew 	"load=tftp ${loadaddr) ${u-boot}\0"	\
128536e7dacSTsiChung Liew 	"upd=run load; run prog\0"		\
129536e7dacSTsiChung Liew 	"prog=prot off 0 3ffff;"		\
130536e7dacSTsiChung Liew 	"era 0 3ffff;"				\
131536e7dacSTsiChung Liew 	"cp.b ${loadaddr} 0 ${filesize};"	\
132536e7dacSTsiChung Liew 	"save\0"				\
133536e7dacSTsiChung Liew 	""
134536e7dacSTsiChung Liew 
135536e7dacSTsiChung Liew #define CONFIG_PRAM		512	/* 512 KB */
136536e7dacSTsiChung Liew #define CONFIG_SYS_PROMPT	"-> "
137536e7dacSTsiChung Liew #define CONFIG_SYS_LONGHELP	/* undef to save memory */
138536e7dacSTsiChung Liew 
139536e7dacSTsiChung Liew #ifdef CONFIG_CMD_KGDB
140536e7dacSTsiChung Liew #	define CONFIG_SYS_CBSIZE	1024	/* Console I/O Buffer Size */
141536e7dacSTsiChung Liew #else
142536e7dacSTsiChung Liew #	define CONFIG_SYS_CBSIZE	256	/* Console I/O Buffer Size */
143536e7dacSTsiChung Liew #endif
144536e7dacSTsiChung Liew 
145536e7dacSTsiChung Liew #define CONFIG_SYS_PBSIZE	(CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)	/* Print Buffer Size */
146536e7dacSTsiChung Liew #define CONFIG_SYS_MAXARGS	16		/* max number of cmd args */
147536e7dacSTsiChung Liew #define CONFIG_SYS_BARGSIZE	CONFIG_SYS_CBSIZE	/* Boot Arg Buf Sz */
148536e7dacSTsiChung Liew #define CONFIG_SYS_LOAD_ADDR	0x40010000
149536e7dacSTsiChung Liew 
150536e7dacSTsiChung Liew #define CONFIG_SYS_HZ		1000
151536e7dacSTsiChung Liew #define CONFIG_SYS_CLK		80000000
152536e7dacSTsiChung Liew #define CONFIG_SYS_CPU_CLK	CONFIG_SYS_CLK * 3
153536e7dacSTsiChung Liew 
154536e7dacSTsiChung Liew #define CONFIG_SYS_MBAR		0xFC000000
155536e7dacSTsiChung Liew 
156536e7dacSTsiChung Liew /*
157536e7dacSTsiChung Liew  * Low Level Configuration Settings
158536e7dacSTsiChung Liew  * (address mappings, register initial values, etc.)
159536e7dacSTsiChung Liew  * You should know what you are doing if you make changes here.
160536e7dacSTsiChung Liew  */
161536e7dacSTsiChung Liew /*
162536e7dacSTsiChung Liew  * Definitions for initial stack pointer and data area (in DPRAM)
163536e7dacSTsiChung Liew  */
164536e7dacSTsiChung Liew #define CONFIG_SYS_INIT_RAM_ADDR	0x80000000
165536e7dacSTsiChung Liew #define CONFIG_SYS_INIT_RAM_END		0x20000	/* End of used area in internal SRAM */
166536e7dacSTsiChung Liew #define CONFIG_SYS_INIT_RAM_CTRL	0x21
167536e7dacSTsiChung Liew #define CONFIG_SYS_GBL_DATA_SIZE	128	/* size in bytes reserved for initial data */
168536e7dacSTsiChung Liew #define CONFIG_SYS_GBL_DATA_OFFSET	((CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) - 0x10)
169536e7dacSTsiChung Liew #define CONFIG_SYS_INIT_SP_OFFSET	CONFIG_SYS_GBL_DATA_OFFSET
170536e7dacSTsiChung Liew 
171536e7dacSTsiChung Liew /*
172536e7dacSTsiChung Liew  * Start addresses for the final memory configuration
173536e7dacSTsiChung Liew  * (Set up by the startup code)
174536e7dacSTsiChung Liew  * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
175536e7dacSTsiChung Liew  */
176536e7dacSTsiChung Liew #define CONFIG_SYS_SDRAM_BASE		0x40000000
177536e7dacSTsiChung Liew #define CONFIG_SYS_SDRAM_SIZE		64	/* SDRAM size in MB */
178536e7dacSTsiChung Liew #define CONFIG_SYS_SDRAM_CFG1		0x43711630
179536e7dacSTsiChung Liew #define CONFIG_SYS_SDRAM_CFG2		0x56670000
180536e7dacSTsiChung Liew #define CONFIG_SYS_SDRAM_CTRL		0xE1002000
181536e7dacSTsiChung Liew #define CONFIG_SYS_SDRAM_EMOD		0x80010000
182536e7dacSTsiChung Liew #define CONFIG_SYS_SDRAM_MODE		0x00CD0000
183536e7dacSTsiChung Liew 
184536e7dacSTsiChung Liew #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE + 0x400
185536e7dacSTsiChung Liew #define CONFIG_SYS_MEMTEST_END		((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
186536e7dacSTsiChung Liew 
187536e7dacSTsiChung Liew #define CONFIG_SYS_MONITOR_BASE		(CONFIG_SYS_FLASH_BASE + 0x400)
188536e7dacSTsiChung Liew #define CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* Reserve 256 kB for Monitor */
189536e7dacSTsiChung Liew 
190536e7dacSTsiChung Liew #define CONFIG_SYS_BOOTPARAMS_LEN	64*1024
191536e7dacSTsiChung Liew #define CONFIG_SYS_MALLOC_LEN		(128 << 10)	/* Reserve 128 kB for malloc() */
192536e7dacSTsiChung Liew 
193536e7dacSTsiChung Liew /*
194536e7dacSTsiChung Liew  * For booting Linux, the board info and command line data
195536e7dacSTsiChung Liew  * have to be in the first 8 MB of memory, since this is
196536e7dacSTsiChung Liew  * the maximum mapped by the Linux kernel during initialization ??
197536e7dacSTsiChung Liew  */
198536e7dacSTsiChung Liew #define CONFIG_SYS_BOOTMAPSZ		(CONFIG_SYS_SDRAM_BASE + (CONFIG_SYS_SDRAM_SIZE << 20))
199d6e4baf4STsiChung Liew #define CONFIG_SYS_BOOTM_LEN		(CONFIG_SYS_SDRAM_SIZE << 20)
200536e7dacSTsiChung Liew 
201536e7dacSTsiChung Liew /*-----------------------------------------------------------------------
202536e7dacSTsiChung Liew  * FLASH organization
203536e7dacSTsiChung Liew  */
204536e7dacSTsiChung Liew #define CONFIG_SYS_FLASH_CFI
205536e7dacSTsiChung Liew #ifdef CONFIG_SYS_FLASH_CFI
206536e7dacSTsiChung Liew #	define CONFIG_FLASH_CFI_DRIVER		1
207*bbf6bbffSTsiChung Liew #	define CONFIG_SYS_FLASH_USE_BUFFER_WRITE	1
208*bbf6bbffSTsiChung Liew #	define CONFIG_FLASH_SPANSION_S29WS_N	1
209536e7dacSTsiChung Liew #	define CONFIG_SYS_FLASH_SIZE		0x800000	/* Max size that the board might have */
210536e7dacSTsiChung Liew #	define CONFIG_SYS_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
211536e7dacSTsiChung Liew #	define CONFIG_SYS_MAX_FLASH_BANKS	1	/* max number of memory banks */
212536e7dacSTsiChung Liew #	define CONFIG_SYS_MAX_FLASH_SECT	137	/* max number of sectors on one chip */
213536e7dacSTsiChung Liew #	define CONFIG_SYS_FLASH_PROTECTION	/* "Real" (hardware) sectors protection */
214536e7dacSTsiChung Liew #endif
215536e7dacSTsiChung Liew 
216536e7dacSTsiChung Liew #define CONFIG_SYS_FLASH_BASE		CONFIG_SYS_CS0_BASE
217536e7dacSTsiChung Liew 
218536e7dacSTsiChung Liew /* Configuration for environment
219536e7dacSTsiChung Liew  * Environment is embedded in u-boot in the second sector of the flash
220536e7dacSTsiChung Liew  */
221536e7dacSTsiChung Liew #define CONFIG_ENV_OFFSET		0x8000
222536e7dacSTsiChung Liew #define CONFIG_ENV_SIZE			0x1000
223536e7dacSTsiChung Liew #define CONFIG_ENV_SECT_SIZE		0x8000
224536e7dacSTsiChung Liew #define CONFIG_ENV_IS_IN_FLASH		1
225536e7dacSTsiChung Liew 
226536e7dacSTsiChung Liew /*-----------------------------------------------------------------------
227536e7dacSTsiChung Liew  * Cache Configuration
228536e7dacSTsiChung Liew  */
229536e7dacSTsiChung Liew #define CONFIG_SYS_CACHELINE_SIZE	16
230536e7dacSTsiChung Liew 
231536e7dacSTsiChung Liew /*-----------------------------------------------------------------------
232536e7dacSTsiChung Liew  * Chipselect bank definitions
233536e7dacSTsiChung Liew  */
234536e7dacSTsiChung Liew /*
235536e7dacSTsiChung Liew  * CS0 - NOR Flash
236536e7dacSTsiChung Liew  * CS1 - Ext SRAM
237536e7dacSTsiChung Liew  * CS2 - Available
238536e7dacSTsiChung Liew  * CS3 - Available
239536e7dacSTsiChung Liew  * CS4 - Available
240536e7dacSTsiChung Liew  * CS5 - Available
241536e7dacSTsiChung Liew  */
242536e7dacSTsiChung Liew #define CONFIG_SYS_CS0_BASE		0
243536e7dacSTsiChung Liew #define CONFIG_SYS_CS0_MASK		0x00FF0001
244536e7dacSTsiChung Liew #define CONFIG_SYS_CS0_CTRL		0x00001FA0
245536e7dacSTsiChung Liew 
246536e7dacSTsiChung Liew #define CONFIG_SYS_CS1_BASE		0xC0000000
247536e7dacSTsiChung Liew #define CONFIG_SYS_CS1_MASK		0x00070001
248536e7dacSTsiChung Liew #define CONFIG_SYS_CS1_CTRL		0x00001FA0
249536e7dacSTsiChung Liew 
250536e7dacSTsiChung Liew #endif				/* _M53017EVB_H */
251