2 * ddbridge-regs.h: Digital Devices PCIe bridge driver
4 * Copyright (C) 2010-2017 Digital Devices GmbH
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.
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.
16 * To obtain the license, point your browser to
17 * http://www.gnu.org/copyleft/gpl.html
20 /* ------------------------------------------------------------------------- */
23 #define SPI_CONTROL 0x10
26 /* ------------------------------------------------------------------------- */
29 #define GPIO_OUTPUT 0x20
30 #define GPIO_INPUT 0x24
31 #define GPIO_DIRECTION 0x28
33 /* ------------------------------------------------------------------------- */
36 #define MDIO_CTRL 0x20
41 /* ------------------------------------------------------------------------- */
43 #define BOARD_CONTROL 0x30
45 /* ------------------------------------------------------------------------- */
47 /* Interrupt controller
48 * How many MSI's are available depends on HW (Min 2 max 8)
49 * How many are usable also depends on Host platform
52 #define INTERRUPT_BASE (0x40)
54 #define INTERRUPT_ENABLE (INTERRUPT_BASE + 0x00)
55 #define MSI1_ENABLE (INTERRUPT_BASE + 0x04)
56 #define MSI2_ENABLE (INTERRUPT_BASE + 0x08)
57 #define MSI3_ENABLE (INTERRUPT_BASE + 0x0C)
58 #define MSI4_ENABLE (INTERRUPT_BASE + 0x10)
59 #define MSI5_ENABLE (INTERRUPT_BASE + 0x14)
60 #define MSI6_ENABLE (INTERRUPT_BASE + 0x18)
61 #define MSI7_ENABLE (INTERRUPT_BASE + 0x1C)
63 #define INTERRUPT_STATUS (INTERRUPT_BASE + 0x20)
64 #define INTERRUPT_ACK (INTERRUPT_BASE + 0x20)
66 /* Temperature Monitor ( 2x LM75A @ 0x90,0x92 I2c ) */
67 #define TEMPMON_BASE (0x1c0)
68 #define TEMPMON_CONTROL (TEMPMON_BASE + 0x00)
70 #define TEMPMON_CONTROL_AUTOSCAN (0x00000002)
71 #define TEMPMON_CONTROL_INTENABLE (0x00000004)
72 #define TEMPMON_CONTROL_OVERTEMP (0x00008000)
74 /* SHORT Temperature in Celsius x 256 */
75 #define TEMPMON_SENSOR0 (TEMPMON_BASE + 0x04)
76 #define TEMPMON_SENSOR1 (TEMPMON_BASE + 0x08)
78 #define TEMPMON_FANCONTROL (TEMPMON_BASE + 0x10)
80 /* ------------------------------------------------------------------------- */
81 /* I2C Master Controller */
83 #define I2C_COMMAND (0x00)
84 #define I2C_TIMING (0x04)
85 #define I2C_TASKLENGTH (0x08) /* High read, low write */
86 #define I2C_TASKADDRESS (0x0C) /* High read, low write */
87 #define I2C_MONITOR (0x1C)
89 #define I2C_SPEED_400 (0x04030404)
90 #define I2C_SPEED_100 (0x13121313)
92 /* ------------------------------------------------------------------------- */
95 #define DMA_BASE_WRITE (0x100)
96 #define DMA_BASE_READ (0x140)
98 #define TS_CONTROL(_io) ((_io)->regs + 0x00)
99 #define TS_CONTROL2(_io) ((_io)->regs + 0x04)
101 /* ------------------------------------------------------------------------- */
104 #define DMA_BUFFER_CONTROL(_dma) ((_dma)->regs + 0x00)
105 #define DMA_BUFFER_ACK(_dma) ((_dma)->regs + 0x04)
106 #define DMA_BUFFER_CURRENT(_dma) ((_dma)->regs + 0x08)
107 #define DMA_BUFFER_SIZE(_dma) ((_dma)->regs + 0x0c)
109 /* ------------------------------------------------------------------------- */
110 /* CI Interface (only CI-Bridge) */
112 #define CI_BASE (0x400)
113 #define CI_CONTROL(i) (CI_BASE + (i) * 32 + 0x00)
115 #define CI_DO_ATTRIBUTE_RW(i) (CI_BASE + (i) * 32 + 0x04)
116 #define CI_DO_IO_RW(i) (CI_BASE + (i) * 32 + 0x08)
117 #define CI_READDATA(i) (CI_BASE + (i) * 32 + 0x0c)
118 #define CI_DO_READ_ATTRIBUTES(i) (CI_BASE + (i) * 32 + 0x10)
120 #define CI_RESET_CAM (0x00000001)
121 #define CI_POWER_ON (0x00000002)
122 #define CI_ENABLE (0x00000004)
123 #define CI_BYPASS_DISABLE (0x00000010)
125 #define CI_CAM_READY (0x00010000)
126 #define CI_CAM_DETECT (0x00020000)
127 #define CI_READY (0x80000000)
129 #define CI_READ_CMD (0x40000000)
130 #define CI_WRITE_CMD (0x80000000)
132 #define CI_BUFFER_BASE (0x3000)
133 #define CI_BUFFER_SIZE (0x0800)
135 #define CI_BUFFER(i) (CI_BUFFER_BASE + (i) * CI_BUFFER_SIZE)
137 /* ------------------------------------------------------------------------- */
138 /* LNB commands (mxl5xx / Max S8) */
140 #define LNB_BASE (0x400)
141 #define LNB_CONTROL(i) (LNB_BASE + (i) * 0x20 + 0x00)
143 #define LNB_CMD (7ULL << 0)
144 #define LNB_CMD_NOP 0
145 #define LNB_CMD_INIT 1
146 #define LNB_CMD_LOW 3
147 #define LNB_CMD_HIGH 4
148 #define LNB_CMD_OFF 5
149 #define LNB_CMD_DISEQC 6
151 #define LNB_BUSY BIT_ULL(4)
152 #define LNB_TONE BIT_ULL(15)
154 #define LNB_BUF_LEVEL(i) (LNB_BASE + (i) * 0x20 + 0x10)
155 #define LNB_BUF_WRITE(i) (LNB_BASE + (i) * 0x20 + 0x14)