Skip to contentSkip to conversation

ide: legacy VLB drivers housekeeping

PATCH In review Bartlomiej Zolnierkiewicz 2 participants 3 messages Feb 7, 2011 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ide: legacy VLB drivers housekeeping

* remove stale documentation
* remove dead ALWAYS_SET_DTC2278_PIO_MODE code from dtc2278
* remove legacy debugging code from ht6560b

There should be no functional changes caused by this patch.

---
 drivers/ide/ali14xx.c |   28 +----------------
 drivers/ide/dtc2278.c |   50 +++++++-------------------------
 drivers/ide/ht6560b.c |   78 
+-------------------------------------------------
 drivers/ide/qd65xx.c  |   43 ---------------------------
 drivers/ide/umc8672.c |   20 ------------
 5 files changed, 17 insertions(+), 202 deletions(-)
drivers/ide/ali14xx.c +1 -26
Index: b/drivers/ide/ali14xx.c
===================================================================
@@ -7,32 +7,7 @@
  *
  * Works for ALI M1439/1443/1445/1487/1489 chipsets.
  *
- * Adapted from code developed by [email protected].  -ml
- * Derek's notes follow:
- *
- * I think the code should be pretty understandable,
- * but I'll be happy to (try to) answer questions.
- *
- * The critical part is in the setupDrive function.  The initRegisters
- * function doesn't seem to be necessary, but the DOS driver does it, so
- * I threw it in.
- *
- * I've only tested this on my system, which only has one disk.  I posted
- * it to comp.sys.linux.hardware, so maybe some other people will try it
- * out.
- *
- * Derek Noonburg  ([email protected])
- * 95-sep-26
- *
- * Update 96-jul-13:
- *
- * I've since upgraded to two disks and a CD-ROM, with no trouble, and
- * I've also heard from several others who have used it successfully.
- * This driver appears to work with both the 1443/1445 and the 1487/1489
- * chipsets.  I've added support for PIO mode 4 for the 1487.  This
- * seems to work just fine on the 1443 also, although I'm not sure it's
- * advertised as supporting mode 4.  (I've been running a WDC AC21200 in
- * mode 4 for a while now with no trouble.)  -Derek
+ * Adapted from code developed by Derek Noonburg <[email protected]>.  -

ml
*/

#include <linux/module.h>
@@ -177,6 +152,7 @@ static int __init findPort(void)

/*
* Initialize controller registers with default values.
+ * (doesn't seem to be necessary but the DOS driver does it). */
static int __init initRegisters(void)
{

drivers/ide/dtc2278.c +7 -0
Index: b/drivers/ide/dtc2278.c
===================================================================
@@ -2,6 +2,17 @@
  *  Copyright (C) 1996  Linus Torvalds & author (see below)
  */
 
+/*
+ * Initial DTC-2278 support from Dyan Wile <[email protected]>.
+ */
+
+/*
+ * DTC2278S has only a single IDE interface
+ * DTC2278D has two IDE interfaces and is otherwise identical to the S 

version
+ * DTC2278E also has serial ports and a printer port
+ * DTC2278EB: has onboard BIOS
+ */
+
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
@@ -17,37 +28,6 @@

#define DRV_NAME "dtc2278"

-/*
- * Changing this #undef to #define may solve start up problems in some systems.
- */
-#undef ALWAYS_SET_DTC2278_PIO_MODE
-
-/*
- * From: [email protected] (Dyan Wile)
- *
- * Below is a patch for DTC-2278 - alike software-programmable controllers
- * The code enables the secondary IDE controller and the PIO4 (3?) timings on
- * the primary (EIDE). You may probably have to enable the 32-bit support to
- * get the full speed. You better get the disk interrupts disabled ( hdparm - u0
- * /dev/hd.. ) for the drives connected to the EIDE interface. (I get my
- * filesystem corrupted with -u1, but under heavy disk load only :-)
- *
- * This card is now forced to use the "serialize" feature,
- * and irq-unmasking is disallowed. If io_32bit is enabled,
- * it must be done for BOTH drives on each interface.
- *
- * This code was written for the DTC2278E, but might work with any of these:
- *
- * DTC2278S has only a single IDE interface.
- * DTC2278D has two IDE interfaces and is otherwise identical to the S version.
- * DTC2278E also has serial ports and a printer port
- * DTC2278EB: has onboard BIOS, and "works like a charm" -- Kent Bradford <[email protected]>
- *
- * There may be a fourth controller type. The S and D versions use the
- * Winbond chip, and I think the E version does also.
- *
- */
-
static void sub22 (char b, char c)
{
int i;
@@ -117,14 +97,6 @@ static int __init dtc2278_probe(void)
inb(0x3f6);
outb_p(0x20,0xb4);
inb(0x3f6);
-#ifdef ALWAYS_SET_DTC2278_PIO_MODE
- /*
- * This enables PIO mode4 (3?) on the first interface
- * and may solve start-up problems for some people.
- */
- sub22(1,0xc3);
- sub22(0,0xa0);
-#endif
local_irq_restore(flags);

return ide_legacy_device_add(&dtc2278_port_info, 0);

drivers/ide/ht6560b.c +1 -58

101 lines not on this page · raw message

active=%d (%dns)\n", drive->name, pio, recovery_cycles, recovery_time, active_cycles, active_time);
-#endif
-
+
return (u8)((recovery_cycles << 4) | active_cycles);
- } else {
-
-#ifdef DEBUG
- printk("ht6560b: drive %s setting pio=0\n", drive->name);
-#endif
-
+ } else
return HT_TIMING_DEFAULT; /* default setting */
- }
}

