at91rm9200.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. * arch/arm/mach-at91rm9200/at91rm9200.c
  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. #include <linux/module.h>
  13. #include <asm/mach/arch.h>
  14. #include <asm/mach/map.h>
  15. #include <asm/hardware.h>
  16. #include "generic.h"
  17. static struct map_desc at91rm9200_io_desc[] __initdata = {
  18. {
  19. .virtual = AT91_VA_BASE_SYS,
  20. .pfn = __phys_to_pfn(AT91_BASE_SYS),
  21. .length = SZ_4K,
  22. .type = MT_DEVICE,
  23. }, {
  24. .virtual = AT91_VA_BASE_SPI,
  25. .pfn = __phys_to_pfn(AT91_BASE_SPI),
  26. .length = SZ_16K,
  27. .type = MT_DEVICE,
  28. }, {
  29. .virtual = AT91_VA_BASE_SSC2,
  30. .pfn = __phys_to_pfn(AT91_BASE_SSC2),
  31. .length = SZ_16K,
  32. .type = MT_DEVICE,
  33. }, {
  34. .virtual = AT91_VA_BASE_SSC1,
  35. .pfn = __phys_to_pfn(AT91_BASE_SSC1),
  36. .length = SZ_16K,
  37. .type = MT_DEVICE,
  38. }, {
  39. .virtual = AT91_VA_BASE_SSC0,
  40. .pfn = __phys_to_pfn(AT91_BASE_SSC0),
  41. .length = SZ_16K,
  42. .type = MT_DEVICE,
  43. }, {
  44. .virtual = AT91_VA_BASE_US3,
  45. .pfn = __phys_to_pfn(AT91_BASE_US3),
  46. .length = SZ_16K,
  47. .type = MT_DEVICE,
  48. }, {
  49. .virtual = AT91_VA_BASE_US2,
  50. .pfn = __phys_to_pfn(AT91_BASE_US2),
  51. .length = SZ_16K,
  52. .type = MT_DEVICE,
  53. }, {
  54. .virtual = AT91_VA_BASE_US1,
  55. .pfn = __phys_to_pfn(AT91_BASE_US1),
  56. .length = SZ_16K,
  57. .type = MT_DEVICE,
  58. }, {
  59. .virtual = AT91_VA_BASE_US0,
  60. .pfn = __phys_to_pfn(AT91_BASE_US0),
  61. .length = SZ_16K,
  62. .type = MT_DEVICE,
  63. }, {
  64. .virtual = AT91_VA_BASE_EMAC,
  65. .pfn = __phys_to_pfn(AT91_BASE_EMAC),
  66. .length = SZ_16K,
  67. .type = MT_DEVICE,
  68. }, {
  69. .virtual = AT91_VA_BASE_TWI,
  70. .pfn = __phys_to_pfn(AT91_BASE_TWI),
  71. .length = SZ_16K,
  72. .type = MT_DEVICE,
  73. }, {
  74. .virtual = AT91_VA_BASE_MCI,
  75. .pfn = __phys_to_pfn(AT91_BASE_MCI),
  76. .length = SZ_16K,
  77. .type = MT_DEVICE,
  78. }, {
  79. .virtual = AT91_VA_BASE_UDP,
  80. .pfn = __phys_to_pfn(AT91_BASE_UDP),
  81. .length = SZ_16K,
  82. .type = MT_DEVICE,
  83. }, {
  84. .virtual = AT91_VA_BASE_TCB1,
  85. .pfn = __phys_to_pfn(AT91_BASE_TCB1),
  86. .length = SZ_16K,
  87. .type = MT_DEVICE,
  88. }, {
  89. .virtual = AT91_VA_BASE_TCB0,
  90. .pfn = __phys_to_pfn(AT91_BASE_TCB0),
  91. .length = SZ_16K,
  92. .type = MT_DEVICE,
  93. }, {
  94. .virtual = AT91_SRAM_VIRT_BASE,
  95. .pfn = __phys_to_pfn(AT91_SRAM_BASE),
  96. .length = AT91_SRAM_SIZE,
  97. .type = MT_DEVICE,
  98. },
  99. };
  100. void __init at91rm9200_map_io(void)
  101. {
  102. iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc));
  103. }
  104. /*
  105. * The default interrupt priority levels (0 = lowest, 7 = highest).
  106. */
  107. static unsigned int at91rm9200_default_irq_priority[NR_AIC_IRQS] __initdata = {
  108. 7, /* Advanced Interrupt Controller (FIQ) */
  109. 7, /* System Peripherals */
  110. 0, /* Parallel IO Controller A */
  111. 0, /* Parallel IO Controller B */
  112. 0, /* Parallel IO Controller C */
  113. 0, /* Parallel IO Controller D */
  114. 6, /* USART 0 */
  115. 6, /* USART 1 */
  116. 6, /* USART 2 */
  117. 6, /* USART 3 */
  118. 0, /* Multimedia Card Interface */
  119. 4, /* USB Device Port */
  120. 0, /* Two-Wire Interface */
  121. 6, /* Serial Peripheral Interface */
  122. 5, /* Serial Synchronous Controller 0 */
  123. 5, /* Serial Synchronous Controller 1 */
  124. 5, /* Serial Synchronous Controller 2 */
  125. 0, /* Timer Counter 0 */
  126. 0, /* Timer Counter 1 */
  127. 0, /* Timer Counter 2 */
  128. 0, /* Timer Counter 3 */
  129. 0, /* Timer Counter 4 */
  130. 0, /* Timer Counter 5 */
  131. 3, /* USB Host port */
  132. 3, /* Ethernet MAC */
  133. 0, /* Advanced Interrupt Controller (IRQ0) */
  134. 0, /* Advanced Interrupt Controller (IRQ1) */
  135. 0, /* Advanced Interrupt Controller (IRQ2) */
  136. 0, /* Advanced Interrupt Controller (IRQ3) */
  137. 0, /* Advanced Interrupt Controller (IRQ4) */
  138. 0, /* Advanced Interrupt Controller (IRQ5) */
  139. 0 /* Advanced Interrupt Controller (IRQ6) */
  140. };
  141. void __init at91rm9200_init_irq(unsigned int priority[NR_AIC_IRQS])
  142. {
  143. if (!priority)
  144. priority = at91rm9200_default_irq_priority;
  145. at91_aic_init(priority);
  146. }