Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 1 | /* |
Eric Bénard | af4b8b4 | 2010-08-09 11:50:45 +0200 | [diff] [blame] | 2 | * CPUAT91 by (C) Copyright 2006-2010 Eric Benard |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 3 | * eric@eukrea.com |
| 4 | * |
| 5 | * Configuration settings for the CPUAT91 board. |
| 6 | * |
Wolfgang Denk | 3765b3e | 2013-10-07 13:07:26 +0200 | [diff] [blame] | 7 | * SPDX-License-Identifier: GPL-2.0+ |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 8 | */ |
| 9 | |
Eric Bénard | af4b8b4 | 2010-08-09 11:50:45 +0200 | [diff] [blame] | 10 | #ifndef _CONFIG_CPUAT91_H |
| 11 | #define _CONFIG_CPUAT91_H |
Jens Scharsig | 425de62 | 2010-02-03 22:45:42 +0100 | [diff] [blame] | 12 | |
Alexey Brodkin | 1ace402 | 2014-02-26 17:47:58 +0400 | [diff] [blame] | 13 | #include <linux/sizes.h> |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 14 | |
| 15 | #ifdef CONFIG_RAMBOOT |
| 16 | #define CONFIG_SKIP_LOWLEVEL_INIT |
| 17 | #define CONFIG_SYS_TEXT_BASE 0x21F00000 |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 18 | #else |
| 19 | #define CONFIG_BOOTDELAY 1 |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 20 | #define CONFIG_SYS_TEXT_BASE 0 |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 21 | #endif |
| 22 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 23 | #define AT91C_XTAL_CLOCK 18432000 |
Andreas Bießmann | 6a372e9 | 2011-06-12 01:49:12 +0000 | [diff] [blame] | 24 | #define CONFIG_SYS_AT91_SLOW_CLOCK 32768 |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 25 | #define AT91C_MAIN_CLOCK ((AT91C_XTAL_CLOCK / 4) * 39) |
| 26 | #define AT91C_MASTER_CLOCK (AT91C_MAIN_CLOCK / 3) |
| 27 | #define CONFIG_SYS_HZ_CLOCK (AT91C_MASTER_CLOCK / 2) |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 28 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 29 | #define CONFIG_AT91RM9200 |
| 30 | #define CONFIG_CPUAT91 |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 31 | #define USE_920T_MMU |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 32 | |
Andreas Bießmann | 6a372e9 | 2011-06-12 01:49:12 +0000 | [diff] [blame] | 33 | #include <asm/hardware.h> /* needed for port definitions */ |
| 34 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 35 | #define CONFIG_CMDLINE_TAG |
| 36 | #define CONFIG_SETUP_MEMORY_TAGS |
| 37 | #define CONFIG_INITRD_TAG |
Andreas Bießmann | dbbf13b | 2011-06-12 01:49:16 +0000 | [diff] [blame] | 38 | #define CONFIG_BOARD_EARLY_INIT_F |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 39 | |
| 40 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 41 | #define CONFIG_SYS_USE_MAIN_OSCILLATOR |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 42 | /* flash */ |
| 43 | #define CONFIG_SYS_MC_PUIA_VAL 0x00000000 |
| 44 | #define CONFIG_SYS_MC_PUP_VAL 0x00000000 |
| 45 | #define CONFIG_SYS_MC_PUER_VAL 0x00000000 |
| 46 | #define CONFIG_SYS_MC_ASR_VAL 0x00000000 |
| 47 | #define CONFIG_SYS_MC_AASR_VAL 0x00000000 |
| 48 | #define CONFIG_SYS_EBI_CFGR_VAL 0x00000000 |
| 49 | #define CONFIG_SYS_SMC_CSR0_VAL 0x00003284 /* 16bit, 2 TDF, 4 WS */ |
| 50 | |
| 51 | /* clocks */ |
| 52 | #define CONFIG_SYS_PLLAR_VAL 0x20263E04 /* 179.712000 MHz for PCK */ |
| 53 | #define CONFIG_SYS_PLLBR_VAL 0x10483E0E /* 48.054857 MHz for USB */ |
| 54 | #define CONFIG_SYS_MCKR_VAL 0x00000202 /* PCK/3 = MCK Master Clock */ |
| 55 | |
| 56 | /* sdram */ |
| 57 | #define CONFIG_SYS_PIOC_ASR_VAL 0xFFFF0000 /* Configure PIOC as D16/D31 */ |
| 58 | #define CONFIG_SYS_PIOC_BSR_VAL 0x00000000 |
| 59 | #define CONFIG_SYS_PIOC_PDR_VAL 0xFFFF0000 |
| 60 | #define CONFIG_SYS_EBI_CSA_VAL 0x00000002 /* CS1=SDRAM */ |
| 61 | #define CONFIG_SYS_SDRC_CR_VAL 0x2188C155 /* set up the SDRAM */ |
| 62 | #define CONFIG_SYS_SDRAM 0x20000000 /* address of the SDRAM */ |
| 63 | #define CONFIG_SYS_SDRAM1 0x20000080 /* address of the SDRAM */ |
| 64 | #define CONFIG_SYS_SDRAM_VAL 0x00000000 /* value written to SDRAM */ |
| 65 | #define CONFIG_SYS_SDRC_MR_VAL 0x00000002 /* Precharge All */ |
| 66 | #define CONFIG_SYS_SDRC_MR_VAL1 0x00000004 /* refresh */ |
| 67 | #define CONFIG_SYS_SDRC_MR_VAL2 0x00000003 /* Load Mode Register */ |
| 68 | #define CONFIG_SYS_SDRC_MR_VAL3 0x00000000 /* Normal Mode */ |
| 69 | #define CONFIG_SYS_SDRC_TR_VAL 0x000002E0 /* Write refresh rate */ |
| 70 | #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ |
| 71 | |
Andreas Bießmann | dbbf13b | 2011-06-12 01:49:16 +0000 | [diff] [blame] | 72 | #define CONFIG_ATMEL_USART |
| 73 | #define CONFIG_USART_BASE ATMEL_BASE_DBGU |
| 74 | #define CONFIG_USART_ID 0/* ignored in arm */ |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 75 | |
Eric Bénard | af4b8b4 | 2010-08-09 11:50:45 +0200 | [diff] [blame] | 76 | #undef CONFIG_HARD_I2C |
Eric Bénard | af4b8b4 | 2010-08-09 11:50:45 +0200 | [diff] [blame] | 77 | #define AT91_PIN_SDA (1<<25) |
| 78 | #define AT91_PIN_SCL (1<<26) |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 79 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 80 | #define CONFIG_SYS_I2C_INIT_BOARD |
Eric Bénard | af4b8b4 | 2010-08-09 11:50:45 +0200 | [diff] [blame] | 81 | #define CONFIG_SYS_I2C_SPEED 50000 |
| 82 | #define CONFIG_SYS_I2C_SLAVE 0 |
| 83 | |
| 84 | #define I2C_INIT i2c_init_board(); |
| 85 | #define I2C_ACTIVE writel(AT91_PMX_AA_TWD, &pio->pioa.mddr); |
| 86 | #define I2C_TRISTATE writel(AT91_PMX_AA_TWD, &pio->pioa.mder); |
| 87 | #define I2C_READ ((readl(&pio->pioa.pdsr) & AT91_PMX_AA_TWD) != 0) |
| 88 | #define I2C_SDA(bit) \ |
| 89 | if (bit) \ |
| 90 | writel(AT91_PMX_AA_TWD, &pio->pioa.sodr); \ |
| 91 | else \ |
| 92 | writel(AT91_PMX_AA_TWD, &pio->pioa.codr); |
| 93 | #define I2C_SCL(bit) \ |
| 94 | if (bit) \ |
| 95 | writel(AT91_PMX_AA_TWCK, &pio->pioa.sodr); \ |
| 96 | else \ |
| 97 | writel(AT91_PMX_AA_TWCK, &pio->pioa.codr); |
| 98 | |
| 99 | #define I2C_DELAY udelay(2500000/CONFIG_SYS_I2C_SPEED) |
| 100 | |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 101 | #define CONFIG_SYS_I2C_EEPROM_ADDR 0x54 |
| 102 | #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 |
| 103 | #define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW 1 |
| 104 | #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10 |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 105 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 106 | #define CONFIG_BOOTP_BOOTFILESIZE |
| 107 | #define CONFIG_BOOTP_BOOTPATH |
| 108 | #define CONFIG_BOOTP_GATEWAY |
| 109 | #define CONFIG_BOOTP_HOSTNAME |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 110 | |
| 111 | #include <config_cmd_default.h> |
| 112 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 113 | #define CONFIG_CMD_PING |
| 114 | #define CONFIG_CMD_MII |
| 115 | #define CONFIG_CMD_CACHE |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 116 | #undef CONFIG_CMD_USB |
| 117 | #undef CONFIG_CMD_FPGA |
| 118 | #undef CONFIG_CMD_IMI |
| 119 | #undef CONFIG_CMD_LOADS |
| 120 | #undef CONFIG_CMD_NFS |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 121 | #undef CONFIG_CMD_DHCP |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 122 | |
Heiko Schocher | ea818db | 2013-01-29 08:53:15 +0100 | [diff] [blame] | 123 | #ifdef CONFIG_SYS_I2C_SOFT |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 124 | #define CONFIG_CMD_EEPROM |
| 125 | #define CONFIG_CMD_I2C |
| 126 | #endif |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 127 | |
| 128 | #define CONFIG_NR_DRAM_BANKS 1 |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 129 | #define CONFIG_SYS_SDRAM_BASE 0x20000000 |
| 130 | #define CONFIG_SYS_SDRAM_SIZE (32 * 1024 * 1024) |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 131 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 132 | #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 133 | #define CONFIG_SYS_MEMTEST_END \ |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 134 | (CONFIG_SYS_MEMTEST_START + CONFIG_SYS_SDRAM_SIZE - 512 * 1024) |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 135 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 136 | #define CONFIG_DRIVER_AT91EMAC |
| 137 | #define CONFIG_SYS_RX_ETH_BUFFER 16 |
| 138 | #define CONFIG_RMII |
| 139 | #define CONFIG_MII |
Eric Bénard | 836cd45 | 2010-06-21 09:40:43 +0200 | [diff] [blame] | 140 | #define CONFIG_DRIVER_AT91EMAC_PHYADDR 1 |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 141 | #define CONFIG_NET_RETRY_COUNT 20 |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 142 | #define CONFIG_KS8721_PHY |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 143 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 144 | #define CONFIG_SYS_FLASH_CFI |
| 145 | #define CONFIG_FLASH_CFI_DRIVER |
| 146 | #define CONFIG_SYS_FLASH_EMPTY_INFO |
| 147 | #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 148 | #define CONFIG_SYS_MAX_FLASH_BANKS 1 |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 149 | #define CONFIG_SYS_FLASH_PROTECTION |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 150 | #define PHYS_FLASH_1 0x10000000 |
| 151 | #define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1 |
| 152 | #define CONFIG_SYS_MAX_FLASH_SECT 128 |
Eric Bénard | af4b8b4 | 2010-08-09 11:50:45 +0200 | [diff] [blame] | 153 | #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 154 | #define CONFIG_SYS_MONITOR_BASE PHYS_FLASH_1 |
| 155 | #define PHYS_FLASH_SIZE (16 * 1024 * 1024) |
| 156 | #define CONFIG_SYS_FLASH_BANKS_LIST \ |
| 157 | { PHYS_FLASH_1 } |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 158 | |
| 159 | #if defined(CONFIG_CMD_USB) |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 160 | #define CONFIG_USB_ATMEL |
Bo Shen | dcd2f1a | 2013-10-21 16:14:00 +0800 | [diff] [blame] | 161 | #define CONFIG_USB_ATMEL_CLK_SEL_PLLB |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 162 | #define CONFIG_USB_OHCI_NEW |
| 163 | #define CONFIG_USB_STORAGE |
| 164 | #define CONFIG_DOS_PARTITION |
| 165 | #define CONFIG_AT91C_PQFP_UHPBU |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 166 | #undef CONFIG_SYS_USB_OHCI_BOARD_INIT |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 167 | #define CONFIG_SYS_USB_OHCI_CPU_INIT |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 168 | #define CONFIG_SYS_USB_OHCI_REGS_BASE AT91_USB_HOST_BASE |
| 169 | #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91rm9200" |
| 170 | #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15 |
| 171 | #endif |
| 172 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 173 | #define CONFIG_ENV_IS_IN_FLASH |
| 174 | #define CONFIG_ENV_ADDR (PHYS_FLASH_1 + 128 * 1024) |
| 175 | #define CONFIG_ENV_SIZE (128 * 1024) |
| 176 | #define CONFIG_ENV_SECT_SIZE (128 * 1024) |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 177 | |
| 178 | #define CONFIG_SYS_LOAD_ADDR 0x21000000 |
| 179 | |
| 180 | #define CONFIG_BAUDRATE 115200 |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 181 | |
| 182 | #define CONFIG_SYS_PROMPT "CPUAT91=> " |
| 183 | #define CONFIG_SYS_CBSIZE 256 |
| 184 | #define CONFIG_SYS_MAXARGS 32 |
| 185 | #define CONFIG_SYS_PBSIZE \ |
| 186 | (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 187 | #define CONFIG_CMDLINE_EDITING |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 188 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 189 | #define CONFIG_SYS_MALLOC_LEN \ |
| 190 | ROUND(3 * CONFIG_ENV_SIZE + 128 * 1024, 4 * 1024) |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 191 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 192 | #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - \ |
| 193 | GENERATED_GBL_DATA_SIZE) |
| 194 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 195 | #define CONFIG_DEVICE_NULLDEV |
| 196 | #define CONFIG_SILENT_CONSOLE |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 197 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 198 | #define CONFIG_AUTOBOOT_KEYED |
Eric Benard | 513bbe1 | 2009-10-12 10:15:39 +0200 | [diff] [blame] | 199 | #define CONFIG_AUTOBOOT_PROMPT \ |
| 200 | "Press SPACE to abort autoboot\n" |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 201 | #define CONFIG_AUTOBOOT_STOP_STR " " |
| 202 | #define CONFIG_AUTOBOOT_DELAY_STR "d" |
| 203 | |
Eric Benard | 632f8fd | 2011-04-03 06:35:55 +0000 | [diff] [blame] | 204 | #define CONFIG_VERSION_VARIABLE |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 205 | |
| 206 | #define MTDIDS_DEFAULT "nor0=physmap-flash.0" |
| 207 | #define MTDPARTS_DEFAULT \ |
| 208 | "mtdparts=physmap-flash.0:" \ |
| 209 | "128k(u-boot)ro," \ |
| 210 | "128k(u-boot-env)," \ |
Eric Bénard | 0ca6c52 | 2010-08-09 11:50:46 +0200 | [diff] [blame] | 211 | "1792k(kernel)," \ |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 212 | "-(rootfs)" |
| 213 | |
| 214 | #define CONFIG_BOOTARGS \ |
| 215 | "root=/dev/mtdblock3 rootfstype=jffs2 console=ttyS0,115200" |
| 216 | |
| 217 | #define CONFIG_BOOTCOMMAND "run flashboot" |
| 218 | |
| 219 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 220 | "mtdid=" MTDIDS_DEFAULT "\0" \ |
| 221 | "mtdparts=" MTDPARTS_DEFAULT "\0" \ |
| 222 | "flub=tftp 21000000 cpuat91/u-boot.bin; protect off 10000000 " \ |
| 223 | "1001FFFF; erase 10000000 1001FFFF; cp.b 21000000 " \ |
| 224 | "10000000 ${filesize}\0" \ |
| 225 | "flui=tftp 21000000 cpuat91/uImage; protect off 10040000 " \ |
Eric Bénard | 0ca6c52 | 2010-08-09 11:50:46 +0200 | [diff] [blame] | 226 | "1019ffff; erase 10040000 101fffff; cp.b 21000000 " \ |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 227 | "10040000 ${filesize}\0" \ |
| 228 | "flrfs=tftp 21000000 cpuat91/rootfs.jffs2; protect off " \ |
Eric Bénard | 0ca6c52 | 2010-08-09 11:50:46 +0200 | [diff] [blame] | 229 | "10200000 10ffffff; erase 10200000 10ffffff; cp.b " \ |
| 230 | "21000000 10200000 ${filesize}\0" \ |
Tom Rix | d8380c9 | 2009-09-27 07:47:24 -0500 | [diff] [blame] | 231 | "ramargs=setenv bootargs $(bootargs) $(mtdparts)\0" \ |
| 232 | "flashboot=run ramargs;bootm 10040000\0" \ |
| 233 | "netboot=run ramargs;tftpboot 21000000 cpuat91/uImage;" \ |
| 234 | "bootm 21000000\0" |
Eric Bénard | af4b8b4 | 2010-08-09 11:50:45 +0200 | [diff] [blame] | 235 | #endif /* _CONFIG_CPUAT91_H */ |