Subject: Re: Some questions about VIA southbridge
To: Juan RP <juan@xtraeme.nopcode.org>
From: None <cube@cubidou.net>
List: port-i386
Date: 10/27/2004 11:23:46
On Wed, Oct 27, 2004 at 09:12:43AM +0200, Juan RP wrote:
> On Wed, 27 Oct 2004 08:58:50 +0200
> Juan RP <juan@xtraeme.nopcode.org> wrote:
> 
> > 
> > My system contains a VIA VT8235 southbridge, and it's working
> > perfectly with NetBSD, but pcictl(8) detects a VT82C586A IDE controller:
> > 
> > [juan@Nocturno][~]> pcictl pci0 list|grep IDE
> > 000:17:1: VIA Technologies VT82C586A IDE Controller [...]
> > [juan@Nocturno][~]>
> > 
> > viaide0 at pci0 dev 17 function 1
> > viaide0: VIA Technologies VT8235 ATA133 controller
> > viaide0: bus-master DMA support present
> > viaide0: primary channel configured to compatibility mode
> > viaide0: primary channel interrupting at irq 14
> > atabus0 at viaide0 channel 0
> > viaide0: secondary channel configured to compatibility mode
> > viaide0: secondary channel interrupting at irq 15
> > atabus1 at viaide0 channel 1
> 
> Clearly pcictl(8) does not work as expected, because it always reports
> the IDE controller is the VIA VT82C586A when it's wrong on my two
> boxes.
> 
> http://www.via.com.tw/en/products/chipsets/southbridge/vt8235/
> 
> Should I fil a PR?

No.

Have a look at the probe code in viaide.c.  What it does is the following.
First, it detects a VIA IDE device.  There are only 3 PCI product IDs for
that:  PCI_PRODUCT_VIATECH_VT82C586_IDE, PCI_PRODUCT_VIATECH_VT82C586A_IDE
and PCI_PRODUCT_VIATECH_VT8237_SATA.

The actual detection happens in via_chip_map, where the actual LPC/ISA
bridge is scanned to know what is the actual device.  That is only at that
point that viaide(4) knows it deals with a VT8235 device.

So pcictl(8) is right, as it only shows the PCI product ID, which is the
same in both case.

Looking closer, it appears that chip is truly always the same, except
for the UDMA level it is capable of, and that's why the driver looks at
the bridge IDs.

Quentin Garnier.