SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 1 | /* |
Andrew Victor | 8fc5ffa | 2006-06-29 16:06:33 +0100 | [diff] [blame] | 2 | * arch/arm/mach-at91rm9200/at91rm9200.c |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2005 SAN People |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | */ |
| 12 | |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 13 | #include <linux/module.h> |
| 14 | |
| 15 | #include <asm/mach/arch.h> |
| 16 | #include <asm/mach/map.h> |
| 17 | |
Russell King | ea75ee9 | 2006-06-20 19:53:16 +0100 | [diff] [blame] | 18 | #include <asm/hardware.h> |
Andrew Victor | 10e8e1f | 2006-06-19 15:26:51 +0100 | [diff] [blame] | 19 | #include "generic.h" |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 20 | |
| 21 | static struct map_desc at91rm9200_io_desc[] __initdata = { |
| 22 | { |
| 23 | .virtual = AT91_VA_BASE_SYS, |
| 24 | .pfn = __phys_to_pfn(AT91_BASE_SYS), |
| 25 | .length = SZ_4K, |
| 26 | .type = MT_DEVICE, |
| 27 | }, { |
| 28 | .virtual = AT91_VA_BASE_SPI, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 29 | .pfn = __phys_to_pfn(AT91RM9200_BASE_SPI), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 30 | .length = SZ_16K, |
| 31 | .type = MT_DEVICE, |
| 32 | }, { |
| 33 | .virtual = AT91_VA_BASE_SSC2, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 34 | .pfn = __phys_to_pfn(AT91RM9200_BASE_SSC2), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 35 | .length = SZ_16K, |
| 36 | .type = MT_DEVICE, |
| 37 | }, { |
| 38 | .virtual = AT91_VA_BASE_SSC1, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 39 | .pfn = __phys_to_pfn(AT91RM9200_BASE_SSC1), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 40 | .length = SZ_16K, |
| 41 | .type = MT_DEVICE, |
| 42 | }, { |
| 43 | .virtual = AT91_VA_BASE_SSC0, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 44 | .pfn = __phys_to_pfn(AT91RM9200_BASE_SSC0), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 45 | .length = SZ_16K, |
| 46 | .type = MT_DEVICE, |
| 47 | }, { |
| 48 | .virtual = AT91_VA_BASE_US3, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 49 | .pfn = __phys_to_pfn(AT91RM9200_BASE_US3), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 50 | .length = SZ_16K, |
| 51 | .type = MT_DEVICE, |
| 52 | }, { |
| 53 | .virtual = AT91_VA_BASE_US2, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 54 | .pfn = __phys_to_pfn(AT91RM9200_BASE_US2), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 55 | .length = SZ_16K, |
| 56 | .type = MT_DEVICE, |
| 57 | }, { |
| 58 | .virtual = AT91_VA_BASE_US1, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 59 | .pfn = __phys_to_pfn(AT91RM9200_BASE_US1), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 60 | .length = SZ_16K, |
| 61 | .type = MT_DEVICE, |
| 62 | }, { |
| 63 | .virtual = AT91_VA_BASE_US0, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 64 | .pfn = __phys_to_pfn(AT91RM9200_BASE_US0), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 65 | .length = SZ_16K, |
| 66 | .type = MT_DEVICE, |
| 67 | }, { |
| 68 | .virtual = AT91_VA_BASE_EMAC, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 69 | .pfn = __phys_to_pfn(AT91RM9200_BASE_EMAC), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 70 | .length = SZ_16K, |
| 71 | .type = MT_DEVICE, |
| 72 | }, { |
| 73 | .virtual = AT91_VA_BASE_TWI, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 74 | .pfn = __phys_to_pfn(AT91RM9200_BASE_TWI), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 75 | .length = SZ_16K, |
| 76 | .type = MT_DEVICE, |
| 77 | }, { |
| 78 | .virtual = AT91_VA_BASE_MCI, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 79 | .pfn = __phys_to_pfn(AT91RM9200_BASE_MCI), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 80 | .length = SZ_16K, |
| 81 | .type = MT_DEVICE, |
| 82 | }, { |
| 83 | .virtual = AT91_VA_BASE_UDP, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 84 | .pfn = __phys_to_pfn(AT91RM9200_BASE_UDP), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 85 | .length = SZ_16K, |
| 86 | .type = MT_DEVICE, |
| 87 | }, { |
| 88 | .virtual = AT91_VA_BASE_TCB1, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 89 | .pfn = __phys_to_pfn(AT91RM9200_BASE_TCB1), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 90 | .length = SZ_16K, |
| 91 | .type = MT_DEVICE, |
| 92 | }, { |
| 93 | .virtual = AT91_VA_BASE_TCB0, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 94 | .pfn = __phys_to_pfn(AT91RM9200_BASE_TCB0), |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 95 | .length = SZ_16K, |
| 96 | .type = MT_DEVICE, |
Andrew Victor | 10e8e1f | 2006-06-19 15:26:51 +0100 | [diff] [blame] | 97 | }, { |
| 98 | .virtual = AT91_SRAM_VIRT_BASE, |
Andrew Victor | 7272991 | 2006-09-27 09:44:11 +0100 | [diff] [blame^] | 99 | .pfn = __phys_to_pfn(AT91RM9200_SRAM_BASE), |
| 100 | .length = AT91RM9200_SRAM_SIZE, |
Andrew Victor | 10e8e1f | 2006-06-19 15:26:51 +0100 | [diff] [blame] | 101 | .type = MT_DEVICE, |
SAN People | 73a59c1 | 2006-01-09 17:05:41 +0000 | [diff] [blame] | 102 | }, |
| 103 | }; |
| 104 | |
| 105 | void __init at91rm9200_map_io(void) |
| 106 | { |
| 107 | iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc)); |
| 108 | } |
| 109 | |
Andrew Victor | ba854e1 | 2006-07-05 17:22:52 +0100 | [diff] [blame] | 110 | /* |
| 111 | * The default interrupt priority levels (0 = lowest, 7 = highest). |
| 112 | */ |
| 113 | static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = { |
| 114 | 7, /* Advanced Interrupt Controller (FIQ) */ |
| 115 | 7, /* System Peripherals */ |
| 116 | 0, /* Parallel IO Controller A */ |
| 117 | 0, /* Parallel IO Controller B */ |
| 118 | 0, /* Parallel IO Controller C */ |
| 119 | 0, /* Parallel IO Controller D */ |
| 120 | 6, /* USART 0 */ |
| 121 | 6, /* USART 1 */ |
| 122 | 6, /* USART 2 */ |
| 123 | 6, /* USART 3 */ |
| 124 | 0, /* Multimedia Card Interface */ |
| 125 | 4, /* USB Device Port */ |
| 126 | 0, /* Two-Wire Interface */ |
| 127 | 6, /* Serial Peripheral Interface */ |
| 128 | 5, /* Serial Synchronous Controller 0 */ |
| 129 | 5, /* Serial Synchronous Controller 1 */ |
| 130 | 5, /* Serial Synchronous Controller 2 */ |
| 131 | 0, /* Timer Counter 0 */ |
| 132 | 0, /* Timer Counter 1 */ |
| 133 | 0, /* Timer Counter 2 */ |
| 134 | 0, /* Timer Counter 3 */ |
| 135 | 0, /* Timer Counter 4 */ |
| 136 | 0, /* Timer Counter 5 */ |
| 137 | 3, /* USB Host port */ |
| 138 | 3, /* Ethernet MAC */ |
| 139 | 0, /* Advanced Interrupt Controller (IRQ0) */ |
| 140 | 0, /* Advanced Interrupt Controller (IRQ1) */ |
| 141 | 0, /* Advanced Interrupt Controller (IRQ2) */ |
| 142 | 0, /* Advanced Interrupt Controller (IRQ3) */ |
| 143 | 0, /* Advanced Interrupt Controller (IRQ4) */ |
| 144 | 0, /* Advanced Interrupt Controller (IRQ5) */ |
| 145 | 0 /* Advanced Interrupt Controller (IRQ6) */ |
| 146 | }; |
| 147 | |
| 148 | void __init at91rm9200_init_irq(unsigned int priority[NR_AIC_IRQS]) |
| 149 | { |
| 150 | if (!priority) |
| 151 | priority = at91rm9200_default_irq_priority; |
| 152 | |
| 153 | at91_aic_init(priority); |
| 154 | } |