Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2007-2008 |
| 3 | * Stelian Pop <stelian.pop@leadtechdesign.com> |
| 4 | * Lead Tech Design <www.leadtechdesign.com> |
| 5 | * Ilko Iliev <www.ronetix.at> |
| 6 | * |
| 7 | * (C) Copyright 2009 |
| 8 | * Eric Benard <eric@eukrea.com> |
| 9 | * |
| 10 | * Configuration settings for the Eukrea CPU9260 board. |
| 11 | * |
| 12 | * See file CREDITS for list of people who contributed to this |
| 13 | * project. |
| 14 | * |
| 15 | * This program is free software; you can redistribute it and/or |
| 16 | * modify it under the terms of the GNU General Public License as |
| 17 | * published by the Free Software Foundation; either version 2 of |
| 18 | * the License, or (at your option) any later version. |
| 19 | * |
| 20 | * This program is distributed in the hope that it will be useful, |
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 | * GNU General Public License for more details. |
| 24 | * |
| 25 | * You should have received a copy of the GNU General Public License |
| 26 | * along with this program; if not, write to the Free Software |
| 27 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 28 | * MA 02111-1307 USA |
| 29 | */ |
| 30 | |
| 31 | #ifndef __CONFIG_H |
| 32 | #define __CONFIG_H |
| 33 | |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 34 | /* to be removed once maemory-map.h is fixed */ |
| 35 | #define AT91_BASE_SYS 0xffffe800 |
| 36 | #define AT91_DBGU (0xfffff200 - AT91_BASE_SYS) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 37 | |
Achim Ehrlich | 7c966a8 | 2010-02-24 10:29:16 +0100 | [diff] [blame] | 38 | #define CONFIG_SYS_AT91_MAIN_CLOCK 18432000 |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 39 | #define CONFIG_SYS_HZ 1000 |
| 40 | |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 41 | #define CONFIG_ARM926EJS |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 42 | |
| 43 | #if defined(CONFIG_CPU9G20) |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 44 | #define CONFIG_AT91SAM9G20 |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 45 | #elif defined(CONFIG_CPU9260) |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 46 | #define CONFIG_AT91SAM9260 |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 47 | #else |
| 48 | #error "Unknown board" |
| 49 | #endif |
| 50 | |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 51 | #define CONFIG_AT91FAMILY |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 52 | #define CONFIG_ARCH_CPU_INIT |
| 53 | #undef CONFIG_USE_IRQ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 54 | #define CONFIG_DISPLAY_CPUINFO |
| 55 | #define CONFIG_BOARD_EARLY_INIT_F |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 56 | |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 57 | #define CONFIG_CMDLINE_TAG |
| 58 | #define CONFIG_SETUP_MEMORY_TAGS |
| 59 | #define CONFIG_INITRD_TAG |
| 60 | |
| 61 | #if defined(CONFIG_NANDBOOT) |
| 62 | #define CONFIG_SKIP_LOWLEVEL_INIT |
| 63 | #define CONFIG_SYS_TEXT_BASE 0x23f00000 |
| 64 | #else |
| 65 | #define CONFIG_SYS_TEXT_BASE 0x00000000 |
| 66 | #endif |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 67 | |
| 68 | /* clocks */ |
| 69 | #if defined(CONFIG_CPU9G20) |
| 70 | #define MASTER_PLL_DIV 0x01 |
| 71 | #define MASTER_PLL_MUL 0x2B |
| 72 | #elif defined(CONFIG_CPU9260) |
| 73 | #define MASTER_PLL_DIV 0x09 |
| 74 | #define MASTER_PLL_MUL 0x61 |
| 75 | #endif |
| 76 | |
| 77 | /* CKGR_MOR - enable main osc. */ |
| 78 | #define CONFIG_SYS_MOR_VAL \ |
| 79 | (AT91_PMC_MOSCEN | \ |
| 80 | (255 << 8)) /* Main Oscillator Start-up Time */ |
| 81 | #if defined(CONFIG_CPU9G20) |
| 82 | #define CONFIG_SYS_PLLAR_VAL \ |
| 83 | (AT91_PMC_PLLA_WR_ERRATA | /* Bit 29 must be 1 when prog */ \ |
| 84 | ((MASTER_PLL_MUL - 1) << 16) | (MASTER_PLL_DIV)) |
| 85 | #elif defined(CONFIG_CPU9260) |
| 86 | #define CONFIG_SYS_PLLAR_VAL \ |
| 87 | (AT91_PMC_PLLA_WR_ERRATA | /* Bit 29 must be 1 when prog */ \ |
| 88 | AT91_PMC_OUT | \ |
| 89 | ((MASTER_PLL_MUL - 1) << 16) | (MASTER_PLL_DIV)) |
| 90 | #endif |
| 91 | |
| 92 | #if defined(CONFIG_CPU9G20) |
| 93 | #define CONFIG_SYS_MCKR1_VAL \ |
| 94 | (AT91_PMC_CSS_PLLA | \ |
| 95 | AT91_PMC_PRES_1 | \ |
| 96 | AT91SAM9_PMC_MDIV_6 | \ |
| 97 | AT91_PMC_PDIV_2) |
| 98 | #define CONFIG_SYS_MCKR2_VAL \ |
| 99 | CONFIG_SYS_MCKR1_VAL |
| 100 | #elif defined(CONFIG_CPU9260) |
| 101 | #define CONFIG_SYS_MCKR1_VAL \ |
| 102 | (AT91_PMC_CSS_SLOW | \ |
| 103 | AT91_PMC_PRES_1 | \ |
| 104 | AT91SAM9_PMC_MDIV_2 | \ |
| 105 | AT91_PMC_PDIV_1) |
| 106 | #define CONFIG_SYS_MCKR2_VAL \ |
| 107 | (AT91_PMC_CSS_PLLA | \ |
| 108 | AT91_PMC_PRES_1 | \ |
| 109 | AT91SAM9_PMC_MDIV_2 | \ |
| 110 | AT91_PMC_PDIV_1) |
| 111 | #endif |
| 112 | |
| 113 | /* define PDC[31:16] as DATA[31:16] */ |
| 114 | #define CONFIG_SYS_PIOC_PDR_VAL1 0xFFFF0000 |
| 115 | /* no pull-up for D[31:16] */ |
| 116 | #define CONFIG_SYS_PIOC_PPUDR_VAL 0xFFFF0000 |
| 117 | |
| 118 | /* EBI_CSA, 3.3V, no pull-ups for D[15:0], CS1 SDRAM, CS3 NAND Flash */ |
| 119 | #define CONFIG_SYS_MATRIX_EBICSA_VAL \ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 120 | (AT91_MATRIX_CSA_DBPUC | AT91_MATRIX_CSA_EBI_CS1A | \ |
| 121 | AT91_MATRIX_CSA_EBI_CS3A | AT91_MATRIX_CSA_VDDIOMSEL_3_3V) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 122 | |
| 123 | /* SDRAM */ |
| 124 | /* SDRAMC_MR Mode register */ |
| 125 | #define CONFIG_SYS_SDRC_MR_VAL1 AT91_SDRAMC_MODE_NORMAL |
| 126 | /* SDRAMC_TR - Refresh Timer register */ |
| 127 | #define CONFIG_SYS_SDRC_TR_VAL1 0x287 |
| 128 | /* SDRAMC_CR - Configuration register*/ |
| 129 | #if defined(CONFIG_CPU9G20) |
| 130 | #define CONFIG_SYS_SDRC_CR_VAL_64MB \ |
| 131 | (AT91_SDRAMC_NC_9 | \ |
| 132 | AT91_SDRAMC_NR_13 | \ |
| 133 | AT91_SDRAMC_NB_4 | \ |
| 134 | AT91_SDRAMC_CAS_2 | \ |
| 135 | AT91_SDRAMC_DBW_32 | \ |
| 136 | (2 << 8) | /* Write Recovery Delay */ \ |
| 137 | (9 << 12) | /* Row Cycle Delay */ \ |
| 138 | (3 << 16) | /* Row Precharge Delay */ \ |
| 139 | (3 << 20) | /* Row to Column Delay */ \ |
| 140 | (6 << 24) | /* Active to Precharge Delay */ \ |
| 141 | (10 << 28)) /* Exit Self Refresh to Active Delay */ |
| 142 | |
| 143 | #define CONFIG_SYS_SDRC_CR_VAL_128MB \ |
| 144 | (AT91_SDRAMC_NC_10 | \ |
| 145 | AT91_SDRAMC_NR_13 | \ |
| 146 | AT91_SDRAMC_NB_4 | \ |
| 147 | AT91_SDRAMC_CAS_2 | \ |
| 148 | AT91_SDRAMC_DBW_32 | \ |
| 149 | (2 << 8) | /* Write Recovery Delay */ \ |
| 150 | (9 << 12) | /* Row Cycle Delay */ \ |
| 151 | (3 << 16) | /* Row Precharge Delay */ \ |
| 152 | (3 << 20) | /* Row to Column Delay */ \ |
| 153 | (6 << 24) | /* Active to Precharge Delay */ \ |
| 154 | (10 << 28)) /* Exit Self Refresh to Active Delay */ |
| 155 | #elif defined(CONFIG_CPU9260) |
| 156 | #define CONFIG_SYS_SDRC_CR_VAL_64MB \ |
| 157 | (AT91_SDRAMC_NC_9 | \ |
| 158 | AT91_SDRAMC_NR_13 | \ |
| 159 | AT91_SDRAMC_NB_4 | \ |
| 160 | AT91_SDRAMC_CAS_2 | \ |
| 161 | AT91_SDRAMC_DBW_32 | \ |
| 162 | (2 << 8) | /* Write Recovery Delay */ \ |
| 163 | (7 << 12) | /* Row Cycle Delay */ \ |
| 164 | (2 << 16) | /* Row Precharge Delay */ \ |
| 165 | (2 << 20) | /* Row to Column Delay */ \ |
| 166 | (5 << 24) | /* Active to Precharge Delay */ \ |
| 167 | (8 << 28)) /* Exit Self Refresh to Active Delay */ |
| 168 | |
| 169 | #define CONFIG_SYS_SDRC_CR_VAL_128MB \ |
| 170 | (AT91_SDRAMC_NC_10 | \ |
| 171 | AT91_SDRAMC_NR_13 | \ |
| 172 | AT91_SDRAMC_NB_4 | \ |
| 173 | AT91_SDRAMC_CAS_2 | \ |
| 174 | AT91_SDRAMC_DBW_32 | \ |
| 175 | (2 << 8) | /* Write Recovery Delay */ \ |
| 176 | (7 << 12) | /* Row Cycle Delay */ \ |
| 177 | (2 << 16) | /* Row Precharge Delay */ \ |
| 178 | (2 << 20) | /* Row to Column Delay */ \ |
| 179 | (5 << 24) | /* Active to Precharge Delay */ \ |
| 180 | (8 << 28)) /* Exit Self Refresh to Active Delay */ |
| 181 | #endif |
| 182 | |
| 183 | /* Memory Device Register -> SDRAM */ |
| 184 | #define CONFIG_SYS_SDRC_MDR_VAL AT91_SDRAMC_MD_SDRAM |
| 185 | #define CONFIG_SYS_SDRC_MR_VAL2 AT91_SDRAMC_MODE_PRECHARGE |
| 186 | #define CONFIG_SYS_SDRAM_VAL1 0 /* SDRAM_BASE */ |
| 187 | #define CONFIG_SYS_SDRC_MR_VAL3 AT91_SDRAMC_MODE_REFRESH |
| 188 | #define CONFIG_SYS_SDRAM_VAL2 0 /* SDRAM_BASE */ |
| 189 | #define CONFIG_SYS_SDRAM_VAL3 0 /* SDRAM_BASE */ |
| 190 | #define CONFIG_SYS_SDRAM_VAL4 0 /* SDRAM_BASE */ |
| 191 | #define CONFIG_SYS_SDRAM_VAL5 0 /* SDRAM_BASE */ |
| 192 | #define CONFIG_SYS_SDRAM_VAL6 0 /* SDRAM_BASE */ |
| 193 | #define CONFIG_SYS_SDRAM_VAL7 0 /* SDRAM_BASE */ |
| 194 | #define CONFIG_SYS_SDRAM_VAL8 0 /* SDRAM_BASE */ |
| 195 | #define CONFIG_SYS_SDRAM_VAL9 0 /* SDRAM_BASE */ |
| 196 | #define CONFIG_SYS_SDRC_MR_VAL4 AT91_SDRAMC_MODE_LMR |
| 197 | #define CONFIG_SYS_SDRAM_VAL10 0 /* SDRAM_BASE */ |
| 198 | #define CONFIG_SYS_SDRC_MR_VAL5 AT91_SDRAMC_MODE_NORMAL |
| 199 | #define CONFIG_SYS_SDRAM_VAL11 0 /* SDRAM_BASE */ |
| 200 | #define CONFIG_SYS_SDRC_TR_VAL2 1200 /* SDRAM_TR */ |
| 201 | #define CONFIG_SYS_SDRAM_VAL12 0 /* SDRAM_BASE */ |
| 202 | |
| 203 | /* setup SMC0, CS0 (NOR Flash) - 16-bit */ |
| 204 | #if defined(CONFIG_CPU9G20) |
| 205 | #define CONFIG_SYS_SMC0_SETUP0_VAL \ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 206 | (AT91_SMC_SETUP_NWE(0) | AT91_SMC_SETUP_NCS_WR(0) | \ |
| 207 | AT91_SMC_SETUP_NRD(0) | AT91_SMC_SETUP_NCS_RD(0)) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 208 | #define CONFIG_SYS_SMC0_PULSE0_VAL \ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 209 | (AT91_SMC_PULSE_NWE(8) | AT91_SMC_PULSE_NCS_WR(8) | \ |
| 210 | AT91_SMC_PULSE_NRD(14) | AT91_SMC_PULSE_NCS_RD(14)) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 211 | #define CONFIG_SYS_SMC0_CYCLE0_VAL \ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 212 | (AT91_SMC_CYCLE_NWE(8) | AT91_SMC_CYCLE_NRD(14)) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 213 | #define CONFIG_SYS_SMC0_MODE0_VAL \ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 214 | (AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE | \ |
| 215 | AT91_SMC_MODE_DBW_16 | \ |
| 216 | AT91_SMC_MODE_TDF | \ |
| 217 | AT91_SMC_MODE_TDF_CYCLE(3)) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 218 | #elif defined(CONFIG_CPU9260) |
| 219 | #define CONFIG_SYS_SMC0_SETUP0_VAL \ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 220 | (AT91_SMC_SETUP_NWE(0) | AT91_SMC_SETUP_NCS_WR(0) | \ |
| 221 | AT91_SMC_SETUP_NRD(0) | AT91_SMC_SETUP_NCS_RD(0)) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 222 | #define CONFIG_SYS_SMC0_PULSE0_VAL \ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 223 | (AT91_SMC_PULSE_NWE(6) | AT91_SMC_PULSE_NCS_WR(6) | \ |
| 224 | AT91_SMC_PULSE_NRD(10) | AT91_SMC_PULSE_NCS_RD(10)) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 225 | #define CONFIG_SYS_SMC0_CYCLE0_VAL \ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 226 | (AT91_SMC_CYCLE_NWE(6) | AT91_SMC_CYCLE_NRD(10)) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 227 | #define CONFIG_SYS_SMC0_MODE0_VAL \ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 228 | (AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE | \ |
| 229 | AT91_SMC_MODE_DBW_16 | \ |
| 230 | AT91_SMC_MODE_TDF | \ |
| 231 | AT91_SMC_MODE_TDF_CYCLE(2)) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 232 | #endif |
| 233 | |
| 234 | /* user reset enable */ |
| 235 | #define CONFIG_SYS_RSTC_RMR_VAL \ |
| 236 | (AT91_RSTC_KEY | \ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 237 | AT91_RSTC_CR_PROCRST | \ |
| 238 | AT91_RSTC_MR_ERSTL(1) | \ |
| 239 | AT91_RSTC_MR_ERSTL(2)) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 240 | |
| 241 | /* Disable Watchdog */ |
| 242 | #define CONFIG_SYS_WDTC_WDMR_VAL \ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 243 | (AT91_WDT_MR_WDIDLEHLT | AT91_WDT_MR_WDDBGHLT | \ |
| 244 | AT91_WDT_MR_WDV(0xfff) | \ |
| 245 | AT91_WDT_MR_WDDIS | \ |
| 246 | AT91_WDT_MR_WDD(0xfff)) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 247 | |
| 248 | /* |
| 249 | * Hardware drivers |
| 250 | */ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 251 | #define CONFIG_AT91SAM9_WATCHDOG |
| 252 | #define CONFIG_AT91_GPIO |
| 253 | #define CONFIG_ATMEL_USART |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 254 | #undef CONFIG_USART0 |
| 255 | #undef CONFIG_USART1 |
| 256 | #undef CONFIG_USART2 |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 257 | #define CONFIG_USART3 |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 258 | |
| 259 | #define CONFIG_BOOTDELAY 3 |
| 260 | |
| 261 | /* |
| 262 | * BOOTP options |
| 263 | */ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 264 | #define CONFIG_BOOTP_BOOTFILESIZE |
| 265 | #define CONFIG_BOOTP_BOOTPATH |
| 266 | #define CONFIG_BOOTP_GATEWAY |
| 267 | #define CONFIG_BOOTP_HOSTNAME |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 268 | |
| 269 | /* |
| 270 | * Command line configuration. |
| 271 | */ |
| 272 | #include <config_cmd_default.h> |
| 273 | #undef CONFIG_CMD_BDI |
| 274 | #undef CONFIG_CMD_IMI |
| 275 | #undef CONFIG_CMD_FPGA |
| 276 | #undef CONFIG_CMD_LOADS |
| 277 | #undef CONFIG_CMD_IMLS |
| 278 | |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 279 | #define CONFIG_CMD_PING |
| 280 | #define CONFIG_CMD_DHCP |
| 281 | #define CONFIG_CMD_NAND |
| 282 | #define CONFIG_CMD_USB |
| 283 | #define CONFIG_CMD_FAT |
| 284 | #define CONFIG_CMD_MII |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 285 | |
| 286 | /* SDRAM */ |
| 287 | #define CONFIG_NR_DRAM_BANKS 1 |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 288 | #define CONFIG_SYS_SDRAM_BASE 0x20000000 |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 289 | #if defined(CONFIG_CPU9260_128M) || defined(CONFIG_CPU9G20_128M) |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 290 | #define CONFIG_SYS_SDRAM_SIZE (128 * 1024 * 1024) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 291 | #define CONFIG_SYS_SDRC_CR_VAL CONFIG_SYS_SDRC_CR_VAL_128MB |
| 292 | #else |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 293 | #define CONFIG_SYS_SDRAM_SIZE (64 * 1024 * 1024) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 294 | #define CONFIG_SYS_SDRC_CR_VAL CONFIG_SYS_SDRC_CR_VAL_64MB |
| 295 | #endif |
| 296 | |
| 297 | /* NAND flash */ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 298 | #define CONFIG_NAND_ATMEL |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 299 | #define NAND_MAX_CHIPS 1 |
| 300 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 301 | #define CONFIG_SYS_NAND_BASE 0x40000000 |
| 302 | #define CONFIG_SYS_NAND_DBW_8 1 |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 303 | #define CONFIG_SYS_NAND_READY_PIN AT91_PIO_PORTC, 13 |
| 304 | #define CONFIG_SYS_NAND_ENABLE_PIN AT91_PIO_PORTC, 14 |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 305 | #define CONFIG_SYS_NAND_MASK_ALE (1 << 21) |
| 306 | #define CONFIG_SYS_NAND_MASK_CLE (1 << 22) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 307 | |
| 308 | /* NOR flash */ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 309 | #if defined(CONFIG_NANDBOOT) |
| 310 | #define CONFIG_SYS_NO_FLASH |
| 311 | #else |
| 312 | #define CONFIG_SYS_FLASH_CFI |
| 313 | #define CONFIG_FLASH_CFI_DRIVER |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 314 | #define PHYS_FLASH_1 0x10000000 |
| 315 | #define PHYS_FLASH_2 0x12000000 |
| 316 | #define CONFIG_SYS_FLASH_BANKS_LIST \ |
| 317 | { PHYS_FLASH_1, PHYS_FLASH_2 } |
| 318 | #define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1 |
| 319 | #define CONFIG_SYS_MAX_FLASH_SECT (255+4) |
| 320 | #define CONFIG_SYS_MAX_FLASH_BANKS 2 |
| 321 | #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 322 | #define CONFIG_SYS_FLASH_EMPTY_INFO |
| 323 | #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE |
| 324 | #define CONFIG_SYS_FLASH_PROTECTION |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 325 | #define CONFIG_SYS_MONITOR_BASE PHYS_FLASH_1 |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 326 | #endif |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 327 | |
| 328 | /* Ethernet */ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 329 | #define CONFIG_MACB |
| 330 | #define CONFIG_RMII |
| 331 | #define CONFIG_NET_MULTI |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 332 | #define CONFIG_NET_RETRY_COUNT 20 |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 333 | #define CONFIG_MACB_SEARCH_PHY |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 334 | |
| 335 | /* LEDS */ |
| 336 | /* Status LED */ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 337 | #define CONFIG_STATUS_LED |
| 338 | #define CONFIG_BOARD_SPECIFIC_LED |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 339 | #define STATUS_LED_RED 0 |
| 340 | #define STATUS_LED_GREEN 1 |
| 341 | #define STATUS_LED_YELLOW 2 |
| 342 | #define STATUS_LED_BLUE 3 |
| 343 | /* Red */ |
| 344 | #define STATUS_LED_BIT STATUS_LED_RED |
| 345 | #define STATUS_LED_STATE STATUS_LED_OFF |
| 346 | #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) |
| 347 | /* Green */ |
| 348 | #define STATUS_LED_BIT1 STATUS_LED_GREEN |
| 349 | #define STATUS_LED_STATE1 STATUS_LED_OFF |
| 350 | #define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 2) |
| 351 | /* Yellow */ |
| 352 | #define STATUS_LED_BIT2 STATUS_LED_YELLOW |
| 353 | #define STATUS_LED_STATE2 STATUS_LED_OFF |
| 354 | #define STATUS_LED_PERIOD2 (CONFIG_SYS_HZ / 2) |
| 355 | /* Blue */ |
| 356 | #define STATUS_LED_BIT3 STATUS_LED_BLUE |
| 357 | #define STATUS_LED_STATE3 STATUS_LED_ON |
| 358 | #define STATUS_LED_PERIOD3 (CONFIG_SYS_HZ / 2) |
| 359 | /* Optional value */ |
| 360 | #define STATUS_LED_BOOT STATUS_LED_BIT |
| 361 | |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 362 | #define CONFIG_RED_LED AT91_PIO_PORTC, 11 |
| 363 | #define CONFIG_GREEN_LED AT91_PIO_PORTC, 12 |
| 364 | #define CONFIG_YELLOW_LED AT91_PIO_PORTC, 7 |
| 365 | #define CONFIG_BLUE_LED AT91_PIO_PORTC, 9 |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 366 | |
| 367 | /* USB */ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 368 | #define CONFIG_USB_ATMEL |
| 369 | #define CONFIG_USB_OHCI_NEW |
| 370 | #define CONFIG_DOS_PARTITION |
| 371 | #define CONFIG_SYS_USB_OHCI_CPU_INIT |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 372 | #define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000 |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 373 | #if defined(CONFIG_CPU9G20) |
| 374 | #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9g20" |
| 375 | #elif defined(CONFIG_CPU9260) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 376 | #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9260" |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 377 | #endif |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 378 | #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2 |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 379 | #define CONFIG_USB_STORAGE |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 380 | |
| 381 | #define CONFIG_SYS_LOAD_ADDR 0x21000000 |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 382 | #define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 383 | |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 384 | #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE |
| 385 | #define CONFIG_SYS_MEMTEST_END \ |
| 386 | (CONFIG_SYS_MEMTEST_START + CONFIG_SYS_SDRAM_SIZE - 512 * 1024) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 387 | |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 388 | #if defined(CONFIG_NANDBOOT) |
| 389 | #define CONFIG_SYS_USE_NANDFLASH |
| 390 | #undef CONFIG_SYS_USE_FLASH |
| 391 | #else |
| 392 | #define CONFIG_SYS_USE_FLASH |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 393 | #undef CONFIG_SYS_USE_NANDFLASH |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 394 | #endif |
| 395 | |
| 396 | #if defined(CONFIG_CPU9G20) |
| 397 | #define CONFIG_SYS_BASEDIR "cpu9G20" |
| 398 | #elif defined(CONFIG_CPU9260) |
| 399 | #define CONFIG_SYS_BASEDIR "cpu9260" |
| 400 | #endif |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 401 | |
| 402 | #if defined(CONFIG_SYS_USE_FLASH) |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 403 | #define CONFIG_ENV_IS_IN_FLASH |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 404 | #define CONFIG_ENV_OFFSET 0x40000 |
| 405 | #define CONFIG_ENV_SECT_SIZE 0x20000 |
| 406 | #define CONFIG_ENV_SIZE 0x20000 |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 407 | #define CONFIG_ENV_OVERWRITE |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 408 | |
| 409 | #define CONFIG_BOOTCOMMAND "run flashboot" |
| 410 | |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 411 | #define MTDIDS_DEFAULT "nor0=physmap-flash.0,nand0=atmel_nand" |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 412 | #define MTDPARTS_DEFAULT \ |
| 413 | "mtdparts=physmap-flash.0:" \ |
| 414 | "256k(u-boot)ro," \ |
| 415 | "128k(u-boot-env)ro," \ |
| 416 | "1792k(kernel)," \ |
| 417 | "-(rootfs);" \ |
| 418 | "atmel_nand:-(nand)" |
| 419 | |
| 420 | #define CONFIG_BOOTARGS "root=/dev/mtdblock3 rootfstype=jffs2 " |
| 421 | |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 422 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 423 | "mtdids=" MTDIDS_DEFAULT "\0" \ |
| 424 | "mtdparts=" MTDPARTS_DEFAULT "\0" \ |
| 425 | "partition=nand0,0\0" \ |
| 426 | "ramargs=setenv bootargs $(bootargs) $(mtdparts)\0" \ |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 427 | "ramboot=tftpboot 0x22000000 $(basedir)/uImage;" \ |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 428 | "run ramargs;bootm 22000000\0" \ |
| 429 | "flashboot=run ramargs;bootm 0x10060000\0" \ |
| 430 | "basedir=" CONFIG_SYS_BASEDIR "\0" \ |
| 431 | "updtub=tftp 0x24000000 $(basedir)/u-boot.bin;protect " \ |
| 432 | "off 0x10000000 0x1003ffff;erase 0x10000000 " \ |
| 433 | "0x1003ffff;cp.b 0x24000000 0x10000000 " \ |
| 434 | "$(filesize)\0" \ |
| 435 | "updtui=tftp 0x24000000 $(basedir)/uImage;protect off" \ |
| 436 | " 0x10060000 0x1021ffff;erase 0x10060000 " \ |
| 437 | "0x1021ffff;cp.b 0x24000000 0x10060000 " \ |
| 438 | "$(filesize)\0" \ |
| 439 | "updtrfs=tftp 0x24000000 $(basedir)/rootfs.jffs2; " \ |
| 440 | "protect off 0x10220000 0x13ffffff;erase " \ |
| 441 | "0x10220000 0x13ffffff;cp.b 0x24000000 " \ |
| 442 | "0x10220000 $(filesize)\0" \ |
| 443 | "" |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 444 | #elif defined(CONFIG_NANDBOOT) |
| 445 | #define CONFIG_ENV_IS_IN_NAND |
| 446 | #define CONFIG_ENV_OFFSET 0x60000 |
| 447 | #define CONFIG_ENV_OFFSET_REDUND 0x80000 |
| 448 | #define CONFIG_ENV_SECT_SIZE 0x20000 |
| 449 | #define CONFIG_ENV_SIZE 0x20000 |
| 450 | #define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE) |
| 451 | #define CONFIG_ENV_OVERWRITE |
| 452 | |
| 453 | #define CONFIG_BOOTCOMMAND "run flashboot" |
| 454 | |
| 455 | #define MTDIDS_DEFAULT "nand0=atmel_nand" |
| 456 | #define MTDPARTS_DEFAULT \ |
| 457 | "mtdparts=atmel_nand:" \ |
| 458 | "128k(bootstrap)ro," \ |
| 459 | "256k(u-boot)ro," \ |
| 460 | "128k(u-boot-env)ro," \ |
| 461 | "128k(u-boot-env2)ro," \ |
| 462 | "2M(kernel)," \ |
| 463 | "-(rootfs)" |
| 464 | |
| 465 | #define CONFIG_BOOTARGS "root=ubi0:eukrea-cpu9260-rootfs " \ |
| 466 | "ubi.mtd=5 rootfstype=ubifs at91sam9_wdt.heartbeat=60" |
| 467 | |
| 468 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 469 | "mtdids=" MTDIDS_DEFAULT "\0" \ |
| 470 | "mtdparts=" MTDPARTS_DEFAULT "\0" \ |
| 471 | "partition=nand0,5\0" \ |
| 472 | "ramargs=setenv bootargs $(bootargs) $(mtdparts)\0" \ |
| 473 | "ramboot=tftpboot 0x22000000 $(basedir)/uImage;" \ |
| 474 | "run ramargs;bootm 22000000\0" \ |
| 475 | "flashboot=run ramargs; nand read 0x22000000 0xA0000 " \ |
| 476 | "0x200000; bootm 0x22000000\0" \ |
| 477 | "basedir=" CONFIG_SYS_BASEDIR "\0" \ |
| 478 | "u-boot=u-boot-eukrea-cpu9260.bin\0" \ |
| 479 | "kernel=uImage-eukrea-cpu9260.bin\0" \ |
| 480 | "rootfs=image-eukrea-cpu9260.ubi\0" \ |
| 481 | "updtub=tftp ${loadaddr} $(basedir)/${u-boot}; " \ |
| 482 | "nand erase 20000 40000; " \ |
| 483 | "nand write ${loadaddr} 20000 40000\0" \ |
| 484 | "updtui=tftp ${loadaddr} $(basedir)/${kernel}; " \ |
| 485 | "nand erase a0000 200000; " \ |
| 486 | "nand write ${loadaddr} a0000 200000\0" \ |
| 487 | "updtrfs=tftp ${loadaddr} $(basedir)/${rootfs}; " \ |
| 488 | "nand erase 2a0000 fd60000; " \ |
| 489 | "nand write ${loadaddr} 2a0000 ${filesize}\0" |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 490 | #endif |
| 491 | |
| 492 | #define CONFIG_BAUDRATE 115200 |
| 493 | #define CONFIG_SYS_BAUDRATE_TABLE {115200 , 19200, 38400, 57600, 9600 } |
| 494 | |
| 495 | #if defined(CONFIG_CPU9G20) |
| 496 | #define CONFIG_SYS_PROMPT "CPU9G20=> " |
| 497 | #elif defined(CONFIG_CPU9260) |
| 498 | #define CONFIG_SYS_PROMPT "CPU9260=> " |
| 499 | #endif |
| 500 | #define CONFIG_SYS_CBSIZE 256 |
| 501 | #define CONFIG_SYS_MAXARGS 16 |
| 502 | #define CONFIG_SYS_PBSIZE \ |
| 503 | (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 504 | #define CONFIG_SYS_LONGHELP |
| 505 | #define CONFIG_CMDLINE_EDITING |
| 506 | #define CONFIG_SILENT_CONSOLE |
| 507 | #define CONFIG_NETCONSOLE |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 508 | |
| 509 | /* |
| 510 | * Size of malloc() pool |
| 511 | */ |
| 512 | #define CONFIG_SYS_MALLOC_LEN \ |
| 513 | ROUND(3 * CONFIG_ENV_SIZE + 128 * 1024, 0x1000) |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 514 | |
Eric Benard | c2b2a07 | 2011-04-03 06:35:54 +0000 | [diff] [blame] | 515 | #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - \ |
| 516 | GENERATED_GBL_DATA_SIZE) |
| 517 | |
Tom Rix | 23b8098 | 2009-09-27 11:10:09 -0500 | [diff] [blame] | 518 | #define CONFIG_STACKSIZE (32 * 1024) |
| 519 | |
| 520 | #if defined(CONFIG_USE_IRQ) |
| 521 | #error CONFIG_USE_IRQ not supported |
| 522 | #endif |
| 523 | |
| 524 | #endif |