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 #ifndef __DDBRIDGE_REGS_H__
21 #define __DDBRIDGE_REGS_H__
23 /* ------------------------------------------------------------------------- */
26 #define SPI_CONTROL 0x10
29 /* ------------------------------------------------------------------------- */
32 #define GPIO_OUTPUT 0x20
33 #define GPIO_INPUT 0x24
34 #define GPIO_DIRECTION 0x28
36 /* ------------------------------------------------------------------------- */
38 #define BOARD_CONTROL 0x30
40 /* ------------------------------------------------------------------------- */
42 /* Interrupt controller
43 * How many MSI's are available depends on HW (Min 2 max 8)
44 * How many are usable also depends on Host platform
47 #define INTERRUPT_BASE (0x40)
49 #define INTERRUPT_ENABLE (INTERRUPT_BASE + 0x00)
50 #define MSI1_ENABLE (INTERRUPT_BASE + 0x04)
51 #define MSI2_ENABLE (INTERRUPT_BASE + 0x08)
52 #define MSI3_ENABLE (INTERRUPT_BASE + 0x0C)
53 #define MSI4_ENABLE (INTERRUPT_BASE + 0x10)
54 #define MSI5_ENABLE (INTERRUPT_BASE + 0x14)
55 #define MSI6_ENABLE (INTERRUPT_BASE + 0x18)
56 #define MSI7_ENABLE (INTERRUPT_BASE + 0x1C)
58 #define INTERRUPT_STATUS (INTERRUPT_BASE + 0x20)
59 #define INTERRUPT_ACK (INTERRUPT_BASE + 0x20)
61 /* Temperature Monitor ( 2x LM75A @ 0x90,0x92 I2c ) */
62 #define TEMPMON_BASE (0x1c0)
63 #define TEMPMON_CONTROL (TEMPMON_BASE + 0x00)
65 #define TEMPMON_CONTROL_AUTOSCAN (0x00000002)
66 #define TEMPMON_CONTROL_INTENABLE (0x00000004)
67 #define TEMPMON_CONTROL_OVERTEMP (0x00008000)
69 /* SHORT Temperature in Celsius x 256 */
70 #define TEMPMON_SENSOR0 (TEMPMON_BASE + 0x04)
71 #define TEMPMON_SENSOR1 (TEMPMON_BASE + 0x08)
73 #define TEMPMON_FANCONTROL (TEMPMON_BASE + 0x10)
75 /* ------------------------------------------------------------------------- */
76 /* I2C Master Controller */
78 #define I2C_COMMAND (0x00)
79 #define I2C_TIMING (0x04)
80 #define I2C_TASKLENGTH (0x08) /* High read, low write */
81 #define I2C_TASKADDRESS (0x0C) /* High read, low write */
82 #define I2C_MONITOR (0x1C)
84 #define I2C_SPEED_400 (0x04030404)
85 #define I2C_SPEED_100 (0x13121313)
87 /* ------------------------------------------------------------------------- */
90 #define DMA_BASE_WRITE (0x100)
91 #define DMA_BASE_READ (0x140)
93 #define TS_CONTROL(_io) ((_io)->regs + 0x00)
94 #define TS_CONTROL2(_io) ((_io)->regs + 0x04)
96 /* ------------------------------------------------------------------------- */
99 #define DMA_BUFFER_CONTROL(_dma) ((_dma)->regs + 0x00)
100 #define DMA_BUFFER_ACK(_dma) ((_dma)->regs + 0x04)
101 #define DMA_BUFFER_CURRENT(_dma) ((_dma)->regs + 0x08)
102 #define DMA_BUFFER_SIZE(_dma) ((_dma)->regs + 0x0c)
104 /* ------------------------------------------------------------------------- */
105 /* CI Interface (only CI-Bridge) */
107 #define CI_BASE (0x400)
108 #define CI_CONTROL(i) (CI_BASE + (i) * 32 + 0x00)
110 #define CI_DO_ATTRIBUTE_RW(i) (CI_BASE + (i) * 32 + 0x04)
111 #define CI_DO_IO_RW(i) (CI_BASE + (i) * 32 + 0x08)
112 #define CI_READDATA(i) (CI_BASE + (i) * 32 + 0x0c)
113 #define CI_DO_READ_ATTRIBUTES(i) (CI_BASE + (i) * 32 + 0x10)
115 #define CI_RESET_CAM (0x00000001)
116 #define CI_POWER_ON (0x00000002)
117 #define CI_ENABLE (0x00000004)
118 #define CI_BYPASS_DISABLE (0x00000010)
120 #define CI_CAM_READY (0x00010000)
121 #define CI_CAM_DETECT (0x00020000)
122 #define CI_READY (0x80000000)
124 #define CI_READ_CMD (0x40000000)
125 #define CI_WRITE_CMD (0x80000000)
127 #define CI_BUFFER_BASE (0x3000)
128 #define CI_BUFFER_SIZE (0x0800)
130 #define CI_BUFFER(i) (CI_BUFFER_BASE + (i) * CI_BUFFER_SIZE)
132 /* ------------------------------------------------------------------------- */
133 /* LNB commands (mxl5xx / Max S8) */
135 #define LNB_BASE (0x400)
136 #define LNB_CONTROL(i) (LNB_BASE + (i) * 0x20 + 0x00)
138 #define LNB_CMD (7ULL << 0)
139 #define LNB_CMD_NOP 0
140 #define LNB_CMD_INIT 1
141 #define LNB_CMD_LOW 3
142 #define LNB_CMD_HIGH 4
143 #define LNB_CMD_OFF 5
144 #define LNB_CMD_DISEQC 6
146 #define LNB_BUSY BIT_ULL(4)
147 #define LNB_TONE BIT_ULL(15)
149 #define LNB_BUF_LEVEL(i) (LNB_BASE + (i) * 0x20 + 0x10)
150 #define LNB_BUF_WRITE(i) (LNB_BASE + (i) * 0x20 + 0x14)
152 #endif /* __DDBRIDGE_REGS_H__ */