[PATCH] Submitting PROMISE IDE Controllers Driver Patch

Hank Yang (hanky@promise.com.tw)
Thu, 7 Mar 2002 14:46:30 +0800


Dear linux-kernel group and Linus Torvalds,

We make some changes for support our product. The ATA-100/133
Controllers.
Hope you can reference following describe and patch code. If there has
anything
wrong, please feel free to tell us. Thank you.

Best Regards
Hank Yang
Promise Technology, Inc.
Tel:+886-3-5782395 ext 7357

Kernel Version: linux kernel 2.4.18
Vendor: PROMISE Technology, Inc.
Author: PROMISE Technologu, Inc.
Describe: Support PDC20268, PDC20269, PDC20275(ATA-100/133 Controllers)
Support Ultra-DMA Mode 6. Maxtor 48-bit LBA spec.
Changes:
/usr/src/linux/drivers/ide/ide-disk.c
ide_startstop_t do_rw_disk()
* if drives support LBA48 and UDMA then prepare 48bit data for UDMA.
* if drives support LBA48 then issue 48bit command for PIO.

init_idedisk_capacity()
* if drives support LBA48 then read current maximal capacity.

/usr/src/linux/drivers/ide/ide-dma.c
report_drive_dmaing()
config_drive_for_dma()
* fix UltraDMA mode 6 selectable
ide_dmaproc()
* if drives support LBA48 and DMA then issue 48bit command for DMA
* if PDC20262/65/67 through ATAPI UDMA

/usr/src/linux/drivers/ide/ide-features.c
eighty_ninty_three()
* fix some hard drivers ATA-66 support response.

/usr/src/linux/drivers/ide/ide.c
ide_dump_status()
* return error 48bit LBA address if running 48bit LBA

/usr/src/linux/drivers/ide/ide-pci.c
* add PDC20268/69/75 controllers structure

/usr/src/linux/drivers/ide/pdc202xx.c
pdc202xx_info()
* fix proc information report
pdc202xx_tune_chipset()
* fix set-speed from PDC20262/65/67 and PDC20268/69/75
because the rule is different.
config_chipset_for_dma()
* support UDMA 6 selectable
* check is 80pin cable, if no will down to UDMA 2.
* fix some control rule for PDC20262/65/67 and PDC20268/69/75
ata66_pdc202xx()
* fix judge 80pin cable
pdc202xx_reset()
pci_init_pdc202xx()
* add PDC20268/69/75 controllers routine.

/usr/src/linux/include/linux/pci_ids.h
* add PROMISE IDE controllers device IDs

Patch code:

diff -urN linux-2.4.18.org/drivers/ide/ide-disk.c
linux/drivers/ide/ide-disk.c
--- linux-2.4.18.org/drivers/ide/ide-disk.c Sat Dec 22 01:41:54 2001
+++ linux/drivers/ide/ide-disk.c Wed Feb 27 23:54:46 2002
@@ -28,6 +28,11 @@
* added UDMA 3/4 reporting
* Version 1.10 request queue changes, Ultra DMA 100
*/
+/*
+ * Support UltraDMA Mode 6 and 48 bit LBA Mode.
+ * Powered by PROMISE Technology, Inc. Portions Copyright (C)2001.
+ */
+#define PCI_VENDOR_ID_PROMISE 0x105a

#define IDEDISK_VERSION "1.10"

