xref: /openbmc/u-boot/include/configs/at91rm9200ek.h (revision 3432a93bcd897913e1a2df58de5ae0226062e5ca)
1cb82a532SUlf Samuelsson /*
299fa97e9SAndreas Bießmann  * Copyright (C) 2010 Andreas Bießmann <biessmann.devel@googlemail.com>
399fa97e9SAndreas Bießmann  *
499fa97e9SAndreas Bießmann  * based on previous work by
599fa97e9SAndreas Bießmann  *
6cb82a532SUlf Samuelsson  * Ulf Samuelsson <ulf@atmel.com>
7cb82a532SUlf Samuelsson  * Rick Bronson <rick@efn.org>
8cb82a532SUlf Samuelsson  *
9cb82a532SUlf Samuelsson  * Configuration settings for the AT91RM9200EK board.
10cb82a532SUlf Samuelsson  *
11cb82a532SUlf Samuelsson  * See file CREDITS for list of people who contributed to this
12cb82a532SUlf Samuelsson  * project.
13cb82a532SUlf Samuelsson  *
14cb82a532SUlf Samuelsson  * This program is free software; you can redistribute it and/or
15cb82a532SUlf Samuelsson  * modify it under the terms of the GNU General Public License as
16cb82a532SUlf Samuelsson  * published by the Free Software Foundation; either version 2 of
17cb82a532SUlf Samuelsson  * the License, or (at your option) any later version.
18cb82a532SUlf Samuelsson  *
19cb82a532SUlf Samuelsson  * This program is distributed in the hope that it will be useful,
20cb82a532SUlf Samuelsson  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21cb82a532SUlf Samuelsson  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22cb82a532SUlf Samuelsson  * GNU General Public License for more details.
23cb82a532SUlf Samuelsson  *
24cb82a532SUlf Samuelsson  * You should have received a copy of the GNU General Public License
25cb82a532SUlf Samuelsson  * along with this program; if not, write to the Free Software
26cb82a532SUlf Samuelsson  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27cb82a532SUlf Samuelsson  * MA 02111-1307 USA
28cb82a532SUlf Samuelsson  */
29cb82a532SUlf Samuelsson 
3099fa97e9SAndreas Bießmann #ifndef __AT91RM9200EK_CONFIG_H__
3199fa97e9SAndreas Bießmann #define __AT91RM9200EK_CONFIG_H__
32cb82a532SUlf Samuelsson 
3399fa97e9SAndreas Bießmann #include <asm/sizes.h>
34425de62dSJens Scharsig 
35cb82a532SUlf Samuelsson /*
363a4ff8b3SAndreas Bießmann  * set some initial configurations depending on configure target
373a4ff8b3SAndreas Bießmann  *
383a4ff8b3SAndreas Bießmann  * at91rm9200ek_config     -> boot from 0x0 in NOR Flash at CS0
393a4ff8b3SAndreas Bießmann  * at91rm9200ek_ram_config -> continue booting from 0x20100000 in RAM; lowlevel
403a4ff8b3SAndreas Bießmann  *                            initialisation was done by some preloader
413a4ff8b3SAndreas Bießmann  */
423a4ff8b3SAndreas Bießmann #ifdef CONFIG_RAMBOOT
433a4ff8b3SAndreas Bießmann #define CONFIG_SKIP_LOWLEVEL_INIT
443a4ff8b3SAndreas Bießmann #define CONFIG_SYS_TEXT_BASE 0x20100000
453a4ff8b3SAndreas Bießmann #else
463a4ff8b3SAndreas Bießmann #define CONFIG_SYS_TEXT_BASE 0x10000000
473a4ff8b3SAndreas Bießmann #endif
483a4ff8b3SAndreas Bießmann 
493a4ff8b3SAndreas Bießmann /*
5099fa97e9SAndreas Bießmann  * AT91C_XTAL_CLOCK is the frequency of external xtal in hertz
5199fa97e9SAndreas Bießmann  * AT91C_MAIN_CLOCK is the frequency of PLLA output
5299fa97e9SAndreas Bießmann  * AT91C_MASTER_CLOCK is the peripherial clock
5399fa97e9SAndreas Bießmann  * CONFIG_SYS_HZ_CLOCK is the value for CCR in tc0 (divider 2 is implicitely
5499fa97e9SAndreas Bießmann  *  set in arch/arm/cpu/arm920t/at91/timer.c)
5599fa97e9SAndreas Bießmann  * CONFIG_SYS_HZ is the tick rate for timer tc0
56cb82a532SUlf Samuelsson  */
5799fa97e9SAndreas Bießmann #define AT91C_XTAL_CLOCK		18432000
586a372e94SAndreas Bießmann #define CONFIG_SYS_AT91_SLOW_CLOCK	32768
5999fa97e9SAndreas Bießmann #define AT91C_MAIN_CLOCK		((AT91C_XTAL_CLOCK / 4) * 39)
6099fa97e9SAndreas Bießmann #define AT91C_MASTER_CLOCK		(AT91C_MAIN_CLOCK / 3 )
6199fa97e9SAndreas Bießmann #define CONFIG_SYS_HZ_CLOCK		(AT91C_MASTER_CLOCK / 2)
6299fa97e9SAndreas Bießmann #define CONFIG_SYS_HZ			1000
6399fa97e9SAndreas Bießmann 
6499fa97e9SAndreas Bießmann /* CPU configuration */
6599fa97e9SAndreas Bießmann #define CONFIG_AT91RM9200
6699fa97e9SAndreas Bießmann #define CONFIG_AT91RM9200EK
6799fa97e9SAndreas Bießmann #define CONFIG_CPUAT91
6899fa97e9SAndreas Bießmann #define USE_920T_MMU
6999fa97e9SAndreas Bießmann 
706a372e94SAndreas Bießmann #include <asm/hardware.h>	/* needed for port definitions */
716a372e94SAndreas Bießmann 
7299fa97e9SAndreas Bießmann #define CONFIG_CMDLINE_TAG
7399fa97e9SAndreas Bießmann #define CONFIG_SETUP_MEMORY_TAGS
7499fa97e9SAndreas Bießmann #define CONFIG_INITRD_TAG
7599fa97e9SAndreas Bießmann 
76*3432a93bSAndreas Bießmann #define CONFIG_BOARD_EARLY_INIT_F
77*3432a93bSAndreas Bießmann 
78cb82a532SUlf Samuelsson /*
7999fa97e9SAndreas Bießmann  * Memory Configuration
80cb82a532SUlf Samuelsson  */
8199fa97e9SAndreas Bießmann #define CONFIG_NR_DRAM_BANKS		1
8299fa97e9SAndreas Bießmann #define CONFIG_SYS_SDRAM_BASE		0x20000000
8399fa97e9SAndreas Bießmann #define CONFIG_SYS_SDRAM_SIZE		SZ_32M
84cb82a532SUlf Samuelsson 
8599fa97e9SAndreas Bießmann #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
8699fa97e9SAndreas Bießmann #define CONFIG_SYS_MEMTEST_END		\
8799fa97e9SAndreas Bießmann 		(CONFIG_SYS_MEMTEST_START + CONFIG_SYS_SDRAM_SIZE - SZ_256K)
88cb82a532SUlf Samuelsson 
89cb82a532SUlf Samuelsson /*
90cb82a532SUlf Samuelsson  * LowLevel Init
91cb82a532SUlf Samuelsson  */
92cb82a532SUlf Samuelsson #ifndef CONFIG_SKIP_LOWLEVEL_INIT
9399fa97e9SAndreas Bießmann #define CONFIG_SYS_USE_MAIN_OSCILLATOR
94cb82a532SUlf Samuelsson /* flash */
95cb82a532SUlf Samuelsson #define CONFIG_SYS_EBI_CFGR_VAL	0x00000000
96cb82a532SUlf Samuelsson #define CONFIG_SYS_SMC_CSR0_VAL	0x00003284 /* 16bit, 2 TDF, 4 WS */
97cb82a532SUlf Samuelsson 
98cb82a532SUlf Samuelsson /* clocks */
99cb82a532SUlf Samuelsson #define CONFIG_SYS_PLLAR_VAL	0x20263E04 /* 179.712000 MHz for PCK */
100cb82a532SUlf Samuelsson #define CONFIG_SYS_PLLBR_VAL	0x10483E0E /* 48.054857 MHz (divider by 2 for USB) */
101cb82a532SUlf Samuelsson /* PCK/3 = MCK Master Clock = 59.904000MHz from PLLA */
102cb82a532SUlf Samuelsson #define CONFIG_SYS_MCKR_VAL	0x00000202
103cb82a532SUlf Samuelsson 
104cb82a532SUlf Samuelsson /* sdram */
105cb82a532SUlf Samuelsson #define CONFIG_SYS_PIOC_ASR_VAL	0xFFFF0000 /* Configure PIOC as peripheral (D16/D31) */
106cb82a532SUlf Samuelsson #define CONFIG_SYS_PIOC_BSR_VAL	0x00000000
107cb82a532SUlf Samuelsson #define CONFIG_SYS_PIOC_PDR_VAL	0xFFFF0000
108cb82a532SUlf Samuelsson #define CONFIG_SYS_EBI_CSA_VAL	0x00000002 /* CS1=CONFIG_SYS_SDRAM */
109cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_CR_VAL	0x2188c155 /* set up the CONFIG_SYS_SDRAM */
11099fa97e9SAndreas Bießmann #define CONFIG_SYS_SDRAM	CONFIG_SYS_SDRAM_BASE /* address of the SDRAM */
111066df1a5SAndreas Bießmann #define CONFIG_SYS_SDRAM1	(CONFIG_SYS_SDRAM_BASE+0x80)
112cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRAM_VAL	0x00000000 /* value written to CONFIG_SYS_SDRAM */
113cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_MR_VAL	0x00000002 /* Precharge All */
114cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_MR_VAL1	0x00000004 /* refresh */
115cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_MR_VAL2	0x00000003 /* Load Mode Register */
116cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_MR_VAL3	0x00000000 /* Normal Mode */
117cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_TR_VAL	0x000002E0 /* Write refresh rate */
118cb82a532SUlf Samuelsson #endif	/* CONFIG_SKIP_LOWLEVEL_INIT */
119cb82a532SUlf Samuelsson 
120cb82a532SUlf Samuelsson /*
121cb82a532SUlf Samuelsson  * Hardware drivers
122cb82a532SUlf Samuelsson  */
123cb82a532SUlf Samuelsson /*
12499fa97e9SAndreas Bießmann  * Choose a USART for serial console
12599fa97e9SAndreas Bießmann  * CONFIG_DBGU is DBGU unit on J10
12699fa97e9SAndreas Bießmann  * CONFIG_USART1 is USART1 on J14
127cb82a532SUlf Samuelsson  */
128*3432a93bSAndreas Bießmann #define CONFIG_ATMEL_USART
129*3432a93bSAndreas Bießmann #define CONFIG_USART_BASE	ATMEL_BASE_DBGU
130*3432a93bSAndreas Bießmann #define CONFIG_USART_ID		0/* ignored in arm */
131cb82a532SUlf Samuelsson 
132cb82a532SUlf Samuelsson #define CONFIG_SYS_BAUDRATE_TABLE	{115200 , 19200, 38400, 57600, 9600 }
133cb82a532SUlf Samuelsson #define CONFIG_BAUDRATE			115200
134cb82a532SUlf Samuelsson 
135cb82a532SUlf Samuelsson /*
136cb82a532SUlf Samuelsson  * Command line configuration.
137cb82a532SUlf Samuelsson  */
138cb82a532SUlf Samuelsson #include <config_cmd_default.h>
139cb82a532SUlf Samuelsson 
140cb82a532SUlf Samuelsson #define CONFIG_CMD_DHCP
141cb82a532SUlf Samuelsson #define CONFIG_CMD_FAT
142cb82a532SUlf Samuelsson #define CONFIG_CMD_MII
143cb82a532SUlf Samuelsson #define CONFIG_CMD_PING
1443b83522bSAndreas Bießmann #define CONFIG_CMD_USB
145cb82a532SUlf Samuelsson #undef CONFIG_CMD_FPGA
146cb82a532SUlf Samuelsson 
147cb82a532SUlf Samuelsson /*
148cb82a532SUlf Samuelsson  * Network Driver Setting
149cb82a532SUlf Samuelsson  */
15099fa97e9SAndreas Bießmann #define CONFIG_NET_MULTI
15199fa97e9SAndreas Bießmann #define CONFIG_DRIVER_AT91EMAC
15299fa97e9SAndreas Bießmann #define CONFIG_SYS_RX_ETH_BUFFER	16
15399fa97e9SAndreas Bießmann #define CONFIG_RMII
15499fa97e9SAndreas Bießmann #define CONFIG_MII
155cb82a532SUlf Samuelsson 
156cb82a532SUlf Samuelsson /*
157cb82a532SUlf Samuelsson  * NOR Flash
158cb82a532SUlf Samuelsson  */
15999fa97e9SAndreas Bießmann #define CONFIG_FLASH_CFI_DRIVER
16099fa97e9SAndreas Bießmann #define CONFIG_SYS_FLASH_CFI
161cb82a532SUlf Samuelsson #define CONFIG_SYS_FLASH_BASE		0x10000000
16299fa97e9SAndreas Bießmann #define PHYS_FLASH_1			CONFIG_SYS_FLASH_BASE
16399fa97e9SAndreas Bießmann #define PHYS_FLASH_SIZE			SZ_8M
164cb82a532SUlf Samuelsson #define CONFIG_SYS_MAX_FLASH_BANKS	1
165cb82a532SUlf Samuelsson #define CONFIG_SYS_MAX_FLASH_SECT	256
166cb82a532SUlf Samuelsson #define CONFIG_SYS_FLASH_PROTECTION
167cb82a532SUlf Samuelsson 
168cb82a532SUlf Samuelsson /*
1693b83522bSAndreas Bießmann  * USB Config
1703b83522bSAndreas Bießmann  */
1713b83522bSAndreas Bießmann #define CONFIG_USB_ATMEL			1
1723b83522bSAndreas Bießmann #define CONFIG_USB_OHCI_NEW			1
1733b83522bSAndreas Bießmann #define CONFIG_USB_KEYBOARD			1
1743b83522bSAndreas Bießmann #define CONFIG_USB_STORAGE			1
1753b83522bSAndreas Bießmann #define CONFIG_DOS_PARTITION			1
1763b83522bSAndreas Bießmann 
1773b83522bSAndreas Bießmann #define CONFIG_SYS_USB_OHCI_CPU_INIT		1
17880733994SJens Scharsig #define CONFIG_SYS_USB_OHCI_REGS_BASE		ATMEL_USB_HOST_BASE
1793b83522bSAndreas Bießmann #define CONFIG_SYS_USB_OHCI_SLOT_NAME		"at91rm9200"
1803b83522bSAndreas Bießmann #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	15
1813b83522bSAndreas Bießmann 
1823b83522bSAndreas Bießmann /*
183cb82a532SUlf Samuelsson  * Environment Settings
184cb82a532SUlf Samuelsson  */
18599fa97e9SAndreas Bießmann #define CONFIG_ENV_IS_IN_FLASH
186cb82a532SUlf Samuelsson 
187cb82a532SUlf Samuelsson /*
188cb82a532SUlf Samuelsson  * after u-boot.bin
189cb82a532SUlf Samuelsson  */
190cb82a532SUlf Samuelsson #define CONFIG_ENV_ADDR			\
191cb82a532SUlf Samuelsson 		(CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
19299fa97e9SAndreas Bießmann #define CONFIG_ENV_SIZE			SZ_64K /* sectors are 64K here */
193cb82a532SUlf Samuelsson /* The following #defines are needed to get flash environment right */
194cb82a532SUlf Samuelsson #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
19599fa97e9SAndreas Bießmann #define CONFIG_SYS_MONITOR_LEN		SZ_256K
196cb82a532SUlf Samuelsson 
197cb82a532SUlf Samuelsson /*
198cb82a532SUlf Samuelsson  * Boot option
199cb82a532SUlf Samuelsson  */
200cb82a532SUlf Samuelsson #define CONFIG_BOOTDELAY		3
201cb82a532SUlf Samuelsson 
20299fa97e9SAndreas Bießmann /* default load address */
20399fa97e9SAndreas Bießmann #define CONFIG_SYS_LOAD_ADDR		CONFIG_SYS_SDRAM_BASE + SZ_16M
20499fa97e9SAndreas Bießmann #define CONFIG_ENV_OVERWRITE
205cb82a532SUlf Samuelsson 
206cb82a532SUlf Samuelsson /*
207cb82a532SUlf Samuelsson  * Shell Settings
208cb82a532SUlf Samuelsson  */
20999fa97e9SAndreas Bießmann #define CONFIG_CMDLINE_EDITING
21099fa97e9SAndreas Bießmann #define CONFIG_SYS_LONGHELP
21199fa97e9SAndreas Bießmann #define CONFIG_AUTO_COMPLETE
21299fa97e9SAndreas Bießmann #define CONFIG_SYS_HUSH_PARSER
213cb82a532SUlf Samuelsson #define CONFIG_SYS_PROMPT		"U-Boot> "
214cb82a532SUlf Samuelsson #define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
215cb82a532SUlf Samuelsson #define CONFIG_SYS_CBSIZE		256	/* Console I/O Buffer Size */
216cb82a532SUlf Samuelsson #define CONFIG_SYS_MAXARGS		16	/* max number of command args */
217cb82a532SUlf Samuelsson /* Print Buffer Size */
218cb82a532SUlf Samuelsson #define CONFIG_SYS_PBSIZE		\
219cb82a532SUlf Samuelsson 		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
220cb82a532SUlf Samuelsson 
221cb82a532SUlf Samuelsson /*
222cb82a532SUlf Samuelsson  * Size of malloc() pool
223cb82a532SUlf Samuelsson  */
22499fa97e9SAndreas Bießmann #define CONFIG_SYS_MALLOC_LEN		ROUND(3 * CONFIG_ENV_SIZE + SZ_128K, \
22599fa97e9SAndreas Bießmann 					     SZ_4K)
226cb82a532SUlf Samuelsson 
22799fa97e9SAndreas Bießmann #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + SZ_4K \
22825ddd1fbSWolfgang Denk 					- GENERATED_GBL_DATA_SIZE)
22999fa97e9SAndreas Bießmann 
23099fa97e9SAndreas Bießmann #define CONFIG_STACKSIZE		SZ_32K	/* regular stack */
23199fa97e9SAndreas Bießmann #define CONFIG_STACKSIZE_IRQ		SZ_4K	/* Unsure if to big or to small*/
23299fa97e9SAndreas Bießmann #define CONFIG_STACKSIZE_FIQ		SZ_4K	/* Unsure if to big or to small*/
23399fa97e9SAndreas Bießmann #endif /* __AT91RM9200EK_CONFIG_H__ */
234