xref: /linux/drivers/media/pci/mantis/mantis_reg.h (revision 976e3645923bdd2fe7893aae33fd7a21098bfb28)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 	Mantis PCI bridge driver
4 
5 	Copyright (C) Manu Abraham (abraham.manu@gmail.com)
6 
7 */
8 
9 #ifndef __MANTIS_REG_H
10 #define __MANTIS_REG_H
11 
12 /* Interrupts */
13 #define MANTIS_INT_STAT			0x00
14 #define MANTIS_INT_MASK			0x04
15 
16 #define MANTIS_INT_RISCSTAT		(0x0f << 28)
17 #define MANTIS_INT_RISCEN		BIT(27)
18 #define MANTIS_INT_I2CRACK		BIT(26)
19 
20 /* #define MANTIS_INT_GPIF			(0xff << 12) */
21 
22 #define MANTIS_INT_PCMCIA7		BIT(19)
23 #define MANTIS_INT_PCMCIA6		BIT(18)
24 #define MANTIS_INT_PCMCIA5		BIT(17)
25 #define MANTIS_INT_PCMCIA4		BIT(16)
26 #define MANTIS_INT_PCMCIA3		BIT(15)
27 #define MANTIS_INT_PCMCIA2		BIT(14)
28 #define MANTIS_INT_PCMCIA1		BIT(13)
29 #define MANTIS_INT_PCMCIA0		BIT(12)
30 #define MANTIS_INT_IRQ1			BIT(11)
31 #define MANTIS_INT_IRQ0			BIT(10)
32 #define MANTIS_INT_OCERR		BIT(8)
33 #define MANTIS_INT_PABORT		BIT(7)
34 #define MANTIS_INT_RIPERR		BIT(6)
35 #define MANTIS_INT_PPERR		BIT(5)
36 #define MANTIS_INT_FTRGT		BIT(3)
37 #define MANTIS_INT_RISCI		BIT(1)
38 #define MANTIS_INT_I2CDONE		BIT(0)
39 
40 /* DMA */
41 #define MANTIS_DMA_CTL			0x08
42 #define MANTIS_GPIF_RD			(0xff << 24)
43 #define MANTIS_GPIF_WR			(0xff << 16)
44 #define MANTIS_CPU_DO			BIT(10)
45 #define MANTIS_DRV_DO			BIT(9)
46 #define	MANTIS_I2C_RD			BIT(7)
47 #define MANTIS_I2C_WR			BIT(6)
48 #define MANTIS_DCAP_MODE		BIT(5)
49 #define MANTIS_FIFO_TP_4		(0x00 <<  3)
50 #define MANTIS_FIFO_TP_8		(0x01 <<  3)
51 #define MANTIS_FIFO_TP_16		(0x02 <<  3)
52 #define MANTIS_FIFO_EN			BIT(2)
53 #define MANTIS_DCAP_EN			BIT(1)
54 #define MANTIS_RISC_EN			BIT(0)
55 
56 /* DEBUG */
57 #define MANTIS_DEBUGREG			0x0c
58 #define MANTIS_DATINV			(0x0e <<  7)
59 #define MANTIS_TOP_DEBUGSEL		(0x07 <<  4)
60 #define MANTIS_PCMCIA_DEBUGSEL		(0x0f <<  0)
61 
62 #define MANTIS_RISC_START		0x10
63 #define MANTIS_RISC_PC			0x14
64 
65 /* I2C */
66 #define MANTIS_I2CDATA_CTL		0x18
67 #define MANTIS_I2C_RATE_1		(0x00 <<  6)
68 #define MANTIS_I2C_RATE_2		(0x01 <<  6)
69 #define MANTIS_I2C_RATE_3		(0x02 <<  6)
70 #define MANTIS_I2C_RATE_4		(0x03 <<  6)
71 #define MANTIS_I2C_STOP			BIT(5)
72 #define MANTIS_I2C_PGMODE		BIT(3)
73 
74 /* DATA */
75 #define MANTIS_CMD_DATA_R1		0x20
76 #define MANTIS_CMD_DATA_3		(0xff << 24)
77 #define MANTIS_CMD_DATA_2		(0xff << 16)
78 #define MANTIS_CMD_DATA_1		(0xff <<  8)
79 #define MANTIS_CMD_DATA_0		(0xff <<  0)
80 
81 #define MANTIS_CMD_DATA_R2		0x24
82 #define MANTIS_CMD_DATA_7		(0xff << 24)
83 #define MANTIS_CMD_DATA_6		(0xff << 16)
84 #define MANTIS_CMD_DATA_5		(0xff <<  8)
85 #define MANTIS_CMD_DATA_4		(0xff <<  0)
86 
87 #define MANTIS_CONTROL			0x28
88 #define MANTIS_DET			BIT(7)
89 #define MANTIS_DAT_CF_EN		BIT(6)
90 #define MANTIS_ACS			(0x03 <<  4)
91 #define MANTIS_VCCEN			BIT(3)
92 #define MANTIS_BYPASS			BIT(2)
93 #define MANTIS_MRST			BIT(1)
94 #define MANTIS_CRST_INT			BIT(0)
95 
96 #define MANTIS_GPIF_CFGSLA		0x84
97 #define MANTIS_GPIF_WAITSMPL		(0x07 << 28)
98 #define MANTIS_GPIF_BYTEADDRSUB		BIT(25)
99 #define MANTIS_GPIF_WAITPOL		BIT(24)
100 #define MANTIS_GPIF_NCDELAY		(0x07 << 20)
101 #define MANTIS_GPIF_RW2CSDELAY		(0x07 << 16)
102 #define MANTIS_GPIF_SLFTIMEDMODE	BIT(15)
103 #define MANTIS_GPIF_SLFTIMEDDELY	(0x7f <<  8)
104 #define MANTIS_GPIF_DEVTYPE		(0x07 <<  4)
105 #define MANTIS_GPIF_BIGENDIAN		BIT(3)
106 #define MANTIS_GPIF_FETCHCMD		(0x03 <<  1)
107 #define MANTIS_GPIF_HWORDDEV		BIT(0)
108 
109 #define MANTIS_GPIF_WSTOPER		0x90
110 #define MANTIS_GPIF_WSTOPERWREN3	BIT(31)
111 #define MANTIS_GPIF_PARBOOTN		BIT(29)
112 #define MANTIS_GPIF_WSTOPERSLID3	(0x1f << 24)
113 #define MANTIS_GPIF_WSTOPERWREN2	BIT(23)
114 #define MANTIS_GPIF_WSTOPERSLID2	(0x1f << 16)
115 #define MANTIS_GPIF_WSTOPERWREN1	BIT(15)
116 #define MANTIS_GPIF_WSTOPERSLID1	(0x1f <<  8)
117 #define MANTIS_GPIF_WSTOPERWREN0	BIT(7)
118 #define MANTIS_GPIF_WSTOPERSLID0	(0x1f <<  0)
119 
120 #define MANTIS_GPIF_CS2RW		0x94
121 #define MANTIS_GPIF_CS2RWWREN3		BIT(31)
122 #define MANTIS_GPIF_CS2RWDELY3		(0x3f << 24)
123 #define MANTIS_GPIF_CS2RWWREN2		BIT(23)
124 #define MANTIS_GPIF_CS2RWDELY2		(0x3f << 16)
125 #define MANTIS_GPIF_CS2RWWREN1		BIT(15)
126 #define MANTIS_GPIF_CS2RWDELY1		(0x3f <<  8)
127 #define MANTIS_GPIF_CS2RWWREN0		BIT(7)
128 #define MANTIS_GPIF_CS2RWDELY0		(0x3f <<  0)
129 
130 #define MANTIS_GPIF_IRQCFG		0x98
131 #define MANTIS_GPIF_IRQPOL		BIT(8)
132 #define MANTIS_MASK_WRACK		BIT(7)
133 #define MANTIS_MASK_BRRDY		BIT(6)
134 #define MANTIS_MASK_OVFLW		BIT(5)
135 #define MANTIS_MASK_OTHERR		BIT(4)
136 #define MANTIS_MASK_WSTO		BIT(3)
137 #define MANTIS_MASK_EXTIRQ		BIT(2)
138 #define MANTIS_MASK_PLUGIN		BIT(1)
139 #define MANTIS_MASK_PLUGOUT		BIT(0)
140 
141 #define MANTIS_GPIF_STATUS		0x9c
142 #define MANTIS_SBUF_KILLOP		BIT(15)
143 #define MANTIS_SBUF_OPDONE		BIT(14)
144 #define MANTIS_SBUF_EMPTY		BIT(13)
145 #define MANTIS_GPIF_DETSTAT		BIT(9)
146 #define MANTIS_GPIF_INTSTAT		BIT(8)
147 #define MANTIS_GPIF_WRACK		BIT(7)
148 #define MANTIS_GPIF_BRRDY		BIT(6)
149 #define MANTIS_SBUF_OVFLW		BIT(5)
150 #define MANTIS_GPIF_OTHERR		BIT(4)
151 #define MANTIS_SBUF_WSTO		BIT(3)
152 #define MANTIS_GPIF_EXTIRQ		BIT(2)
153 #define MANTIS_CARD_PLUGIN		BIT(1)
154 #define MANTIS_CARD_PLUGOUT		BIT(0)
155 
156 #define MANTIS_GPIF_BRADDR		0xa0
157 #define MANTIS_GPIF_PCMCIAREG		BIT(27)
158 #define MANTIS_GPIF_PCMCIAIOM		BIT(26)
159 #define MANTIS_GPIF_BR_ADDR		(0xfffffff	<<  0)
160 
161 #define MANTIS_GPIF_BRBYTES		0xa4
162 #define MANTIS_GPIF_BRCNT		(0xfff		<<  0)
163 
164 #define MANTIS_PCMCIA_RESET		0xa8
165 #define MANTIS_PCMCIA_RSTVAL		(0xff << 0)
166 
167 #define MANTIS_CARD_RESET		0xac
168 
169 #define MANTIS_GPIF_ADDR		0xb0
170 #define MANTIS_GPIF_HIFRDWRN		BIT(31)
171 #define MANTIS_GPIF_PCMCIAREG		BIT(27)
172 #define MANTIS_GPIF_PCMCIAIOM		BIT(26)
173 #define MANTIS_GPIF_HIFADDR		(0xfffffff	<<  0)
174 
175 #define MANTIS_GPIF_DOUT		0xb4
176 #define MANTIS_GPIF_HIFDOUT		(0xfffffff	<<  0)
177 
178 #define MANTIS_GPIF_DIN			0xb8
179 #define MANTIS_GPIF_HIFDIN		(0xfffffff	<<  0)
180 
181 #define MANTIS_GPIF_SPARE		0xbc
182 #define MANTIS_GPIF_LOGICRD		(0xffff		<< 16)
183 #define MANTIS_GPIF_LOGICRW		(0xffff		<<  0)
184 
185 #endif /* __MANTIS_REG_H */
186