Re: [PATCH] pata_legacy: multiple updates (rediff as asked)

2008-02-01 Thread Jeff Garzik

Alan Cox wrote:

- Fix probe logic to support multiple devices better
- Fold in qdi and winbond support
- Fix promise 202C30 probe
- Restructure


hrm, some of this is already in #upstream (and thus -mm, though maybe 
akpm has not yet regenerated his stuff).


patch(1) seems to think I already have this stuff, and indeed the most 
recent changesets in pata_legacy are



commit b832548773b0cd98216534caa31b9ed7607c4e76
Author: Alan Cox [EMAIL PROTECTED]
Date:   Sat Jan 19 15:47:23 2008 +

pata_legacy: Merge winbond support

This puts winbond VLB in with the other ISA/VLB support and means 
we can
lose pata_winbond.c. With all the VLB/ISA probe in one space (and 
out of

the core libata) this makes legacy probing work sanely.

Also switch to devm_ for resource handling on the ports post probe

Signed-off-by: Alan Cox [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

commit defc9cd826e4a99f550504a744f9407b518828ae
Author: Alan Cox [EMAIL PROTECTED]
Date:   Thu Jan 10 14:33:10 2008 -0800

pata_legacy: resychronize with upstream changes and resubmit

Update the legacy driver so it can handle VLB ports nicely, and has an
internal structure for nailing new ISA/VLB forms in.  Anyone got an 
ALI14xx

and a spare day ;)

Also adds an all parameter so you can load this driver after all 
the PCI
ones in a boot time kernel and tell it to grab anything ST412 
compatible
even if it is an unknown PCI device.  That allows libata to offer 
the same

just get me a disk somehow fallback that old IDE did.

Obsoletes pata_qdi.

Signed-off-by: Alan Cox [EMAIL PROTECTED]
Cc: Tejun Heo [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]



-
To unsubscribe from this list: send the line unsubscribe linux-ide in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] pata_legacy: multiple updates (rediff as asked)

2008-01-28 Thread Alan Cox

- 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