@@ -371,10 +376,22 @@
OUT_BYTE(drive->ctl,IDE_CONTROL_REG);
OUT_BYTE(0x00, IDE_FEATURE_REG);
OUT_BYTE(rq->nr_sectors,IDE_NSECTOR_REG);
+ if ((drive->id->command_set_2 & 0x0400) &&
HWIF(drive)->pci_devid.vid==PCI_VENDOR_ID_PROMISE) {
+ /* 48 bits data previous */
+ OUT_BYTE(rq->nr_sectors>>8, IDE_NSECTOR_REG);
+ OUT_BYTE(block>>24, IDE_SECTOR_REG);
+ OUT_BYTE(0x00, IDE_LCYL_REG); //block only 32 bits
+ OUT_BYTE(0x00, IDE_HCYL_REG);
+ /* 48 bits data current */
+ OUT_BYTE(rq->nr_sectors, IDE_NSECTOR_REG);
+ OUT_BYTE(block, IDE_SECTOR_REG);
+ OUT_BYTE(block>>8, IDE_LCYL_REG);
+ OUT_BYTE(block>>16, IDE_HCYL_REG);
+ OUT_BYTE(drive->select.all,IDE_SELECT_REG);
#ifdef CONFIG_BLK_DEV_PDC4030
- if (drive->select.b.lba || IS_PDC4030_DRIVE) {
-#else /* !CONFIG_BLK_DEV_PDC4030 */
- if (drive->select.b.lba) {
+ } else if (drive->select.b.lba || IS_PDC4030_DRIVE) {
+#else /* !CONFIG_BLK_DEV_PDC4030 */
+ } else if (drive->select.b.lba) {
#endif /* CONFIG_BLK_DEV_PDC4030 */
#ifdef DEBUG
printk("%s: %sing: LBAsect=%ld, sectors=%ld, buffer=0x%08lx\n",
@@ -413,7 +430,10 @@
return ide_started;
#endif /* CONFIG_BLK_DEV_IDEDMA */
ide_set_handler(drive, &read_intr, WAIT_CMD, NULL);
- OUT_BYTE(drive->mult_count ? WIN_MULTREAD : WIN_READ, IDE_COMMAND_REG);
+ if ((drive->id->command_set_2 & 0x0400) &&
HWIF(drive)->pci_devid.vid==PCI_VENDOR_ID_PROMISE)
+ OUT_BYTE(drive->mult_count ? MULTI_READ_EXT : READ_EXT,
IDE_COMMAND_REG);
+ else
+ OUT_BYTE(drive->mult_count ? WIN_MULTREAD : WIN_READ, IDE_COMMAND_REG);
return ide_started;
}
if (rq->cmd == WRITE) {
@@ -422,7 +442,11 @@
if (drive->using_dma && !(HWIF(drive)->dmaproc(ide_dma_write, drive)))
return ide_started;
#endif /* CONFIG_BLK_DEV_IDEDMA */
- OUT_BYTE(drive->mult_count ? WIN_MULTWRITE : WIN_WRITE, IDE_COMMAND_REG);
+ /* out 48 bits R/W command here */
+ if ((drive->id->command_set_2 & 0x0400) &&
HWIF(drive)->pci_devid.vid==PCI_VENDOR_ID_PROMISE)
+ OUT_BYTE(drive->mult_count ? MULTI_WRITE_EXT : WRITE_EXT,
IDE_COMMAND_REG);
+ else
+ OUT_BYTE(drive->mult_count ? WIN_MULTWRITE : WIN_WRITE,
IDE_COMMAND_REG);
if (ide_wait_stat(&startstop, drive, DATA_READY, drive->bad_wstat,
WAIT_DRQ)) {
printk(KERN_ERR "%s: no DRQ after issuing %s\n", drive->name,
drive->mult_count ? "MULTWRITE" : "WRITE");
@@ -481,7 +505,7 @@
static void idedisk_release (struct inode *inode, struct file *filp,
ide_drive_t *drive)
{
if (drive->removable && !drive->usage) {
- invalidate_bdev(inode->i_bdev, 0);
+ invalidate_buffers(inode->i_rdev);
if (drive->doorlocking && ide_wait_cmd(drive, WIN_DOORUNLOCK, 0, 0, 0,
NULL))
drive->doorlocking = 0;
}
@@ -508,12 +532,22 @@
{
struct hd_driveid *id = drive->id;
unsigned long capacity = drive->cyl * drive->head * drive->sect;
+ int lba48=drive->id->command_set_2 & 0x0400;
+ unsigned long temp=0;

drive->select.b.lba = 0;

/* Determine capacity, and use LBA if the drive properly supports it */
if ((id->capability & 2) && lba_capacity_is_ok(id)) {
capacity = id->lba_capacity;
+ /* get 48 bits disk capacity if support */
+ if (lba48 && HWIF(drive)->pci_devid.vid==PCI_VENDOR_ID_PROMISE)
+ {
+ temp=id->words94_125[7];
+ temp<<=16;
+ temp|=id->words94_125[6];
+ capacity=temp;
+ }
drive->cyl = capacity / (drive->head * drive->sect);
drive->select.b.lba = 1;
}
@@ -769,7 +803,7 @@

/* Give size in megabytes (MB), not mebibytes (MiB). */
/* We compute the exact rounded value, avoiding overflow. */
- printk (" (%ld MB)", (capacity - capacity/625 + 974)/1950);
+ printk (" (%ld GB)", ((capacity - capacity/625 + 974)/1950)/1024);

/* Only print cache size when it was specified */
if (id->buf_size)
diff -urN linux-2.4.18.org/drivers/ide/ide-dma.c linux/drivers/ide/ide-dma.c
--- linux-2.4.18.org/drivers/ide/ide-dma.c Mon Sep 10 01:43:02 2001
+++ linux/drivers/ide/ide-dma.c Thu Feb 28 00:00:15 2002
@@ -75,6 +75,8 @@
* ATA-66/100 and recovery functions, I forgot the rest......
* SELECT_READ_WRITE(hwif,drive,func) for active tuning based on IO
direction.
*
+ * Support UltraDMA Mode 6 and 48 bit LBA Mode.
+ * Powered by PROMISE Technology, Inc. Portions Copyright (C)2001.
*/

#include <linux/config.h>
@@ -101,6 +103,8 @@
#define DEFAULT_BMCRBA 0xcc00 /* VIA's default value */
#define DEFAULT_BMALIBA 0xd400 /* ALI's default value */

+#define CONFIG_BLK_DEV_IDEDMA_TIMEOUT 1 // By Promise
+
extern char *ide_dmafunc_verbose(ide_dma_action_t dmafunc);

#ifdef CONFIG_IDEDMA_NEW_DRIVE_LISTINGS
@@ -429,18 +433,22 @@
struct hd_driveid *id = drive->id;

if ((id->field_valid & 4) && (eighty_ninty_three(drive)) &&
- (id->dma_ultra & (id->dma_ultra >> 11) & 7)) {
- if ((id->dma_ultra >> 13) & 1) {
- printk(", UDMA(100)"); /* UDMA BIOS-enabled! */
+ (id->dma_ultra & (id->dma_ultra >> 14) & 3)) {
+ if ((id->dma_ultra >> 15) & 1) {
+ printk(", UDMA(166?)"); /* UDMA 7 BIOS-enabled! */
+ } else if ((id->dma_ultra >> 14) & 1) {
+ printk(", UDMA(133)"); /* UDMA 6 BIOS-enabled! */
+ } else if ((id->dma_ultra >> 13) & 1) {
+ printk(", UDMA(100)"); /* UDMA 5 BIOS-enabled! */
} else if ((id->dma_ultra >> 12) & 1) {
- printk(", UDMA(66)"); /* UDMA BIOS-enabled! */
+ printk(", UDMA(66)"); /* UDMA 4 BIOS-enabled! */
} else {
printk(", UDMA(44)"); /* UDMA BIOS-enabled! */
}
} else if ((id->field_valid & 4) &&
(id->dma_ultra & (id->dma_ultra >> 8) & 7)) {
if ((id->dma_ultra >> 10) & 1) {
- printk(", UDMA(33)"); /* UDMA BIOS-enabled! */
+ printk(", UDMA(33)"); /* UDMA 2 BIOS-enabled! */
} else if ((id->dma_ultra >> 9) & 1) {
printk(", UDMA(25)"); /* UDMA BIOS-enabled! */
} else {
@@ -463,7 +471,11 @@
/* Consult the list of known "bad" drives */
if (ide_dmaproc(ide_dma_bad_drive, drive))
return hwif->dmaproc(ide_dma_off, drive);
-
+
+ /* Enable DMA on any drive that has UltraDMA (mode 6/7) enabled */
+ if ((id->field_valid & 4) && (eighty_ninty_three(drive)))
+ if ((id->dma_ultra & (id->dma_ultra >> 14) & 3))
+ return hwif->dmaproc(ide_dma_on, drive);
/* Enable DMA on any drive that has UltraDMA (mode 3/4/5) enabled */
if ((id->field_valid & 4) && (eighty_ninty_three(drive)))
if ((id->dma_ultra & (id->dma_ultra >> 11) & 7))
@@ -550,13 +562,18 @@
*/
int ide_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
{
-// ide_hwgroup_t *hwgroup = HWGROUP(drive);
ide_hwif_t *hwif = HWIF(drive);
- unsigned long dma_base = hwif->dma_base;
+ unsigned long dma_base = hwif->dma_base;
byte unit = (drive->select.b.unit & 0x01);
unsigned int count, reading = 0;
byte dma_stat;
-
+ int lba48 =drive->id->command_set_2 & 0x0400;
+ unsigned long high_16 = pci_resource_start(hwif->pci_dev, 4);
+ byte clock =inb(high_16+0x11);
+ unsigned long atapi_port =high_16+ 0x20 + (hwif->channel ? 0x04 : 0x00);
+ struct request *rq = HWGROUP(drive)->rq;
+ unsigned long word_count = 0;
+
switch (func) {
case ide_dma_off:
printk("%s: DMA disabled\n", drive->name);
@@ -586,18 +603,39 @@
#else /* !CONFIG_BLK_DEV_IDEDMA_TIMEOUT */
ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, dma_timer_expiry); /*
issue cmd to drive */
#endif /* CONFIG_BLK_DEV_IDEDMA_TIMEOUT */
- OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG);
+ if (lba48 && hwif->pci_devid.vid==PCI_VENDOR_ID_PROMISE)
+ OUT_BYTE(reading ? READ_DMA_EXT : WRITE_DMA_EXT, IDE_COMMAND_REG);
+ else
+ OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG);
case ide_dma_begin:
/* Note that this is done *after* the cmd has
- * been issued to the drive, as per the BM-IDE spec.
- * The Promise Ultra33 doesn't work correctly when
- * we do this part before issuing the drive cmd.
- */
- outb(inb(dma_base)|1, dma_base); /* start DMA */
+ * been issued to the drive, as per the BM-IDE spec. */
+ /* Enable ATAPI UDMA port for 48bit data on PDC20267 */
+ if (lba48 && hwif->pci_devid.vid==PCI_VENDOR_ID_PROMISE &&
+ (hwif->pci_devid.did == PCI_DEVICE_ID_PROMISE_20267 ||
+ hwif->pci_devid.did == PCI_DEVICE_ID_PROMISE_20265 ||
+ hwif->pci_devid.did == PCI_DEVICE_ID_PROMISE_20262))
+ {
+ outb(clock|(hwif->channel ? 0x08:0x02), high_16 + 0x11);
+ word_count=(rq->nr_sectors << 8);
+ word_count=reading ? word_count | 0x05000000 : word_count | 0x06000000;
+ outl(word_count, atapi_port);
+ }
+ outb(inb(dma_base)|1, dma_base); /* start DMA */
return 0;
case ide_dma_end: /* returns 1 on error, 0 otherwise */
drive->waiting_for_dma = 0;
outb(inb(dma_base)&~1, dma_base); /* stop DMA */
+ /* Disable ATAPI UDMA port for 48bit data on PDC20267 */
+ if (lba48 && hwif->pci_devid.vid==PCI_VENDOR_ID_PROMISE &&
+ (hwif->pci_devid.did == PCI_DEVICE_ID_PROMISE_20267 ||
+ hwif->pci_devid.did == PCI_DEVICE_ID_PROMISE_20265 ||
+ hwif->pci_devid.did == PCI_DEVICE_ID_PROMISE_20262))
+ {
+ outl(0, atapi_port);
+ clock=inb(high_16+0x11);
+ outb(clock & ~(hwif->channel ? 0x08:0x02), high_16+0x11);
+ }
dma_stat = inb(dma_base+2); /* get DMA status */
outb(dma_stat|6, dma_base+2); /* clear the INTR & ERROR bits */
ide_destroy_dmatable(drive); /* purge DMA mappings */
diff -urN linux-2.4.18.org/drivers/ide/ide-features.c
linux/drivers/ide/ide-features.c
--- linux-2.4.18.org/drivers/ide/ide-features.c Sat Feb 10 03:40:02 2001
+++ linux/drivers/ide/ide-features.c Thu Feb 28 00:04:42 2002
@@ -261,6 +261,9 @@
*/
byte eighty_ninty_three (ide_drive_t *drive)
{
+ if (HWIF(drive)->pci_devid.vid==0x105a)
+ return(HWIF(drive)->udma_four);
+ /* PDC202XX: that's because some HDD will return wrong info */
return ((byte) ((HWIF(drive)->udma_four) &&
#ifndef CONFIG_IDEDMA_IVB
(drive->id->hw_config & 0x4000) &&
diff -urN linux-2.4.18.org/drivers/ide/ide-pci.c linux/drivers/ide/ide-pci.c
--- linux-2.4.18.org/drivers/ide/ide-pci.c Fri Oct 26 04:53:47 2001
+++ linux/drivers/ide/ide-pci.c Wed Feb 27 19:26:40 2002
@@ -11,6 +11,10 @@
* This module provides support for automatic detection and
* configuration of all PCI IDE interfaces present in a system.
*/
+/*
+ * Support PROMISE PDC20268/20269/20275 IDE Controller.
+ * Powered by PROMISE Technology, Inc. Portions Copyright (C)2001.
+ */

#include <linux/config.h>
#include <linux/types.h>
@@ -45,8 +49,9 @@
#define DEVID_PDC20262 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE,
PCI_DEVICE_ID_PROMISE_20262})
#define DEVID_PDC20265 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE,
PCI_DEVICE_ID_PROMISE_20265})
#define DEVID_PDC20267 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE,
PCI_DEVICE_ID_PROMISE_20267})
-#define DEVID_PDC20268 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE,
PCI_DEVICE_ID_PROMISE_20268})
-#define DEVID_PDC20268R ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE,
PCI_DEVICE_ID_PROMISE_20268R})
+#define DEVID_PDC20268 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE,
PCI_DEVICE_ID_PROMISE_20268})
+#define DEVID_PDC20269 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE,
PCI_DEVICE_ID_PROMISE_20269})
+#define DEVID_PDC20275 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE,
PCI_DEVICE_ID_PROMISE_20275})
#define DEVID_RZ1000 ((ide_pci_devid_t){PCI_VENDOR_ID_PCTECH,
PCI_DEVICE_ID_PCTECH_RZ1000})
#define DEVID_RZ1001 ((ide_pci_devid_t){PCI_VENDOR_ID_PCTECH,
PCI_DEVICE_ID_PCTECH_RZ1001})
#define DEVID_SAMURAI ((ide_pci_devid_t){PCI_VENDOR_ID_PCTECH,
PCI_DEVICE_ID_PCTECH_SAMURAI_IDE})
@@ -402,10 +407,8 @@
{DEVID_PDC20267,"PDC20267", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX,
NULL, {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, OFF_BOARD, 48 },
#endif
{DEVID_PDC20268,"PDC20268", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX,
NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 16 },
- /* Promise used a different PCI ident for the raid card apparently to try
and
- prevent Linux detecting it and using our own raid code. We want to
detect
- it for the ataraid drivers, so we have to list both here.. */
- {DEVID_PDC20268R,"PDC20268", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX,
NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 16 },
+ {DEVID_PDC20269,"PDC20269", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX,
NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 16 },
+ {DEVID_PDC20275,"PDC20275", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX,
NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 16 },
{DEVID_RZ1000, "RZ1000", NULL, NULL, INIT_RZ1000, NULL,
{{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 },
{DEVID_RZ1001, "RZ1001", NULL, NULL, INIT_RZ1000, NULL,
{{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 },
{DEVID_SAMURAI, "SAMURAI", NULL, NULL, INIT_SAMURAI, NULL,
{{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 },
@@ -458,6 +461,8 @@
case PCI_DEVICE_ID_PROMISE_20265:
case PCI_DEVICE_ID_PROMISE_20267:
case PCI_DEVICE_ID_PROMISE_20268:
+ case PCI_DEVICE_ID_PROMISE_20269:
+ case PCI_DEVICE_ID_PROMISE_20275:
case PCI_DEVICE_ID_ARTOP_ATP850UF:
case PCI_DEVICE_ID_ARTOP_ATP860:
case PCI_DEVICE_ID_ARTOP_ATP860R:
@@ -586,6 +591,7 @@
ide_hwif_t *hwif, *mate = NULL;
unsigned int class_rev;
static int secondpdc = 0;
+ int new_chip=0;

#ifdef CONFIG_IDEDMA_AUTO
if (!noautodma)
@@ -684,6 +690,10 @@
/*
* Set up the IDE ports
*/
+ if ((IDE_PCI_DEVID_EQ(d->devid,DEVID_PDC20268)) ||
+ (IDE_PCI_DEVID_EQ(d->devid,DEVID_PDC20269)) ||
+ (IDE_PCI_DEVID_EQ(d->devid,DEVID_PDC20275)))
+ new_chip=1;
for (port = 0; port <= 1; ++port) {
unsigned long base = 0, ctl = 0;
ide_pci_enablebit_t *e = &(d->enablebits[port]);
@@ -697,9 +707,9 @@
goto controller_ok;
if ((IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20262)) && (secondpdc++==1) &&
(port==1) )
goto controller_ok;
-
- if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || (tmp & e->mask)
!= e->val))
- continue; /* port not enabled */
+ if (!(new_chip))
+ if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || (tmp &
e->mask) != e->val))
+ continue; /* port not enabled */
controller_ok:
if (IDE_PCI_DEVID_EQ(d->devid, DEVID_HPT366) && (port) && (class_rev <
0x03))
return;
@@ -774,7 +784,8 @@
IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20265) ||
IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20267) ||
IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20268) ||
- IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20268R) ||
+ IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20269) ||
+ IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20275) ||
IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6210) ||
IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6260) ||
IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6260R) ||
diff -urN linux-2.4.18.org/drivers/ide/ide.c linux/drivers/ide/ide.c
--- linux-2.4.18.org/drivers/ide/ide.c Tue Feb 26 03:37:57 2002
+++ linux/drivers/ide/ide.c Wed Feb 27 19:27:51 2002
@@ -716,7 +716,6 @@
}
}
hwgroup->poll_timeout = 0; /* done polling */
- return ide_stopped;
}

