* Re: non-DMA CMD646 driver
[not found] <19971211014512.26161@vision.aart.ch>
@ 1997-12-11 0:50 ` Andreas Trottmann
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Trottmann @ 1997-12-11 0:50 UTC (permalink / raw)
On Thu, Dec 11, 1997 at 01:45:12AM +0100, Andreas Trottmann wrote:
> I think I'll reboot and look if the HD is still OK :-))
Ten seconds after I sent out this mail, I heard yet another
frightening-to-the-bone sound from the IDE drive. But this time, the
reset seemed to be successful, as I could use both drives again:
Dec 11 01:41:54 clockwork kernel: ide1: reset timed-out, status=0xd0
Dec 11 01:41:54 clockwork kernel: hdc: status timeout: status=0xd0 { Busy }
Dec 11 01:41:54 clockwork kernel: hdc: drive not ready for command
Dec 11 01:42:03 clockwork kernel: ide1: reset: success
... and of course, I started bashing again (only the HD this time, no
CD-ROM), and it locked up again. At least, it doesn't seem to related to
the concurrent use of the CD-ROM and the HD.
--
Andreas Trottmann <andreas.trottmann@aart.ch>
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: non-DMA CMD646 driver
@ 1997-12-11 16:27 Kai Schuetz
0 siblings, 0 replies; 4+ messages in thread
From: Kai Schuetz @ 1997-12-11 16:27 UTC (permalink / raw)
Andreas Trottmann wrote:
>
> > hdparm -m16 -c1 -p5 /dev/hda
> > hdparm -p9 /dev/hda
> > hdparm -p7 /dev/hda
Perhaps you shouldn't start with the most agressive configurations.
As the manpage of hdparm says especially -m could be dangerous.
Start with -p4, if it works you can test -c1 (32 bit access) or -p9
(prefetch).
I hope your HD is healthy again !
--
|/
|\ai
--------------------------------------------------------------------------------
Kai Schuetz
mailto:kais@i6.informatik.rwth-aachen.de
Hi, I'm not a signature virus. Why don't you just copy me into your
signature?
--------------------------------------------------------------------------------
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <348EC044.4487@i6.informatik.rwth-aachen.de>]
* Re: non-DMA CMD646 driver
[not found] <348EC044.4487@i6.informatik.rwth-aachen.de>
@ 1997-12-11 0:45 ` Andreas Trottmann
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Trottmann @ 1997-12-11 0:45 UTC (permalink / raw)
On Wed, Dec 10, 1997 at 05:16:04PM +0100, Kai Schuetz wrote:
> I've hacked together suppot of the CMD 646 and CMD643 chips PIO-Mode
> tweaking which is especially useful for owners of PC164, SX164 or LX164
> Alpha-Boards.
>
> Linear-Read transfer speed rose from 1.5Mb/s to ~5Mb/s !
I tried it on my Miata (Personal Workstation 433a). It *did* boost
performance (hdparm went up from 800 KB/sec to >6 MB/sec), but after I
put on some IDE load it seemed to lock up something quite heavily:
This is what I did:
tar -cf - /mnt/cd >/dev/null &
tar -cf - /usr/local/spare >/dev/null &
(where the CD-ROM is an ATAPI one on /dev/hdb and /usr/local/spare is on
some a Maxtor 71260 AT disk on /dev/hdc). It worked for half a minute,
but then started to cause some trouble:
Dec 11 01:19:02 clockwork kernel: hdc: irq timeout: status=0xd0 { Busy }
Dec 11 01:19:32 clockwork kernel: ide1: reset timed-out, status=0xd0
Dec 11 01:19:32 clockwork kernel: hdc: status timeout: status=0xd0 { Busy }
Dec 11 01:19:32 clockwork kernel: hdc: drive not ready for command
Dec 11 01:20:02 clockwork kernel: ide1: reset timed-out, status=0xd0
Dec 11 01:20:02 clockwork kernel: hdc: status timeout: status=0xd0 { Busy }
Dec 11 01:20:02 clockwork kernel: end_request: I/O error, dev 16:05,
sector 32786
Dec 11 01:20:02 clockwork kernel: hdc: drive not ready for command
Dec 11 01:20:02 clockwork kernel: hdc: status timeout: status=0xd0 { Busy }
... then, it went on a bit like this...
Dec 11 01:31:04 clockwork kernel: ide1: reset: master: error (0x00?)
Dec 11 01:31:04 clockwork kernel: hdc: status error: status=0x58 {
DriveReady SeekComplete DataRequest }
Dec 11 01:31:04 clockwork kernel: hdc: drive not ready for command
Dec 11 01:31:04 clockwork kernel: hdc: set_geometry_intr: status=0x80 {
Busy }
Dec 11 01:31:13 clockwork kernel: ide1: reset: success
... here, the HD made some quite frightening sound :-) ...
Dec 11 01:31:23 clockwork kernel: hdc: irq timeout: status=0xd0 { Busy }
Dec 11 01:31:53 clockwork kernel: ide1: reset timed-out, status=0xd0
Dec 11 01:31:53 clockwork kernel: hdc: status timeout: status=0xd0 { Busy }
Dec 11 01:31:53 clockwork kernel: hdc: drive not ready for command
Both tar processes hung with status D (which means "uninterruptable
sleep", IIRC), but after ten minutes or so, I was able to kill them. Both
devices are still not accessible, and it still seems to be constantly
resetting the dive.
I think I'll reboot and look if the HD is still OK :-))
> hdparm -m16 -c1 -p5 /dev/hda
> hdparm -p9 /dev/hda
> hdparm -p7 /dev/hda
That's exactly what I did.
> Just take a 2.1.* kernel (I took linux-2.1.67-BEFORE-MEGAMERGE.tar.gz
> from David Mosberger Tang) and apply the attached diff to cmd640.c in
> drivers/block.
Oops... I didn't even read this before trying it! I just patched it into
my 2.0.32 kernel (Linus' 2.0.32 sources plus Jay's
alpha-patches-2.0.32-0.1) and got only one reject concerning the
changement from "cmd640" to "cmd%s" in the kprintf()s, so I thought it was
safe... could this be causing the problems?
> Please also not I feel not responsible for any loss of data/problems
> due to the patch,
Of course! And don't take this mail as a flame -- I just tried your patch
and am reporting a problem, hoping it can be of help to you. Also, I'd
really like to see my IDE sped up a bit.
If you miss any details in this report (it's getting late and I want to
have more sleep this night than the two hours I had last night...) don't
hesitate to ask.
--
Andreas Trottmann <andreas.trottmann@aart.ch>
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* non-DMA CMD646 driver
@ 1997-12-10 16:16 Kai Schuetz
0 siblings, 0 replies; 4+ messages in thread
From: Kai Schuetz @ 1997-12-10 16:16 UTC (permalink / raw)
This is a multi-part message in MIME format.
--------------620152BF6231
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I've hacked together suppot of the CMD 646 and CMD643 chips PIO-Mode
tweaking which is especially useful for owners of PC164, SX164 or LX164
Alpha-Boards.
Linear-Read transfer speed rose from 1.5Mb/s to ~5Mb/s !
Please not that this still has got _no_ DMA support, so the system load
will probably be as high as usual. Also note to get any speedup you
have got to use hdparm, e.g.
hdparm -m16 -c1 -p5 /dev/hda
hdparm -p9 /dev/hda
hdparm -p7 /dev/hda
works fine for us.
Just take a 2.1.* kernel (I took linux-2.1.67-BEFORE-MEGAMERGE.tar.gz
from David Mosberger Tang) and apply the attached diff to cmd640.c in
drivers/block.
Please also not I feel not responsible for any loss of data/problems
due to the patch, but for us it works fine on a PC164 with a Seagate
ST34342A harddisk.
I would appreciate to hear anything about the driver, if it's
success or not. (Of course I rather would like to hear success stories
;-) )
--
|/
|\ai
--------------------------------------------------------------------------------
Kai Schuetz
mailto:kais@i6.informatik.rwth-aachen.de
Hi, I'm not a signature virus. Why don't you just copy me into your
signature?
--------------------------------------------------------------------------------
--------------620152BF6231
Content-Type: text/plain; charset=us-ascii; name="cmd640.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="cmd640.c.diff"
*** cmd640.c.orig Wed Sep 17 20:32:54 1997
--- cmd640.c Wed Dec 10 12:31:46 1997
***************
*** 96,105 ****
--- 96,108 ----
* ("fast" is necessary for 32bit I/O in some systems)
* Version 1.02 fix bug that resulted in slow "setup times"
* (patch courtesy of Zoltan Hidvegi)
+ * Version 1.03 Support for CMD643 and CMD646 chips.
+ * added by Kai Schuetz(kais@i6.informatik.rwth-aachen.de)
*/
#undef REALLY_SLOW_IO /* most systems can safely undef this */
#define CMD640_PREFETCH_MASKS 1
+ #define CMD640_DUMP_REGS
#include <linux/config.h>
#include <linux/types.h>
***************
*** 110,115 ****
--- 113,120 ----
#include <linux/ioport.h>
#include <linux/blkdev.h>
#include <linux/hdreg.h>
+ #include <linux/pci.h>
+ #include <linux/bios32.h>
#include <asm/io.h>
#include "ide.h"
#include "ide_modes.h"
***************
*** 126,132 ****
#define VID 0x00
#define DID 0x02
#define PCMD 0x04
! #define PCMD_ENA 0x01
#define PSTTS 0x06
#define REVID 0x08
#define PROGIF 0x09
--- 131,137 ----
#define VID 0x00
#define DID 0x02
#define PCMD 0x04
! #define PCMD_ENA 0x0001
#define PSTTS 0x06
#define REVID 0x08
#define PROGIF 0x09
***************
*** 161,166 ****
--- 166,174 ----
#define ARTTIM23_DIS_RA2 0x04
#define ARTTIM23_DIS_RA3 0x08
#define DRWTIM23 0x58
+ /* on a CMD646 this is splitted into 2 regs: */
+ #define DRWTIM2 0x58
+ #define DRWTIM3 0x5b
#define BRST 0x59
/*
***************
*** 194,206 ****
* Interface to access cmd640x registers
*/
static unsigned int cmd640_key;
static void (*put_cmd640_reg)(unsigned short reg, byte val);
static byte (*get_cmd640_reg)(unsigned short reg);
/*
* This is read from the CFR reg, and is used in several places.
*/
! static unsigned int cmd640_chip_version;
/*
* The CMD640x chip does not support DWORD config write cycles, but some
--- 202,217 ----
* Interface to access cmd640x registers
*/
static unsigned int cmd640_key;
+ unsigned char pci_bus;
+ unsigned char pci_dev_fn;
static void (*put_cmd640_reg)(unsigned short reg, byte val);
static byte (*get_cmd640_reg)(unsigned short reg);
/*
* This is read from the CFR reg, and is used in several places.
*/
! enum {cmd640, cmd640b, cmd643, cmd646} cmd_chip_type;
! static char cmd64x_strname[4] = {"640", "640b", "643", "646"};
/*
* The CMD640x chip does not support DWORD config write cycles, but some
***************
*** 208,213 ****
--- 219,239 ----
* Therefore, we must use direct IO instead.
*/
+ /* PCI bios32 access (needed e.g. for alpha) */
+
+ static void put_cmd640_reg_pci (unsigned short reg, byte val)
+ {
+ pcibios_write_config_byte(pci_bus, pci_dev_fn, reg, val);
+ }
+
+
+ static byte get_cmd640_reg_pci (unsigned short reg)
+ {
+ byte val;
+ pcibios_read_config_byte(pci_bus, pci_dev_fn, reg, &val);
+ return val;
+ }
+
/* PCI method 1 access */
static void put_cmd640_reg_pci1 (unsigned short reg, byte val)
***************
*** 290,300 ****
static int match_pci_cmd640_device (void)
{
- const byte ven_dev[4] = {0x95, 0x10, 0x40, 0x06};
unsigned int i;
! for (i = 0; i < 4; i++) {
! if (get_cmd640_reg(i) != ven_dev[i])
! return 0;
}
#ifdef STUPIDLY_TRUST_BROKEN_PCMD_ENA_BIT
if ((get_cmd640_reg(PCMD) & PCMD_ENA) == 0) {
--- 316,340 ----
static int match_pci_cmd640_device (void)
{
unsigned int i;
! if (get_cmd640_reg(0) != 0x95)
! return 0;
! if (get_cmd640_reg(1) != 0x10)
! return 0;
! if (get_cmd640_reg(3) != 0x06)
! return 0;
! switch(get_cmd640_reg(2)) {
! case 0x40:
! cmd_chip_type = cmd640;
! break;
! case 0x43:
! cmd_chip_type = cmd643;
! break;
! case 0x46:
! cmd_chip_type = cmd646;
! break;
! default:
! return 0;
}
#ifdef STUPIDLY_TRUST_BROKEN_PCMD_ENA_BIT
if ((get_cmd640_reg(PCMD) & PCMD_ENA) == 0) {
***************
*** 306,311 ****
--- 346,382 ----
}
/*
+ * Probe for CMD640x -- kernel pci support
+ */
+ static int probe_for_cmd640_pci (void)
+ {
+ get_cmd640_reg = get_cmd640_reg_pci;
+ put_cmd640_reg = put_cmd640_reg_pci;
+ if (pcibios_present) {
+ if (pcibios_find_device(PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_646, 0,
+ &pci_bus, &pci_dev_fn) == PCIBIOS_SUCCESSFUL) {
+ cmd_chip_type = cmd646;
+ return 1; /* success */
+ }else if (pcibios_find_device(PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_643, 0,
+ &pci_bus, &pci_dev_fn) == PCIBIOS_SUCCESSFUL)
+ {
+ cmd_chip_type = cmd643;
+ return 1; /* success */
+
+ /* Im not sure if the following will break something, see the note above
+ about DWORD write cycles on CMD640 */
+
+ }else if (pcibios_find_device(PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_640, 0,
+ &pci_bus, &pci_dev_fn) == PCIBIOS_SUCCESSFUL)
+ {
+ cmd_chip_type = cmd640;
+ return 1; /* success */
+ }
+ }
+ return 0;
+ }
+
+ /*
* Probe for CMD640x -- pci method 1
*/
static int probe_for_cmd640_pci1 (void)
***************
*** 313,320 ****
get_cmd640_reg = get_cmd640_reg_pci1;
put_cmd640_reg = put_cmd640_reg_pci1;
for (cmd640_key = 0x80000000; cmd640_key <= 0x8000f800; cmd640_key += 0x800) {
! if (match_pci_cmd640_device())
! return 1; /* success */
}
return 0;
}
--- 384,391 ----
get_cmd640_reg = get_cmd640_reg_pci1;
put_cmd640_reg = put_cmd640_reg_pci1;
for (cmd640_key = 0x80000000; cmd640_key <= 0x8000f800; cmd640_key += 0x800) {
! if (match_pci_cmd640_device())
! return 1; /* success */
}
return 0;
}
***************
*** 384,394 ****
*/
void cmd640_dump_regs (void)
{
! unsigned int reg = cmd640_vlb ? 0x50 : 0x00;
!
/* Dump current state of chip registers */
! printk("ide: cmd640 internal register dump:");
! for (; reg <= 0x59; reg++) {
if (!(reg & 0x0f))
printk("\n%04x:", reg);
printk(" %02x", get_cmd640_reg(reg));
--- 455,466 ----
*/
void cmd640_dump_regs (void)
{
! unsigned int reg = cmd640_vlb ? 0x50 : 0x00,
! toreg = (cmd_chip_type == cmd646) ? 0x5b : 0x59;
/* Dump current state of chip registers */
! printk("ide: cmd%s internal register dump:",
! cmd64x_strname[cmd_chip_type]);
! for (; reg <= toreg; reg++) {
if (!(reg & 0x0f))
printk("\n%04x:", reg);
printk(" %02x", get_cmd640_reg(reg));
***************
*** 483,495 ****
byte active_count, recovery_count;
active_count = active_counts[index];
- if (active_count == 1)
- ++active_count;
recovery_count = recovery_counts[index];
! if (active_count > 3 && recovery_count == 1)
! ++recovery_count;
! if (cmd640_chip_version > 1)
! recovery_count += 1; /* cmd640b uses (count + 1)*/
printk(", clocks=%d/%d/%d\n", setup_counts[index], active_count, recovery_count);
}
--- 555,582 ----
byte active_count, recovery_count;
active_count = active_counts[index];
recovery_count = recovery_counts[index];
! switch(cmd_chip_type) {
! case cmd640:
! case cmd640b:
! if (active_count == 1)
! ++active_count;
! if (active_count > 3 && recovery_count == 1)
! ++recovery_count;
! if (cmd_chip_type == cmd640b)
! recovery_count += 1; /* cmd640b uses (count + 1)*/
! break;
! case cmd643:
! case cmd646:
! ++recovery_count;
! switch(recovery_count) {
! case 1 : /* 0x0 */
! recovery_count = 16; break;
! case 16 : /* 0xf */
! recovery_count = 1; break;
! }
! break;
! }
printk(", clocks=%d/%d/%d\n", setup_counts[index], active_count, recovery_count);
}
***************
*** 547,553 ****
* each drive. Secondary interface has one common set of registers,
* so we merge the timings, using the slowest value for each timing.
*/
! if (index > 1) {
unsigned int mate;
if (cmd_drives[mate = index ^ 1]->present) {
if (setup_count < setup_counts[mate])
--- 634,641 ----
* each drive. Secondary interface has one common set of registers,
* so we merge the timings, using the slowest value for each timing.
*/
! if ((cmd_chip_type == cmd640) || (cmd_chip_type == cmd640b)) {
! if (index > 1) {
unsigned int mate;
if (cmd_drives[mate = index ^ 1]->present) {
if (setup_count < setup_counts[mate])
***************
*** 557,562 ****
--- 645,651 ----
if (recovery_count < recovery_counts[mate])
recovery_count = recovery_counts[mate];
}
+ }
}
/*
***************
*** 592,598 ****
static void cmd640_set_mode (unsigned int index, byte pio_mode, unsigned int cycle_time)
{
int setup_time, active_time, recovery_time, clock_time;
! byte setup_count, active_count, recovery_count, recovery_count2, cycle_count;
int bus_speed = ide_system_bus_speed();
if (pio_mode > 5)
--- 681,688 ----
static void cmd640_set_mode (unsigned int index, byte pio_mode, unsigned int cycle_time)
{
int setup_time, active_time, recovery_time, clock_time;
! byte setup_count, active_count, recovery_count, recovery_count2,
! cycle_count;
int bus_speed = ide_system_bus_speed();
if (pio_mode > 5)
***************
*** 614,631 ****
if (recovery_count2 > recovery_count)
recovery_count = recovery_count2;
if (recovery_count < 2)
! recovery_count = 2; /* minimum allowed by cmd640 */
! if (recovery_count > 17) {
! active_count += recovery_count - 17;
! recovery_count = 17;
}
if (active_count > 16)
! active_count = 16; /* maximum allowed by cmd640 */
! if (cmd640_chip_version > 1)
! recovery_count -= 1; /* cmd640b uses (count + 1)*/
if (recovery_count > 16)
recovery_count = 16; /* maximum allowed by cmd640 */
setup_counts[index] = setup_count;
active_counts[index] = active_count;
recovery_counts[index] = recovery_count;
--- 704,739 ----
if (recovery_count2 > recovery_count)
recovery_count = recovery_count2;
if (recovery_count < 2)
! recovery_count = 2; /* minimum allowed recovery count */
! switch(cmd_chip_type) {
! case cmd640:
! case cmd640b:
! recovery_count2 = 17; break;
! case cmd643:
! case cmd646:
! recovery_count2 = 16; break;
! }
! if (recovery_count > recovery_count2) {
! active_count += recovery_count - recovery_count2;
! recovery_count = recovery_count2;
}
if (active_count > 16)
! active_count = 16; /* maximum allowed by cmd64x */
! if (cmd_chip_type == cmd640b)
! recovery_count -= 1; /* cmd640b uses (count + 1)*/
if (recovery_count > 16)
recovery_count = 16; /* maximum allowed by cmd640 */
+ if ((cmd_chip_type == cmd643) || (cmd_chip_type == cmd646)) {
+ --recovery_count;
+ switch (recovery_count) {
+ case 0:
+ recovery_count = 0xf; break;
+ case 15:
+ recovery_count = 0x0; break;
+ }
+ }
+
setup_counts[index] = setup_count;
active_counts[index] = active_count;
recovery_counts[index] = recovery_count;
***************
*** 664,685 ****
if (mode_wanted)
b |= 0x27;
put_cmd640_reg(CNTRL, b);
! printk("%s: %sabled cmd640 fast host timing (devsel)\n", drive->name, mode_wanted ? "en" : "dis");
return;
case 8: /* set prefetch off */
case 9: /* set prefetch on */
mode_wanted &= 1;
set_prefetch_mode(index, mode_wanted);
! printk("%s: %sabled cmd640 prefetch\n", drive->name, mode_wanted ? "en" : "dis");
return;
}
(void) ide_get_best_pio_mode (drive, mode_wanted, 5, &d);
cmd640_set_mode (index, d.pio_mode, d.cycle_time);
! printk ("%s: selected cmd640 PIO mode%d (%dns)%s",
drive->name,
d.pio_mode,
d.cycle_time,
d.overridden ? " (overriding vendor mode)" : "");
--- 772,794 ----
if (mode_wanted)
b |= 0x27;
put_cmd640_reg(CNTRL, b);
! printk("%s: %sabled cmd%s fast host timing (devsel)\n", drive->name, mode_wanted ? "en" : "dis", cmd64x_strname[cmd_chip_type]);
return;
case 8: /* set prefetch off */
case 9: /* set prefetch on */
mode_wanted &= 1;
set_prefetch_mode(index, mode_wanted);
! printk("%s: %sabled cmd%s prefetch\n", drive->name, mode_wanted ? "en" : "dis", cmd64x_strname[cmd_chip_type]);
return;
}
(void) ide_get_best_pio_mode (drive, mode_wanted, 5, &d);
cmd640_set_mode (index, d.pio_mode, d.cycle_time);
! printk ("%s: selected cmd%s PIO mode%d (%dns)%s",
drive->name,
+ cmd64x_strname[cmd_chip_type],
d.pio_mode,
d.cycle_time,
d.overridden ? " (overriding vendor mode)" : "");
***************
*** 699,711 ****
int second_port_cmd640 = 0;
const char *bus_type, *port2;
unsigned int index;
! byte b, cfr;
if (cmd640_vlb && probe_for_cmd640_vlb()) {
bus_type = "VLB";
} else {
cmd640_vlb = 0;
! if (probe_for_cmd640_pci1())
bus_type = "PCI (type1)";
else if (probe_for_cmd640_pci2())
bus_type = "PCI (type2)";
--- 808,822 ----
int second_port_cmd640 = 0;
const char *bus_type, *port2;
unsigned int index;
! byte b, cfr=0;
if (cmd640_vlb && probe_for_cmd640_vlb()) {
bus_type = "VLB";
} else {
cmd640_vlb = 0;
! if (probe_for_cmd640_pci())
! bus_type = "PCI (Bios32)";
! else if (probe_for_cmd640_pci1())
bus_type = "PCI (type1)";
else if (probe_for_cmd640_pci2())
bus_type = "PCI (type2)";
***************
*** 715,726 ****
/*
* Undocumented magic (there is no 0x5b reg in specs)
*/
! put_cmd640_reg(0x5b, 0xbd);
! if (get_cmd640_reg(0x5b) != 0xbd) {
! printk("ide: cmd640 init failed: wrong value in reg 0x5b\n");
! return 0;
}
- put_cmd640_reg(0x5b, 0);
#ifdef CMD640_DUMP_REGS
CMD640_DUMP_REGS;
--- 826,840 ----
/*
* Undocumented magic (there is no 0x5b reg in specs)
*/
! if (cmd_chip_type == 640) {
! put_cmd640_reg(0x5b, 0xbd);
! if (get_cmd640_reg(0x5b) != 0xbd) {
! printk("ide: cmd%s init failed: wrong value in reg 0x5b\n",
! cmd64x_strname[cmd_chip_type]);
! return 0;
! }
! put_cmd640_reg(0x5b, 0);
}
#ifdef CMD640_DUMP_REGS
CMD640_DUMP_REGS;
***************
*** 729,749 ****
/*
* Documented magic begins here
*/
! cfr = get_cmd640_reg(CFR);
! cmd640_chip_version = cfr & CFR_DEVREV;
! if (cmd640_chip_version == 0) {
! printk ("ide: bad cmd640 revision: %d\n", cmd640_chip_version);
! return 0;
}
/*
* Initialize data for primary port
*/
setup_device_ptrs ();
! printk("%s: buggy cmd640%c interface on %s, config=0x%02x\n",
! cmd_hwif0->name, 'a' + cmd640_chip_version - 1, bus_type, cfr);
cmd_hwif0->chipset = ide_cmd640;
#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
cmd_hwif0->tuneproc = &cmd640_tune_drive;
#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
--- 843,873 ----
/*
* Documented magic begins here
*/
! if (cmd_chip_type == 640) {
! int cmd640_chip_version;
! cfr = get_cmd640_reg(CFR);
! cmd640_chip_version = cfr & CFR_DEVREV;
! if (cmd640_chip_version == 0) {
! printk ("ide: bad cmd640 revision: %d\n", cmd640_chip_version);
! return 0;
! }
! if (cmd640_chip_version > 1)
! cmd_chip_type = cmd640b;
}
/*
* Initialize data for primary port
*/
setup_device_ptrs ();
! printk("%s:%s cmd%s interface on %s, config=0x%02x\n",
! cmd_hwif0->name,
! ((cmd_chip_type <= cmd640b) ? " buggy" : ""),
! cmd64x_strname[cmd_chip_type],
! bus_type, cfr);
cmd_hwif0->chipset = ide_cmd640;
#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
+ if ((cmd_chip_type == cmd643) || (cmd_chip_type == cmd646))
+ drwtim_regs[3] = DRWTIM3;
cmd_hwif0->tuneproc = &cmd640_tune_drive;
#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
***************
*** 819,825 ****
recovery_counts [index] = 16; /* max possible */
program_drive_counts (index);
set_prefetch_mode (index, 0);
! printk("cmd640: drive%d timings/prefetch cleared\n", index);
} else {
/*
* Record timings/prefetch without changing them.
--- 943,951 ----
recovery_counts [index] = 16; /* max possible */
program_drive_counts (index);
set_prefetch_mode (index, 0);
! printk("cmd%s: drive%d timings/prefetch cleared\n",
! cmd64x_strname[cmd_chip_type],
! index);
} else {
/*
* Record timings/prefetch without changing them.
***************
*** 827,834 ****
*/
retrieve_drive_counts (index);
check_prefetch (index);
! printk("cmd640: drive%d timings/prefetch(%s) preserved",
! index, drive->no_io_32bit ? "off" : "on");
display_clocks(index);
}
#else
--- 953,961 ----
*/
retrieve_drive_counts (index);
check_prefetch (index);
! printk("cmd%s: drive%d timings/prefetch(%s) preserved",
! cmd64x_strname[cmd_chip_type],
! index, drive->no_io_32bit ? "off" : "on");
display_clocks(index);
}
#else
***************
*** 836,843 ****
* Set the drive unmask flags to match the prefetch setting
*/
check_prefetch (index);
! printk("cmd640: drive%d timings/prefetch(%s) preserved\n",
! index, drive->no_io_32bit ? "off" : "on");
#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
}
--- 963,971 ----
* Set the drive unmask flags to match the prefetch setting
*/
check_prefetch (index);
! printk("cmd%s: drive%d timings/prefetch(%s) preserved\n",
! cmd64x_strname[cmd_chip_type],
! index, drive->no_io_32bit ? "off" : "on");
#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
}
--------------620152BF6231--
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1997-12-11 16:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <19971211014512.26161@vision.aart.ch>
1997-12-11 0:50 ` non-DMA CMD646 driver Andreas Trottmann
1997-12-11 16:27 Kai Schuetz
[not found] <348EC044.4487@i6.informatik.rwth-aachen.de>
1997-12-11 0:45 ` Andreas Trottmann
-- strict thread matches above, loose matches on Subject: below --
1997-12-10 16:16 Kai Schuetz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox