blob: 04042bbe4ba7ea729fe8114911fcb82d60229046 [file] [log] [blame]
Greg Watsonf655bf72003-06-09 21:59:27 +00001/*
2 * (C) Copyright 2000
3 * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
Stefan Reinauer6ab43fc2005-10-05 18:17:45 +000020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21 * MA 02110-1301 USA
Greg Watsonf655bf72003-06-09 21:59:27 +000022 */
23
Greg Watson1b362c42003-12-17 17:51:35 +000024#ifndef _W83C553_H
25#define _W83C553_H
26
Greg Watsonf655bf72003-06-09 21:59:27 +000027 /* winbond access routines and defines*/
28
29/* from the winbond data sheet -
30 The W83C553F SIO controller with PCI arbiter is a multi-function PCI device.
31 Function 0 is the ISA bridge, and Function 1 is the bus master IDE controller.
32*/
33
34/*ISA bridge configuration space*/
35
36#define W83C553F_VID 0x10AD
37#define W83C553F_DID 0x0565
38#define W83C553F_IDE 0x0105
39
40/* Function 0 registers */
41#define W83C553F_PCICONTR 0x40 /*pci control reg*/
42#define W83C553F_SGBAR 0x41 /*scatter/gather base address reg*/
43#define W83C553F_LBCR 0x42 /*Line Buffer Control reg*/
44#define W83C553F_IDEIRCR 0x43 /*IDE Interrupt Routing Control Reg*/
45#define W83C553F_PCIIRCR 0x44 /*PCI Interrupt Routing Control Reg*/
46#define W83C553F_BTBAR 0x46 /*BIOS Timer Base Address Register*/
47#define W83C553F_IPADCR 0x48 /*ISA to PCI Address Decoder Control Register*/
48#define W83C553F_IRADCR 0x49 /*ISA ROM Address Decoder Control Register*/
49#define W83C553F_IPMHSAR 0x4a /*ISA to PCI Memory Hole STart Address Register*/
50#define W83C553F_IPMHSR 0x4b /*ISA to PCI Memory Hols Size Register*/
51#define W83C553F_CDR 0x4c /*Clock Divisor Register*/
52#define W83C553F_CSCR 0x4d /*Chip Select Control Register*/
53#define W83C553F_ATSCR 0x4e /*AT System Control register*/
54#define W83C553F_ATBCR 0x4f /*AT Bus ControL Register*/
55#define W83C553F_IRQBEE0R 0x60 /*IRQ Break Event Enable 0 Register*/
56#define W83C553F_IRQBEE1R 0x61 /*IRQ Break Event Enable 1 Register*/
57#define W83C553F_ABEER 0x62 /*Additional Break Event Enable Register*/
58#define W83C553F_DMABEER 0x63 /*DMA Break Event Enable Register*/
59
60/* Function 1 registers */
61#define W83C553F_PIR 0x09 /*Programming Interface Register*/
62#define W83C553F_IDECSR 0x40 /*IDE Control/Status Register*/
63
64/* register bit definitions */
65#define W83C553F_IPADCR_MBE512 0x1
66#define W83C553F_IPADCR_MBE640 0x2
67#define W83C553F_IPADCR_IPATOM4 0x10
68#define W83C553F_IPADCR_IPATOM5 0x20
69#define W83C553F_IPADCR_IPATOM6 0x40
70#define W83C553F_IPADCR_IPATOM7 0x80
71
72#define W83C553F_CSCR_UBIOSCSE 0x10
73#define W83C553F_CSCR_BIOSWP 0x20
74
75#define W83C553F_IDECSR_P0EN 0x01
76#define W83C553F_IDECSR_P0F16 0x02
77#define W83C553F_IDECSR_P1EN 0x10
78#define W83C553F_IDECSR_P1F16 0x20
79#define W83C553F_IDECSR_LEGIRQ 0x800
80
81#define W83C553F_ATSCR_ISARE 0x40
82#define W83C553F_ATSCR_FERRE 0x10
83#define W83C553F_ATSCR_P92E 0x04
84#define W83C553F_ATSCR_KRCEE 0x02
85#define W83C553F_ATSCR_KGA20EE 0x01
86
87#define W83C553F_PIR_BM 0x80
88#define W83C553F_PIR_P1PROG 0x08
89#define W83C553F_PIR_P1NL 0x04
90#define W83C553F_PIR_P0PROG 0x02
91#define W83C553F_PIR_P0NL 0x01
92
93/*
94 * Interrupt controller
95 */
96#define W83C553F_PIC1_ICW1 CONFIG_ISA_IO + 0x20
97#define W83C553F_PIC1_ICW2 CONFIG_ISA_IO + 0x21
98#define W83C553F_PIC1_ICW3 CONFIG_ISA_IO + 0x21
99#define W83C553F_PIC1_ICW4 CONFIG_ISA_IO + 0x21
100#define W83C553F_PIC1_OCW1 CONFIG_ISA_IO + 0x21
101#define W83C553F_PIC1_OCW2 CONFIG_ISA_IO + 0x20
102#define W83C553F_PIC1_OCW3 CONFIG_ISA_IO + 0x20
103#define W83C553F_PIC1_ELC CONFIG_ISA_IO + 0x4D0
104#define W83C553F_PIC2_ICW1 CONFIG_ISA_IO + 0xA0
105#define W83C553F_PIC2_ICW2 CONFIG_ISA_IO + 0xA1
106#define W83C553F_PIC2_ICW3 CONFIG_ISA_IO + 0xA1
107#define W83C553F_PIC2_ICW4 CONFIG_ISA_IO + 0xA1
108#define W83C553F_PIC2_OCW1 CONFIG_ISA_IO + 0xA1
109#define W83C553F_PIC2_OCW2 CONFIG_ISA_IO + 0xA0
110#define W83C553F_PIC2_OCW3 CONFIG_ISA_IO + 0xA0
111#define W83C553F_PIC2_ELC CONFIG_ISA_IO + 0x4D1
112
113#define W83C553F_TMR1_CMOD CONFIG_ISA_IO + 0x43
114
115/*
116 * DMA controller
117 */
118#define W83C553F_DMA1 CONFIG_ISA_IO + 0x000 /* channel 0 - 3 */
119#define W83C553F_DMA2 CONFIG_ISA_IO + 0x0C0 /* channel 4 - 7 */
120
121/* command/status register bit definitions */
122
123#define W83C553F_CS_COM_DACKAL (1<<7) /* DACK# assert level */
124#define W83C553F_CS_COM_DREQSAL (1<<6) /* DREQ sense assert level */
125#define W83C553F_CS_COM_GAP (1<<4) /* group arbitration priority */
126#define W83C553F_CS_COM_CGE (1<<2) /* channel group enable */
127
128#define W83C553F_CS_STAT_CH0REQ (1<<4) /* channel 0 (4) DREQ status */
129#define W83C553F_CS_STAT_CH1REQ (1<<5) /* channel 1 (5) DREQ status */
130#define W83C553F_CS_STAT_CH2REQ (1<<6) /* channel 2 (6) DREQ status */
131#define W83C553F_CS_STAT_CH3REQ (1<<7) /* channel 3 (7) DREQ status */
132
133#define W83C553F_CS_STAT_CH0TC (1<<0) /* channel 0 (4) TC status */
134#define W83C553F_CS_STAT_CH1TC (1<<1) /* channel 1 (5) TC status */
135#define W83C553F_CS_STAT_CH2TC (1<<2) /* channel 2 (6) TC status */
136#define W83C553F_CS_STAT_CH3TC (1<<3) /* channel 3 (7) TC status */
137
138/* mode register bit definitions */
139
140#define W83C553F_MODE_TM_DEMAND (0<<6) /* transfer mode - demand */
141#define W83C553F_MODE_TM_SINGLE (1<<6) /* transfer mode - single */
142#define W83C553F_MODE_TM_BLOCK (2<<6) /* transfer mode - block */
143#define W83C553F_MODE_TM_CASCADE (3<<6) /* transfer mode - cascade */
144#define W83C553F_MODE_ADDRDEC (1<<5) /* address increment/decrement select */
145#define W83C553F_MODE_AUTOINIT (1<<4) /* autoinitialize enable */
146#define W83C553F_MODE_TT_VERIFY (0<<2) /* transfer type - verify */
147#define W83C553F_MODE_TT_WRITE (1<<2) /* transfer type - write */
148#define W83C553F_MODE_TT_READ (2<<2) /* transfer type - read */
149#define W83C553F_MODE_TT_ILLEGAL (3<<2) /* transfer type - illegal */
150#define W83C553F_MODE_CH0SEL (0<<0) /* channel 0 (4) select */
151#define W83C553F_MODE_CH1SEL (1<<0) /* channel 1 (5) select */
152#define W83C553F_MODE_CH2SEL (2<<0) /* channel 2 (6) select */
153#define W83C553F_MODE_CH3SEL (3<<0) /* channel 3 (7) select */
154
155/* request register bit definitions */
156
157#define W83C553F_REQ_CHSERREQ (1<<2) /* channel service request */
158#define W83C553F_REQ_CH0SEL (0<<0) /* channel 0 (4) select */
159#define W83C553F_REQ_CH1SEL (1<<0) /* channel 1 (5) select */
160#define W83C553F_REQ_CH2SEL (2<<0) /* channel 2 (6) select */
161#define W83C553F_REQ_CH3SEL (3<<0) /* channel 3 (7) select */
162
163/* write single mask bit register bit definitions */
164
165#define W83C553F_WSMB_CHMASKSEL (1<<2) /* channel mask select */
166#define W83C553F_WSMB_CH0SEL (0<<0) /* channel 0 (4) select */
167#define W83C553F_WSMB_CH1SEL (1<<0) /* channel 1 (5) select */
168#define W83C553F_WSMB_CH2SEL (2<<0) /* channel 2 (6) select */
169#define W83C553F_WSMB_CH3SEL (3<<0) /* channel 3 (7) select */
170
171/* read/write all mask bits register bit definitions */
172
173#define W83C553F_RWAMB_CH0MASK (1<<0) /* channel 0 (4) mask */
174#define W83C553F_RWAMB_CH1MASK (1<<1) /* channel 1 (5) mask */
175#define W83C553F_RWAMB_CH2MASK (1<<2) /* channel 2 (6) mask */
176#define W83C553F_RWAMB_CH3MASK (1<<3) /* channel 3 (7) mask */
177
178/* typedefs */
179
180#define W83C553F_DMA1_CS 0x8
181#define W83C553F_DMA1_WR 0x9
182#define W83C553F_DMA1_WSMB 0xA
183#define W83C553F_DMA1_WM 0xB
184#define W83C553F_DMA1_CBP 0xC
185#define W83C553F_DMA1_MC 0xD
186#define W83C553F_DMA1_CM 0xE
187#define W83C553F_DMA1_RWAMB 0xF
188
189#define W83C553F_DMA2_CS 0xD0
190#define W83C553F_DMA2_WR 0xD2
191#define W83C553F_DMA2_WSMB 0xD4
192#define W83C553F_DMA2_WM 0xD6
193#define W83C553F_DMA2_CBP 0xD8
194#define W83C553F_DMA2_MC 0xDA
195#define W83C553F_DMA2_CM 0xDC
196#define W83C553F_DMA2_RWAMB 0xDE
197
Greg Watson1b362c42003-12-17 17:51:35 +0000198extern struct device_operations w83c553_ops;
199
200#endif /* _W83C553_H */