2004-11-23 07:23:57

by Mathias Kretschmer

[permalink] [raw]
Subject: VIA VT610 IDE support for 2.4.28 (trivial)

diff -u -r -N linux-2.4.28/drivers/ide/pci/generic.c linux-2.4.28-vt610/drivers/ide/pci/generic.c
--- linux-2.4.28/drivers/ide/pci/generic.c 2004-08-07 16:26:04.000000000 -0700
+++ linux-2.4.28-vt610/drivers/ide/pci/generic.c 2004-11-22 21:50:25.000000000 -0800
@@ -66,6 +66,9 @@
hwif->mwdma_mask = 0x07;
hwif->swdma_mask = 0x07;

+ if (hwif->pci_dev->device == PCI_DEVICE_ID_VIA_610)
+ hwif->udma_four = 1; /* mj */
+
if (!noautodma)
hwif->autodma = 1;
hwif->drives[0].autodma = hwif->autodma;
@@ -143,6 +146,7 @@
{ PCI_VENDOR_ID_TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9},
{ PCI_VENDOR_ID_TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10},
{ PCI_VENDOR_ID_TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11},
+ { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_610, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12},
{ 0, },
};

diff -u -r -N linux-2.4.28/drivers/ide/pci/generic.h linux-2.4.28-vt610/drivers/ide/pci/generic.h
--- linux-2.4.28/drivers/ide/pci/generic.h 2004-08-07 16:26:04.000000000 -0700
+++ linux-2.4.28-vt610/drivers/ide/pci/generic.h 2004-11-22 21:50:13.000000000 -0800
@@ -157,6 +157,19 @@
.channels = 2,
.autodma = NOAUTODMA,
.bootable = ON_BOARD,
+ },{ /* 12 */
+ .vendor = PCI_VENDOR_ID_VIA,
+ .device = PCI_DEVICE_ID_VIA_610,
+ .name = "VIA_610",
+ .init_chipset = init_chipset_generic,
+ .init_iops = NULL,
+ .init_hwif = init_hwif_generic,
+ .init_dma = init_dma_generic,
+ .channels = 2,
+ .autodma = AUTODMA,
+ .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
+ .bootable = ON_BOARD,
+ .extra = 0,
},{
.vendor = 0,
.device = 0,
diff -u -r -N linux-2.4.28/include/linux/pci_ids.h linux-2.4.28-vt610/include/linux/pci_ids.h
--- linux-2.4.28/include/linux/pci_ids.h 2004-11-17 03:54:22.000000000 -0800
+++ linux-2.4.28-vt610/include/linux/pci_ids.h 2004-11-22 21:54:09.000000000 -0800
@@ -1123,6 +1123,7 @@
#define PCI_DEVICE_ID_VIA_8233A 0x3147
#define PCI_DEVICE_ID_VIA_P4M266 0x3148
#define PCI_DEVICE_ID_VIA_8237_SATA 0x3149
+#define PCI_DEVICE_ID_VIA_610 0x3164
#define PCI_DEVICE_ID_VIA_P4X333 0x3168
#define PCI_DEVICE_ID_VIA_8235 0x3177
#define PCI_DEVICE_ID_VIA_8377_0 0x3189


Attachments:
2.4.28-vt610.patch (2.36 kB)

2004-11-23 18:32:00

by Jeff Garzik

[permalink] [raw]
Subject: Re: VIA VT610 IDE support for 2.4.28 (trivial)

Mathias Kretschmer wrote:
> hi,
>
> I found an older version of this patch (against 2.4.22) on some website.
> After a little bit of editing it applied cleanly to 2.4.27 (and now
> 2.4.28). It works fine for me on a ASUS P4P800-Deluxe with 4x 300GB disks.
>
> Maybe someone finds this patch helpful. Any reason why the original
> patch did not make it into the kernel ?

Why not add it to the existing via82cxxx driver, and get better
performance and device tuning?

Jeff



2004-11-23 20:51:22

by Mathias Kretschmer

[permalink] [raw]
Subject: Re: VIA VT610 IDE support for 2.4.28 (trivial)

Jeff Garzik wrote:

> Mathias Kretschmer wrote:
>
>> hi,
>>
>> I found an older version of this patch (against 2.4.22) on some
>> website. After a little bit of editing it applied cleanly to 2.4.27
>> (and now 2.4.28). It works fine for me on a ASUS P4P800-Deluxe with
>> 4x 300GB disks.
>>
>> Maybe someone finds this patch helpful. Any reason why the original
>> patch did not make it into the kernel ?
>
>
> Why not add it to the existing via82cxxx driver, and get better
> performance and device tuning?


I only have that one ASUS board and there's data on the disks that I do
not want to loose.
The current patch worked well for me (performance is pretty decent), so
I went with it.

I can modify the VIA driver code, but looking at the various
exceptions/quirks for the various VIA chip sets, I'm a bit hesitant to
test it on my box.

-Mathias

2005-02-06 23:02:22

by Mathias Kretschmer

[permalink] [raw]
Subject: Re: VIA VT610 IDE support for 2.4.28 (trivial) - now for 2.4.29/via82cxxx

diff -aurN linux-2.4.29/drivers/ide/pci/via82cxxx.c linux-2.4.29-vanilla/drivers/ide/pci/via82cxxx.c
--- linux-2.4.29/drivers/ide/pci/via82cxxx.c 2003-08-25 04:44:41.000000000 -0700
+++ linux-2.4.29-vanilla/drivers/ide/pci/via82cxxx.c 2005-02-06 14:45:20.000000000 -0800
@@ -74,6 +74,7 @@
u8 rev_max;
u16 flags;
} via_isa_bridges[] = {
+ { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt8233a", PCI_DEVICE_ID_VIA_8233A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
@@ -641,6 +642,7 @@
static struct pci_device_id via_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
+ { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_6410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ 0, },
};

diff -aurN linux-2.4.29/drivers/ide/pci/via82cxxx.h linux-2.4.29-vanilla/drivers/ide/pci/via82cxxx.h
--- linux-2.4.29/drivers/ide/pci/via82cxxx.h 2003-06-13 07:51:33.000000000 -0700
+++ linux-2.4.29-vanilla/drivers/ide/pci/via82cxxx.h 2005-02-06 14:45:16.000000000 -0800
@@ -56,6 +56,19 @@
.enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
.bootable = ON_BOARD,
.extra = 0,
+ },{ /* 2 */
+ .vendor = PCI_VENDOR_ID_VIA,
+ .device = PCI_DEVICE_ID_VIA_6410,
+ .name = "VP_IDE",
+ .init_chipset = init_chipset_via82cxxx,
+ .init_iops = NULL,
+ .init_hwif = init_hwif_via82cxxx,
+ .init_dma = init_dma_via82cxxx,
+ .channels = 2,
+ .autodma = AUTODMA,
+ .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
+ .bootable = ON_BOARD,
+ .extra = 0,
},{
.vendor = 0,
.device = 0,
diff -aurN linux-2.4.29/include/linux/pci_ids.h linux-2.4.29-vanilla/include/linux/pci_ids.h
--- linux-2.4.29/include/linux/pci_ids.h 2005-01-19 06:10:12.000000000 -0800
+++ linux-2.4.29-vanilla/include/linux/pci_ids.h 2005-02-06 14:46:48.000000000 -0800
@@ -1136,6 +1136,7 @@
#define PCI_DEVICE_ID_VIA_8233A 0x3147
#define PCI_DEVICE_ID_VIA_P4M266 0x3148
#define PCI_DEVICE_ID_VIA_8237_SATA 0x3149
+#define PCI_DEVICE_ID_VIA_6410 0x3164
#define PCI_DEVICE_ID_VIA_P4X333 0x3168
#define PCI_DEVICE_ID_VIA_8235 0x3177
#define PCI_DEVICE_ID_VIA_8377_0 0x3189


Attachments:
2.4.29-vt6410.patch (2.60 kB)

2005-02-07 17:17:00

by Mathias Kretschmer

[permalink] [raw]
Subject: VIA VT6410 IDE support for 2.6.11-rc3/via82cxxx

diff -ruaN linux-2.6.10/drivers/ide/pci/via82cxxx.c linux-2.6.10-vt6410/drivers/ide/pci/via82cxxx.c
--- linux-2.6.10/drivers/ide/pci/via82cxxx.c 2005-02-07 08:43:05.899657752 -0800
+++ linux-2.6.10-vt6410/drivers/ide/pci/via82cxxx.c 2005-02-07 08:47:24.001420320 -0800
@@ -79,6 +79,7 @@
u8 rev_max;
u16 flags;
} via_isa_bridges[] = {
+ { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt8233a", PCI_DEVICE_ID_VIA_8233A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
@@ -619,24 +620,35 @@
hwif->drives[1].autodma = hwif->autodma;
}

-static ide_pci_device_t via82cxxx_chipset __devinitdata = {
- .name = "VP_IDE",
- .init_chipset = init_chipset_via82cxxx,
- .init_hwif = init_hwif_via82cxxx,
- .channels = 2,
- .autodma = NOAUTODMA,
- .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
- .bootable = ON_BOARD,
+static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
+ { /* 0 */
+ .name = "VP_IDE",
+ .init_chipset = init_chipset_via82cxxx,
+ .init_hwif = init_hwif_via82cxxx,
+ .channels = 2,
+ .autodma = NOAUTODMA,
+ .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
+ .bootable = ON_BOARD
+ },{ /* 1 */
+ .name = "VP_IDE",
+ .init_chipset = init_chipset_via82cxxx,
+ .init_hwif = init_hwif_via82cxxx,
+ .channels = 2,
+ .autodma = AUTODMA,
+ .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
+ .bootable = ON_BOARD,
+ }
};

static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
- return ide_setup_pci_device(dev, &via82cxxx_chipset);
+ return ide_setup_pci_device(dev, &via82cxxx_chipsets[id->driver_data]);
}

static struct pci_device_id via_pci_tbl[] = {
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+ { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_6410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
MODULE_DEVICE_TABLE(pci, via_pci_tbl);
diff -ruaN linux-2.6.10/include/linux/pci_ids.h linux-2.6.10-vt6410/include/linux/pci_ids.h
--- linux-2.6.10/include/linux/pci_ids.h 2005-02-07 08:43:10.560949128 -0800
+++ linux-2.6.10-vt6410/include/linux/pci_ids.h 2005-02-06 17:42:54.836256000 -0800
@@ -1280,6 +1280,7 @@
#define PCI_DEVICE_ID_VIA_8703_51_0 0x3148
#define PCI_DEVICE_ID_VIA_8237_SATA 0x3149
#define PCI_DEVICE_ID_VIA_XN266 0x3156
+#define PCI_DEVICE_ID_VIA_6410 0x3164
#define PCI_DEVICE_ID_VIA_8754C_0 0x3168
#define PCI_DEVICE_ID_VIA_8235 0x3177
#define PCI_DEVICE_ID_VIA_P4N333 0x3178


Attachments:
2.6.11-rc3-vt6410.patch (2.80 kB)

2005-02-07 17:29:07

by Jeff Garzik

[permalink] [raw]
Subject: Re: VIA VT6410 IDE support for 2.6.11-rc3/via82cxxx

Mathias Kretschmer wrote:
> Mathias Kretschmer wrote:
>
>> Mathias Kretschmer wrote:
>>
>>> Jeff Garzik wrote:
>>>
>>>> Mathias Kretschmer wrote:
>>>>
>>>>> hi,
>>>>>
>>>>> I found an older version of this patch (against 2.4.22) on some
>>>>> website. After a little bit of editing it applied cleanly to 2.4.27
>>>>> (and now 2.4.28). It works fine for me on a ASUS P4P800-Deluxe with
>>>>> 4x 300GB disks.
>>>>>
>>>>> Maybe someone finds this patch helpful. Any reason why the original
>>>>> patch did not make it into the kernel ?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Why not add it to the existing via82cxxx driver, and get better
>>>> performance and device tuning?
>>
>>
>>
>> OK, the attached patch adds support for the VIA 6410 chip to the
>> via82cxxx driver (instead of the generic driver).
>> I've tested it on the board mentioned above. Works fine for me.
>>
>> Cheers,
>>
>> Mathias
>
>
> as above, but for 2.6.11-rc3


Bart, got this one?

Jeff


Subject: Re: VIA VT6410 IDE support for 2.6.11-rc3/via82cxxx

On Mon, 07 Feb 2005 12:27:47 -0500, Jeff Garzik <[email protected]> wrote:
> Mathias Kretschmer wrote:
> > Mathias Kretschmer wrote:
> >
> >> Mathias Kretschmer wrote:
> >>
> >>> Jeff Garzik wrote:
> >>>
> >>>> Mathias Kretschmer wrote:
> >>>>
> >>>>> hi,
> >>>>>
> >>>>> I found an older version of this patch (against 2.4.22) on some
> >>>>> website. After a little bit of editing it applied cleanly to 2.4.27
> >>>>> (and now 2.4.28). It works fine for me on a ASUS P4P800-Deluxe with
> >>>>> 4x 300GB disks.
> >>>>>
> >>>>> Maybe someone finds this patch helpful. Any reason why the original
> >>>>> patch did not make it into the kernel ?
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> Why not add it to the existing via82cxxx driver, and get better
> >>>> performance and device tuning?
> >>
> >>
> >>
> >> OK, the attached patch adds support for the VIA 6410 chip to the
> >> via82cxxx driver (instead of the generic driver).
> >> I've tested it on the board mentioned above. Works fine for me.
> >>
> >> Cheers,
> >>
> >> Mathias
> >
> >
> > as above, but for 2.6.11-rc3
>
> Bart, got this one?

I applied it (after whitespace cleanup) to ide-dev-2.6.

Thanks,
Bartlomiej