ddbridge-regs.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. * ddbridge-regs.h: Digital Devices PCIe bridge driver
  3. *
  4. * Copyright (C) 2010-2017 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. * To obtain the license, point your browser to
  17. * http://www.gnu.org/copyleft/gpl.html
  18. */
  19. #ifndef __DDBRIDGE_REGS_H__
  20. #define __DDBRIDGE_REGS_H__
  21. /* ------------------------------------------------------------------------- */
  22. /* SPI Controller */
  23. #define SPI_CONTROL 0x10
  24. #define SPI_DATA 0x14
  25. /* ------------------------------------------------------------------------- */
  26. /* GPIO */
  27. #define GPIO_OUTPUT 0x20
  28. #define GPIO_INPUT 0x24
  29. #define GPIO_DIRECTION 0x28
  30. /* ------------------------------------------------------------------------- */
  31. #define BOARD_CONTROL 0x30
  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. */
  37. #define INTERRUPT_BASE (0x40)
  38. #define INTERRUPT_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. /* Temperature Monitor ( 2x LM75A @ 0x90,0x92 I2c ) */
  49. #define TEMPMON_BASE (0x1c0)
  50. #define TEMPMON_CONTROL (TEMPMON_BASE + 0x00)
  51. #define TEMPMON_CONTROL_AUTOSCAN (0x00000002)
  52. #define TEMPMON_CONTROL_INTENABLE (0x00000004)
  53. #define TEMPMON_CONTROL_OVERTEMP (0x00008000)
  54. /* SHORT Temperature in Celsius x 256 */
  55. #define TEMPMON_SENSOR0 (TEMPMON_BASE + 0x04)
  56. #define TEMPMON_SENSOR1 (TEMPMON_BASE + 0x08)
  57. #define TEMPMON_FANCONTROL (TEMPMON_BASE + 0x10)
  58. /* ------------------------------------------------------------------------- */
  59. /* I2C Master Controller */
  60. #define I2C_COMMAND (0x00)
  61. #define I2C_TIMING (0x04)
  62. #define I2C_TASKLENGTH (0x08) /* High read, low write */
  63. #define I2C_TASKADDRESS (0x0C) /* High read, low write */
  64. #define I2C_MONITOR (0x1C)
  65. #define I2C_SPEED_400 (0x04030404)
  66. #define I2C_SPEED_100 (0x13121313)
  67. /* ------------------------------------------------------------------------- */
  68. /* DMA Controller */
  69. #define DMA_BASE_WRITE (0x100)
  70. #define DMA_BASE_READ (0x140)
  71. #define TS_CONTROL(_io) ((_io)->regs + 0x00)
  72. #define TS_CONTROL2(_io) ((_io)->regs + 0x04)
  73. /* ------------------------------------------------------------------------- */
  74. /* DMA Buffer */
  75. #define DMA_BUFFER_CONTROL(_dma) ((_dma)->regs + 0x00)
  76. #define DMA_BUFFER_ACK(_dma) ((_dma)->regs + 0x04)
  77. #define DMA_BUFFER_CURRENT(_dma) ((_dma)->regs + 0x08)
  78. #define DMA_BUFFER_SIZE(_dma) ((_dma)->regs + 0x0c)
  79. /* ------------------------------------------------------------------------- */
  80. /* CI Interface (only CI-Bridge) */
  81. #define CI_BASE (0x400)
  82. #define CI_CONTROL(i) (CI_BASE + (i) * 32 + 0x00)
  83. #define CI_DO_ATTRIBUTE_RW(i) (CI_BASE + (i) * 32 + 0x04)
  84. #define CI_DO_IO_RW(i) (CI_BASE + (i) * 32 + 0x08)
  85. #define CI_READDATA(i) (CI_BASE + (i) * 32 + 0x0c)
  86. #define CI_DO_READ_ATTRIBUTES(i) (CI_BASE + (i) * 32 + 0x10)
  87. #define CI_RESET_CAM (0x00000001)
  88. #define CI_POWER_ON (0x00000002)
  89. #define CI_ENABLE (0x00000004)
  90. #define CI_BYPASS_DISABLE (0x00000010)
  91. #define CI_CAM_READY (0x00010000)
  92. #define CI_CAM_DETECT (0x00020000)
  93. #define CI_READY (0x80000000)
  94. #define CI_READ_CMD (0x40000000)
  95. #define CI_WRITE_CMD (0x80000000)
  96. #define CI_BUFFER_BASE (0x3000)
  97. #define CI_BUFFER_SIZE (0x0800)
  98. #define CI_BUFFER(i) (CI_BUFFER_BASE + (i) * CI_BUFFER_SIZE)
  99. /* ------------------------------------------------------------------------- */
  100. /* LNB commands (mxl5xx / Max S8) */
  101. #define LNB_BASE (0x400)
  102. #define LNB_CONTROL(i) (LNB_BASE + (i) * 0x20 + 0x00)
  103. #define LNB_CMD (7ULL << 0)
  104. #define LNB_CMD_NOP 0
  105. #define LNB_CMD_INIT 1
  106. #define LNB_CMD_LOW 3
  107. #define LNB_CMD_HIGH 4
  108. #define LNB_CMD_OFF 5
  109. #define LNB_CMD_DISEQC 6
  110. #define LNB_BUSY BIT_ULL(4)
  111. #define LNB_TONE BIT_ULL(15)
  112. #define LNB_BUF_LEVEL(i) (LNB_BASE + (i) * 0x20 + 0x10)
  113. #define LNB_BUF_WRITE(i) (LNB_BASE + (i) * 0x20 + 0x14)
  114. #endif /* __DDBRIDGE_REGS_H__ */