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