orion5x.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*
  2. * arch/arm/mach-orion5x/include/mach/orion5x.h
  3. *
  4. * Generic definitions of Orion SoC flavors:
  5. * Orion-1, Orion-VoIP, Orion-NAS, Orion-2, and Orion-1-90.
  6. *
  7. * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
  8. *
  9. * This file is licensed under the terms of the GNU General Public
  10. * License version 2. This program is licensed "as is" without any
  11. * warranty of any kind, whether express or implied.
  12. */
  13. #ifndef __ASM_ARCH_ORION5X_H
  14. #define __ASM_ARCH_ORION5X_H
  15. /*****************************************************************************
  16. * Orion Address Maps
  17. *
  18. * phys
  19. * e0000000 PCIe MEM space
  20. * e8000000 PCI MEM space
  21. * f0000000 PCIe WA space (Orion-1/Orion-NAS only)
  22. * f1000000 on-chip peripheral registers
  23. * f2000000 PCIe I/O space
  24. * f2100000 PCI I/O space
  25. * f4000000 device bus mappings (boot)
  26. * fa000000 device bus mappings (cs0)
  27. * fa800000 device bus mappings (cs2)
  28. * fc000000 device bus mappings (cs0/cs1)
  29. *
  30. * virt phys size
  31. * fdd00000 f1000000 1M on-chip peripheral registers
  32. * fde00000 f2000000 1M PCIe I/O space
  33. * fdf00000 f2100000 1M PCI I/O space
  34. * fe000000 f0000000 16M PCIe WA space (Orion-1/Orion-NAS only)
  35. ****************************************************************************/
  36. #define ORION5X_REGS_PHYS_BASE 0xf1000000
  37. #define ORION5X_REGS_VIRT_BASE 0xfdd00000
  38. #define ORION5X_REGS_SIZE SZ_1M
  39. #define ORION5X_PCIE_IO_PHYS_BASE 0xf2000000
  40. #define ORION5X_PCIE_IO_VIRT_BASE 0xfde00000
  41. #define ORION5X_PCIE_IO_BUS_BASE 0x00000000
  42. #define ORION5X_PCIE_IO_SIZE SZ_1M
  43. #define ORION5X_PCI_IO_PHYS_BASE 0xf2100000
  44. #define ORION5X_PCI_IO_VIRT_BASE 0xfdf00000
  45. #define ORION5X_PCI_IO_BUS_BASE 0x00100000
  46. #define ORION5X_PCI_IO_SIZE SZ_1M
  47. /* Relevant only for Orion-1/Orion-NAS */
  48. #define ORION5X_PCIE_WA_PHYS_BASE 0xf0000000
  49. #define ORION5X_PCIE_WA_VIRT_BASE 0xfe000000
  50. #define ORION5X_PCIE_WA_SIZE SZ_16M
  51. #define ORION5X_PCIE_MEM_PHYS_BASE 0xe0000000
  52. #define ORION5X_PCIE_MEM_SIZE SZ_128M
  53. #define ORION5X_PCI_MEM_PHYS_BASE 0xe8000000
  54. #define ORION5X_PCI_MEM_SIZE SZ_128M
  55. /*******************************************************************************
  56. * Supported Devices & Revisions
  57. ******************************************************************************/
  58. /* Orion-1 (88F5181) and Orion-VoIP (88F5181L) */
  59. #define MV88F5181_DEV_ID 0x5181
  60. #define MV88F5181_REV_B1 3
  61. #define MV88F5181L_REV_A0 8
  62. #define MV88F5181L_REV_A1 9
  63. /* Orion-NAS (88F5182) */
  64. #define MV88F5182_DEV_ID 0x5182
  65. #define MV88F5182_REV_A2 2
  66. /* Orion-2 (88F5281) */
  67. #define MV88F5281_DEV_ID 0x5281
  68. #define MV88F5281_REV_D0 4
  69. #define MV88F5281_REV_D1 5
  70. #define MV88F5281_REV_D2 6
  71. /* Orion-1-90 (88F6183) */
  72. #define MV88F6183_DEV_ID 0x6183
  73. #define MV88F6183_REV_B0 3
  74. /*******************************************************************************
  75. * Orion Registers Map
  76. ******************************************************************************/
  77. #define ORION5X_DDR_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x00000)
  78. #define ORION5X_DDR_REG(x) (ORION5X_DDR_VIRT_BASE | (x))
  79. #define ORION5X_DEV_BUS_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x10000)
  80. #define ORION5X_DEV_BUS_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x10000)
  81. #define ORION5X_DEV_BUS_REG(x) (ORION5X_DEV_BUS_VIRT_BASE | (x))
  82. #define SPI_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x0600)
  83. #define I2C_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x1000)
  84. #define UART0_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x2000)
  85. #define UART0_VIRT_BASE (ORION5X_DEV_BUS_VIRT_BASE | 0x2000)
  86. #define UART1_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x2100)
  87. #define UART1_VIRT_BASE (ORION5X_DEV_BUS_VIRT_BASE | 0x2100)
  88. #define ORION5X_BRIDGE_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x20000)
  89. #define ORION5X_BRIDGE_REG(x) (ORION5X_BRIDGE_VIRT_BASE | (x))
  90. #define TIMER_VIRT_BASE (ORION5X_BRIDGE_VIRT_BASE | 0x300)
  91. #define ORION5X_PCI_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x30000)
  92. #define ORION5X_PCI_REG(x) (ORION5X_PCI_VIRT_BASE | (x))
  93. #define ORION5X_PCIE_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x40000)
  94. #define ORION5X_PCIE_REG(x) (ORION5X_PCIE_VIRT_BASE | (x))
  95. #define ORION5X_USB0_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x50000)
  96. #define ORION5X_USB0_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x50000)
  97. #define ORION5X_USB0_REG(x) (ORION5X_USB0_VIRT_BASE | (x))
  98. #define ORION5X_XOR_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x60900)
  99. #define ORION5X_XOR_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x60900)
  100. #define ORION5X_XOR_REG(x) (ORION5X_XOR_VIRT_BASE | (x))
  101. #define ORION5X_ETH_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x70000)
  102. #define ORION5X_ETH_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x70000)
  103. #define ORION5X_ETH_REG(x) (ORION5X_ETH_VIRT_BASE | (x))
  104. #define ORION5X_SATA_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x80000)
  105. #define ORION5X_SATA_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x80000)
  106. #define ORION5X_SATA_REG(x) (ORION5X_SATA_VIRT_BASE | (x))
  107. #define ORION5X_USB1_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0xa0000)
  108. #define ORION5X_USB1_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0xa0000)
  109. #define ORION5X_USB1_REG(x) (ORION5X_USB1_VIRT_BASE | (x))
  110. /*******************************************************************************
  111. * Device Bus Registers
  112. ******************************************************************************/
  113. #define MPP_0_7_CTRL ORION5X_DEV_BUS_REG(0x000)
  114. #define MPP_8_15_CTRL ORION5X_DEV_BUS_REG(0x004)
  115. #define MPP_16_19_CTRL ORION5X_DEV_BUS_REG(0x050)
  116. #define MPP_DEV_CTRL ORION5X_DEV_BUS_REG(0x008)
  117. #define MPP_RESET_SAMPLE ORION5X_DEV_BUS_REG(0x010)
  118. #define GPIO_OUT ORION5X_DEV_BUS_REG(0x100)
  119. #define GPIO_IO_CONF ORION5X_DEV_BUS_REG(0x104)
  120. #define GPIO_BLINK_EN ORION5X_DEV_BUS_REG(0x108)
  121. #define GPIO_IN_POL ORION5X_DEV_BUS_REG(0x10c)
  122. #define GPIO_DATA_IN ORION5X_DEV_BUS_REG(0x110)
  123. #define GPIO_EDGE_CAUSE ORION5X_DEV_BUS_REG(0x114)
  124. #define GPIO_EDGE_MASK ORION5X_DEV_BUS_REG(0x118)
  125. #define GPIO_LEVEL_MASK ORION5X_DEV_BUS_REG(0x11c)
  126. #define DEV_BANK_0_PARAM ORION5X_DEV_BUS_REG(0x45c)
  127. #define DEV_BANK_1_PARAM ORION5X_DEV_BUS_REG(0x460)
  128. #define DEV_BANK_2_PARAM ORION5X_DEV_BUS_REG(0x464)
  129. #define DEV_BANK_BOOT_PARAM ORION5X_DEV_BUS_REG(0x46c)
  130. #define DEV_BUS_CTRL ORION5X_DEV_BUS_REG(0x4c0)
  131. #define DEV_BUS_INT_CAUSE ORION5X_DEV_BUS_REG(0x4d0)
  132. #define DEV_BUS_INT_MASK ORION5X_DEV_BUS_REG(0x4d4)
  133. #define GPIO_MAX 32
  134. /***************************************************************************
  135. * Orion CPU Bridge Registers
  136. **************************************************************************/
  137. #define CPU_CONF ORION5X_BRIDGE_REG(0x100)
  138. #define CPU_CTRL ORION5X_BRIDGE_REG(0x104)
  139. #define CPU_RESET_MASK ORION5X_BRIDGE_REG(0x108)
  140. #define CPU_SOFT_RESET ORION5X_BRIDGE_REG(0x10c)
  141. #define POWER_MNG_CTRL_REG ORION5X_BRIDGE_REG(0x11C)
  142. #define BRIDGE_CAUSE ORION5X_BRIDGE_REG(0x110)
  143. #define BRIDGE_MASK ORION5X_BRIDGE_REG(0x114)
  144. #define BRIDGE_INT_TIMER0 0x0002
  145. #define BRIDGE_INT_TIMER1 0x0004
  146. #define BRIDGE_INT_TIMER1_CLR (~0x0004)
  147. #define MAIN_IRQ_CAUSE ORION5X_BRIDGE_REG(0x200)
  148. #define MAIN_IRQ_MASK ORION5X_BRIDGE_REG(0x204)
  149. #endif