2004-03-30 13:24:32

by Zdenek Tlusty

[permalink] [raw]
Subject: via 6420 pata/sata controller

hello,

I have problem with via 6420 controller under linux (I have mandrake 9.1 with
kernel 2.4.25 with libata patch version 16).
This controller has two sata and one pata channels. Sata channel works fine
with libata. My problem is with pata channel. I have pata hard disk on this
controller. Bios of the controller detected this disk but linux did not.
What is the current status of the driver for this controller?
Thank you for your time.

Zdenek Tlusty

cat /proc/ioports:

0000-001f : dma1
0020-003f : pic1
0040-005f : timer
0060-006f : keyboard
0070-007f : rtc
0080-008f : dma page reg
00a0-00bf : pic2
00c0-00df : dma2
00f0-00ff : fpu
0170-0177 : ide1
01f0-01f7 : ide0
0376-0376 : ide1
03c0-03df : vga+
03f6-03f6 : ide0
0cf8-0cff : PCI conf1
c800-c8ff : PCI device 1106:3149 (VIA Technologies, Inc.)
c800-c8ff : sata_via
cc00-cc7f : 3Com Corporation 3c905B 100BaseTX [Cyclone]
cc00-cc7f : 01:0b.0
cf60-cf6f : PCI device 1106:3149 (VIA Technologies, Inc.)
cf60-cf6f : sata_via
cf80-cf87 : PCI device 1106:3149 (VIA Technologies, Inc.)
cf80-cf87 : sata_via
cf88-cf8b : PCI device 1106:3149 (VIA Technologies, Inc.)
cf88-cf8b : sata_via
cf8c-cf8f : PCI device 1106:3149 (VIA Technologies, Inc.)
cf8c-cf8f : sata_via
cf90-cf9f : PCI device 1106:4149 (VIA Technologies, Inc.)
cfa0-cfa7 : PCI device 1106:3149 (VIA Technologies, Inc.)
cfa0-cfa7 : sata_via
cfa8-cfaf : PCI device 1106:4149 (VIA Technologies, Inc.)
cfe0-cfe3 : PCI device 1106:4149 (VIA Technologies, Inc.)
cfe4-cfe7 : PCI device 1106:4149 (VIA Technologies, Inc.)
cff0-cff7 : PCI device 1106:4149 (VIA Technologies, Inc.)
d000-dfff : PCI Bus #02
d800-d8ff : ATI Technologies Inc 3D Rage Pro AGP 1X/2X
ef40-ef5f : Intel Corp. 82801BA/BAM USB (Hub #1)
ef40-ef5f : usb-uhci
ef80-ef9f : Intel Corp. 82801BA/BAM USB (Hub #2)
ef80-ef9f : usb-uhci
efa0-efaf : Intel Corp. 82801BA/BAM SMBus
ffa0-ffaf : Intel Corp. 82801BA IDE U100
ffa0-ffa7 : ide0
ffa8-ffaf : ide1


Subject: Re: via 6420 pata/sata controller

On Tuesday 30 of March 2004 15:24, Zdenek Tlusty wrote:
> hello,
>
> I have problem with via 6420 controller under linux (I have mandrake 9.1
> with kernel 2.4.25 with libata patch version 16).
> This controller has two sata and one pata channels. Sata channel works fine
> with libata. My problem is with pata channel. I have pata hard disk on this
> controller. Bios of the controller detected this disk but linux did not.
> What is the current status of the driver for this controller?
> Thank you for your time.

There are some patches floating around adding support for VT6410
(not VT6420) to generic IDE PCI driver. This controller may also work
with generic IDE PCI driver (PCI VendorID/ProductID needs to be added
to drivers/ide/pci/generic.h and drivers/ide/pci/generic.c).


http://www.viaarena.com/?PageID=186

"VIA want to make available code and other resources to appropriate open
source developers. The VIA Open Source Developer's portal currently accepts
requests for IDE and Networking development as well as the CLE266 display
adaptor."

Unfortunately it seems I'm not "appropriate" enough as I didn't get any reply.
:/

BTW Does anybody has contacts in VIA?

Regards,
Bartlomiej

2004-03-31 01:54:10

by Jeff Garzik

[permalink] [raw]
Subject: Re: via 6420 pata/sata controller

Bartlomiej Zolnierkiewicz wrote:
> On Tuesday 30 of March 2004 15:24, Zdenek Tlusty wrote:
>
>>hello,
>>
>>I have problem with via 6420 controller under linux (I have mandrake 9.1
>>with kernel 2.4.25 with libata patch version 16).
>>This controller has two sata and one pata channels. Sata channel works fine
>>with libata. My problem is with pata channel. I have pata hard disk on this
>>controller. Bios of the controller detected this disk but linux did not.
>>What is the current status of the driver for this controller?
>>Thank you for your time.
>
>
> There are some patches floating around adding support for VT6410
> (not VT6420) to generic IDE PCI driver. This controller may also work
> with generic IDE PCI driver (PCI VendorID/ProductID needs to be added
> to drivers/ide/pci/generic.h and drivers/ide/pci/generic.c).

VT 6420 should be added to via82cxxx.c, since it does the necessary bus
setup and such. AFAICS it is programmed just like all the other VIA
PATA controllers.


> BTW Does anybody has contacts in VIA?

Sure... I'll check my VT 6420 cards as well. It should just be another
PCI id added to via82cxxx.c.

Jeff



2004-04-18 23:14:00

by Kamil Okac

[permalink] [raw]
Subject: Re: via 6420 pata/sata controller

>Bartlomiej Zolnierkiewicz wrote:
>> On Tuesday 30 of March 2004 15:24, Zdenek Tlusty wrote:
>>
>>>hello,
>>>
>>>I have problem with via 6420 controller under linux (I have mandrake 9.1
>>>with kernel 2.4.25 with libata patch version 16).
>>>This controller has two sata and one pata channels. Sata channel
works fine
>>>with libata. My problem is with pata channel. I have pata hard disk
on this
>>>controller. Bios of the controller detected this disk but linux did not.
>>>What is the current status of the driver for this controller?
>>>Thank you for your time.
>>
>>
>> There are some patches floating around adding support for VT6410
>> (not VT6420) to generic IDE PCI driver. This controller may also work
>> with generic IDE PCI driver (PCI VendorID/ProductID needs to be added
>> to drivers/ide/pci/generic.h and drivers/ide/pci/generic.c).
>
>VT 6420 should be added to via82cxxx.c, since it does the necessary bus
>setup and such. AFAICS it is programmed just like all the other VIA
>PATA controllers.
>
>> BTW Does anybody has contacts in VIA?
>
>Sure... I'll check my VT 6420 cards as well. It should just be another
>PCI id added to via82cxxx.c.
>
> Jeff
>

Hello,

I tried to modify via82cxxx.c and .h, but was unsuccessful. Has anyone
got it to work properly?

Kamil Okac

2005-02-27 02:59:46

by [email protected]

[permalink] [raw]
Subject: Re: via 6420 pata/sata controller

>>Bartlomiej Zolnierkiewicz wrote:
>>> On Tuesday 30 of March 2004 15:24, Zdenek Tlusty wrote:
>>>
>>>>Hello,
>>>>
>>>>I have problem with via 6420 controller under linux (I have
mandrake 9.1
>>>>with kernel 2.4.25 with libata patch version 16).
>>>>This controller has two sata and one pata channels. Sata channel
works fine
>>>>with libata. My problem is with pata channel. I have pata hard disk
on this
>>>>controller. Bios of the controller detected this disk but linux did
not.
>>>>What is the current status of the driver for this controller?
>>>>Thank you for your time.
>>>
>>>
>>> There are some patches floating around adding support for VT6410
>>> (not VT6420) to generic IDE PCI driver. This controller may also work
>>> with generic IDE PCI driver (PCI VendorID/ProductID needs to be added
>>> to drivers/ide/pci/generic.h and drivers/ide/pci/generic.c).
>>
>>VT 6420 should be added to via82cxxx.c, since it does the necessary bus
>>setup and such. AFAICS it is programmed just like all the other VIA
>>PATA controllers.
>>
>> BTW Does anybody has contacts in VIA?
>>
>>Sure... I'll check my VT 6420 cards as well. It should just be another
>>PCI id added to via82cxxx.c.
>>
>> Jeff
>>
>
>Hello,
>
>I tried to modify via82cxxx.c and .h, but was unsuccessful. Has anyone
got it to work properly?
>
>Kamil Okac

* Per my message (last quoted line), the user should add the PCI ID to
* drivers/ide/via82cxxx.[ch] and see what happens.
*
* Jeff



Hello,
i trying resurrect this discussion again for solve this problem successfuly.

My experiments:
I changed two files:

usr/src/linux-2.6.11-rc5/include/linux/pci_ids.h
--- cut here ---
#define PCI_DEVICE_ID_VIA_8703_51_0 0x3148
#define PCI_DEVICE_ID_VIA_8237_SATA 0x3149
#define PCI_DEVICE_ID_VIA_6420 0x4149 ; <= this i was
add
#define PCI_DEVICE_ID_VIA_XN266 0x3156
#define PCI_DEVICE_ID_VIA_8754C_0 0x3168
--- cut here ---

/use/src/linux-2.6.11-rc5/drivers/ide/pci/via82cxxx.c
--- cut here ---
{ "vt8233c", PCI_DEVICE_ID_VIA_8233C_0, 0x00, 0x2f, VIA_UDMA_100 },
{ "vt8233", PCI_DEVICE_ID_VIA_8233_0, 0x00, 0x2f, VIA_UDMA_100 },
{ "vt8231", PCI_DEVICE_ID_VIA_8231, 0x00, 0x2f, VIA_UDMA_100 },
{ "vt6420", PCI_DEVICE_ID_VIA_6420, 0x00, 0x2f, VIA_UDMA_100 },
; <= this i was add
{ "vt82c686b", PCI_DEVICE_ID_VIA_82C686, 0x40, 0x4f, VIA_UDMA_100 },
{ "vt82c686a", PCI_DEVICE_ID_VIA_82C686, 0x10, 0x2f, VIA_UDMA_66 },
--- cut here ---

But i was not successful :'-(



Informations from my computer:
dmesg
--- cut here ---
Linux version 2.6.11-rc5 (root@linux) (gcc version 2.95.4 20011002
(Debian prerelease)) #1 Sat Feb 26 02:18:02 CET 2005
.
.
.
SCSI subsystem initialized
libata version 1.10 loaded.
sata_via version 1.1
sata_via(0000:00:0f.0): routed to hard irq line 10
ata1: SATA max UDMA/133 cmd 0x6200 ctl 0x6302 bmdma 0x6600 irq 10
ata2: SATA max UDMA/133 cmd 0x6400 ctl 0x6502 bmdma 0x6608 irq 10
ata1: no device found (phy stat 00000000)
scsi0 : sata_via
ata2: no device found (phy stat 00000000)
scsi1 : sata_via
--- cut here ---

lspci
--- cut here ---
0000:00:0f.0 RAID bus controller: VIA Technologies, Inc. VIA VT6420 SATA
RAID Controller (rev 50)
0000:00:0f.1 RAID bus controller: VIA Technologies, Inc.: Unknown device
4149 (rev 80)
--- cut here ---

lspci -n
--- cut here ---
0000:00:0f.0 0104: 1106:3149 (rev 50)
0000:00:0f.1 0104: 1106:4149 (rev 80)
--- cut here ---

cat /proc/ioports
--- cut here ---
6200-6207 : 0000:00:0f.0
6200-6207 : sata_via
6300-6303 : 0000:00:0f.0
6300-6303 : sata_via
6400-6407 : 0000:00:0f.0
6400-6407 : sata_via
6500-6503 : 0000:00:0f.0
6500-6503 : sata_via
6600-660f : 0000:00:0f.0
6600-660f : sata_via
6700-67ff : 0000:00:0f.0
6700-67ff : sata_via
6800-6807 : 0000:00:0f.1
6900-6903 : 0000:00:0f.1
6a00-6a07 : 0000:00:0f.1
6b00-6b03 : 0000:00:0f.1
6c00-6c0f : 0000:00:0f.1
--- cut here ---


This controller talking about:
http://www.sunsway.com.hk/products/sata-ide.html
http://www.viatech.co.jp/en/Products/vt6420.jsp
http://www.via.com.tw/en/products/peripherals/serial-ata_raid/vt6420/

Forum where they talked about - linux talking:
http://www.ussg.iu.edu/hypermail/linux/kernel/0403.3/1565.html
http://www.ussg.iu.edu/hypermail/linux/kernel/0403.3/1814.html
http://www.ussg.iu.edu/hypermail/linux/kernel/0403.3/1821.html
_http://www.ussg.iu.edu/hypermail/linux/kernel/0404.2/0573.html_

Forum where they talked about - freebsd talking:
http://lists.freebsd.org/pipermail/freebsd-current/2004-January/017706.html
http://lists.freebsd.org/pipermail/freebsd-current/2004-January/017725.html


Your's Sincerely
Petr Nov?k
[email protected]


2005-03-02 06:34:34

by Jeff Garzik

[permalink] [raw]
Subject: Re: via 6420 pata/sata controller

===== drivers/ide/pci/via82cxxx.c 1.27 vs edited =====
--- 1.27/drivers/ide/pci/via82cxxx.c 2005-02-03 02:24:29 -05:00
+++ edited/drivers/ide/pci/via82cxxx.c 2005-03-02 01:28:26 -05:00
@@ -79,6 +79,7 @@
u8 rev_max;
u16 flags;
} via_isa_bridges[] = {
+ { "vt6420", 0x4149, 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 },
@@ -635,9 +636,10 @@
}

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},
- { 0, },
+ { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1) },
+ { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1) },
+ { PCI_DEVICE(PCI_VENDOR_ID_VIA, 0x4149) },
+ { }, /* terminate list */
};
MODULE_DEVICE_TABLE(pci, via_pci_tbl);