static DEFINE_SPINLOCK(ht6560b_lock);
@@ -272,10 +208,6 @@ static void ht_set_prefetch(ide_drive_t
ide_set_drivedata(drive, (void *)config);

spin_unlock_irqrestore(&ht6560b_lock, flags);
-
-#ifdef DEBUG
- printk("ht6560b: drive %s prefetch mode %sabled\n", drive->name, (state ?
"en" : "dis"));
-#endif
}

static void ht6560b_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
@@ -299,10 +231,6 @@ static void ht6560b_set_pio_mode(ide_hwi
config |= timing;
ide_set_drivedata(drive, (void *)config); spin_unlock_irqrestore(&ht6560b_lock, flags);
-
-#ifdef DEBUG
- printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive-

Quoted 1 line

name, pio, timing);

-#endif
}

static void __init ht6560b_init_dev(ide_drive_t *drive)

drivers/ide/qd65xx.c +0 -32
Index: b/drivers/ide/qd65xx.c
===================================================================
@@ -3,15 +3,7 @@
  */
 
 /*
- *  Version 0.03	Cleaned auto-tune, added probe
- *  Version 0.04	Added second channel tuning
- *  Version 0.05	Enhanced tuning ; added qd6500 support
- *  Version 0.06	Added dos driver's list
- *  Version 0.07	Second channel bug fix 
- *
  * QDI QD6500/QD6580 EIDE controller fast support
- *
- * To activate controller support, use "ide0=qd65xx"
  */
 
 /*
@@ -47,41 +39,6 @@
  * http://www.ryston.cz/petr/vlb
  */
 
-/*
- * base: Timer1
- *
- *
- * base+0x01: Config (R/O)
- *
- * bit 0: ide baseport: 1 = 0x1f0 ; 0 = 0x170 (only useful for qd6500)
- * bit 1: qd65xx baseport: 1 = 0xb0 ; 0 = 0x30
- * bit 2: ID3: bus speed: 1 = <=33MHz ; 0 = >33MHz
- * bit 3: qd6500: 1 = disabled, 0 = enabled
- *        qd6580: 1
- * upper nibble:
- *        qd6500: 1100
- *        qd6580: either 1010 or 0101
- *
- *
- * base+0x02: Timer2 (qd6580 only)
- *
- *
- * base+0x03: Control (qd6580 only)
- *
- * bits 0-3 must always be set 1
- * bit 4 must be set 1, but is set 0 by dos driver while measuring vlb clock
- * bit 0 : 1 = Only primary port enabled : channel 0 for hda, channel 1 for 

hdb
- * 0 = Primary and Secondary ports enabled : channel 0 for hda & hdb
- * channel 1 for hdc & hdd
- * bit 1 : 1 = only disks on primary port
- * 0 = disks & ATAPI devices on primary port
- * bit 2-4 : always 0
- * bit 5 : status, but of what ?
- * bit 6 : always set 1 by dos driver
- * bit 7 : set 1 for non-ATAPI devices on primary port
- * (maybe read-ahead and post-write buffer ?)
- */
-
static int timings[4]={-1,-1,-1,-1}; /* stores current timing for each timer
*/

/*

drivers/ide/umc8672.c +1 -12
Index: b/drivers/ide/umc8672.c
===================================================================
@@ -5,8 +5,7 @@
 /*
  *  Principal Author/Maintainer:  [email protected] (Wolfram Podien)
  *
- *  This file provides support for the advanced features
- *  of the UMC 8672 IDE interface.
+ *  UMC 8672 IDE interface
  *
  *  Version 0.01	Initial version, hacked out of ide.c,
  *			and #include'd rather than compiled separately.
@@ -18,23 +17,6 @@
  *			add detection of possible race condition  -ml
  */
 