static void check_dma_crc (ide_drive_t *drive)
@@ -883,6 +882,7 @@
{
unsigned long flags;
byte err = 0;
+ int lba48=(drive->id->command_set_2 & 0x0400);

__save_flags (flags); /* local CPU only */
ide__sti(); /* local CPU only */
@@ -918,7 +918,16 @@
printk("}");
if ((err & (BBD_ERR | ABRT_ERR)) == BBD_ERR || (err &
(ECC_ERR|ID_ERR|MARK_ERR))) {
byte cur = IN_BYTE(IDE_SELECT_REG);
- if (cur & 0x40) { /* using LBA? */
+ if ((lba48) && (HWIF(drive)->pci_devid.vid==0x105a)) { /* 48bit LBA? */
+ OUT_BYTE(0x88, IDE_CONTROL_REG);
+ cur = IN_BYTE(IDE_SECTOR_REG);
+ OUT_BYTE(0x08, IDE_CONTROL_REG);
+ printk(", LBAsect=%ld", (unsigned long)
+ (cur << 24)
+ |(IN_BYTE(IDE_HCYL_REG)<<16)
+ |(IN_BYTE(IDE_LCYL_REG)<<8)
+ | IN_BYTE(IDE_SECTOR_REG));
+ } else if (cur & 0x40) { /* using LBA? */
printk(", LBAsect=%ld", (unsigned long)
((cur&0xf)<<24)
|(IN_BYTE(IDE_HCYL_REG)<<16)
@@ -3746,7 +3755,6 @@
char *options = NULL;
MODULE_PARM(options,"s");
MODULE_LICENSE("GPL");
-
static void __init parse_options (char *line)
{
char *next = line;
diff -urN linux-2.4.18.org/drivers/ide/pdc202xx.c
linux/drivers/ide/pdc202xx.c
--- linux-2.4.18.org/drivers/ide/pdc202xx.c Thu Nov 15 03:44:03 2001
+++ linux/drivers/ide/pdc202xx.c Thu Feb 28 00:48:45 2002
@@ -1,5 +1,5 @@
/*
- * linux/drivers/ide/pdc202xx.c Version 0.30 Mar. 18, 2000
+ * linux/drivers/ide/pdc202xx.c Version 0.32 Feb. 27, 2002
*
* Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org>
* May be copied or modified under the terms of the GNU General Public
License
@@ -12,7 +12,8 @@
* Promise Ultra66 cards with BIOS v1.11 this
* compiled into the kernel if you have more than one card installed.
*
- * Promise Ultra100 cards.
+ * Promise Ultra Series cards.
+ * Promise Ultra100TX2 & Ultra133TX2 cards.
*
* The latest chipset code will support the following ::
* Three Ultra33 controllers and 12 drives.
@@ -21,13 +22,29 @@
*
* UNLESS you enable "CONFIG_PDC202XX_BURST"
*
- */
-
-/*
- * Portions Copyright (C) 1999 Promise Technology, Inc.
- * Author: Frank Tiernan (frankt@promise.com)
+ * Version 1.20.b1 support PDC20268
+ * fix cable judge function
+ * Version 1.20.b2 support ATA-133 PDC20269/75
+ * support UDMA Mode 6
+ * fix proc report information
+ * set ATA133 timing
+ * fix ultra dma bit 14 selectable
+ * support 32bit LBA
+ * Version 1.20 b3 fix eighty_ninty_three()
+ * fix offset address 0x1c~0x1f
+ * Version 1.20 b4 fix 48bit LBA HOB bit
+ * force rescan drive under PIO modes if need
+ * Version 1.20.0.5 could be patched with ext3 filesystem code
+ * Vers