Attachments:
patch (1.05 kB)

2005-03-04 14:11:13

by [email protected]

[permalink] [raw]
Subject: Re: via 6420 pata/sata controller

I downloaded new kernel 2.6.11, applied your's via82cxxx.c patch and
compiled it (.config was derived "make oldconfig" from 2.6.8 kernel from
Debian Sarge 3.1).

I created initrd.img with this settings:
/etc/mkinitrd/mkinitrd.conf
--- cut here ---
MODULES=dep
--- cut here ---

/etc/mkinitrd/modules
###
jbd
ext3
ide-core
via82cxxx

I boot PC with this settings:
/etc/modules
###
ide-cd
via82cxxx

Results:
Everything is the same, dmesg, lspci, lspci -n, cat /proc/ioports, lsmod
as the last email.

Controller still don't working :'(.

PS: I don't add anything into pci_ids.h, I only applied your's
via82cxxx.c patch:
#define PCI_DEVICE_ID_VIA_6420 0x4149

Your's Sincerely
Petr Nov?k
[email protected]

Jeff Garzik napsal(a):

> If I had to guess, I would try the attached patch. The via82cxxx.c
> driver is a bit annoying in that, here we do not talk to the ISA
> bridge but to the PCI device 0x4149 itself.
>
> If this doesn't work, I could probably whip together a quick PATA
> driver for libata that works on this hardware.
>
> Jeff
>
>------------------------------------------------------------------------
>
>===== drivers/ide/pci/via82cxxx.c 1.27 vs edited =====
>--- 1.27/drivers/ide/pci/via82cxxx.c 2005-02-03 02:24:29 -05:00
>+++ edited/drivers/ide/pci/via82cxxx.c 2005-03-02 01:28:26 -05:00
>@@ -79,6 +79,7 @@
> u8 rev_max;
> u16 flags;
> } via_isa_bridges[] = {
>+ { "vt6420", 0x4149, 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 },
>@@ -635,9 +636,10 @@
> }
>
> 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},
>- { 0, },
>+ { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1) },
>+ { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1) },
>+ { PCI_DEVICE(PCI_VENDOR_ID_VIA, 0x4149) },
>+ { }, /* terminate list */
> };
> MODULE_DEVICE_TABLE(pci, via_pci_tbl);
>