orion.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * include/asm-arm/arch-orion/orion.h
  3. *
  4. * Generic definitions of Orion SoC flavors:
  5. * Orion-1, Orion-NAS, Orion-VoIP, and Orion-2.
  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_ORION_H__
  14. #define __ASM_ARCH_ORION_H__
  15. /*******************************************************************************
  16. * Orion Address Map
  17. * Use the same mapping (1:1 virtual:physical) of internal registers and
  18. * PCI system (PCI+PCIE) for all machines.
  19. * Each machine defines the rest of its mapping (e.g. device bus flashes)
  20. ******************************************************************************/
  21. #define ORION_REGS_BASE 0xf1000000
  22. #define ORION_REGS_SIZE SZ_1M
  23. #define ORION_PCI_SYS_MEM_BASE 0xe0000000
  24. #define ORION_PCIE_MEM_BASE ORION_PCI_SYS_MEM_BASE
  25. #define ORION_PCIE_MEM_SIZE SZ_128M
  26. #define ORION_PCI_MEM_BASE (ORION_PCIE_MEM_BASE + ORION_PCIE_MEM_SIZE)
  27. #define ORION_PCI_MEM_SIZE SZ_128M
  28. #define ORION_PCI_SYS_IO_BASE 0xf2000000
  29. #define ORION_PCIE_IO_BASE ORION_PCI_SYS_IO_BASE
  30. #define ORION_PCIE_IO_SIZE SZ_1M
  31. #define ORION_PCIE_IO_REMAP (ORION_PCIE_IO_BASE - ORION_PCI_SYS_IO_BASE)
  32. #define ORION_PCI_IO_BASE (ORION_PCIE_IO_BASE + ORION_PCIE_IO_SIZE)
  33. #define ORION_PCI_IO_SIZE SZ_1M
  34. #define ORION_PCI_IO_REMAP (ORION_PCI_IO_BASE - ORION_PCI_SYS_IO_BASE)
  35. /* Relevant only for Orion-NAS */
  36. #define ORION_PCIE_WA_BASE 0xf0000000
  37. #define ORION_PCIE_WA_SIZE SZ_16M
  38. /*******************************************************************************
  39. * Supported Devices & Revisions
  40. ******************************************************************************/
  41. /* Orion-1 (88F5181) */
  42. #define MV88F5181_DEV_ID 0x5181
  43. #define MV88F5181_REV_B1 3
  44. /* Orion-NAS (88F5182) */
  45. #define MV88F5182_DEV_ID 0x5182
  46. #define MV88F5182_REV_A2 2
  47. /* Orion-2 (88F5281) */
  48. #define MV88F5281_DEV_ID 0x5281
  49. #define MV88F5281_REV_D1 5
  50. #define MV88F5281_REV_D2 6
  51. /*******************************************************************************
  52. * Orion Registers Map
  53. ******************************************************************************/
  54. #define ORION_DDR_REG_BASE (ORION_REGS_BASE | 0x00000)
  55. #define ORION_DEV_BUS_REG_BASE (ORION_REGS_BASE | 0x10000)
  56. #define ORION_BRIDGE_REG_BASE (ORION_REGS_BASE | 0x20000)
  57. #define ORION_PCI_REG_BASE (ORION_REGS_BASE | 0x30000)
  58. #define ORION_PCIE_REG_BASE (ORION_REGS_BASE | 0x40000)
  59. #define ORION_USB0_REG_BASE (ORION_REGS_BASE | 0x50000)
  60. #define ORION_ETH_REG_BASE (ORION_REGS_BASE | 0x70000)
  61. #define ORION_SATA_REG_BASE (ORION_REGS_BASE | 0x80000)
  62. #define ORION_USB1_REG_BASE (ORION_REGS_BASE | 0xa0000)
  63. #define ORION_DDR_REG(x) (ORION_DDR_REG_BASE | (x))
  64. #define ORION_DEV_BUS_REG(x) (ORION_DEV_BUS_REG_BASE | (x))
  65. #define ORION_BRIDGE_REG(x) (ORION_BRIDGE_REG_BASE | (x))
  66. #define ORION_PCI_REG(x) (ORION_PCI_REG_BASE | (x))
  67. #define ORION_PCIE_REG(x) (ORION_PCIE_REG_BASE | (x))
  68. #define ORION_USB0_REG(x) (ORION_USB0_REG_BASE | (x))
  69. #define ORION_USB1_REG(x) (ORION_USB1_REG_BASE | (x))
  70. #define ORION_ETH_REG(x) (ORION_ETH_REG_BASE | (x))
  71. #define ORION_SATA_REG(x) (ORION_SATA_REG_BASE | (x))
  72. /*******************************************************************************
  73. * Device Bus Registers
  74. ******************************************************************************/
  75. #define MPP_0_7_CTRL ORION_DEV_BUS_REG(0x000)
  76. #define MPP_8_15_CTRL ORION_DEV_BUS_REG(0x004)
  77. #define MPP_16_19_CTRL ORION_DEV_BUS_REG(0x050)
  78. #define MPP_DEV_CTRL ORION_DEV_BUS_REG(0x008)
  79. #define MPP_RESET_SAMPLE ORION_DEV_BUS_REG(0x010)
  80. #define GPIO_OUT ORION_DEV_BUS_REG(0x100)
  81. #define GPIO_IO_CONF ORION_DEV_BUS_REG(0x104)
  82. #define GPIO_BLINK_EN ORION_DEV_BUS_REG(0x108)
  83. #define GPIO_IN_POL ORION_DEV_BUS_REG(0x10c)
  84. #define GPIO_DATA_IN ORION_DEV_BUS_REG(0x110)
  85. #define GPIO_EDGE_CAUSE ORION_DEV_BUS_REG(0x114)
  86. #define GPIO_EDGE_MASK ORION_DEV_BUS_REG(0x118)
  87. #define GPIO_LEVEL_MASK ORION_DEV_BUS_REG(0x11c)
  88. #define DEV_BANK_0_PARAM ORION_DEV_BUS_REG(0x45c)
  89. #define DEV_BANK_1_PARAM ORION_DEV_BUS_REG(0x460)
  90. #define DEV_BANK_2_PARAM ORION_DEV_BUS_REG(0x464)
  91. #define DEV_BANK_BOOT_PARAM ORION_DEV_BUS_REG(0x46c)
  92. #define DEV_BUS_CTRL ORION_DEV_BUS_REG(0x4c0)
  93. #define DEV_BUS_INT_CAUSE ORION_DEV_BUS_REG(0x4d0)
  94. #define DEV_BUS_INT_MASK ORION_DEV_BUS_REG(0x4d4)
  95. #define I2C_BASE ORION_DEV_BUS_REG(0x1000)
  96. #define UART0_BASE ORION_DEV_BUS_REG(0x2000)
  97. #define UART1_BASE ORION_DEV_BUS_REG(0x2100)
  98. #define GPIO_MAX 32
  99. /***************************************************************************
  100. * Orion CPU Bridge Registers
  101. **************************************************************************/
  102. #define CPU_CONF ORION_BRIDGE_REG(0x100)
  103. #define CPU_CTRL ORION_BRIDGE_REG(0x104)
  104. #define CPU_RESET_MASK ORION_BRIDGE_REG(0x108)
  105. #define CPU_SOFT_RESET ORION_BRIDGE_REG(0x10c)
  106. #define POWER_MNG_CTRL_REG ORION_BRIDGE_REG(0x11C)
  107. #define BRIDGE_CAUSE ORION_BRIDGE_REG(0x110)
  108. #define BRIDGE_MASK ORION_BRIDGE_REG(0x114)
  109. #define MAIN_IRQ_CAUSE ORION_BRIDGE_REG(0x200)
  110. #define MAIN_IRQ_MASK ORION_BRIDGE_REG(0x204)
  111. #define TIMER_CTRL ORION_BRIDGE_REG(0x300)
  112. #define TIMER_VAL(x) ORION_BRIDGE_REG(0x314 + ((x) * 8))
  113. #define TIMER_VAL_RELOAD(x) ORION_BRIDGE_REG(0x310 + ((x) * 8))
  114. #ifndef __ASSEMBLY__
  115. /*******************************************************************************
  116. * Helpers to access Orion registers
  117. ******************************************************************************/
  118. #include <asm/types.h>
  119. #include <asm/io.h>
  120. #define orion_read(r) __raw_readl(r)
  121. #define orion_write(r, val) __raw_writel(val, r)
  122. /*
  123. * These are not preempt safe. Locks, if needed, must be taken care by caller.
  124. */
  125. #define orion_setbits(r, mask) orion_write((r), orion_read(r) | (mask))
  126. #define orion_clrbits(r, mask) orion_write((r), orion_read(r) & ~(mask))
  127. #endif /* __ASSEMBLY__ */
  128. #endif /* __ASM_ARCH_ORION_H__ */