xref: /openbmc/u-boot/include/configs/at91rm9200ek.h (revision 2fe88d452268d61b5ca9cb0b1dda2974cc43faeb)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
2cb82a532SUlf Samuelsson /*
399fa97e9SAndreas Bießmann  * Copyright (C) 2010 Andreas Bießmann <biessmann.devel@googlemail.com>
499fa97e9SAndreas Bießmann  *
599fa97e9SAndreas Bießmann  * based on previous work by
699fa97e9SAndreas Bießmann  *
7cb82a532SUlf Samuelsson  * Ulf Samuelsson <ulf@atmel.com>
8cb82a532SUlf Samuelsson  * Rick Bronson <rick@efn.org>
9cb82a532SUlf Samuelsson  *
10cb82a532SUlf Samuelsson  * Configuration settings for the AT91RM9200EK board.
11cb82a532SUlf Samuelsson  */
12cb82a532SUlf Samuelsson 
1399fa97e9SAndreas Bießmann #ifndef __AT91RM9200EK_CONFIG_H__
1499fa97e9SAndreas Bießmann #define __AT91RM9200EK_CONFIG_H__
15cb82a532SUlf Samuelsson 
161ace4022SAlexey Brodkin #include <linux/sizes.h>
17425de62dSJens Scharsig 
18cb82a532SUlf Samuelsson /*
193a4ff8b3SAndreas Bießmann  * set some initial configurations depending on configure target
203a4ff8b3SAndreas Bießmann  *
213a4ff8b3SAndreas Bießmann  * at91rm9200ek_config     -> boot from 0x0 in NOR Flash at CS0
223a4ff8b3SAndreas Bießmann  * at91rm9200ek_ram_config -> continue booting from 0x20100000 in RAM; lowlevel
233a4ff8b3SAndreas Bießmann  *                            initialisation was done by some preloader
243a4ff8b3SAndreas Bießmann  */
253a4ff8b3SAndreas Bießmann #ifdef CONFIG_RAMBOOT
263a4ff8b3SAndreas Bießmann #define CONFIG_SKIP_LOWLEVEL_INIT
273a4ff8b3SAndreas Bießmann #endif
283a4ff8b3SAndreas Bießmann 
293a4ff8b3SAndreas Bießmann /*
3099fa97e9SAndreas Bießmann  * AT91C_XTAL_CLOCK is the frequency of external xtal in hertz
3199fa97e9SAndreas Bießmann  * AT91C_MAIN_CLOCK is the frequency of PLLA output
3299fa97e9SAndreas Bießmann  * AT91C_MASTER_CLOCK is the peripherial clock
3399fa97e9SAndreas Bießmann  * CONFIG_SYS_HZ_CLOCK is the value for CCR in tc0 (divider 2 is implicitely
3499fa97e9SAndreas Bießmann  *  set in arch/arm/cpu/arm920t/at91/timer.c)
3599fa97e9SAndreas Bießmann  * CONFIG_SYS_HZ is the tick rate for timer tc0
36cb82a532SUlf Samuelsson  */
3799fa97e9SAndreas Bießmann #define AT91C_XTAL_CLOCK		18432000
386a372e94SAndreas Bießmann #define CONFIG_SYS_AT91_SLOW_CLOCK	32768
3999fa97e9SAndreas Bießmann #define AT91C_MAIN_CLOCK		((AT91C_XTAL_CLOCK / 4) * 39)
4099fa97e9SAndreas Bießmann #define AT91C_MASTER_CLOCK		(AT91C_MAIN_CLOCK / 3 )
4199fa97e9SAndreas Bießmann #define CONFIG_SYS_HZ_CLOCK		(AT91C_MASTER_CLOCK / 2)
4299fa97e9SAndreas Bießmann 
4399fa97e9SAndreas Bießmann /* CPU configuration */
4499fa97e9SAndreas Bießmann #define CONFIG_AT91RM9200
4599fa97e9SAndreas Bießmann #define CONFIG_AT91RM9200EK
4699fa97e9SAndreas Bießmann #define USE_920T_MMU
4799fa97e9SAndreas Bießmann 
486a372e94SAndreas Bießmann #include <asm/hardware.h>	/* needed for port definitions */
496a372e94SAndreas Bießmann 
5099fa97e9SAndreas Bießmann #define CONFIG_CMDLINE_TAG
5199fa97e9SAndreas Bießmann #define CONFIG_SETUP_MEMORY_TAGS
5299fa97e9SAndreas Bießmann #define CONFIG_INITRD_TAG
5399fa97e9SAndreas Bießmann 
54cb82a532SUlf Samuelsson /*
5599fa97e9SAndreas Bießmann  * Memory Configuration
56cb82a532SUlf Samuelsson  */
5799fa97e9SAndreas Bießmann #define CONFIG_SYS_SDRAM_BASE		0x20000000
5899fa97e9SAndreas Bießmann #define CONFIG_SYS_SDRAM_SIZE		SZ_32M
59cb82a532SUlf Samuelsson 
6099fa97e9SAndreas Bießmann #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
6199fa97e9SAndreas Bießmann #define CONFIG_SYS_MEMTEST_END		\
6299fa97e9SAndreas Bießmann 		(CONFIG_SYS_MEMTEST_START + CONFIG_SYS_SDRAM_SIZE - SZ_256K)
63cb82a532SUlf Samuelsson 
64cb82a532SUlf Samuelsson /*
65cb82a532SUlf Samuelsson  * LowLevel Init
66cb82a532SUlf Samuelsson  */
67cb82a532SUlf Samuelsson #ifndef CONFIG_SKIP_LOWLEVEL_INIT
6899fa97e9SAndreas Bießmann #define CONFIG_SYS_USE_MAIN_OSCILLATOR
69cb82a532SUlf Samuelsson /* flash */
70cb82a532SUlf Samuelsson #define CONFIG_SYS_EBI_CFGR_VAL	0x00000000
71cb82a532SUlf Samuelsson #define CONFIG_SYS_SMC_CSR0_VAL	0x00003284 /* 16bit, 2 TDF, 4 WS */
72cb82a532SUlf Samuelsson 
73cb82a532SUlf Samuelsson /* clocks */
74cb82a532SUlf Samuelsson #define CONFIG_SYS_PLLAR_VAL	0x20263E04 /* 179.712000 MHz for PCK */
75cb82a532SUlf Samuelsson #define CONFIG_SYS_PLLBR_VAL	0x10483E0E /* 48.054857 MHz (divider by 2 for USB) */
76cb82a532SUlf Samuelsson /* PCK/3 = MCK Master Clock = 59.904000MHz from PLLA */
77cb82a532SUlf Samuelsson #define CONFIG_SYS_MCKR_VAL	0x00000202
78cb82a532SUlf Samuelsson 
79cb82a532SUlf Samuelsson /* sdram */
80cb82a532SUlf Samuelsson #define CONFIG_SYS_PIOC_ASR_VAL	0xFFFF0000 /* Configure PIOC as peripheral (D16/D31) */
81cb82a532SUlf Samuelsson #define CONFIG_SYS_PIOC_BSR_VAL	0x00000000
82cb82a532SUlf Samuelsson #define CONFIG_SYS_PIOC_PDR_VAL	0xFFFF0000
83cb82a532SUlf Samuelsson #define CONFIG_SYS_EBI_CSA_VAL	0x00000002 /* CS1=CONFIG_SYS_SDRAM */
84cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_CR_VAL	0x2188c155 /* set up the CONFIG_SYS_SDRAM */
8599fa97e9SAndreas Bießmann #define CONFIG_SYS_SDRAM	CONFIG_SYS_SDRAM_BASE /* address of the SDRAM */
86066df1a5SAndreas Bießmann #define CONFIG_SYS_SDRAM1	(CONFIG_SYS_SDRAM_BASE+0x80)
87cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRAM_VAL	0x00000000 /* value written to CONFIG_SYS_SDRAM */
88cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_MR_VAL	0x00000002 /* Precharge All */
89cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_MR_VAL1	0x00000004 /* refresh */
90cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_MR_VAL2	0x00000003 /* Load Mode Register */
91cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_MR_VAL3	0x00000000 /* Normal Mode */
92cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_TR_VAL	0x000002E0 /* Write refresh rate */
93cb82a532SUlf Samuelsson #endif	/* CONFIG_SKIP_LOWLEVEL_INIT */
94cb82a532SUlf Samuelsson 
95cb82a532SUlf Samuelsson /*
96cb82a532SUlf Samuelsson  * Hardware drivers
97cb82a532SUlf Samuelsson  */
98cb82a532SUlf Samuelsson /*
9999fa97e9SAndreas Bießmann  * Choose a USART for serial console
10099fa97e9SAndreas Bießmann  * CONFIG_DBGU is DBGU unit on J10
10199fa97e9SAndreas Bießmann  * CONFIG_USART1 is USART1 on J14
102cb82a532SUlf Samuelsson  */
1033432a93bSAndreas Bießmann #define CONFIG_ATMEL_USART
1043432a93bSAndreas Bießmann #define CONFIG_USART_BASE	ATMEL_BASE_DBGU
1053432a93bSAndreas Bießmann #define CONFIG_USART_ID		0/* ignored in arm */
106cb82a532SUlf Samuelsson 
107cb82a532SUlf Samuelsson /*
108cb82a532SUlf Samuelsson  * Command line configuration.
109cb82a532SUlf Samuelsson  */
110cb82a532SUlf Samuelsson 
111cb82a532SUlf Samuelsson /*
112cb82a532SUlf Samuelsson  * Network Driver Setting
113cb82a532SUlf Samuelsson  */
11499fa97e9SAndreas Bießmann #define CONFIG_DRIVER_AT91EMAC
11599fa97e9SAndreas Bießmann #define CONFIG_SYS_RX_ETH_BUFFER	16
11699fa97e9SAndreas Bießmann #define CONFIG_RMII
117cb82a532SUlf Samuelsson 
118cb82a532SUlf Samuelsson /*
119cb82a532SUlf Samuelsson  * NOR Flash
120cb82a532SUlf Samuelsson  */
121cb82a532SUlf Samuelsson #define CONFIG_SYS_FLASH_BASE		0x10000000
12299fa97e9SAndreas Bießmann #define PHYS_FLASH_1			CONFIG_SYS_FLASH_BASE
12399fa97e9SAndreas Bießmann #define PHYS_FLASH_SIZE			SZ_8M
124cb82a532SUlf Samuelsson #define CONFIG_SYS_MAX_FLASH_BANKS	1
125cb82a532SUlf Samuelsson #define CONFIG_SYS_MAX_FLASH_SECT	256
126cb82a532SUlf Samuelsson 
127cb82a532SUlf Samuelsson /*
1283b83522bSAndreas Bießmann  * USB Config
1293b83522bSAndreas Bießmann  */
1303b83522bSAndreas Bießmann #define CONFIG_USB_ATMEL			1
131dcd2f1a0SBo Shen #define CONFIG_USB_ATMEL_CLK_SEL_PLLB
1323b83522bSAndreas Bießmann #define CONFIG_USB_OHCI_NEW			1
1333b83522bSAndreas Bießmann 
1343b83522bSAndreas Bießmann #define CONFIG_SYS_USB_OHCI_CPU_INIT		1
13580733994SJens Scharsig #define CONFIG_SYS_USB_OHCI_REGS_BASE		ATMEL_USB_HOST_BASE
1363b83522bSAndreas Bießmann #define CONFIG_SYS_USB_OHCI_SLOT_NAME		"at91rm9200"
1373b83522bSAndreas Bießmann #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	15
1383b83522bSAndreas Bießmann 
1393b83522bSAndreas Bießmann /*
140cb82a532SUlf Samuelsson  * Environment Settings
141cb82a532SUlf Samuelsson  */
142cb82a532SUlf Samuelsson 
143cb82a532SUlf Samuelsson /*
144cb82a532SUlf Samuelsson  * after u-boot.bin
145cb82a532SUlf Samuelsson  */
146cb82a532SUlf Samuelsson #define CONFIG_ENV_ADDR			\
147cb82a532SUlf Samuelsson 		(CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
14899fa97e9SAndreas Bießmann #define CONFIG_ENV_SIZE			SZ_64K /* sectors are 64K here */
149cb82a532SUlf Samuelsson /* The following #defines are needed to get flash environment right */
150cb82a532SUlf Samuelsson #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
15199fa97e9SAndreas Bießmann #define CONFIG_SYS_MONITOR_LEN		SZ_256K
152cb82a532SUlf Samuelsson 
153cb82a532SUlf Samuelsson /*
154cb82a532SUlf Samuelsson  * Boot option
155cb82a532SUlf Samuelsson  */
156cb82a532SUlf Samuelsson 
15799fa97e9SAndreas Bießmann /* default load address */
15899fa97e9SAndreas Bießmann #define CONFIG_SYS_LOAD_ADDR		CONFIG_SYS_SDRAM_BASE + SZ_16M
15999fa97e9SAndreas Bießmann #define CONFIG_ENV_OVERWRITE
160cb82a532SUlf Samuelsson 
161cb82a532SUlf Samuelsson /*
162cb82a532SUlf Samuelsson  * Shell Settings
163cb82a532SUlf Samuelsson  */
164cb82a532SUlf Samuelsson 
165cb82a532SUlf Samuelsson /*
166cb82a532SUlf Samuelsson  * Size of malloc() pool
167cb82a532SUlf Samuelsson  */
16899fa97e9SAndreas Bießmann #define CONFIG_SYS_MALLOC_LEN		ROUND(3 * CONFIG_ENV_SIZE + SZ_128K, \
16999fa97e9SAndreas Bießmann 					     SZ_4K)
170cb82a532SUlf Samuelsson 
17199fa97e9SAndreas Bießmann #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + SZ_4K \
17225ddd1fbSWolfgang Denk 					- GENERATED_GBL_DATA_SIZE)
17399fa97e9SAndreas Bießmann 
17499fa97e9SAndreas Bießmann #endif /* __AT91RM9200EK_CONFIG_H__ */
175