aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ioc4.h
diff options
context:
space:
mode:
authorBrent Casavant <bcasavan@sgi.com>2005-06-21 20:16:01 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 21:46:32 -0400
commitd4c477ca5448f19afaaf6c0cfd655009ea9e614d (patch)
tree75571ad144ff904afbd39b1b24766461255396ac /include/linux/ioc4.h
parente5d310b349b2cbcc0dab31139c92201f332695bb (diff)
[PATCH] ioc4: PCI bus speed detection
Several hardware features of SGI's IOC4 I/O controller chip require timing-related driver calculations dependent upon the PCI bus speed. This patch enables the core IOC4 driver code to detect the actual bus speed and store a value that can later be used by the IOC4 subdrivers as needed. Signed-off-by: Brent Casavant <bcasavan@sgi.com> Acked-by: Pat Gefre <pfg@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/ioc4.h')
-rw-r--r--include/linux/ioc4.h37
1 files changed, 30 insertions, 7 deletions
diff --git a/include/linux/ioc4.h b/include/linux/ioc4.h
index 729bfa4c4ac5..3dd18b785ebd 100644
--- a/include/linux/ioc4.h
+++ b/include/linux/ioc4.h
@@ -11,6 +11,14 @@
11 11
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13 13
14/***************
15 * Definitions *
16 ***************/
17
18/* Miscellaneous values inherent to hardware */
19
20#define IOC4_EXTINT_COUNT_DIVISOR 520 /* PCI clocks per COUNT tick */
21
14/*********************************** 22/***********************************
15 * Structures needed by subdrivers * 23 * Structures needed by subdrivers *
16 ***********************************/ 24 ***********************************/
@@ -119,19 +127,34 @@ struct ioc4_misc_regs {
119 } gppr[8]; /* Generic PIO pins */ 127 } gppr[8]; /* Generic PIO pins */
120}; 128};
121 129
122/* One of these per IOC4 130/* Masks for GPCR DIR pins */
123 * 131#define IOC4_GPCR_DIR_0 0x01 /* External interrupt output */
124 * The idd_serial_data field is present here, even though it's used 132#define IOC4_GPCR_DIR_1 0x02 /* External interrupt input */
125 * solely by the serial subdriver, because the main IOC4 module 133#define IOC4_GPCR_DIR_2 0x04
126 * properly owns pci_{get,set}_drvdata functionality. This field 134#define IOC4_GPCR_DIR_3 0x08 /* Keyboard/mouse presence */
127 * allows that subdriver to stash its own drvdata somewhere. 135#define IOC4_GPCR_DIR_4 0x10 /* Ser. port 0 xcvr select (0=232, 1=422) */
128 */ 136#define IOC4_GPCR_DIR_5 0x20 /* Ser. port 1 xcvr select (0=232, 1=422) */
137#define IOC4_GPCR_DIR_6 0x40 /* Ser. port 2 xcvr select (0=232, 1=422) */
138#define IOC4_GPCR_DIR_7 0x80 /* Ser. port 3 xcvr select (0=232, 1=422) */
139
140/* Masks for GPCR EDGE pins */
141#define IOC4_GPCR_EDGE_0 0x01
142#define IOC4_GPCR_EDGE_1 0x02 /* External interrupt input */
143#define IOC4_GPCR_EDGE_2 0x04
144#define IOC4_GPCR_EDGE_3 0x08
145#define IOC4_GPCR_EDGE_4 0x10
146#define IOC4_GPCR_EDGE_5 0x20
147#define IOC4_GPCR_EDGE_6 0x40
148#define IOC4_GPCR_EDGE_7 0x80
149
150/* One of these per IOC4 */
129struct ioc4_driver_data { 151struct ioc4_driver_data {
130 struct list_head idd_list; 152 struct list_head idd_list;
131 unsigned long idd_bar0; 153 unsigned long idd_bar0;
132 struct pci_dev *idd_pdev; 154 struct pci_dev *idd_pdev;
133 const struct pci_device_id *idd_pci_id; 155 const struct pci_device_id *idd_pci_id;
134 struct __iomem ioc4_misc_regs *idd_misc_regs; 156 struct __iomem ioc4_misc_regs *idd_misc_regs;
157 unsigned long count_period;
135 void *idd_serial_data; 158 void *idd_serial_data;
136}; 159};
137 160