-/*
- * VLB Controller Support from
- * Wolfram Podien
- * Rohoefe 3
- * D28832 Achim
- * Germany
- *
- * To enable UMC8672 support there must a lilo line like
- * append="ide0=umc8672"...
- * To set the speed according to the abilities of the hardware there must be 

a
- * line like
- * #define UMC_DRIVE0 11
- * in the beginning of the driver, which sets the speed of drive 0 to 11 (there
- * are some lines present). 0 - 11 are allowed speed values. These values are
- * the results from the DOS speed test program supplied from UMC. 11 is the
- * highest speed (about PIO mode 3)
- */
#define REALLY_SLOW_IO /* some systems can safely undef this */

#include <linux/module.h>

#1 lore raw

Hello.

Quoted 7 lines · Bartlomiej Zolnierkiewicz

* remove stale documentation
* remove dead ALWAYS_SET_DTC2278_PIO_MODE code from dtc2278
* remove legacy debugging code from ht6560b

There should be no functional changes caused by this patch.

[...]

Quoted 35 lines

Index: b/drivers/ide/ali14xx.c
===================================================================

drivers/ide/ali14xx.c +1 -26
@@ -7,32 +7,7 @@
   *
   * Works for ALI M1439/1443/1445/1487/1489 chipsets.
   *
- * Adapted from code developed by [email protected].  -ml
- * Derek's notes follow:
- *
- * I think the code should be pretty understandable,
- * but I'll be happy to (try to) answer questions.
- *
- * The critical part is in the setupDrive function.  The initRegisters
- * function doesn't seem to be necessary, but the DOS driver does it, so
- * I threw it in.
- *
- * I've only tested this on my system, which only has one disk.  I posted
- * it to comp.sys.linux.hardware, so maybe some other people will try it
- * out.
- *
- * Derek Noonburg  ([email protected])
- * 95-sep-26
- *
- * Update 96-jul-13:
- *
- * I've since upgraded to two disks and a CD-ROM, with no trouble, and
- * I've also heard from several others who have used it successfully.
- * This driver appears to work with both the 1443/1445 and the 1487/1489
- * chipsets.  I've added support for PIO mode 4 for the 1487.  This
- * seems to work just fine on the 1443 also, although I'm not sure it's
- * advertised as supporting mode 4.  (I've been running a WDC AC21200 in
- * mode 4 for a while now with no trouble.)  -Derek
+ * Adapted from code developed by Derek Noonburg<[email protected]>.  -
Quoted 1 line

ml

The patch is line-wrapped...

Quoted 15 lines

Index: b/drivers/ide/dtc2278.c
===================================================================

drivers/ide/dtc2278.c +7 -0
@@ -2,6 +2,17 @@
   *  Copyright (C) 1996  Linus Torvalds&  author (see below)
   */
 
+/*
+ * Initial DTC-2278 support from Dyan Wile<[email protected]>.
+ */
+
+/*
+ * DTC2278S has only a single IDE interface
+ * DTC2278D has two IDE interfaces and is otherwise identical to the S
Quoted 1 line

version

Here too...

Quoted 13 lines

+ * DTC2278E also has serial ports and a printer port
+ * DTC2278EB: has onboard BIOS
+ */

drivers/ide/dtc2278.c +1 -2
+
  #include<linux/module.h>
  #include<linux/types.h>
  #include<linux/kernel.h>
@@ -17,37 +28,6 @@
 
  #define DRV_NAME "dtc2278"
 
-/*
- * Changing this #undef to #define may solve start up problems in some
Quoted 1 line

systems.

And here...

Quoted 18 lines

- */

drivers/ide/dtc2278.c +0 -9
-#undef ALWAYS_SET_DTC2278_PIO_MODE
-
-/*
- * From: [email protected] (Dyan Wile)
- *
- * Below is a patch for DTC-2278 - alike software-programmable controllers
- * The code enables the secondary IDE controller and the PIO4 (3?) timings on
- * the primary (EIDE). You may probably have to enable the 32-bit support to
- * get the full speed. You better get the disk interrupts disabled ( hdparm -

u0
- * /dev/hd.. ) for the drives connected to the EIDE interface. (I get my
- * filesystem corrupted with -u1, but under heavy disk load only :-)
- *
- * This card is now forced to use the "serialize" feature,
- * and irq-unmasking is disallowed. If io_32bit is enabled,
- * it must be done for BOTH drives on each interface.
- *

Quoted 8 lines

- * This code was written for the DTC2278E, but might work with any of these:
- *
- * DTC2278S has only a single IDE interface.
- * DTC2278D has two IDE interfaces and is otherwise identical to the S version.
- * DTC2278E also has serial ports and a printer port
- * DTC2278EB: has onboard BIOS, and "works like a charm" -- Kent Bradford <[email protected]>

And above...

Quoted 6 lines

Index: b/drivers/ide/ht6560b.c
===================================================================

drivers/ide/ht6560b.c static u8 ht_pio2timings(ide_drive_t *dr · line 177

Quoted 8 lines
drivers/ide/ht6560b.c +0 -3
@@ -227,20 +173,10 @@ static u8 ht_pio2timings(ide_drive_t *dr
  		if (recovery_cycles<  2)  recovery_cycles = 2;
  		if (active_cycles>  15) active_cycles   = 15;
  		if (recovery_cycles>  15) recovery_cycles = 0;  /* 0==16 */
-		
-#ifdef DEBUG
-		printk("ht6560b: drive %s setting pio=%d recovery=%d (%dns)
 active=%d (%dns)\n", drive->name, pio, recovery_cycles, recovery_time,
 active_cycles, active_time);

Here too...

drivers/ide/ht6560b.c static void ht_set_prefetch(ide_drive_t · line 211

Quoted 8 lines
drivers/ide/ht6560b.c +0 -3
@@ -272,10 +208,6 @@ static void ht_set_prefetch(ide_drive_t
  	ide_set_drivedata(drive, (void *)config);
 
  	spin_unlock_irqrestore(&ht6560b_lock, flags);
-
-#ifdef DEBUG
-	printk("ht6560b: drive %s prefetch mode %sabled\n", drive->name, (state ?
 "en" : "dis"));

And here.

drivers/ide/ht6560b.c static void ht6560b_set_pio_mode(ide_hwi · line 234

Quoted 8 lines
drivers/ide/ht6560b.c +0 -3
@@ -299,10 +231,6 @@ static void ht6560b_set_pio_mode(ide_hwi
  	config |= timing;
  	ide_set_drivedata(drive, (void *)config);
  	spin_unlock_irqrestore(&ht6560b_lock, flags);
-
-#ifdef DEBUG
-	printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive-
 > name, pio, timing);

Here too...

Quoted 4 lines

Index: b/drivers/ide/umc8672.c
===================================================================

drivers/ide/umc8672.c +0 -0

[...]

Quoted 14 lines
drivers/ide/umc8672.c +0 -10
@@ -18,23 +17,6 @@
   *			add detection of possible race condition  -ml
   */
 
-/*
- * VLB Controller Support from
- * Wolfram Podien
- * Rohoefe 3
- * D28832 Achim
- * Germany
- *
- * To enable UMC8672 support there must a lilo line like
- * append="ide0=umc8672"...
- * To set the speed according to the abilities of the hardware there must be
Quoted 5 lines

a
- * line like
- * #define UMC_DRIVE0 11
- * in the beginning of the driver, which sets the speed of drive 0 to 11 (there

And above...

WBR, Sergei

#2 lore raw
Quoted 1 line · Sergei Shtylyov

Hello.

Hi,

Quoted 51 lines · Bartlomiej Zolnierkiewicz
Quoted 8 lines

* remove stale documentation
* remove dead ALWAYS_SET_DTC2278_PIO_MODE code from dtc2278
* remove legacy debugging code from ht6560b

There should be no functional changes caused by this patch.

[...]

Quoted 35 lines

Index: b/drivers/ide/ali14xx.c
===================================================================

drivers/ide/ali14xx.c +1 -26
@@ -7,32 +7,7 @@
   *
   * Works for ALI M1439/1443/1445/1487/1489 chipsets.
   *
- * Adapted from code developed by [email protected].  -ml
- * Derek's notes follow:
- *
- * I think the code should be pretty understandable,
- * but I'll be happy to (try to) answer questions.
- *
- * The critical part is in the setupDrive function.  The initRegisters
- * function doesn't seem to be necessary, but the DOS driver does it, so
- * I threw it in.
- *
- * I've only tested this on my system, which only has one disk.  I posted
- * it to comp.sys.linux.hardware, so maybe some other people will try it
- * out.
- *
- * Derek Noonburg  ([email protected])
- * 95-sep-26
- *
- * Update 96-jul-13:
- *
- * I've since upgraded to two disks and a CD-ROM, with no trouble, and
- * I've also heard from several others who have used it successfully.
- * This driver appears to work with both the 1443/1445 and the 1487/1489
- * chipsets.  I've added support for PIO mode 4 for the 1487.  This
- * seems to work just fine on the 1443 also, although I'm not sure it's
- * advertised as supporting mode 4.  (I've been running a WDC AC21200 in
- * mode 4 for a while now with no trouble.)  -Derek
+ * Adapted from code developed by Derek Noonburg<[email protected]>.
Quoted 2 lines

 -
ml

  The patch is line-wrapped...

[...]

Quoted 1 line

  And above...

Sorry for that, I somehow managed to not notice it until now.. (ah, the joys of fresh OS installation)..