ddbridge-regs.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * ddbridge-regs.h: Digital Devices PCIe bridge driver
  4. *
  5. * Copyright (C) 2010-2017 Digital Devices GmbH
  6. */
  7. #ifndef __DDBRIDGE_REGS_H__
  8. #define __DDBRIDGE_REGS_H__
  9. /* ------------------------------------------------------------------------- */
  10. /* SPI Controller */
  11. #define SPI_CONTROL 0x10
  12. #define SPI_DATA 0x14
  13. /* ------------------------------------------------------------------------- */
  14. /* GPIO */
  15. #define GPIO_OUTPUT 0x20
  16. #define GPIO_INPUT 0x24
  17. #define GPIO_DIRECTION 0x28
  18. /* ------------------------------------------------------------------------- */
  19. #define BOARD_CONTROL 0x30
  20. /* ------------------------------------------------------------------------- */
  21. /* Interrupt controller
  22. * How many MSI's are available depends on HW (Min 2 max 8)
  23. * How many are usable also depends on Host platform
  24. */
  25. #define INTERRUPT_BASE (0x40)
  26. #define INTERRUPT_ENABLE (INTERRUPT_BASE + 0x00)
  27. #define MSI1_ENABLE (INTERRUPT_BASE + 0x04)
  28. #define MSI2_ENABLE (INTERRUPT_BASE + 0x08)
  29. #define MSI3_ENABLE (INTERRUPT_BASE + 0x0C)
  30. #define MSI4_ENABLE (INTERRUPT_BASE + 0x10)
  31. #define MSI5_ENABLE (INTERRUPT_BASE + 0x14)
  32. #define MSI6_ENABLE (INTERRUPT_BASE + 0x18)
  33. #define MSI7_ENABLE (INTERRUPT_BASE + 0x1C)
  34. #define INTERRUPT_STATUS (INTERRUPT_BASE + 0x20)
  35. #define INTERRUPT_ACK (INTERRUPT_BASE + 0x20)
  36. /* Temperature Monitor ( 2x LM75A @ 0x90,0x92 I2c ) */
  37. #define TEMPMON_BASE (0x1c0)
  38. #define TEMPMON_CONTROL (TEMPMON_BASE + 0x00)
  39. #define TEMPMON_CONTROL_AUTOSCAN (0x00000002)
  40. #define TEMPMON_CONTROL_INTENABLE (0x00000004)
  41. #define TEMPMON_CONTROL_OVERTEMP (0x00008000)
  42. /* SHORT Temperature in Celsius x 256 */
  43. #define TEMPMON_SENSOR0 (TEMPMON_BASE + 0x04)
  44. #define TEMPMON_SENSOR1 (TEMPMON_BASE + 0x08)
  45. #define TEMPMON_FANCONTROL (TEMPMON_BASE + 0x10)
  46. /* ------------------------------------------------------------------------- */
  47. /* I2C Master Controller */
  48. #define I2C_COMMAND (0x00)
  49. #define I2C_TIMING (0x04)
  50. #define I2C_TASKLENGTH (0x08) /* High read, low write */
  51. #define I2C_TASKADDRESS (0x0C) /* High read, low write */
  52. #define I2C_MONITOR (0x1C)
  53. #define I2C_SPEED_400 (0x04030404)
  54. #define I2C_SPEED_100 (0x13121313)
  55. /* ------------------------------------------------------------------------- */
  56. /* DMA Controller */
  57. #define DMA_BASE_WRITE (0x100)
  58. #define DMA_BASE_READ (0x140)
  59. #define TS_CONTROL(_io) ((_io)->regs + 0x00)
  60. #define TS_CONTROL2(_io) ((_io)->regs + 0x04)
  61. /* ------------------------------------------------------------------------- */
  62. /* DMA Buffer */
  63. #define DMA_BUFFER_CONTROL(_dma) ((_dma)->regs + 0x00)
  64. #define DMA_BUFFER_ACK(_dma) ((_dma)->regs + 0x04)
  65. #define DMA_BUFFER_CURRENT(_dma) ((_dma)->regs + 0x08)
  66. #define DMA_BUFFER_SIZE(_dma) ((_dma)->regs + 0x0c)
  67. /* ------------------------------------------------------------------------- */
  68. /* CI Interface (only CI-Bridge) */
  69. #define CI_BASE (0x400)
  70. #define CI_CONTROL(i) (CI_BASE + (i) * 32 + 0x00)
  71. #define CI_DO_ATTRIBUTE_RW(i) (CI_BASE + (i) * 32 + 0x04)
  72. #define CI_DO_IO_RW(i) (CI_BASE + (i) * 32 + 0x08)
  73. #define CI_READDATA(i) (CI_BASE + (i) * 32 + 0x0c)
  74. #define CI_DO_READ_ATTRIBUTES(i) (CI_BASE + (i) * 32 + 0x10)
  75. #define CI_RESET_CAM (0x00000001)
  76. #define CI_POWER_ON (0x00000002)
  77. #define CI_ENABLE (0x00000004)
  78. #define CI_BYPASS_DISABLE (0x00000010)
  79. #define CI_CAM_READY (0x00010000)
  80. #define CI_CAM_DETECT (0x00020000)
  81. #define CI_READY (0x80000000)
  82. #define CI_READ_CMD (0x40000000)
  83. #define CI_WRITE_CMD (0x80000000)
  84. #define CI_BUFFER_BASE (0x3000)
  85. #define CI_BUFFER_SIZE (0x0800)
  86. #define CI_BUFFER(i) (CI_BUFFER_BASE + (i) * CI_BUFFER_SIZE)
  87. /* ------------------------------------------------------------------------- */
  88. /* LNB commands (mxl5xx / Max S8) */
  89. #define LNB_BASE (0x400)
  90. #define LNB_CONTROL(i) (LNB_BASE + (i) * 0x20 + 0x00)
  91. #define LNB_CMD (7ULL << 0)
  92. #define LNB_CMD_NOP 0
  93. #define LNB_CMD_INIT 1
  94. #define LNB_CMD_LOW 3
  95. #define LNB_CMD_HIGH 4
  96. #define LNB_CMD_OFF 5
  97. #define LNB_CMD_DISEQC 6
  98. #define LNB_BUSY BIT_ULL(4)
  99. #define LNB_TONE BIT_ULL(15)
  100. #define LNB_BUF_LEVEL(i) (LNB_BASE + (i) * 0x20 + 0x10)
  101. #define LNB_BUF_WRITE(i) (LNB_BASE + (i) * 0x20 + 0x14)
  102. #endif /* __DDBRIDGE_REGS_H__ */