Commit 6a429be8 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] strip out PCI cruft from i82365 driver

From: David Hinds <dhinds@sonic.net>

This removes dead PCI-related code from the i82365 driver.
parent d3444889
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pci.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
...@@ -188,10 +187,6 @@ static struct timer_list poll_timer; ...@@ -188,10 +187,6 @@ static struct timer_list poll_timer;
/*====================================================================*/ /*====================================================================*/
/* Default settings for PCI command configuration register */
#define CMD_DFLT (PCI_COMMAND_IO|PCI_COMMAND_MEMORY| \
PCI_COMMAND_MASTER|PCI_COMMAND_WAIT)
/* These definitions must match the pcic table! */ /* These definitions must match the pcic table! */
typedef enum pcic_id { typedef enum pcic_id {
IS_I82365A, IS_I82365B, IS_I82365DF, IS_I82365A, IS_I82365B, IS_I82365DF,
...@@ -202,15 +197,10 @@ typedef enum pcic_id { ...@@ -202,15 +197,10 @@ typedef enum pcic_id {
/* Flags for classifying groups of controllers */ /* Flags for classifying groups of controllers */
#define IS_VADEM 0x0001 #define IS_VADEM 0x0001
#define IS_CIRRUS 0x0002 #define IS_CIRRUS 0x0002
#define IS_TI 0x0004
#define IS_O2MICRO 0x0008
#define IS_VIA 0x0010 #define IS_VIA 0x0010
#define IS_TOPIC 0x0020
#define IS_RICOH 0x0040
#define IS_UNKNOWN 0x0400 #define IS_UNKNOWN 0x0400
#define IS_VG_PWR 0x0800 #define IS_VG_PWR 0x0800
#define IS_DF_PWR 0x1000 #define IS_DF_PWR 0x1000
#define IS_PCI 0x2000
#define IS_ALIVE 0x8000 #define IS_ALIVE 0x8000
typedef struct pcic_t { typedef struct pcic_t {
...@@ -351,26 +341,24 @@ static u_int __init cirrus_set_opts(u_short s, char *buf) ...@@ -351,26 +341,24 @@ static u_int __init cirrus_set_opts(u_short s, char *buf)
if (has_ring == -1) has_ring = 1; if (has_ring == -1) has_ring = 1;
flip(p->misc2, PD67_MC2_IRQ15_RI, has_ring); flip(p->misc2, PD67_MC2_IRQ15_RI, has_ring);
flip(p->misc2, PD67_MC2_DYNAMIC_MODE, dynamic_mode); flip(p->misc2, PD67_MC2_DYNAMIC_MODE, dynamic_mode);
flip(p->misc2, PD67_MC2_FREQ_BYPASS, freq_bypass);
if (p->misc2 & PD67_MC2_IRQ15_RI) if (p->misc2 & PD67_MC2_IRQ15_RI)
strcat(buf, " [ring]"); strcat(buf, " [ring]");
if (p->misc2 & PD67_MC2_DYNAMIC_MODE) if (p->misc2 & PD67_MC2_DYNAMIC_MODE)
strcat(buf, " [dyn mode]"); strcat(buf, " [dyn mode]");
if (p->misc2 & PD67_MC2_FREQ_BYPASS)
strcat(buf, " [freq bypass]");
if (p->misc1 & PD67_MC1_INPACK_ENA) if (p->misc1 & PD67_MC1_INPACK_ENA)
strcat(buf, " [inpack]"); strcat(buf, " [inpack]");
if (!(t->flags & IS_PCI)) { if (p->misc2 & PD67_MC2_IRQ15_RI)
if (p->misc2 & PD67_MC2_IRQ15_RI) mask &= ~0x8000;
mask &= ~0x8000; if (has_led > 0) {
if (has_led > 0) { strcat(buf, " [led]");
strcat(buf, " [led]"); mask &= ~0x1000;
mask &= ~0x1000; }
} if (has_dma > 0) {
if (has_dma > 0) { strcat(buf, " [dma]");
strcat(buf, " [dma]"); mask &= ~0x0600;
mask &= ~0x0600;
flip(p->misc2, PD67_MC2_FREQ_BYPASS, freq_bypass);
if (p->misc2 & PD67_MC2_FREQ_BYPASS)
strcat(buf, " [freq bypass]");
}
} }
if (!(t->flags & IS_VIA)) { if (!(t->flags & IS_VIA)) {
if (setup_time >= 0) if (setup_time >= 0)
...@@ -540,7 +528,6 @@ static u_int __init test_irq(u_short sock, int irq) ...@@ -540,7 +528,6 @@ static u_int __init test_irq(u_short sock, int irq)
return (irq_hits != 1); return (irq_hits != 1);
} }
static u_int __init isa_scan(u_short sock, u_int mask0) static u_int __init isa_scan(u_short sock, u_int mask0)
{ {
u_int mask1 = 0; u_int mask1 = 0;
...@@ -585,7 +572,6 @@ static u_int __init isa_scan(u_short sock, u_int mask0) ...@@ -585,7 +572,6 @@ static u_int __init isa_scan(u_short sock, u_int mask0)
return mask1; return mask1;
} }
/*====================================================================*/ /*====================================================================*/
/* Time conversion functions */ /* Time conversion functions */
...@@ -597,7 +583,6 @@ static int to_cycles(int ns) ...@@ -597,7 +583,6 @@ static int to_cycles(int ns)
/*====================================================================*/ /*====================================================================*/
static int __init identify(u_short port, u_short sock) static int __init identify(u_short port, u_short sock)
{ {
u_char val; u_char val;
...@@ -700,7 +685,7 @@ static void __init add_socket(u_short port, int psock, int type) ...@@ -700,7 +685,7 @@ static void __init add_socket(u_short port, int psock, int type)
static void __init add_pcic(int ns, int type) static void __init add_pcic(int ns, int type)
{ {
u_int mask = 0, i, base; u_int mask = 0, i, base;
int use_pci = 0, isa_irq = 0; int isa_irq = 0;
struct i82365_socket *t = &socket[sockets-ns]; struct i82365_socket *t = &socket[sockets-ns];
base = sockets-ns; base = sockets-ns;
...@@ -721,17 +706,16 @@ static void __init add_pcic(int ns, int type) ...@@ -721,17 +706,16 @@ static void __init add_pcic(int ns, int type)
mask &= I365_MASK & set_bridge_opts(base, ns); mask &= I365_MASK & set_bridge_opts(base, ns);
/* Scan for ISA interrupts */ /* Scan for ISA interrupts */
mask = isa_scan(base, mask); mask = isa_scan(base, mask);
printk(KERN_INFO " PCI card interrupts,");
/* Poll if only two interrupts available */ /* Poll if only two interrupts available */
if (!use_pci && !poll_interval) { if (!poll_interval) {
u_int tmp = (mask & 0xff20); u_int tmp = (mask & 0xff20);
tmp = tmp & (tmp-1); tmp = tmp & (tmp-1);
if ((tmp & (tmp-1)) == 0) if ((tmp & (tmp-1)) == 0)
poll_interval = HZ; poll_interval = HZ;
} }
/* Only try an ISA cs_irq if this is the first controller */ /* Only try an ISA cs_irq if this is the first controller */
if (!use_pci && !grab_irq && (cs_irq || !poll_interval)) { if (!grab_irq && (cs_irq || !poll_interval)) {
/* Avoid irq 12 unless it is explicitly requested */ /* Avoid irq 12 unless it is explicitly requested */
u_int cs_mask = mask & ((cs_irq) ? (1<<cs_irq) : ~(1<<12)); u_int cs_mask = mask & ((cs_irq) ? (1<<cs_irq) : ~(1<<12));
for (cs_irq = 15; cs_irq > 0; cs_irq--) for (cs_irq = 15; cs_irq > 0; cs_irq--)
...@@ -745,7 +729,7 @@ static void __init add_pcic(int ns, int type) ...@@ -745,7 +729,7 @@ static void __init add_pcic(int ns, int type)
} }
} }
if (!use_pci && !isa_irq) { if (!isa_irq) {
if (poll_interval == 0) if (poll_interval == 0)
poll_interval = HZ; poll_interval = HZ;
printk(" polling interval = %d ms\n", printk(" polling interval = %d ms\n",
...@@ -763,10 +747,8 @@ static void __init add_pcic(int ns, int type) ...@@ -763,10 +747,8 @@ static void __init add_pcic(int ns, int type)
} /* add_pcic */ } /* add_pcic */
/*====================================================================*/ /*====================================================================*/
#ifdef CONFIG_PNP #ifdef CONFIG_PNP
static struct isapnp_device_id id_table[] __initdata = { static struct isapnp_device_id id_table[] __initdata = {
{ ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('P', 'N', 'P'), { ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('P', 'N', 'P'),
...@@ -832,7 +814,9 @@ static void __init isa_probe(void) ...@@ -832,7 +814,9 @@ static void __init isa_probe(void)
} }
} }
} else { } else {
for (i = 0; i < (extra_sockets ? 8 : 4); i += 2) { for (i = 0; i < 8; i += 2) {
if (sockets && !extra_sockets && (i == 4))
break;
port = i365_base + 2*(i>>2); port = i365_base + 2*(i>>2);
sock = (i & 3); sock = (i & 3);
id = identify(port, sock); id = identify(port, sock);
...@@ -856,7 +840,6 @@ static void __init isa_probe(void) ...@@ -856,7 +840,6 @@ static void __init isa_probe(void)
} }
} }
/*====================================================================*/ /*====================================================================*/
static irqreturn_t pcic_interrupt(int irq, void *dev, static irqreturn_t pcic_interrupt(int irq, void *dev,
...@@ -872,8 +855,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev, ...@@ -872,8 +855,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev,
for (j = 0; j < 20; j++) { for (j = 0; j < 20; j++) {
active = 0; active = 0;
for (i = 0; i < sockets; i++) { for (i = 0; i < sockets; i++) {
if ((socket[i].cs_irq != irq) && if (socket[i].cs_irq != irq)
(socket[i].socket.pci_irq != irq))
continue; continue;
handled = 1; handled = 1;
ISA_LOCK(i, flags); ISA_LOCK(i, flags);
...@@ -911,7 +893,6 @@ static irqreturn_t pcic_interrupt(int irq, void *dev, ...@@ -911,7 +893,6 @@ static irqreturn_t pcic_interrupt(int irq, void *dev,
static void pcic_interrupt_wrapper(u_long data) static void pcic_interrupt_wrapper(u_long data)
{ {
pcic_interrupt(0, NULL, NULL); pcic_interrupt(0, NULL, NULL);
init_timer(&poll_timer);
poll_timer.expires = jiffies + poll_interval; poll_timer.expires = jiffies + poll_interval;
add_timer(&poll_timer); add_timer(&poll_timer);
} }
...@@ -1039,7 +1020,7 @@ static int i365_set_socket(u_short sock, socket_state_t *state) ...@@ -1039,7 +1020,7 @@ static int i365_set_socket(u_short sock, socket_state_t *state)
/* IO card, RESET flag, IO interrupt */ /* IO card, RESET flag, IO interrupt */
reg = t->intr; reg = t->intr;
if (state->io_irq != t->socket.pci_irq) reg |= state->io_irq; reg |= state->io_irq;
reg |= (state->flags & SS_RESET) ? 0 : I365_PC_RESET; reg |= (state->flags & SS_RESET) ? 0 : I365_PC_RESET;
reg |= (state->flags & SS_IOCARD) ? I365_PC_IOCARD : 0; reg |= (state->flags & SS_IOCARD) ? I365_PC_IOCARD : 0;
i365_set(sock, I365_INTCTL, reg); i365_set(sock, I365_INTCTL, reg);
...@@ -1177,8 +1158,7 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem) ...@@ -1177,8 +1158,7 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem)
if ((map > 4) || (mem->card_start > 0x3ffffff) || if ((map > 4) || (mem->card_start > 0x3ffffff) ||
(mem->sys_start > mem->sys_stop) || (mem->speed > 1000)) (mem->sys_start > mem->sys_stop) || (mem->speed > 1000))
return -EINVAL; return -EINVAL;
if (!(socket[sock].flags & IS_PCI) && if ((mem->sys_start > 0xffffff) || (mem->sys_stop > 0xffffff))
((mem->sys_start > 0xffffff) || (mem->sys_stop > 0xffffff)))
return -EINVAL; return -EINVAL;
/* Turn off the window before changing anything */ /* Turn off the window before changing anything */
...@@ -1387,7 +1367,7 @@ static int __init init_i82365(void) ...@@ -1387,7 +1367,7 @@ static int __init init_i82365(void)
if (driver_register(&i82365_driver)) if (driver_register(&i82365_driver))
return -1; return -1;
printk(KERN_INFO "Intel PCIC probe: "); printk(KERN_INFO "Intel ISA PCIC probe: ");
sockets = 0; sockets = 0;
isa_probe(); isa_probe();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment