ddbridge-regs.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /*
  2. * ddbridge-regs.h: Digital Devices PCIe bridge driver
  3. *
  4. * Copyright (C) 2010-2011 Digital Devices GmbH
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * version 2 only, as published by the Free Software Foundation.
  9. *
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  20. * 02110-1301, USA
  21. * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
  22. */
  23. // $Id: DD-DVBBridgeV1.h 273 2010-09-17 05:03:16Z manfred $
  24. // Register Definitions
  25. #define CUR_REGISTERMAP_VERSION 0x10000
  26. #define HARDWARE_VERSION 0x00
  27. #define REGISTERMAP_VERSION 0x04
  28. // --------------------------------------------------------------------------
  29. // SPI Controller
  30. #define SPI_CONTROL 0x10
  31. #define SPI_DATA 0x14
  32. // --------------------------------------------------------------------------
  33. // Interrupt controller
  34. // How many MSI's are available depends on HW (Min 2 max 8)
  35. // How many are usable also depends on Host platform
  36. #define INTERRUPT_BASE (0x40)
  37. #define INTERRUPT_ENABLE (INTERRUPT_BASE + 0x00)
  38. #define MSI0_ENABLE (INTERRUPT_BASE + 0x00)
  39. #define MSI1_ENABLE (INTERRUPT_BASE + 0x04)
  40. #define MSI2_ENABLE (INTERRUPT_BASE + 0x08)
  41. #define MSI3_ENABLE (INTERRUPT_BASE + 0x0C)
  42. #define MSI4_ENABLE (INTERRUPT_BASE + 0x10)
  43. #define MSI5_ENABLE (INTERRUPT_BASE + 0x14)
  44. #define MSI6_ENABLE (INTERRUPT_BASE + 0x18)
  45. #define MSI7_ENABLE (INTERRUPT_BASE + 0x1C)
  46. #define INTERRUPT_STATUS (INTERRUPT_BASE + 0x20)
  47. #define INTERRUPT_ACK (INTERRUPT_BASE + 0x20)
  48. #define INTMASK_I2C1 (0x00000001)
  49. #define INTMASK_I2C2 (0x00000002)
  50. #define INTMASK_I2C3 (0x00000004)
  51. #define INTMASK_I2C4 (0x00000008)
  52. #define INTMASK_CIRQ1 (0x00000010)
  53. #define INTMASK_CIRQ2 (0x00000020)
  54. #define INTMASK_CIRQ3 (0x00000040)
  55. #define INTMASK_CIRQ4 (0x00000080)
  56. #define INTMASK_TSINPUT1 (0x00000100)
  57. #define INTMASK_TSINPUT2 (0x00000200)
  58. #define INTMASK_TSINPUT3 (0x00000400)
  59. #define INTMASK_TSINPUT4 (0x00000800)
  60. #define INTMASK_TSINPUT5 (0x00001000)
  61. #define INTMASK_TSINPUT6 (0x00002000)
  62. #define INTMASK_TSINPUT7 (0x00004000)
  63. #define INTMASK_TSINPUT8 (0x00008000)
  64. #define INTMASK_TSOUTPUT1 (0x00010000)
  65. #define INTMASK_TSOUTPUT2 (0x00020000)
  66. #define INTMASK_TSOUTPUT3 (0x00040000)
  67. #define INTMASK_TSOUTPUT4 (0x00080000)
  68. // --------------------------------------------------------------------------
  69. // I2C Master Controller
  70. #define I2C_BASE (0x80) // Byte offset
  71. #define I2C_COMMAND (0x00)
  72. #define I2C_TIMING (0x04)
  73. #define I2C_TASKLENGTH (0x08) // High read, low write
  74. #define I2C_TASKADDRESS (0x0C) // High read, low write
  75. #define I2C_MONITOR (0x1C)
  76. #define I2C_BASE_1 (I2C_BASE + 0x00)
  77. #define I2C_BASE_2 (I2C_BASE + 0x20)
  78. #define I2C_BASE_3 (I2C_BASE + 0x40)
  79. #define I2C_BASE_4 (I2C_BASE + 0x60)
  80. #define I2C_BASE_N(i) (I2C_BASE + (i) * 0x20)
  81. #define I2C_TASKMEM_BASE (0x1000) // Byte offset
  82. #define I2C_TASKMEM_SIZE (0x1000)
  83. #define I2C_SPEED_400 (0x04030404)
  84. #define I2C_SPEED_200 (0x09080909)
  85. #define I2C_SPEED_154 (0x0C0B0C0C)
  86. #define I2C_SPEED_100 (0x13121313)
  87. #define I2C_SPEED_77 (0x19181919)
  88. #define I2C_SPEED_50 (0x27262727)
  89. // --------------------------------------------------------------------------
  90. // DMA Controller
  91. #define DMA_BASE_WRITE (0x100)
  92. #define DMA_BASE_READ (0x140)
  93. #define DMA_CONTROL (0x00) // 64
  94. #define DMA_ERROR (0x04) // 65 ( only read instance )
  95. #define DMA_DIAG_CONTROL (0x1C) // 71
  96. #define DMA_DIAG_PACKETCOUNTER_LOW (0x20) // 72
  97. #define DMA_DIAG_PACKETCOUNTER_HIGH (0x24) // 73
  98. #define DMA_DIAG_TIMECOUNTER_LOW (0x28) // 74
  99. #define DMA_DIAG_TIMECOUNTER_HIGH (0x2C) // 75
  100. #define DMA_DIAG_RECHECKCOUNTER (0x30) // 76 ( Split completions on read )
  101. #define DMA_DIAG_WAITTIMEOUTINIT (0x34) // 77
  102. #define DMA_DIAG_WAITOVERFLOWCOUNTER (0x38) // 78
  103. #define DMA_DIAG_WAITCOUNTER (0x3C) // 79
  104. // --------------------------------------------------------------------------
  105. // DMA Buffer
  106. #define TS_INPUT_BASE (0x200)
  107. #define TS_INPUT_CONTROL(i) (TS_INPUT_BASE + (i) * 16 + 0x00)
  108. #define TS_OUTPUT_BASE (0x280)
  109. #define TS_OUTPUT_CONTROL(i) (TS_OUTPUT_BASE + (i) * 16 + 0x00)
  110. #define DMA_BUFFER_BASE (0x300)
  111. #define DMA_BUFFER_CONTROL(i) (DMA_BUFFER_BASE + (i) * 16 + 0x00)
  112. #define DMA_BUFFER_ACK(i) (DMA_BUFFER_BASE + (i) * 16 + 0x04)
  113. #define DMA_BUFFER_CURRENT(i) (DMA_BUFFER_BASE + (i) * 16 + 0x08)
  114. #define DMA_BUFFER_SIZE(i) (DMA_BUFFER_BASE + (i) * 16 + 0x0c)
  115. #define DMA_BASE_ADDRESS_TABLE (0x2000)
  116. #define DMA_BASE_ADDRESS_TABLE_ENTRIES (512)