Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/mach-at91/at91cap9.c |
| 3 | * |
| 4 | * Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com> |
| 5 | * Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com> |
| 6 | * Copyright (C) 2007 Atmel Corporation. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | #include <linux/module.h> |
| 16 | |
Nicolas Pitre | c9dfafb | 2011-08-02 10:21:36 -0400 | [diff] [blame^] | 17 | #include <asm/proc-fns.h> |
Russell King | 80b02c1 | 2009-01-08 10:01:47 +0000 | [diff] [blame] | 18 | #include <asm/irq.h> |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 19 | #include <asm/mach/arch.h> |
| 20 | #include <asm/mach/map.h> |
Stelian Pop | 7be90a6 | 2008-10-22 13:52:08 +0100 | [diff] [blame] | 21 | |
| 22 | #include <mach/cpu.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 23 | #include <mach/at91cap9.h> |
| 24 | #include <mach/at91_pmc.h> |
| 25 | #include <mach/at91_rstc.h> |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 26 | |
Jean-Christophe PLAGNIOL-VILLARD | 21d08b9 | 2011-04-23 15:28:34 +0800 | [diff] [blame] | 27 | #include "soc.h" |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 28 | #include "generic.h" |
| 29 | #include "clock.h" |
Jean-Christophe PLAGNIOL-VILLARD | faee0cc | 2011-10-14 01:37:09 +0800 | [diff] [blame] | 30 | #include "sam9_smc.h" |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 31 | |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 32 | /* -------------------------------------------------------------------- |
| 33 | * Clocks |
| 34 | * -------------------------------------------------------------------- */ |
| 35 | |
| 36 | /* |
| 37 | * The peripheral clocks. |
| 38 | */ |
| 39 | static struct clk pioABCD_clk = { |
| 40 | .name = "pioABCD_clk", |
| 41 | .pmc_mask = 1 << AT91CAP9_ID_PIOABCD, |
| 42 | .type = CLK_TYPE_PERIPHERAL, |
| 43 | }; |
| 44 | static struct clk mpb0_clk = { |
| 45 | .name = "mpb0_clk", |
| 46 | .pmc_mask = 1 << AT91CAP9_ID_MPB0, |
| 47 | .type = CLK_TYPE_PERIPHERAL, |
| 48 | }; |
| 49 | static struct clk mpb1_clk = { |
| 50 | .name = "mpb1_clk", |
| 51 | .pmc_mask = 1 << AT91CAP9_ID_MPB1, |
| 52 | .type = CLK_TYPE_PERIPHERAL, |
| 53 | }; |
| 54 | static struct clk mpb2_clk = { |
| 55 | .name = "mpb2_clk", |
| 56 | .pmc_mask = 1 << AT91CAP9_ID_MPB2, |
| 57 | .type = CLK_TYPE_PERIPHERAL, |
| 58 | }; |
| 59 | static struct clk mpb3_clk = { |
| 60 | .name = "mpb3_clk", |
| 61 | .pmc_mask = 1 << AT91CAP9_ID_MPB3, |
| 62 | .type = CLK_TYPE_PERIPHERAL, |
| 63 | }; |
| 64 | static struct clk mpb4_clk = { |
| 65 | .name = "mpb4_clk", |
| 66 | .pmc_mask = 1 << AT91CAP9_ID_MPB4, |
| 67 | .type = CLK_TYPE_PERIPHERAL, |
| 68 | }; |
| 69 | static struct clk usart0_clk = { |
| 70 | .name = "usart0_clk", |
| 71 | .pmc_mask = 1 << AT91CAP9_ID_US0, |
| 72 | .type = CLK_TYPE_PERIPHERAL, |
| 73 | }; |
| 74 | static struct clk usart1_clk = { |
| 75 | .name = "usart1_clk", |
| 76 | .pmc_mask = 1 << AT91CAP9_ID_US1, |
| 77 | .type = CLK_TYPE_PERIPHERAL, |
| 78 | }; |
| 79 | static struct clk usart2_clk = { |
| 80 | .name = "usart2_clk", |
| 81 | .pmc_mask = 1 << AT91CAP9_ID_US2, |
| 82 | .type = CLK_TYPE_PERIPHERAL, |
| 83 | }; |
| 84 | static struct clk mmc0_clk = { |
| 85 | .name = "mci0_clk", |
| 86 | .pmc_mask = 1 << AT91CAP9_ID_MCI0, |
| 87 | .type = CLK_TYPE_PERIPHERAL, |
| 88 | }; |
| 89 | static struct clk mmc1_clk = { |
| 90 | .name = "mci1_clk", |
| 91 | .pmc_mask = 1 << AT91CAP9_ID_MCI1, |
| 92 | .type = CLK_TYPE_PERIPHERAL, |
| 93 | }; |
| 94 | static struct clk can_clk = { |
| 95 | .name = "can_clk", |
| 96 | .pmc_mask = 1 << AT91CAP9_ID_CAN, |
| 97 | .type = CLK_TYPE_PERIPHERAL, |
| 98 | }; |
| 99 | static struct clk twi_clk = { |
| 100 | .name = "twi_clk", |
| 101 | .pmc_mask = 1 << AT91CAP9_ID_TWI, |
| 102 | .type = CLK_TYPE_PERIPHERAL, |
| 103 | }; |
| 104 | static struct clk spi0_clk = { |
| 105 | .name = "spi0_clk", |
| 106 | .pmc_mask = 1 << AT91CAP9_ID_SPI0, |
| 107 | .type = CLK_TYPE_PERIPHERAL, |
| 108 | }; |
| 109 | static struct clk spi1_clk = { |
| 110 | .name = "spi1_clk", |
| 111 | .pmc_mask = 1 << AT91CAP9_ID_SPI1, |
| 112 | .type = CLK_TYPE_PERIPHERAL, |
| 113 | }; |
| 114 | static struct clk ssc0_clk = { |
| 115 | .name = "ssc0_clk", |
| 116 | .pmc_mask = 1 << AT91CAP9_ID_SSC0, |
| 117 | .type = CLK_TYPE_PERIPHERAL, |
| 118 | }; |
| 119 | static struct clk ssc1_clk = { |
| 120 | .name = "ssc1_clk", |
| 121 | .pmc_mask = 1 << AT91CAP9_ID_SSC1, |
| 122 | .type = CLK_TYPE_PERIPHERAL, |
| 123 | }; |
| 124 | static struct clk ac97_clk = { |
| 125 | .name = "ac97_clk", |
| 126 | .pmc_mask = 1 << AT91CAP9_ID_AC97C, |
| 127 | .type = CLK_TYPE_PERIPHERAL, |
| 128 | }; |
| 129 | static struct clk tcb_clk = { |
| 130 | .name = "tcb_clk", |
| 131 | .pmc_mask = 1 << AT91CAP9_ID_TCB, |
| 132 | .type = CLK_TYPE_PERIPHERAL, |
| 133 | }; |
Andrew Victor | bb1ad68 | 2008-09-18 19:42:37 +0100 | [diff] [blame] | 134 | static struct clk pwm_clk = { |
| 135 | .name = "pwm_clk", |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 136 | .pmc_mask = 1 << AT91CAP9_ID_PWMC, |
| 137 | .type = CLK_TYPE_PERIPHERAL, |
| 138 | }; |
| 139 | static struct clk macb_clk = { |
Jamie Iles | 865d605 | 2011-08-09 16:51:11 +0200 | [diff] [blame] | 140 | .name = "pclk", |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 141 | .pmc_mask = 1 << AT91CAP9_ID_EMAC, |
| 142 | .type = CLK_TYPE_PERIPHERAL, |
| 143 | }; |
| 144 | static struct clk aestdes_clk = { |
| 145 | .name = "aestdes_clk", |
| 146 | .pmc_mask = 1 << AT91CAP9_ID_AESTDES, |
| 147 | .type = CLK_TYPE_PERIPHERAL, |
| 148 | }; |
| 149 | static struct clk adc_clk = { |
| 150 | .name = "adc_clk", |
| 151 | .pmc_mask = 1 << AT91CAP9_ID_ADC, |
| 152 | .type = CLK_TYPE_PERIPHERAL, |
| 153 | }; |
| 154 | static struct clk isi_clk = { |
| 155 | .name = "isi_clk", |
| 156 | .pmc_mask = 1 << AT91CAP9_ID_ISI, |
| 157 | .type = CLK_TYPE_PERIPHERAL, |
| 158 | }; |
| 159 | static struct clk lcdc_clk = { |
| 160 | .name = "lcdc_clk", |
| 161 | .pmc_mask = 1 << AT91CAP9_ID_LCDC, |
| 162 | .type = CLK_TYPE_PERIPHERAL, |
| 163 | }; |
| 164 | static struct clk dma_clk = { |
| 165 | .name = "dma_clk", |
| 166 | .pmc_mask = 1 << AT91CAP9_ID_DMA, |
| 167 | .type = CLK_TYPE_PERIPHERAL, |
| 168 | }; |
| 169 | static struct clk udphs_clk = { |
| 170 | .name = "udphs_clk", |
| 171 | .pmc_mask = 1 << AT91CAP9_ID_UDPHS, |
| 172 | .type = CLK_TYPE_PERIPHERAL, |
| 173 | }; |
| 174 | static struct clk ohci_clk = { |
| 175 | .name = "ohci_clk", |
| 176 | .pmc_mask = 1 << AT91CAP9_ID_UHP, |
| 177 | .type = CLK_TYPE_PERIPHERAL, |
| 178 | }; |
| 179 | |
| 180 | static struct clk *periph_clocks[] __initdata = { |
| 181 | &pioABCD_clk, |
| 182 | &mpb0_clk, |
| 183 | &mpb1_clk, |
| 184 | &mpb2_clk, |
| 185 | &mpb3_clk, |
| 186 | &mpb4_clk, |
| 187 | &usart0_clk, |
| 188 | &usart1_clk, |
| 189 | &usart2_clk, |
| 190 | &mmc0_clk, |
| 191 | &mmc1_clk, |
| 192 | &can_clk, |
| 193 | &twi_clk, |
| 194 | &spi0_clk, |
| 195 | &spi1_clk, |
| 196 | &ssc0_clk, |
| 197 | &ssc1_clk, |
| 198 | &ac97_clk, |
| 199 | &tcb_clk, |
Andrew Victor | bb1ad68 | 2008-09-18 19:42:37 +0100 | [diff] [blame] | 200 | &pwm_clk, |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 201 | &macb_clk, |
| 202 | &aestdes_clk, |
| 203 | &adc_clk, |
| 204 | &isi_clk, |
| 205 | &lcdc_clk, |
| 206 | &dma_clk, |
| 207 | &udphs_clk, |
| 208 | &ohci_clk, |
| 209 | // irq0 .. irq1 |
| 210 | }; |
| 211 | |
Jean-Christophe PLAGNIOL-VILLARD | bd60299 | 2011-02-02 07:27:07 +0100 | [diff] [blame] | 212 | static struct clk_lookup periph_clocks_lookups[] = { |
Jamie Iles | 865d605 | 2011-08-09 16:51:11 +0200 | [diff] [blame] | 213 | /* One additional fake clock for macb_hclk */ |
| 214 | CLKDEV_CON_ID("hclk", &macb_clk), |
Jean-Christophe PLAGNIOL-VILLARD | 9d87159 | 2011-06-21 14:24:33 +0800 | [diff] [blame] | 215 | CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk), |
| 216 | CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk), |
Jean-Christophe PLAGNIOL-VILLARD | bd60299 | 2011-02-02 07:27:07 +0100 | [diff] [blame] | 217 | CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), |
| 218 | CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk), |
| 219 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), |
| 220 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), |
| 221 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), |
Joachim Eastwood | c5efefa | 2011-06-02 01:36:09 +0200 | [diff] [blame] | 222 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), |
| 223 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
Jean-Christophe PLAGNIOL-VILLARD | 0af4316 | 2011-08-30 03:29:28 +0200 | [diff] [blame] | 224 | /* fake hclk clock */ |
| 225 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), |
Jean-Christophe PLAGNIOL-VILLARD | 619d4a4 | 2011-11-13 13:00:58 +0800 | [diff] [blame] | 226 | CLKDEV_CON_ID("pioA", &pioABCD_clk), |
| 227 | CLKDEV_CON_ID("pioB", &pioABCD_clk), |
| 228 | CLKDEV_CON_ID("pioC", &pioABCD_clk), |
| 229 | CLKDEV_CON_ID("pioD", &pioABCD_clk), |
Jean-Christophe PLAGNIOL-VILLARD | bd60299 | 2011-02-02 07:27:07 +0100 | [diff] [blame] | 230 | }; |
| 231 | |
| 232 | static struct clk_lookup usart_clocks_lookups[] = { |
| 233 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck), |
| 234 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk), |
| 235 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk), |
| 236 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk), |
| 237 | }; |
| 238 | |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 239 | /* |
| 240 | * The four programmable clocks. |
| 241 | * You must configure pin multiplexing to bring these signals out. |
| 242 | */ |
| 243 | static struct clk pck0 = { |
| 244 | .name = "pck0", |
| 245 | .pmc_mask = AT91_PMC_PCK0, |
| 246 | .type = CLK_TYPE_PROGRAMMABLE, |
| 247 | .id = 0, |
| 248 | }; |
| 249 | static struct clk pck1 = { |
| 250 | .name = "pck1", |
| 251 | .pmc_mask = AT91_PMC_PCK1, |
| 252 | .type = CLK_TYPE_PROGRAMMABLE, |
| 253 | .id = 1, |
| 254 | }; |
| 255 | static struct clk pck2 = { |
| 256 | .name = "pck2", |
| 257 | .pmc_mask = AT91_PMC_PCK2, |
| 258 | .type = CLK_TYPE_PROGRAMMABLE, |
| 259 | .id = 2, |
| 260 | }; |
| 261 | static struct clk pck3 = { |
| 262 | .name = "pck3", |
| 263 | .pmc_mask = AT91_PMC_PCK3, |
| 264 | .type = CLK_TYPE_PROGRAMMABLE, |
| 265 | .id = 3, |
| 266 | }; |
| 267 | |
| 268 | static void __init at91cap9_register_clocks(void) |
| 269 | { |
| 270 | int i; |
| 271 | |
| 272 | for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) |
| 273 | clk_register(periph_clocks[i]); |
| 274 | |
Jean-Christophe PLAGNIOL-VILLARD | bd60299 | 2011-02-02 07:27:07 +0100 | [diff] [blame] | 275 | clkdev_add_table(periph_clocks_lookups, |
| 276 | ARRAY_SIZE(periph_clocks_lookups)); |
| 277 | clkdev_add_table(usart_clocks_lookups, |
| 278 | ARRAY_SIZE(usart_clocks_lookups)); |
| 279 | |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 280 | clk_register(&pck0); |
| 281 | clk_register(&pck1); |
| 282 | clk_register(&pck2); |
| 283 | clk_register(&pck3); |
| 284 | } |
| 285 | |
Jean-Christophe PLAGNIOL-VILLARD | bd60299 | 2011-02-02 07:27:07 +0100 | [diff] [blame] | 286 | static struct clk_lookup console_clock_lookup; |
| 287 | |
| 288 | void __init at91cap9_set_console_clock(int id) |
| 289 | { |
| 290 | if (id >= ARRAY_SIZE(usart_clocks_lookups)) |
| 291 | return; |
| 292 | |
| 293 | console_clock_lookup.con_id = "usart"; |
| 294 | console_clock_lookup.clk = usart_clocks_lookups[id].clk; |
| 295 | clkdev_add(&console_clock_lookup); |
| 296 | } |
| 297 | |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 298 | /* -------------------------------------------------------------------- |
| 299 | * GPIO |
| 300 | * -------------------------------------------------------------------- */ |
| 301 | |
Jean-Christophe PLAGNIOL-VILLARD | 1a2d915 | 2011-10-17 14:28:38 +0800 | [diff] [blame] | 302 | static struct at91_gpio_bank at91cap9_gpio[] __initdata = { |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 303 | { |
| 304 | .id = AT91CAP9_ID_PIOABCD, |
Jean-Christophe PLAGNIOL-VILLARD | 80e91cb | 2011-09-16 23:37:50 +0800 | [diff] [blame] | 305 | .regbase = AT91CAP9_BASE_PIOA, |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 306 | }, { |
| 307 | .id = AT91CAP9_ID_PIOABCD, |
Jean-Christophe PLAGNIOL-VILLARD | 80e91cb | 2011-09-16 23:37:50 +0800 | [diff] [blame] | 308 | .regbase = AT91CAP9_BASE_PIOB, |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 309 | }, { |
| 310 | .id = AT91CAP9_ID_PIOABCD, |
Jean-Christophe PLAGNIOL-VILLARD | 80e91cb | 2011-09-16 23:37:50 +0800 | [diff] [blame] | 311 | .regbase = AT91CAP9_BASE_PIOC, |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 312 | }, { |
| 313 | .id = AT91CAP9_ID_PIOABCD, |
Jean-Christophe PLAGNIOL-VILLARD | 80e91cb | 2011-09-16 23:37:50 +0800 | [diff] [blame] | 314 | .regbase = AT91CAP9_BASE_PIOD, |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 315 | } |
| 316 | }; |
| 317 | |
Nicolas Pitre | c9dfafb | 2011-08-02 10:21:36 -0400 | [diff] [blame^] | 318 | static void at91cap9_idle(void) |
| 319 | { |
| 320 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); |
| 321 | cpu_do_idle(); |
| 322 | } |
| 323 | |
Russell King | 1b2073e | 2011-11-03 09:53:29 +0000 | [diff] [blame] | 324 | static void at91cap9_restart(char mode, const char *cmd) |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 325 | { |
| 326 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); |
| 327 | } |
| 328 | |
| 329 | /* -------------------------------------------------------------------- |
| 330 | * AT91CAP9 processor initialization |
| 331 | * -------------------------------------------------------------------- */ |
| 332 | |
Jean-Christophe PLAGNIOL-VILLARD | 21d08b9 | 2011-04-23 15:28:34 +0800 | [diff] [blame] | 333 | static void __init at91cap9_map_io(void) |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 334 | { |
Jean-Christophe PLAGNIOL-VILLARD | f0051d8 | 2011-05-10 03:20:09 +0800 | [diff] [blame] | 335 | at91_init_sram(0, AT91CAP9_SRAM_BASE, AT91CAP9_SRAM_SIZE); |
Jean-Christophe PLAGNIOL-VILLARD | 1b021a3 | 2011-04-28 20:19:32 +0800 | [diff] [blame] | 336 | } |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 337 | |
Jean-Christophe PLAGNIOL-VILLARD | cfa5a1f | 2011-10-14 01:17:18 +0800 | [diff] [blame] | 338 | static void __init at91cap9_ioremap_registers(void) |
| 339 | { |
Jean-Christophe PLAGNIOL-VILLARD | f22deee | 2011-11-01 01:23:20 +0800 | [diff] [blame] | 340 | at91_ioremap_shdwc(AT91CAP9_BASE_SHDWC); |
Jean-Christophe PLAGNIOL-VILLARD | 4ab0c599 | 2011-09-18 22:29:50 +0800 | [diff] [blame] | 341 | at91sam926x_ioremap_pit(AT91CAP9_BASE_PIT); |
Jean-Christophe PLAGNIOL-VILLARD | faee0cc | 2011-10-14 01:37:09 +0800 | [diff] [blame] | 342 | at91sam9_ioremap_smc(0, AT91CAP9_BASE_SMC); |
Jean-Christophe PLAGNIOL-VILLARD | cfa5a1f | 2011-10-14 01:17:18 +0800 | [diff] [blame] | 343 | } |
| 344 | |
Jean-Christophe PLAGNIOL-VILLARD | 4653937 | 2011-04-24 18:20:28 +0800 | [diff] [blame] | 345 | static void __init at91cap9_initialize(void) |
| 346 | { |
Nicolas Pitre | c9dfafb | 2011-08-02 10:21:36 -0400 | [diff] [blame^] | 347 | arm_pm_idle = at91cap9_idle; |
Russell King | 1b2073e | 2011-11-03 09:53:29 +0000 | [diff] [blame] | 348 | arm_pm_restart = at91cap9_restart; |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 349 | at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); |
| 350 | |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 351 | /* Register GPIO subsystem */ |
| 352 | at91_gpio_init(at91cap9_gpio, 4); |
Stelian Pop | 7be90a6 | 2008-10-22 13:52:08 +0100 | [diff] [blame] | 353 | |
| 354 | /* Remember the silicon revision */ |
| 355 | if (cpu_is_at91cap9_revB()) |
| 356 | system_rev = 0xB; |
| 357 | else if (cpu_is_at91cap9_revC()) |
| 358 | system_rev = 0xC; |
Andrew Victor | 2b3b351 | 2008-01-24 15:10:39 +0100 | [diff] [blame] | 359 | } |
| 360 | |
| 361 | /* -------------------------------------------------------------------- |
| 362 | * Interrupt initialization |
| 363 | * -------------------------------------------------------------------- */ |
| 364 | |
| 365 | /* |
| 366 | * The default interrupt priority levels (0 = lowest, 7 = highest). |
| 367 | */ |
| 368 | static unsigned int at91cap9_default_irq_priority[NR_AIC_IRQS] __initdata = { |
| 369 | 7, /* Advanced Interrupt Controller (FIQ) */ |
| 370 | 7, /* System Peripherals */ |
| 371 | 1, /* Parallel IO Controller A, B, C and D */ |
| 372 | 0, /* MP Block Peripheral 0 */ |
| 373 | 0, /* MP Block Peripheral 1 */ |
| 374 | 0, /* MP Block Peripheral 2 */ |
| 375 | 0, /* MP Block Peripheral 3 */ |
| 376 | 0, /* MP Block Peripheral 4 */ |
| 377 | 5, /* USART 0 */ |
| 378 | 5, /* USART 1 */ |
| 379 | 5, /* USART 2 */ |
| 380 | 0, /* Multimedia Card Interface 0 */ |
| 381 | 0, /* Multimedia Card Interface 1 */ |
| 382 | 3, /* CAN */ |
| 383 | 6, /* Two-Wire Interface */ |
| 384 | 5, /* Serial Peripheral Interface 0 */ |
| 385 | 5, /* Serial Peripheral Interface 1 */ |
| 386 | 4, /* Serial Synchronous Controller 0 */ |
| 387 | 4, /* Serial Synchronous Controller 1 */ |
| 388 | 5, /* AC97 Controller */ |
| 389 | 0, /* Timer Counter 0, 1 and 2 */ |
| 390 | 0, /* Pulse Width Modulation Controller */ |
| 391 | 3, /* Ethernet */ |
| 392 | 0, /* Advanced Encryption Standard, Triple DES*/ |
| 393 | 0, /* Analog-to-Digital Converter */ |
| 394 | 0, /* Image Sensor Interface */ |
| 395 | 3, /* LCD Controller */ |
| 396 | 0, /* DMA Controller */ |
| 397 | 2, /* USB Device Port */ |
| 398 | 2, /* USB Host port */ |
| 399 | 0, /* Advanced Interrupt Controller (IRQ0) */ |
| 400 | 0, /* Advanced Interrupt Controller (IRQ1) */ |
| 401 | }; |
| 402 | |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 403 | struct at91_init_soc __initdata at91cap9_soc = { |
Jean-Christophe PLAGNIOL-VILLARD | 21d08b9 | 2011-04-23 15:28:34 +0800 | [diff] [blame] | 404 | .map_io = at91cap9_map_io, |
Jean-Christophe PLAGNIOL-VILLARD | 92100c1 | 2011-04-23 15:28:34 +0800 | [diff] [blame] | 405 | .default_irq_priority = at91cap9_default_irq_priority, |
Jean-Christophe PLAGNIOL-VILLARD | cfa5a1f | 2011-10-14 01:17:18 +0800 | [diff] [blame] | 406 | .ioremap_registers = at91cap9_ioremap_registers, |
Jean-Christophe PLAGNIOL-VILLARD | 51ddec7 | 2011-04-24 18:15:34 +0800 | [diff] [blame] | 407 | .register_clocks = at91cap9_register_clocks, |
Jean-Christophe PLAGNIOL-VILLARD | 21d08b9 | 2011-04-23 15:28:34 +0800 | [diff] [blame] | 408 | .init = at91cap9_initialize, |
| 409 | }; |