- Fix probe logic to support multiple devices better
- Fold in qdi and winbond support
- Fix promise 202C30 probe
- Restructure
diff -u --new-file --recursive --exclude-from /usr/src/exclude
linux.vanilla-2.6.24/drivers/ata/pata_legacy.c
linux-2.6.24/drivers/ata/pata_legacy.c
--- linux.vanilla-2.6.24/drivers/ata/pata_legacy.c 2008-01-24
22:58:37.0 +
+++ linux-2.6.24/drivers/ata/pata_legacy.c 2008-01-28 15:47:45.0
+
@@ -28,7 +28,6 @@
*
* Unsupported but docs exist:
* Appian/Adaptec AIC25VL01/Cirrus Logic PD7220
- * Winbond W83759A
*
* This driver handles legacy (that is ISA/VLB side) IDE ports found
* on PC class systems. There are three hybrid devices that are exceptions
@@ -36,7 +35,7 @@
* the MPIIX where the tuning is PCI side but the IDE is ISA side.
*
* Specific support is included for the ht6560a/ht6560b/opti82c611a/
- * opti82c465mv/promise 20230c/20630
+ * opti82c465mv/promise 20230c/20630/winbond83759A
*
* Use the autospeed and pio_mask options with:
* Appian ADI/2 aka CLPD7220 or AIC25VL01.
@@ -47,9 +46,6 @@
* For now use autospeed and pio_mask as above with the W83759A. This may
* change.
*
- * TODO
- * Merge existing pata_qdi driver
- *
*/
#include linux/kernel.h
@@ -64,12 +60,13 @@
#include linux/platform_device.h
#define DRV_NAME pata_legacy
-#define DRV_VERSION 0.5.5
+#define DRV_VERSION 0.6.5
#define NR_HOST 6
-static int legacy_port[NR_HOST] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 };
-static int legacy_irq[NR_HOST] = { 14, 15, 11, 10, 8, 12 };
+static int all;
+module_param(all, int, 0444);
+MODULE_PARM_DESC(all, Grab all legacy port devices, even if PCI(0=off,
1=on));
struct legacy_data {
unsigned long timing;
@@ -80,21 +77,107 @@
};
+enum controller {
+ BIOS = 0,
+ SNOOP = 1,
+ PDC20230 = 2,
+ HT6560A = 3,
+ HT6560B = 4,
+ OPTI611A = 5,
+ OPTI46X = 6,
+ QDI6500 = 7,
+ QDI6580 = 8,
+ QDI6580DP = 9, /* Dual channel mode is different */
+ W83759A = 10,
+
+ UNKNOWN = -1
+};
+
+
+struct legacy_probe {
+ unsigned char *name;
+ unsigned long port;
+ unsigned int irq;
+ unsigned int slot;
+ enum controller type;
+ unsigned long private;
+};
+
+struct legacy_controller {
+ const char *name;
+ struct ata_port_operations *ops;
+ unsigned int pio_mask;
+ unsigned int flags;
+ int (*setup)(struct platform_device *, struct legacy_probe *probe,
+ struct legacy_data *data);
+};
+
+static int legacy_port[NR_HOST] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 };
+
+static struct legacy_probe probe_list[NR_HOST];
static struct legacy_data legacy_data[NR_HOST];
static struct ata_host *legacy_host[NR_HOST];
static int nr_legacy_host;
-static int probe_all; /* Set to check all ISA port ranges */
-static int ht6560a;/* HT 6560A on primary 1, secondary 2,
both 3 */
-static int ht6560b;/* HT 6560A on primary 1, secondary 2,
both 3 */
-static int opti82c611a;/* Opti82c611A on primary 1,
secondary 2, both 3 */
-static int opti82c46x; /* Opti 82c465MV present (pri/sec
autodetect) */
-static int autospeed; /* Chip present which snoops speed
changes */
-static int pio_mask = 0x1F;/* PIO range for autospeed devices */
+static int probe_all; /* Set to check all ISA port ranges */
+static int ht6560a;/* HT 6560A on primary 1, second 2, both 3 */
+static int ht6560b;/* HT 6560A on primary 1, second 2, both 3 */
+static int opti82c611a;/* Opti82c611A on primary 1, sec 2,
both 3 */
+static int opti82c46x; /* Opti 82c465MV present(pri/sec autodetect) */
+static int qdi;/* Set to probe QDI controllers */
+static int winbond;/* Set to probe Winbond controllers,
+ give I/O port if non stdanard */
+static int autospeed; /* Chip present which snoops speed changes */
+static int pio_mask = 0x1F;/* PIO range for autospeed devices */
static int iordy_mask = 0x;/* Use iordy if available */
/**
+ * legacy_probe_add- Add interface to probe list
+ * @port: Controller port
+ * @irq: IRQ number
+ * @type: Controller type
+ * @private: Controller specific info
+ *
+ * Add an entry into the probe list for ATA controllers. This is used
+ * to add the default ISA slots and then to build up the table
+ * further according to other ISA/VLB/Weird device scans
+ *
+ * An I/O port list is used to keep ordering stable and sane, as we
+ * don't have any good way to talk about ordering otherwise
+ */
+
+static int legacy_probe_add(unsigned long port, unsigned int irq,
+ enum