Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Fwd: port-amd64/43309: VX800 and CN896-VT8237S is not configured in RAID mode



Hi,

I am forwarding my email regarding my own old PR/43309 to
current-users, possibly it will have better visibility here. I wrote a
small patch which should fix:
* VX800 IDE will set correct UDMA mode. (VX855 should too, but can't test)
* If RAID mode is selected in BIOS (in my board), disks will be
recognized and attached. Possibly should fix id:7372 of 8237S variant
too (can't test).
* There's caveat that I am getting these errors below depending on
BIOS config for viaide0 or/and viaide1:
viaide1: autoconfiguration error: couldn't map SATA regs
viaide1: bus-master DMA support present, but unused (couldn't map registers)
viaide1: autoconfiguration error: couldn't map native-PCI interrupt

Can this patch be applied fully or partially (let's say just IDE
part)? Maybe somebody can test it too if anyone has machines with
affermentioned VIA chipsets. Thanks.

Regards,
Andrius V

---------- Forwarded message ---------
From: Andrius V <vezhlys%gmail.com@localhost>
Date: Tue, May 28, 2019 at 3:21 AM
Subject: Re: port-amd64/43309: VX800 and CN896-VT8237S is not
configured in RAID mode
To: <port-amd64-maintainer%netbsd.org@localhost>, <gnats-admin%netbsd.org@localhost>,
<netbsd-bugs%netbsd.org@localhost>, <gnats-bugs%netbsd.org@localhost>


Hi,

Since I still use VX800 based system, I decided to RAID/IDE support
again. It appeared support for VX800 had been never implemented in
NetBSD. So I decided to look at FreeBSD driver and test a bit. I
managed to make some fixes which apparently allows to recognized SATA
drives in RAID mode and use UDMA on IDE mode (it appeared that
recognized drives were working on DMA mode 2 only). I am still getting
messages below though in dmesg:

viaide1: autoconfiguration error: couldn't map SATA regs
viaide1: bus-master DMA support present, but unused (couldn't map registers)
viaide1: autoconfiguration error: couldn't map native-PCI interrupt

Also added VX855 IDE ID from FreeBSD. VT8237S_SATA_2 ID is taken from
dmesg in my bug report (plus confirmed in FreeBSD, Linux, though
naming is confused between systems), but I don't have these systems to
test.

I guess fix is not ideal, still having autoconfiguration errors,
didn't test anything beyond disk recognition but possibly worth to
add? If somebody can help to improve as well, I can test it anytime.
Thanks.

--- a/sys/dev/pci/pcidevs
+++ b/sys/dev/pci/pcidevs
@@ -7692,6 +7692,7 @@ product VIATECH VT8237A_SATA_2    0x5337
VT8237A Integrated SATA Controller
 product VIATECH VT3351_IOAPIC  0x5351  VT3351 I/O APIC Interrupt Controller
 product VIATECH P4M900_IOAPIC  0x5364  CN896/P4M900 IOAPIC
 product VIATECH VT8237S_SATA   0x5372  VT8237S Integrated SATA Controller
+product VIATECH VT8237S_SATA_2 0x7372  VT8237S Integrated SATA Controller
 product VIATECH VT86C100A      0x6100  VT86C100A (Rhine-II) 10/100 Ethernet
 product VIATECH VT8251_SATA    0x6287  VT8251 Integrated SATA Controller
 product VIATECH P4M900_6       0x6364  CN896/P4M900 Security Device
@@ -7704,6 +7705,7 @@ product VIATECH VT8231_PWR        0x8235  VT8231
Power Management Controller
 product VIATECH VT8363_PPB     0x8305  VT8363 (Apollo KT133) PCI to AGP Bridge
 product VIATECH CX700          0x8324  CX700 PCI-LPC Bridge
 product VIATECH VX800          0x8353  VX800/VX820 PCI-LPC Bridge
+product VIATECH VX855          0x8409  VX855  PCI-LPC Bridge
 product VIATECH VT8371_PPB     0x8391  VT8371 (Apollo KX133) PCI-PCI Bridge
 product VIATECH VT8501AGP      0x8501  VT8501 (Apollo MVP4) CPU-AGP Bridge
 product VIATECH VT82C597AGP    0x8597  VT82C597 (Apollo VP3) CPU-AGP Bridge

--- a/sys/dev/pci/viaide.c
+++ b/sys/dev/pci/viaide.c
@@ -309,6 +309,11 @@ static const struct pciide_product_desc
pciide_via_products[] =  {
          NULL,
          via_chip_map,
        },
+       { PCI_PRODUCT_VIATECH_VX800,
+         0,
+         "VIA Technologies VX800 SATA Controller",
+         via_sata_chip_map_new,
+       },
        { PCI_PRODUCT_VIATECH_VX900_IDE,
          0,
          NULL,
@@ -349,6 +354,11 @@ static const struct pciide_product_desc
pciide_via_products[] =  {
          "VIA Technologies VT8237S SATA Controller",
          via_sata_chip_map_7,
        },
+       { PCI_PRODUCT_VIATECH_VT8237S_SATA_2,
+         0,
+         "VIA Technologies VT8237S SATA Controller",
+         via_sata_chip_map_7,
+       },
        { 0,
          0,
          NULL,
@@ -546,6 +556,14 @@ via_chip_map(struct pciide_softc *sc, const
struct pci_attach_args *pa)
                                aprint_normal("VT8251 ATA133 controller\n");
                                sc->sc_wdcdev.sc_atac.atac_udma_cap = 6;
                                break;
+                       case PCI_PRODUCT_VIATECH_VX800:
+                               aprint_normal("VX800 ATA133 controller\n");
+                               sc->sc_wdcdev.sc_atac.atac_udma_cap = 6;
+                               break;
+                       case PCI_PRODUCT_VIATECH_VX855:
+                               aprint_normal("VX855 ATA133 controller\n");
+                               sc->sc_wdcdev.sc_atac.atac_udma_cap = 6;
+                               break;
                        default:
                unknown:
                                aprint_normal("unknown VIA ATA controller\n");


Changes in dmesg (IDE mode):
viaide0 at pci0 dev 15 function 0
viaide0: VIA Technologies unknown VIA ATA controller
viaide0: bus-master DMA support present
viaide0: primary channel configured to compatibility mode
viaide0: primary channel interrupting at ioapic0 pin 14
atabus0 at viaide0 channel 0
viaide0: secondary channel configured to compatibility mode
viaide0: secondary channel interrupting at ioapic0 pin 15
atabus1 at viaide0 channel 1
...
pcib0 at pci0 dev 17 function 0: vendor 1106 product 8353 (rev. 0x00)
...
wd0(viaide0:0:0): using PIO mode 4, DMA mode 2 (using DMA), WRITE DMA FUA EXT
wd1(viaide0:0:1): using PIO mode 4, DMA mode 2 (using DMA), WRITE DMA FUA EXT

became:

viaide0 at pci0 dev 15 function 0
viaide0: VIA Technologies VX800 ATA133 controller
viaide0: bus-master DMA support present
viaide0: primary channel configured to compatibility mode
viaide0: primary channel interrupting at ioapic0 pin 14
atabus0 at viaide0 channel 0
viaide0: secondary channel configured to compatibility mode
viaide0: secondary channel interrupting at ioapic0 pin 15
atabus1 at viaide0 channel 1
...
viaide1 at pci0 dev 17 function 0: VIA Technologies VX800 SATA
Controller (rev. 0x00)
viaide1: autoconfiguration error: couldn't map SATA regs
viaide1: bus-master DMA support present, but unused (couldn't map registers)
viaide1: autoconfiguration error: couldn't map native-PCI interrupt
...
wd0(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133)
(using DMA), WRITE DMA FUA EXT
wd1(viaide0:0:1): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133)
(using DMA), WRITE DMA FUA EXT

Changes in dmesg (RAID mode):

iaide0 at pci0 dev 15 function 0
viaide0: VIA Technologies unknown VIA ATA controller
viaide0: bus-master DMA support present
viaide0: primary channel wired to compatibility mode
viaide0: primary channel interrupting at ioapic0 pin 14
atabus0 at viaide0 channel 0
viaide0: secondary channel wired to compatibility mode
viaide0: secondary channel interrupting at ioapic0 pin 15
atabus1 at viaide0 channel 1
...
pcib0 at pci0 dev 17 function 0: vendor 1106 product 8353 (rev. 0x00)

became
viaide0 at pci0 dev 15 function 0
viaide0: autoconfiguration error: couldn't map SATA regs
viaide0: bus-master DMA support present
viaide0: using ioapic0 pin 21 for native-PCI interrupt
atabus0 at viaide0 channel 0
atabus1 at viaide0 channel 1
atabus2 at viaide0 channel 2
...
viaide1 at pci0 dev 17 function 0: VIA Technologies VX800 SATA
Controller (rev. 0x00)
viaide1: autoconfiguration error: couldn't map SATA regs
viaide1: bus-master DMA support present, but unused (couldn't map registers)
viaide1: autoconfiguration error: couldn't map native-PCI interrupt
...
wd0 at atabus0 drive 0
wd0: <ST3000DM001-1CH166>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 2794 GB, 5814021 cyl, 16 head, 63 sec, 512 bytes/sect x 5860533168 sectors
...
wd0: GPT GUID: 3954a983-ae2c-44b4-929a-a6f25b77cd1b
dk0 at wd0: "primary", 5860530176 blocks at 2048, type: ntfs
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6
(Ultra/133), WRITE DMA FUA, NCQ (32 tags)
wd1 at atabus0 drive 1
wd1: <TOSHIBA DT01ACA300>
wd1: drive supports 16-sector PIO transfers, LBA48 addressing
wd1: 2794 GB, 5814021 cyl, 16 head, 63 sec, 512 bytes/sect x 5860533168 sectors
wd1: 32-bit data port
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6
(Ultra/133), WRITE DMA FUA, NCQ (32 tags) w/PRIO
wd0(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133)
(using DMA), WRITE DMA FUA EXT
wd1(viaide0:0:1): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133)
(using DMA), WRITE DMA FUA EXT


Home | Main Index | Thread Index | Old Index