* [PATCH 2.5] [0/6] EISA support updates
@ 2003-07-04 23:01 Marc Zyngier
2003-07-04 23:04 ` [PATCH 2.5] [1/6] " Marc Zyngier
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Marc Zyngier @ 2003-07-04 23:01 UTC (permalink / raw)
To: torvalds; +Cc: akpm, linux-kernel
Linus, Andrew,
The following serie of 6 patches updates the EISA support to its
latest version.
Summary :
- Now reserves I/O ranges according to EISA specs (four 256 bytes
regions instead of a single 4KB region).
- By default, do not try to probe the bus if the mainboard does not
seems to support EISA (allow this behaviour to be changed through a
command-line option).
- Use parent bridge device dma_mask as default for each discovered
device.
- Allow devices to be enabled or disabled from the kernel command line
(usefull for non-x86 platforms where the firmware simply disable
devices it doesn't know about...).
- Probe the right number of EISA slots on PA-RISC. No more, no less.
The whole thing have been tested on x86, Alpha and PA-RISC.
Please apply.
M.
--
Places change, faces change. Life is so very strange.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2.5] [1/6] EISA support updates
2003-07-04 23:01 [PATCH 2.5] [0/6] EISA support updates Marc Zyngier
@ 2003-07-04 23:04 ` Marc Zyngier
2003-07-04 23:05 ` [PATCH 2.5] [2/6] " Marc Zyngier
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Marc Zyngier @ 2003-07-04 23:04 UTC (permalink / raw)
To: torvalds, akpm, linux-kernel
Core changes :
- Now reserves I/O ranges according to EISA specs (four 256 bytes
regions instead of a single 4KB region).
- By default, do not try to probe the bus if the mainboard does not
seems to support EISA (allow this behaviour to be changed through a
command-line option).
- Use parent bridge device dma_mask as default for each discovered
device.
- Allow devices to be enabled or disabled from the kernel command line
(usefull for non-x86 platforms where the firmware simply disable
devices it doesn't know about...).
M.
diff -ruN linux-latest/drivers/eisa/eisa-bus.c linux-eisa/drivers/eisa/eisa-bus.c
--- linux-latest/drivers/eisa/eisa-bus.c 2003-07-04 09:40:00.000000000 +0200
+++ linux-eisa/drivers/eisa/eisa-bus.c 2003-07-04 09:41:28.000000000 +0200
@@ -1,7 +1,7 @@
/*
* EISA bus support functions for sysfs.
*
- * (C) 2002 Marc Zyngier <maz@wild-wind.fr.eu.org>
+ * (C) 2002, 2003 Marc Zyngier <maz@wild-wind.fr.eu.org>
*
* This code is released under the GPL version 2.
*/
@@ -10,6 +10,7 @@
#include <linux/device.h>
#include <linux/eisa.h>
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/ioport.h>
@@ -24,7 +25,7 @@
char name[DEVICE_NAME_SIZE];
};
-struct eisa_device_info __initdata eisa_table[] = {
+static struct eisa_device_info __initdata eisa_table[] = {
#ifdef CONFIG_EISA_NAMES
#include "devlist.h"
#endif
@@ -32,6 +33,30 @@
#define EISA_INFOS (sizeof (eisa_table) / (sizeof (struct eisa_device_info)))
+#define EISA_MAX_FORCED_DEV 16
+#define EISA_FORCED_OFFSET 2
+
+static int enable_dev[EISA_MAX_FORCED_DEV + EISA_FORCED_OFFSET] = { 1, EISA_MAX_FORCED_DEV, };
+static int disable_dev[EISA_MAX_FORCED_DEV + EISA_FORCED_OFFSET] = { 1, EISA_MAX_FORCED_DEV, };
+
+static int is_forced_dev (int *forced_tab,
+ struct eisa_root_device *root,
+ struct eisa_device *edev)
+{
+ int i, x;
+
+ for (i = 0; i < EISA_MAX_FORCED_DEV; i++) {
+ if (!forced_tab[EISA_FORCED_OFFSET + i])
+ return 0;
+
+ x = (root->bus_nr << 8) | edev->slot;
+ if (forced_tab[EISA_FORCED_OFFSET + i] == x)
+ return 1;
+ }
+
+ return 0;
+}
+
static void __init eisa_name_device (struct eisa_device *edev)
{
int i;
@@ -92,7 +117,8 @@
return 0;
while (strlen (eids->sig)) {
- if (!strcmp (eids->sig, edev->id.sig)) {
+ if (!strcmp (eids->sig, edev->id.sig) &&
+ edev->state & EISA_CONFIG_ENABLED) {
edev->id.driver_data = eids->driver_data;
return 1;
}
@@ -132,41 +158,160 @@
static DEVICE_ATTR(signature, S_IRUGO, eisa_show_sig, NULL);
-static int __init eisa_register_device (struct eisa_root_device *root,
- struct eisa_device *edev,
- char *sig, int slot)
+static ssize_t eisa_show_state (struct device *dev, char *buf)
+{
+ struct eisa_device *edev = to_eisa_device (dev);
+ return sprintf (buf,"%d\n", edev->state & EISA_CONFIG_ENABLED);
+}
+
+static DEVICE_ATTR(enabled, S_IRUGO, eisa_show_state, NULL);
+
+static int __init eisa_init_device (struct eisa_root_device *root,
+ struct eisa_device *edev,
+ int slot)
{
+ char *sig;
+ unsigned long sig_addr;
+ int i;
+
+ sig_addr = SLOT_ADDRESS (root, slot) + EISA_VENDOR_ID_OFFSET;
+
+ if (!(sig = decode_eisa_sig (sig_addr)))
+ return -1; /* No EISA device here */
+
memcpy (edev->id.sig, sig, EISA_SIG_LEN);
edev->slot = slot;
+ edev->state = inb (SLOT_ADDRESS (root, slot) + EISA_CONFIG_OFFSET) & EISA_CONFIG_ENABLED;
edev->base_addr = SLOT_ADDRESS (root, slot);
- edev->dma_mask = 0xffffffff; /* Default DMA mask */
+ edev->dma_mask = root->dma_mask; /* Default DMA mask */
eisa_name_device (edev);
edev->dev.parent = root->dev;
edev->dev.bus = &eisa_bus_type;
edev->dev.dma_mask = &edev->dma_mask;
sprintf (edev->dev.bus_id, "%02X:%02X", root->bus_nr, slot);
- edev->res.name = edev->dev.name;
+ for (i = 0; i < EISA_MAX_RESOURCES; i++)
+ edev->res[i].name = edev->dev.name;
+
+ if (is_forced_dev (enable_dev, root, edev))
+ edev->state = EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED;
+
+ if (is_forced_dev (disable_dev, root, edev))
+ edev->state = EISA_CONFIG_FORCED;
+
+ return 0;
+}
+static int __init eisa_register_device (struct eisa_device *edev)
+{
if (device_register (&edev->dev))
return -1;
device_create_file (&edev->dev, &dev_attr_signature);
+ device_create_file (&edev->dev, &dev_attr_enabled);
+
+ return 0;
+}
+
+static int __init eisa_request_resources (struct eisa_root_device *root,
+ struct eisa_device *edev,
+ int slot)
+{
+ int i;
+
+ for (i = 0; i < EISA_MAX_RESOURCES; i++) {
+ /* Don't register resource for slot 0, since this is
+ * very likely to fail... :-( Instead, grab the EISA
+ * id, now we can display something in /proc/ioports.
+ */
+
+ /* Only one region for mainboard */
+ if (!slot && i > 0) {
+ edev->res[i].start = edev->res[i].end = 0;
+ continue;
+ }
+
+ if (slot) {
+ edev->res[i].name = NULL;
+ edev->res[i].start = SLOT_ADDRESS (root, slot) + (i * 0x400);
+ edev->res[i].end = edev->res[i].start + 0xff;
+ edev->res[i].flags = IORESOURCE_IO;
+ } else {
+ edev->res[i].name = NULL;
+ edev->res[i].start = SLOT_ADDRESS (root, slot) + EISA_VENDOR_ID_OFFSET;
+ edev->res[i].end = edev->res[i].start + 3;
+ edev->res[i].flags = IORESOURCE_BUSY;
+ }
+
+ if (request_resource (root->res, &edev->res[i]))
+ goto failed;
+ }
return 0;
+
+ failed:
+ while (--i >= 0)
+ release_resource (&edev->res[i]);
+
+ return -1;
+}
+
+static void __init eisa_release_resources (struct eisa_device *edev)
+{
+ int i;
+
+ for (i = 0; i < EISA_MAX_RESOURCES; i++)
+ if (edev->res[i].start || edev->res[i].end)
+ release_resource (&edev->res[i]);
}
static int __init eisa_probe (struct eisa_root_device *root)
{
int i, c;
- char *str;
- unsigned long sig_addr;
struct eisa_device *edev;
printk (KERN_INFO "EISA: Probing bus %d at %s\n",
root->bus_nr, root->dev->name);
+
+ /* First try to get hold of slot 0. If there is no device
+ * here, simply fail, unless root->force_probe is set. */
+
+ if (!(edev = kmalloc (sizeof (*edev), GFP_KERNEL))) {
+ printk (KERN_ERR "EISA: Couldn't allocate mainboard slot\n");
+ return -ENOMEM;
+ }
+
+ memset (edev, 0, sizeof (*edev));
+
+ if (eisa_request_resources (root, edev, 0)) {
+ printk (KERN_WARNING \
+ "EISA: Cannot allocate resource for mainboard\n");
+ kfree (edev);
+ if (!root->force_probe)
+ return -EBUSY;
+ goto force_probe;
+ }
+
+ if (eisa_init_device (root, edev, 0)) {
+ eisa_release_resources (edev);
+ kfree (edev);
+ if (!root->force_probe)
+ return -ENODEV;
+ goto force_probe;
+ }
+
+ printk (KERN_INFO "EISA: Mainboard %s detected.\n", edev->id.sig);
+
+ if (eisa_register_device (edev)) {
+ printk (KERN_ERR "EISA: Failed to register %s\n",
+ edev->id.sig);
+ eisa_release_resources (edev);
+ kfree (edev);
+ }
- for (c = 0, i = 0; i <= root->slots; i++) {
+ force_probe:
+
+ for (c = 0, i = 1; i <= root->slots; i++) {
if (!(edev = kmalloc (sizeof (*edev), GFP_KERNEL))) {
printk (KERN_ERR "EISA: Out of memory for slot %d\n",
i);
@@ -175,24 +320,7 @@
memset (edev, 0, sizeof (*edev));
- /* Don't register resource for slot 0, since this is
- * very likely to fail... :-( Instead, grab the EISA
- * id, now we can display something in /proc/ioports.
- */
-
- if (i) {
- edev->res.name = NULL;
- edev->res.start = SLOT_ADDRESS (root, i);
- edev->res.end = edev->res.start + 0xfff;
- edev->res.flags = IORESOURCE_IO;
- } else {
- edev->res.name = NULL;
- edev->res.start = SLOT_ADDRESS (root, i) + EISA_VENDOR_ID_OFFSET;
- edev->res.end = edev->res.start + 3;
- edev->res.flags = IORESOURCE_BUSY;
- }
-
- if (request_resource (root->res, &edev->res)) {
+ if (eisa_request_resources (root, edev, i)) {
printk (KERN_WARNING \
"Cannot allocate resource for EISA slot %d\n",
i);
@@ -200,30 +328,41 @@
continue;
}
- sig_addr = SLOT_ADDRESS (root, i) + EISA_VENDOR_ID_OFFSET;
-
- if (!(str = decode_eisa_sig (sig_addr))) {
- release_resource (&edev->res);
+ if (eisa_init_device (root, edev, i)) {
+ eisa_release_resources (edev);
kfree (edev);
continue;
}
- if (!i)
- printk (KERN_INFO "EISA: Motherboard %s detected\n",
- str);
- else {
- printk (KERN_INFO "EISA: slot %d : %s detected.\n",
- i, str);
-
- c++;
+ printk (KERN_INFO "EISA: slot %d : %s detected",
+ i, edev->id.sig);
+
+ switch (edev->state) {
+ case EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED:
+ printk (" (forced enabled)");
+ break;
+
+ case EISA_CONFIG_FORCED:
+ printk (" (forced disabled)");
+ break;
+
+ case 0:
+ printk (" (disabled)");
+ break;
}
+
+ printk (".\n");
+
+ c++;
- if (eisa_register_device (root, edev, str, i)) {
- printk (KERN_ERR "EISA: Failed to register %s\n", str);
- release_resource (&edev->res);
+ if (eisa_register_device (edev)) {
+ printk (KERN_ERR "EISA: Failed to register %s\n",
+ edev->id.sig);
+ eisa_release_resources (edev);
kfree (edev);
}
}
+
printk (KERN_INFO "EISA: Detected %d card%s.\n", c, c == 1 ? "" : "s");
return 0;
@@ -274,6 +413,13 @@
return 0;
}
+/* Couldn't use intarray with checking on... :-( */
+#undef param_check_intarray
+#define param_check_intarray(name, p)
+
+module_param(enable_dev, intarray, 0444);
+module_param(disable_dev, intarray, 0444);
+
postcore_initcall (eisa_init);
EXPORT_SYMBOL (eisa_bus_type);
diff -ruN linux-latest/include/linux/eisa.h linux-eisa/include/linux/eisa.h
--- linux-latest/include/linux/eisa.h 2003-07-04 09:44:00.000000000 +0200
+++ linux-eisa/include/linux/eisa.h 2003-07-04 09:46:02.000000000 +0200
@@ -4,6 +4,8 @@
#define EISA_SIG_LEN 8
#define EISA_MAX_SLOTS 8
+#define EISA_MAX_RESOURCES 4
+
/* A few EISA constants/offsets... */
#define EISA_DMA1_STATUS 8
@@ -17,6 +19,10 @@
#define EISA_INT1_EDGE_LEVEL 0x4D0
#define EISA_INT2_EDGE_LEVEL 0x4D1
#define EISA_VENDOR_ID_OFFSET 0xC80
+#define EISA_CONFIG_OFFSET 0xC84
+
+#define EISA_CONFIG_ENABLED 1
+#define EISA_CONFIG_FORCED 2
/* The EISA signature, in ASCII form, null terminated */
struct eisa_device_id {
@@ -26,19 +32,28 @@
/* There is not much we can say about an EISA device, apart from
* signature, slot number, and base address. dma_mask is set by
- * default to 32 bits.*/
+ * default to parent device mask..*/
struct eisa_device {
struct eisa_device_id id;
int slot;
+ int state;
unsigned long base_addr;
- struct resource res;
+ struct resource res[EISA_MAX_RESOURCES];
u64 dma_mask;
struct device dev; /* generic device */
};
#define to_eisa_device(n) container_of(n, struct eisa_device, dev)
+static inline int eisa_get_region_index (void *addr)
+{
+ unsigned long x = (unsigned long) addr;
+
+ x &= 0xc00;
+ return (x >> 12);
+}
+
struct eisa_driver {
const struct eisa_device_id *id_table;
struct device_driver driver;
@@ -69,6 +84,8 @@
struct resource *res;
unsigned long bus_base_addr;
int slots; /* Max slot number */
+ int force_probe; /* Probe even when no slot 0 */
+ u64 dma_mask; /* from bridge device */
int bus_nr; /* Set by eisa_root_register */
struct resource eisa_root_res; /* ditto */
};
--
Places change, faces change. Life is so very strange.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2.5] [2/6] EISA support updates
2003-07-04 23:01 [PATCH 2.5] [0/6] EISA support updates Marc Zyngier
2003-07-04 23:04 ` [PATCH 2.5] [1/6] " Marc Zyngier
@ 2003-07-04 23:05 ` Marc Zyngier
2003-07-04 23:06 ` [PATCH 2.5] [3/6] " Marc Zyngier
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Marc Zyngier @ 2003-07-04 23:05 UTC (permalink / raw)
To: torvalds, akpm, linux-kernel
Documentation update.
M.
diff -ruN linux-latest/Documentation/eisa.txt linux-eisa/Documentation/eisa.txt
--- linux-latest/Documentation/eisa.txt 2003-07-04 09:42:45.000000000 +0200
+++ linux-eisa/Documentation/eisa.txt 2003-07-04 09:44:46.000000000 +0200
@@ -46,12 +46,14 @@
to this device, as well as some parameters for probing purposes.
struct eisa_root_device {
- struct list_head node;
- struct device *dev; /* Pointer to bridge device */
- struct resource *res;
- unsigned long bus_base_addr;
- int slots; /* Max slot number */
- int bus_nr; /* Set by eisa_root_register */
+ struct device *dev; /* Pointer to bridge device */
+ struct resource *res;
+ unsigned long bus_base_addr;
+ int slots; /* Max slot number */
+ int force_probe; /* Probe even when no slot 0 */
+ u64 dma_mask; /* from bridge device */
+ int bus_nr; /* Set by eisa_root_register */
+ struct resource eisa_root_res; /* ditto */
};
node : used for eisa_root_register internal purpose
@@ -59,6 +61,8 @@
res : root device I/O resource
bus_base_addr : slot 0 address on this bus
slots : max slot number to probe
+force_probe : Probe even when slot 0 is empty (no EISA mainboard)
+dma_mask : Default DMA mask. Usualy the bridge device dma_mask.
bus_nr : unique bus id, set by eisa_root_register
** Driver :
@@ -87,7 +91,7 @@
Documentation/driver-model/driver.txt. Only .name,
.probe and .remove members are mandatory.
-An example is the 3c509 driver :
+An example is the 3c59x driver :
static struct eisa_device_id vortex_eisa_ids[] = {
{ "TCM5920", EISA_3C592_OFFSET },
@@ -116,15 +120,20 @@
struct eisa_device {
struct eisa_device_id id;
int slot;
- unsigned long base_addr;
- struct resource res;
+ int state;
+ unsigned long base_addr;
+ struct resource res[EISA_MAX_RESOURCES];
+ u64 dma_mask;
struct device dev; /* generic device */
};
id : EISA id, as read from device. id.driver_data is set from the
matching driver EISA id.
slot : slot number which the device was detected on
-res : I/O resource allocated to this device
+state : set of flags indicating the state of the device. Current
+ flags are EISA_CONFIG_ENABLED and EISA_CONFIG_FORCED.
+res : set of four 256 bytes I/O regions allocated to this device
+dma_mask: DMA mask set from the parent device.
dev : generic device (see Documentation/driver-model/device.txt)
You can get the 'struct eisa_device' from 'struct device' using the
@@ -140,6 +149,32 @@
Gets the pointer previously stored into the device's driver_data area.
+int eisa_get_region_index (void *addr);
+
+Returns the region number (0 <= x < EISA_MAX_RESOURCES) of a given
+address.
+
+** Kernel parameters :
+
+eisa_bus.enable_dev :
+
+A comma-separated list of slots to be enabled, even if the firmware
+set the card as disabled. The driver must be able to properly
+initialize the device in such conditions.
+
+eisa_bus.disable_dev :
+
+A comma-separated list of slots to be enabled, even if the firmware
+set the card as enabled. The driver won't be called to handle this
+device.
+
+virtual_root.force_probe :
+
+Force the probing code to probe EISA slots even when it cannot find an
+EISA compliant mainboard (nothing appears on slot 0). Defaultd to 0
+(don't force), and set to 1 (force probing) when either
+CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set.
+
** Random notes :
Converting an EISA driver to the new API mostly involves *deleting*
@@ -156,10 +191,13 @@
expect to have explored the whole machine when they exit their probe
routine.
+For example, switching your favorite EISA SCSI card to the "hotplug"
+model is "the right thing"(tm).
+
** Thanks :
I'd like to thank the following people for their help :
- Xavier Benigni for lending me a wonderful Alpha Jensen,
- James Bottomley, Jeff Garzik for getting this stuff into the kernel,
- Andries Brouwer for contributing numerous EISA ids,
-- Catrin Jones for coping with too many machines at home
+- Catrin Jones for coping with far too many machines at home.
--
Places change, faces change. Life is so very strange.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2.5] [3/6] EISA support updates
2003-07-04 23:01 [PATCH 2.5] [0/6] EISA support updates Marc Zyngier
2003-07-04 23:04 ` [PATCH 2.5] [1/6] " Marc Zyngier
2003-07-04 23:05 ` [PATCH 2.5] [2/6] " Marc Zyngier
@ 2003-07-04 23:06 ` Marc Zyngier
2003-07-04 23:07 ` [PATCH 2.5] [4/6] " Marc Zyngier
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Marc Zyngier @ 2003-07-04 23:06 UTC (permalink / raw)
To: torvalds, akpm, linux-kernel
More EISA ids.
M.
diff -ruN linux-latest/drivers/eisa/eisa.ids linux-eisa/drivers/eisa/eisa.ids
--- linux-latest/drivers/eisa/eisa.ids 2003-07-04 09:38:32.000000000 +0200
+++ linux-eisa/drivers/eisa/eisa.ids 2003-07-04 09:39:32.000000000 +0200
@@ -504,6 +504,7 @@
DTK0003 "DTK PLM-3331P EISACACHE486 33/25/50 MHZ"
ECS0580 "DI-580A EISA SCSI Host Adapter"
ECS0590 "DI-590 EISA SCSI Cache Host Adapter"
+EGL0101 "Eagle Technology EP3210 EtherXpert EISA Adapter"
ELS8041 "ELSA WINNER 1000 Enhanced VGA"
ETI1001 "NE3300 Ethernet Rev. C & D"
EVX0002 "PN-3000 System Board"
@@ -515,6 +516,9 @@
FSI2001 "ESA-200 ATM"
FSI2002 "ESA-200A ATM"
FSI2003 "ESA-200E ATM"
+GCI0101 "Gateway G/Ethernet 32EB -- 32-Bit EISA Bus Master Ethernet Adpater"
+GCI0102 "Gateway G/Ethernet 32EB -- 32-Bit EISA Bus Master Ethernet Adapter"
+GCI0103 "Gateway G/Ethernet 32EB -- 32-Bit EISA Bus Master Ethernet Adapter"
GDT2001 "GDT2000/GDT2020 Fast-SCSI Cache Controller - Rev. 1.0"
GDT3001 "GDT3000/GDT3020 Dual Channel SCSI Controller - Rev. 1.0"
GDT3002 "GDT30x0A Cache Controller"
@@ -1138,12 +1142,14 @@
NON0601 "c't Universal 8-Bit Adapter"
NSS0011 "Newport Systems Solutions WNIC Adapter"
NVL0701 "Novell NE3200 Bus Master Ethernet"
+NVL0702 "Novell NE3200T Bus Master Ethernet"
NVL0901 "Novell NE2100 Ethernet/Cheapernet Adapter"
NVL1001 "Novell NMSL (Netware Mirrored Server Link)"
NVL1201 "Novell NE32HUB 32-bit Base EISA Adapter"
NVL1301 "Novell NE32HUB 32-bit TPE EISA Adapter"
NVL1401 "Novell NE32HUB PME ISA Adapter"
NVL1501 "Novell NE2000PLUS Ethernet Adapter"
+NVL1801 "Eagle Technology NE3210 EISA Ethernet LAN Adapter"
OLC0701 "Olicom ISA 16/4 Token-Ring Network Adapter"
OLC0702 "Olicom OC-3117, ISA 16/4 Adapter (NIC)"
OLC0801 "OC-3118 Olicom ISA 16/4 Token-Ring Network Adapter"
--
Places change, faces change. Life is so very strange.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2.5] [4/6] EISA support updates
2003-07-04 23:01 [PATCH 2.5] [0/6] EISA support updates Marc Zyngier
` (2 preceding siblings ...)
2003-07-04 23:06 ` [PATCH 2.5] [3/6] " Marc Zyngier
@ 2003-07-04 23:07 ` Marc Zyngier
2003-07-04 23:09 ` [PATCH 2.5] [5/6] " Marc Zyngier
2003-07-04 23:10 ` [PATCH 2.5] [6/6] " Marc Zyngier
5 siblings, 0 replies; 7+ messages in thread
From: Marc Zyngier @ 2003-07-04 23:07 UTC (permalink / raw)
To: torvalds, akpm, linux-kernel
PA-RISC changes :
- Probe the right number of EISA slots on PA-RISC. No more, no less.
M.
diff -ruN linux-latest/drivers/parisc/eisa.c linux-eisa/drivers/parisc/eisa.c
--- linux-latest/drivers/parisc/eisa.c 2003-07-04 09:38:48.000000000 +0200
+++ linux-eisa/drivers/parisc/eisa.c 2003-07-04 09:39:46.000000000 +0200
@@ -378,19 +378,21 @@
}
}
eisa_eeprom_init(eisa_dev.eeprom_addr);
- eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space, &eisa_dev.hba.lmmio_space);
+ result = eisa_enumerator(eisa_dev.eeprom_addr, &eisa_dev.hba.io_space, &eisa_dev.hba.lmmio_space);
init_eisa_pic();
- /* FIXME : Get the number of slots from the enumerator, not a
- * hadcoded value. Also don't enumerate the bus twice. */
- eisa_dev.root.dev = &dev->dev;
- dev->dev.driver_data = &eisa_dev.root;
- eisa_dev.root.bus_base_addr = 0;
- eisa_dev.root.res = &eisa_dev.hba.io_space;
- eisa_dev.root.slots = EISA_MAX_SLOTS;
- if (eisa_root_register (&eisa_dev.root)) {
- printk(KERN_ERR "EISA: Failed to register EISA root\n");
- return -1;
+ if (result >= 0) {
+ /* FIXME : Don't enumerate the bus twice. */
+ eisa_dev.root.dev = &dev->dev;
+ dev->dev.driver_data = &eisa_dev.root;
+ eisa_dev.root.bus_base_addr = 0;
+ eisa_dev.root.res = &eisa_dev.hba.io_space;
+ eisa_dev.root.slots = result;
+ eisa_dev.root.dma_mask = 0xffffffff; /* wild guess */
+ if (eisa_root_register (&eisa_dev.root)) {
+ printk(KERN_ERR "EISA: Failed to register EISA root\n");
+ return -1;
+ }
}
return 0;
diff -ruN linux-latest/drivers/parisc/eisa_enumerator.c linux-eisa/drivers/parisc/eisa_enumerator.c
--- linux-latest/drivers/parisc/eisa_enumerator.c 2003-07-04 09:39:09.000000000 +0200
+++ linux-eisa/drivers/parisc/eisa_enumerator.c 2003-07-04 09:40:06.000000000 +0200
@@ -438,6 +438,10 @@
id = le32_to_cpu(inl(SLOT2PORT(slot)+EPI));
if (0xffffffff == id) {
+ /* Maybe we didn't expect a card to be here... */
+ if (es->eisa_slot_id == 0xffffffff)
+ return -1;
+
/* this board is not here or it does not
* support readid
*/
@@ -499,8 +503,7 @@
(&eeprom_buf[HPEE_SLOT_INFO(i)]);
if (-1==init_slot(i+1, es)) {
- return -1;
-
+ continue;
}
if (es->config_data_offset < HPEE_MAX_LENGTH) {
@@ -513,6 +516,6 @@
return -1;
}
}
- return 0;
+ return eh->num_slots;
}
--
Places change, faces change. Life is so very strange.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2.5] [5/6] EISA support updates
2003-07-04 23:01 [PATCH 2.5] [0/6] EISA support updates Marc Zyngier
` (3 preceding siblings ...)
2003-07-04 23:07 ` [PATCH 2.5] [4/6] " Marc Zyngier
@ 2003-07-04 23:09 ` Marc Zyngier
2003-07-04 23:10 ` [PATCH 2.5] [6/6] " Marc Zyngier
5 siblings, 0 replies; 7+ messages in thread
From: Marc Zyngier @ 2003-07-04 23:09 UTC (permalink / raw)
To: torvalds, akpm, linux-kernel
PCI-EISA bridge :
- Use parent bridge device dma_mask as default for each discovered
device.
M.
diff -ruN linux-latest/drivers/eisa/pci_eisa.c linux-eisa/drivers/eisa/pci_eisa.c
--- linux-latest/drivers/eisa/pci_eisa.c 2003-07-04 09:39:31.000000000 +0200
+++ linux-eisa/drivers/eisa/pci_eisa.c 2003-07-04 09:40:43.000000000 +0200
@@ -20,7 +20,7 @@
static struct eisa_root_device pci_eisa_root;
static int __devinit pci_eisa_init (struct pci_dev *pdev,
- const struct pci_device_id *ent)
+ const struct pci_device_id *ent)
{
int rc;
@@ -35,6 +35,7 @@
pci_eisa_root.res = pdev->bus->resource[0];
pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start;
pci_eisa_root.slots = EISA_MAX_SLOTS;
+ pci_eisa_root.dma_mask = pdev->dma_mask;
if (eisa_root_register (&pci_eisa_root)) {
printk (KERN_ERR "pci_eisa : Could not register EISA root\n");
--
Places change, faces change. Life is so very strange.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2.5] [6/6] EISA support updates
2003-07-04 23:01 [PATCH 2.5] [0/6] EISA support updates Marc Zyngier
` (4 preceding siblings ...)
2003-07-04 23:09 ` [PATCH 2.5] [5/6] " Marc Zyngier
@ 2003-07-04 23:10 ` Marc Zyngier
5 siblings, 0 replies; 7+ messages in thread
From: Marc Zyngier @ 2003-07-04 23:10 UTC (permalink / raw)
To: torvalds, akpm, linux-kernel
Virtual root :
- By default, do not try to probe the bus if the mainboard does not
seems to support EISA (allow this behaviour to be changed through a
command-line option).
M.
diff -ruN linux-latest/drivers/eisa/virtual_root.c linux-eisa/drivers/eisa/virtual_root.c
--- linux-latest/drivers/eisa/virtual_root.c 2003-07-04 09:43:35.000000000 +0200
+++ linux-eisa/drivers/eisa/virtual_root.c 2003-07-04 09:45:31.000000000 +0200
@@ -7,12 +7,22 @@
* This code is released under the GPL version 2.
*/
+#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/eisa.h>
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/init.h>
+#if defined(CONFIG_ALPHA_JENSEN) || defined(CONFIG_EISA_VLB_PRIMING)
+#define EISA_FORCE_PROBE_DEFAULT 1
+#else
+#define EISA_FORCE_PROBE_DEFAULT 0
+#endif
+
+static int force_probe = EISA_FORCE_PROBE_DEFAULT;
+
/* The default EISA device parent (virtual root device).
* Now use a platform device, since that's the obvious choice. */
@@ -29,6 +39,7 @@
.bus_base_addr = 0,
.res = &ioport_resource,
.slots = EISA_MAX_SLOTS,
+ .dma_mask = 0xffffffff,
};
static int virtual_eisa_root_init (void)
@@ -39,6 +50,8 @@
return r;
}
+ eisa_bus_root.force_probe = force_probe;
+
eisa_root_dev.dev.driver_data = &eisa_bus_root;
if (eisa_root_register (&eisa_bus_root)) {
@@ -51,4 +64,6 @@
return 0;
}
+module_param (force_probe, int, 0444);
+
device_initcall (virtual_eisa_root_init);
--
Places change, faces change. Life is so very strange.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-07-04 23:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-04 23:01 [PATCH 2.5] [0/6] EISA support updates Marc Zyngier
2003-07-04 23:04 ` [PATCH 2.5] [1/6] " Marc Zyngier
2003-07-04 23:05 ` [PATCH 2.5] [2/6] " Marc Zyngier
2003-07-04 23:06 ` [PATCH 2.5] [3/6] " Marc Zyngier
2003-07-04 23:07 ` [PATCH 2.5] [4/6] " Marc Zyngier
2003-07-04 23:09 ` [PATCH 2.5] [5/6] " Marc Zyngier
2003-07-04 23:10 ` [PATCH 2.5] [6/6] " Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).