xref: /rk3399_rockchip-uboot/include/configs/M53017EVB.h (revision e090579d0a2d1aa38eab94b98877de9bcdd4f31d)
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  *
71a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
8536e7dacSTsiChung Liew  */
9536e7dacSTsiChung Liew 
10536e7dacSTsiChung Liew /*
11536e7dacSTsiChung Liew  * board/config.h - configuration options, board specific
12536e7dacSTsiChung Liew  */
13536e7dacSTsiChung Liew 
14536e7dacSTsiChung Liew #ifndef _M53017EVB_H
15536e7dacSTsiChung Liew #define _M53017EVB_H
16536e7dacSTsiChung Liew 
17536e7dacSTsiChung Liew /*
18536e7dacSTsiChung Liew  * High Level Configuration Options
19536e7dacSTsiChung Liew  * (easy to change)
20536e7dacSTsiChung Liew  */
21536e7dacSTsiChung Liew 
22536e7dacSTsiChung Liew #define CONFIG_MCFUART
23536e7dacSTsiChung Liew #define CONFIG_SYS_UART_PORT		(0)
24536e7dacSTsiChung Liew 
25536e7dacSTsiChung Liew #undef CONFIG_WATCHDOG
26536e7dacSTsiChung Liew #define CONFIG_WATCHDOG_TIMEOUT		5000
27536e7dacSTsiChung Liew 
28536e7dacSTsiChung Liew #define CONFIG_SYS_UNIFY_CACHE
29536e7dacSTsiChung Liew 
30536e7dacSTsiChung Liew #define CONFIG_MCFFEC
31536e7dacSTsiChung Liew #ifdef CONFIG_MCFFEC
32536e7dacSTsiChung Liew #	define CONFIG_MII		1
33536e7dacSTsiChung Liew #	define CONFIG_MII_INIT		1
34536e7dacSTsiChung Liew #	define CONFIG_SYS_DISCOVER_PHY
35536e7dacSTsiChung Liew #	define CONFIG_SYS_RX_ETH_BUFFER	8
369e8e9270STsiChung Liew #	define CONFIG_SYS_TX_ETH_BUFFER	8
379e8e9270STsiChung Liew #	define CONFIG_SYS_FEC_BUF_USE_SRAM
38536e7dacSTsiChung Liew #	define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
39536e7dacSTsiChung Liew #	define CONFIG_HAS_ETH1
40536e7dacSTsiChung Liew 
41536e7dacSTsiChung Liew #	define CONFIG_SYS_FEC0_PINMUX	0
42536e7dacSTsiChung Liew #	define CONFIG_SYS_FEC0_MIIBASE	CONFIG_SYS_FEC0_IOBASE
43536e7dacSTsiChung Liew #	define CONFIG_SYS_FEC1_PINMUX	0
44536e7dacSTsiChung Liew #	define CONFIG_SYS_FEC1_MIIBASE	CONFIG_SYS_FEC1_IOBASE
45536e7dacSTsiChung Liew #	define MCFFEC_TOUT_LOOP		50000
46052c0891STsiChung Liew 
47536e7dacSTsiChung Liew /* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */
48536e7dacSTsiChung Liew #	ifndef CONFIG_SYS_DISCOVER_PHY
49536e7dacSTsiChung Liew #		define FECDUPLEX	FULL
50536e7dacSTsiChung Liew #		define FECSPEED		_100BASET
51536e7dacSTsiChung Liew #	else
52536e7dacSTsiChung Liew #		ifndef CONFIG_SYS_FAULT_ECHO_LINK_DOWN
53536e7dacSTsiChung Liew #			define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
54536e7dacSTsiChung Liew #		endif
55536e7dacSTsiChung Liew #	endif			/* CONFIG_SYS_DISCOVER_PHY */
56536e7dacSTsiChung Liew #endif
57536e7dacSTsiChung Liew 
58536e7dacSTsiChung Liew #define CONFIG_MCFRTC
59536e7dacSTsiChung Liew #undef RTC_DEBUG
60536e7dacSTsiChung Liew #define CONFIG_SYS_RTC_CNT		(0x8000)
61536e7dacSTsiChung Liew #define CONFIG_SYS_RTC_SETUP		(RTC_OCEN_OSCBYP | RTC_OCEN_CLKEN)
62536e7dacSTsiChung Liew 
63536e7dacSTsiChung Liew /* Timer */
64536e7dacSTsiChung Liew #define CONFIG_MCFTMR
65536e7dacSTsiChung Liew #undef CONFIG_MCFPIT
66536e7dacSTsiChung Liew 
67536e7dacSTsiChung Liew /* I2C */
6800f792e0SHeiko Schocher #define CONFIG_SYS_I2C
6900f792e0SHeiko Schocher #define CONFIG_SYS_I2C_FSL
7000f792e0SHeiko Schocher #define CONFIG_SYS_FSL_I2C_SPEED	80000
7100f792e0SHeiko Schocher #define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
7200f792e0SHeiko Schocher #define CONFIG_SYS_FSL_I2C_OFFSET	0x58000
73536e7dacSTsiChung Liew #define CONFIG_SYS_IMMR			CONFIG_SYS_MBAR
74536e7dacSTsiChung Liew 
75536e7dacSTsiChung Liew #define CONFIG_UDP_CHECKSUM
76536e7dacSTsiChung Liew 
77536e7dacSTsiChung Liew #ifdef CONFIG_MCFFEC
78536e7dacSTsiChung Liew #	define CONFIG_IPADDR	192.162.1.2
79536e7dacSTsiChung Liew #	define CONFIG_NETMASK	255.255.255.0
80536e7dacSTsiChung Liew #	define CONFIG_SERVERIP	192.162.1.1
81536e7dacSTsiChung Liew #	define CONFIG_GATEWAYIP	192.162.1.1
82536e7dacSTsiChung Liew #endif				/* FEC_ENET */
83536e7dacSTsiChung Liew 
84536e7dacSTsiChung Liew #define CONFIG_HOSTNAME		M53017
85536e7dacSTsiChung Liew #define CONFIG_EXTRA_ENV_SETTINGS		\
86536e7dacSTsiChung Liew 	"netdev=eth0\0"				\
87536e7dacSTsiChung Liew 	"loadaddr=40010000\0"			\
88536e7dacSTsiChung Liew 	"u-boot=u-boot.bin\0"			\
89536e7dacSTsiChung Liew 	"load=tftp ${loadaddr) ${u-boot}\0"	\
90536e7dacSTsiChung Liew 	"upd=run load; run prog\0"		\
91536e7dacSTsiChung Liew 	"prog=prot off 0 3ffff;"		\
92536e7dacSTsiChung Liew 	"era 0 3ffff;"				\
93536e7dacSTsiChung Liew 	"cp.b ${loadaddr} 0 ${filesize};"	\
94536e7dacSTsiChung Liew 	"save\0"				\
95536e7dacSTsiChung Liew 	""
96536e7dacSTsiChung Liew 
97536e7dacSTsiChung Liew #define CONFIG_PRAM		512	/* 512 KB */
98536e7dacSTsiChung Liew #define CONFIG_SYS_LONGHELP	/* undef to save memory */
99536e7dacSTsiChung Liew 
100536e7dacSTsiChung Liew #define CONFIG_SYS_LOAD_ADDR	0x40010000
101536e7dacSTsiChung Liew 
102536e7dacSTsiChung Liew #define CONFIG_SYS_CLK		80000000
103536e7dacSTsiChung Liew #define CONFIG_SYS_CPU_CLK	CONFIG_SYS_CLK * 3
104536e7dacSTsiChung Liew 
105536e7dacSTsiChung Liew #define CONFIG_SYS_MBAR		0xFC000000
106536e7dacSTsiChung Liew 
107536e7dacSTsiChung Liew /*
108536e7dacSTsiChung Liew  * Low Level Configuration Settings
109536e7dacSTsiChung Liew  * (address mappings, register initial values, etc.)
110536e7dacSTsiChung Liew  * You should know what you are doing if you make changes here.
111536e7dacSTsiChung Liew  */
112536e7dacSTsiChung Liew /*
113536e7dacSTsiChung Liew  * Definitions for initial stack pointer and data area (in DPRAM)
114536e7dacSTsiChung Liew  */
115536e7dacSTsiChung Liew #define CONFIG_SYS_INIT_RAM_ADDR	0x80000000
116553f0982SWolfgang Denk #define CONFIG_SYS_INIT_RAM_SIZE		0x20000	/* Size of used area in internal SRAM */
1179e8e9270STsiChung Liew #define CONFIG_SYS_INIT_RAM_CTRL	0x221
11825ddd1fbSWolfgang Denk #define CONFIG_SYS_GBL_DATA_OFFSET	((CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) - 0x10)
119536e7dacSTsiChung Liew #define CONFIG_SYS_INIT_SP_OFFSET	CONFIG_SYS_GBL_DATA_OFFSET
120536e7dacSTsiChung Liew 
121536e7dacSTsiChung Liew /*
122536e7dacSTsiChung Liew  * Start addresses for the final memory configuration
123536e7dacSTsiChung Liew  * (Set up by the startup code)
124536e7dacSTsiChung Liew  * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
125536e7dacSTsiChung Liew  */
126536e7dacSTsiChung Liew #define CONFIG_SYS_SDRAM_BASE		0x40000000
127536e7dacSTsiChung Liew #define CONFIG_SYS_SDRAM_SIZE		64	/* SDRAM size in MB */
128536e7dacSTsiChung Liew #define CONFIG_SYS_SDRAM_CFG1		0x43711630
129536e7dacSTsiChung Liew #define CONFIG_SYS_SDRAM_CFG2		0x56670000
1309e8e9270STsiChung Liew #define CONFIG_SYS_SDRAM_CTRL		0xE1092000
131536e7dacSTsiChung Liew #define CONFIG_SYS_SDRAM_EMOD		0x80010000
132536e7dacSTsiChung Liew #define CONFIG_SYS_SDRAM_MODE		0x00CD0000
133536e7dacSTsiChung Liew 
134536e7dacSTsiChung Liew #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE + 0x400
135536e7dacSTsiChung Liew #define CONFIG_SYS_MEMTEST_END		((CONFIG_SYS_SDRAM_SIZE - 3) << 20)
136536e7dacSTsiChung Liew 
137536e7dacSTsiChung Liew #define CONFIG_SYS_MONITOR_BASE		(CONFIG_SYS_FLASH_BASE + 0x400)
138536e7dacSTsiChung Liew #define CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* Reserve 256 kB for Monitor */
139536e7dacSTsiChung Liew 
140536e7dacSTsiChung Liew #define CONFIG_SYS_BOOTPARAMS_LEN	64*1024
141536e7dacSTsiChung Liew #define CONFIG_SYS_MALLOC_LEN		(128 << 10)	/* Reserve 128 kB for malloc() */
142536e7dacSTsiChung Liew 
143536e7dacSTsiChung Liew /*
144536e7dacSTsiChung Liew  * For booting Linux, the board info and command line data
145536e7dacSTsiChung Liew  * have to be in the first 8 MB of memory, since this is
146536e7dacSTsiChung Liew  * the maximum mapped by the Linux kernel during initialization ??
147536e7dacSTsiChung Liew  */
148536e7dacSTsiChung Liew #define CONFIG_SYS_BOOTMAPSZ		(CONFIG_SYS_SDRAM_BASE + (CONFIG_SYS_SDRAM_SIZE << 20))
149d6e4baf4STsiChung Liew #define CONFIG_SYS_BOOTM_LEN		(CONFIG_SYS_SDRAM_SIZE << 20)
150536e7dacSTsiChung Liew 
151536e7dacSTsiChung Liew /*-----------------------------------------------------------------------
152536e7dacSTsiChung Liew  * FLASH organization
153536e7dacSTsiChung Liew  */
154536e7dacSTsiChung Liew #define CONFIG_SYS_FLASH_CFI
155536e7dacSTsiChung Liew #ifdef CONFIG_SYS_FLASH_CFI
156536e7dacSTsiChung Liew #	define CONFIG_FLASH_CFI_DRIVER		1
157bbf6bbffSTsiChung Liew #	define CONFIG_SYS_FLASH_USE_BUFFER_WRITE	1
158bbf6bbffSTsiChung Liew #	define CONFIG_FLASH_SPANSION_S29WS_N	1
1594567c7bfSTsiChung Liew #	define CONFIG_SYS_FLASH_SIZE		0x1000000	/* Max size that the board might have */
160536e7dacSTsiChung Liew #	define CONFIG_SYS_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
161536e7dacSTsiChung Liew #	define CONFIG_SYS_MAX_FLASH_BANKS	1	/* max number of memory banks */
162536e7dacSTsiChung Liew #	define CONFIG_SYS_MAX_FLASH_SECT	137	/* max number of sectors on one chip */
163536e7dacSTsiChung Liew #	define CONFIG_SYS_FLASH_PROTECTION	/* "Real" (hardware) sectors protection */
164536e7dacSTsiChung Liew #endif
165536e7dacSTsiChung Liew 
166536e7dacSTsiChung Liew #define CONFIG_SYS_FLASH_BASE		CONFIG_SYS_CS0_BASE
167536e7dacSTsiChung Liew 
168536e7dacSTsiChung Liew /* Configuration for environment
169536e7dacSTsiChung Liew  * Environment is embedded in u-boot in the second sector of the flash
170536e7dacSTsiChung Liew  */
171944ab340Sangelo@sysam.it #define CONFIG_ENV_OFFSET		(CONFIG_SYS_FLASH_BASE + 0x40000)
172536e7dacSTsiChung Liew #define CONFIG_ENV_SIZE			0x1000
173536e7dacSTsiChung Liew #define CONFIG_ENV_SECT_SIZE		0x8000
174536e7dacSTsiChung Liew 
1755296cb1dSangelo@sysam.it #define LDS_BOARD_TEXT \
1765296cb1dSangelo@sysam.it 	. = DEFINED(env_offset) ? env_offset : .; \
177*0649cd0dSSimon Glass 	env/embedded.o(.text*)
1785296cb1dSangelo@sysam.it 
179536e7dacSTsiChung Liew /*-----------------------------------------------------------------------
180536e7dacSTsiChung Liew  * Cache Configuration
181536e7dacSTsiChung Liew  */
182536e7dacSTsiChung Liew #define CONFIG_SYS_CACHELINE_SIZE	16
183536e7dacSTsiChung Liew 
184dd9f054eSTsiChung Liew #define ICACHE_STATUS			(CONFIG_SYS_INIT_RAM_ADDR + \
185553f0982SWolfgang Denk 					 CONFIG_SYS_INIT_RAM_SIZE - 8)
186dd9f054eSTsiChung Liew #define DCACHE_STATUS			(CONFIG_SYS_INIT_RAM_ADDR + \
187553f0982SWolfgang Denk 					 CONFIG_SYS_INIT_RAM_SIZE - 4)
188dd9f054eSTsiChung Liew #define CONFIG_SYS_ICACHE_INV		(CF_CACR_CINVA)
189dd9f054eSTsiChung Liew #define CONFIG_SYS_CACHE_ACR0		(CONFIG_SYS_SDRAM_BASE | \
190dd9f054eSTsiChung Liew 					 CF_ADDRMASK(CONFIG_SYS_SDRAM_SIZE) | \
191dd9f054eSTsiChung Liew 					 CF_ACR_EN | CF_ACR_SM_ALL)
192dd9f054eSTsiChung Liew #define CONFIG_SYS_CACHE_ICACR		(CF_CACR_EC | CF_CACR_CINVA | \
193dd9f054eSTsiChung Liew 					 CF_CACR_DCM_P)
194dd9f054eSTsiChung Liew 
195536e7dacSTsiChung Liew /*-----------------------------------------------------------------------
196536e7dacSTsiChung Liew  * Chipselect bank definitions
197536e7dacSTsiChung Liew  */
198536e7dacSTsiChung Liew /*
199536e7dacSTsiChung Liew  * CS0 - NOR Flash
200536e7dacSTsiChung Liew  * CS1 - Ext SRAM
201536e7dacSTsiChung Liew  * CS2 - Available
202536e7dacSTsiChung Liew  * CS3 - Available
203536e7dacSTsiChung Liew  * CS4 - Available
204536e7dacSTsiChung Liew  * CS5 - Available
205536e7dacSTsiChung Liew  */
206536e7dacSTsiChung Liew #define CONFIG_SYS_CS0_BASE		0
207536e7dacSTsiChung Liew #define CONFIG_SYS_CS0_MASK		0x00FF0001
208536e7dacSTsiChung Liew #define CONFIG_SYS_CS0_CTRL		0x00001FA0
209536e7dacSTsiChung Liew 
210536e7dacSTsiChung Liew #define CONFIG_SYS_CS1_BASE		0xC0000000
211536e7dacSTsiChung Liew #define CONFIG_SYS_CS1_MASK		0x00070001
212536e7dacSTsiChung Liew #define CONFIG_SYS_CS1_CTRL		0x00001FA0
213536e7dacSTsiChung Liew 
214536e7dacSTsiChung Liew #endif				/* _M53017EVB_H */
215