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 58*6a372e94SAndreas 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 70*6a372e94SAndreas Bießmann #include <asm/hardware.h> /* needed for port definitions */ 71*6a372e94SAndreas 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 76cb82a532SUlf Samuelsson /* 7799fa97e9SAndreas Bießmann * Memory Configuration 78cb82a532SUlf Samuelsson */ 7999fa97e9SAndreas Bießmann #define CONFIG_NR_DRAM_BANKS 1 8099fa97e9SAndreas Bießmann #define CONFIG_SYS_SDRAM_BASE 0x20000000 8199fa97e9SAndreas Bießmann #define CONFIG_SYS_SDRAM_SIZE SZ_32M 82cb82a532SUlf Samuelsson 8399fa97e9SAndreas Bießmann #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE 8499fa97e9SAndreas Bießmann #define CONFIG_SYS_MEMTEST_END \ 8599fa97e9SAndreas Bießmann (CONFIG_SYS_MEMTEST_START + CONFIG_SYS_SDRAM_SIZE - SZ_256K) 86cb82a532SUlf Samuelsson 87cb82a532SUlf Samuelsson /* 88cb82a532SUlf Samuelsson * LowLevel Init 89cb82a532SUlf Samuelsson */ 90cb82a532SUlf Samuelsson #ifndef CONFIG_SKIP_LOWLEVEL_INIT 9199fa97e9SAndreas Bießmann #define CONFIG_SYS_USE_MAIN_OSCILLATOR 92cb82a532SUlf Samuelsson /* flash */ 93cb82a532SUlf Samuelsson #define CONFIG_SYS_EBI_CFGR_VAL 0x00000000 94cb82a532SUlf Samuelsson #define CONFIG_SYS_SMC_CSR0_VAL 0x00003284 /* 16bit, 2 TDF, 4 WS */ 95cb82a532SUlf Samuelsson 96cb82a532SUlf Samuelsson /* clocks */ 97cb82a532SUlf Samuelsson #define CONFIG_SYS_PLLAR_VAL 0x20263E04 /* 179.712000 MHz for PCK */ 98cb82a532SUlf Samuelsson #define CONFIG_SYS_PLLBR_VAL 0x10483E0E /* 48.054857 MHz (divider by 2 for USB) */ 99cb82a532SUlf Samuelsson /* PCK/3 = MCK Master Clock = 59.904000MHz from PLLA */ 100cb82a532SUlf Samuelsson #define CONFIG_SYS_MCKR_VAL 0x00000202 101cb82a532SUlf Samuelsson 102cb82a532SUlf Samuelsson /* sdram */ 103cb82a532SUlf Samuelsson #define CONFIG_SYS_PIOC_ASR_VAL 0xFFFF0000 /* Configure PIOC as peripheral (D16/D31) */ 104cb82a532SUlf Samuelsson #define CONFIG_SYS_PIOC_BSR_VAL 0x00000000 105cb82a532SUlf Samuelsson #define CONFIG_SYS_PIOC_PDR_VAL 0xFFFF0000 106cb82a532SUlf Samuelsson #define CONFIG_SYS_EBI_CSA_VAL 0x00000002 /* CS1=CONFIG_SYS_SDRAM */ 107cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_CR_VAL 0x2188c155 /* set up the CONFIG_SYS_SDRAM */ 10899fa97e9SAndreas Bießmann #define CONFIG_SYS_SDRAM CONFIG_SYS_SDRAM_BASE /* address of the SDRAM */ 109066df1a5SAndreas Bießmann #define CONFIG_SYS_SDRAM1 (CONFIG_SYS_SDRAM_BASE+0x80) 110cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRAM_VAL 0x00000000 /* value written to CONFIG_SYS_SDRAM */ 111cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_MR_VAL 0x00000002 /* Precharge All */ 112cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_MR_VAL1 0x00000004 /* refresh */ 113cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_MR_VAL2 0x00000003 /* Load Mode Register */ 114cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_MR_VAL3 0x00000000 /* Normal Mode */ 115cb82a532SUlf Samuelsson #define CONFIG_SYS_SDRC_TR_VAL 0x000002E0 /* Write refresh rate */ 116cb82a532SUlf Samuelsson #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ 117cb82a532SUlf Samuelsson 118cb82a532SUlf Samuelsson /* 119cb82a532SUlf Samuelsson * Hardware drivers 120cb82a532SUlf Samuelsson */ 121cb82a532SUlf Samuelsson /* 12299fa97e9SAndreas Bießmann * Choose a USART for serial console 12399fa97e9SAndreas Bießmann * CONFIG_DBGU is DBGU unit on J10 12499fa97e9SAndreas Bießmann * CONFIG_USART1 is USART1 on J14 125cb82a532SUlf Samuelsson */ 126beebd851SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_AT91RM9200_USART 127cb82a532SUlf Samuelsson #define CONFIG_DBGU 128cb82a532SUlf Samuelsson 129cb82a532SUlf Samuelsson #define CONFIG_SYS_BAUDRATE_TABLE {115200 , 19200, 38400, 57600, 9600 } 130cb82a532SUlf Samuelsson #define CONFIG_BAUDRATE 115200 131cb82a532SUlf Samuelsson 132cb82a532SUlf Samuelsson /* 133cb82a532SUlf Samuelsson * Command line configuration. 134cb82a532SUlf Samuelsson */ 135cb82a532SUlf Samuelsson #include <config_cmd_default.h> 136cb82a532SUlf Samuelsson 137cb82a532SUlf Samuelsson #define CONFIG_CMD_DHCP 138cb82a532SUlf Samuelsson #define CONFIG_CMD_FAT 139cb82a532SUlf Samuelsson #define CONFIG_CMD_MII 140cb82a532SUlf Samuelsson #define CONFIG_CMD_PING 1413b83522bSAndreas Bießmann #define CONFIG_CMD_USB 142cb82a532SUlf Samuelsson #undef CONFIG_CMD_FPGA 143cb82a532SUlf Samuelsson 144cb82a532SUlf Samuelsson /* 145cb82a532SUlf Samuelsson * Network Driver Setting 146cb82a532SUlf Samuelsson */ 14799fa97e9SAndreas Bießmann #define CONFIG_NET_MULTI 14899fa97e9SAndreas Bießmann #define CONFIG_DRIVER_AT91EMAC 14999fa97e9SAndreas Bießmann #define CONFIG_SYS_RX_ETH_BUFFER 16 15099fa97e9SAndreas Bießmann #define CONFIG_RMII 15199fa97e9SAndreas Bießmann #define CONFIG_MII 152cb82a532SUlf Samuelsson 153cb82a532SUlf Samuelsson /* 154cb82a532SUlf Samuelsson * NOR Flash 155cb82a532SUlf Samuelsson */ 15699fa97e9SAndreas Bießmann #define CONFIG_FLASH_CFI_DRIVER 15799fa97e9SAndreas Bießmann #define CONFIG_SYS_FLASH_CFI 158cb82a532SUlf Samuelsson #define CONFIG_SYS_FLASH_BASE 0x10000000 15999fa97e9SAndreas Bießmann #define PHYS_FLASH_1 CONFIG_SYS_FLASH_BASE 16099fa97e9SAndreas Bießmann #define PHYS_FLASH_SIZE SZ_8M 161cb82a532SUlf Samuelsson #define CONFIG_SYS_MAX_FLASH_BANKS 1 162cb82a532SUlf Samuelsson #define CONFIG_SYS_MAX_FLASH_SECT 256 163cb82a532SUlf Samuelsson #define CONFIG_SYS_FLASH_PROTECTION 164cb82a532SUlf Samuelsson 165cb82a532SUlf Samuelsson /* 1663b83522bSAndreas Bießmann * USB Config 1673b83522bSAndreas Bießmann */ 1683b83522bSAndreas Bießmann #define CONFIG_USB_ATMEL 1 1693b83522bSAndreas Bießmann #define CONFIG_USB_OHCI_NEW 1 1703b83522bSAndreas Bießmann #define CONFIG_USB_KEYBOARD 1 1713b83522bSAndreas Bießmann #define CONFIG_USB_STORAGE 1 1723b83522bSAndreas Bießmann #define CONFIG_DOS_PARTITION 1 1733b83522bSAndreas Bießmann 1743b83522bSAndreas Bießmann #define CONFIG_SYS_USB_OHCI_CPU_INIT 1 17580733994SJens Scharsig #define CONFIG_SYS_USB_OHCI_REGS_BASE ATMEL_USB_HOST_BASE 1763b83522bSAndreas Bießmann #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91rm9200" 1773b83522bSAndreas Bießmann #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15 1783b83522bSAndreas Bießmann 1793b83522bSAndreas Bießmann /* 180cb82a532SUlf Samuelsson * Environment Settings 181cb82a532SUlf Samuelsson */ 18299fa97e9SAndreas Bießmann #define CONFIG_ENV_IS_IN_FLASH 183cb82a532SUlf Samuelsson 184cb82a532SUlf Samuelsson /* 185cb82a532SUlf Samuelsson * after u-boot.bin 186cb82a532SUlf Samuelsson */ 187cb82a532SUlf Samuelsson #define CONFIG_ENV_ADDR \ 188cb82a532SUlf Samuelsson (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN) 18999fa97e9SAndreas Bießmann #define CONFIG_ENV_SIZE SZ_64K /* sectors are 64K here */ 190cb82a532SUlf Samuelsson /* The following #defines are needed to get flash environment right */ 191cb82a532SUlf Samuelsson #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE 19299fa97e9SAndreas Bießmann #define CONFIG_SYS_MONITOR_LEN SZ_256K 193cb82a532SUlf Samuelsson 194cb82a532SUlf Samuelsson /* 195cb82a532SUlf Samuelsson * Boot option 196cb82a532SUlf Samuelsson */ 197cb82a532SUlf Samuelsson #define CONFIG_BOOTDELAY 3 198cb82a532SUlf Samuelsson 19999fa97e9SAndreas Bießmann /* default load address */ 20099fa97e9SAndreas Bießmann #define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE + SZ_16M 20199fa97e9SAndreas Bießmann #define CONFIG_ENV_OVERWRITE 202cb82a532SUlf Samuelsson 203cb82a532SUlf Samuelsson /* 204cb82a532SUlf Samuelsson * Shell Settings 205cb82a532SUlf Samuelsson */ 20699fa97e9SAndreas Bießmann #define CONFIG_CMDLINE_EDITING 20799fa97e9SAndreas Bießmann #define CONFIG_SYS_LONGHELP 20899fa97e9SAndreas Bießmann #define CONFIG_AUTO_COMPLETE 20999fa97e9SAndreas Bießmann #define CONFIG_SYS_HUSH_PARSER 210cb82a532SUlf Samuelsson #define CONFIG_SYS_PROMPT "U-Boot> " 211cb82a532SUlf Samuelsson #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " 212cb82a532SUlf Samuelsson #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ 213cb82a532SUlf Samuelsson #define CONFIG_SYS_MAXARGS 16 /* max number of command args */ 214cb82a532SUlf Samuelsson /* Print Buffer Size */ 215cb82a532SUlf Samuelsson #define CONFIG_SYS_PBSIZE \ 216cb82a532SUlf Samuelsson (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) 217cb82a532SUlf Samuelsson 218cb82a532SUlf Samuelsson /* 219cb82a532SUlf Samuelsson * Size of malloc() pool 220cb82a532SUlf Samuelsson */ 22199fa97e9SAndreas Bießmann #define CONFIG_SYS_MALLOC_LEN ROUND(3 * CONFIG_ENV_SIZE + SZ_128K, \ 22299fa97e9SAndreas Bießmann SZ_4K) 223cb82a532SUlf Samuelsson 22499fa97e9SAndreas Bießmann #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_4K \ 22525ddd1fbSWolfgang Denk - GENERATED_GBL_DATA_SIZE) 22699fa97e9SAndreas Bießmann 22799fa97e9SAndreas Bießmann #define CONFIG_STACKSIZE SZ_32K /* regular stack */ 22899fa97e9SAndreas Bießmann #define CONFIG_STACKSIZE_IRQ SZ_4K /* Unsure if to big or to small*/ 22999fa97e9SAndreas Bießmann #define CONFIG_STACKSIZE_FIQ SZ_4K /* Unsure if to big or to small*/ 23099fa97e9SAndreas Bießmann #endif /* __AT91RM9200EK_CONFIG_H__ */ 231