Hi,
I was recently working on VIA IDE/SATA controllers in NetBSD and noticed a few
missing IDs in the OpenBSD code as a result.
The VT8237A and VT8237S chipsets need to be identified not only by their SATA
controller IDs, but also by the ISA bus for UDMA support, since their
IDE controller
uses the common VIA chipset PCI ID 0x0571.
The VT8237S also has an additional PCI ID (0x7372) when RAID mode is selected
in the BIOS.
The VT8251 includes another PCI ID for the CE version of the southbridge
(0x5287), which is used when IDE mode is selected.
In addition to the above, I included a few more uncommon variants.
The VT8233C (ISA bus) supports UDMA100 like the VT8233 (not the VT8233A, which
supports UDMA133). This southbridge is quite rare; I have found it only on a
few RioWorks motherboard models in the internet resources.
The VT8261 is identified by its ISA bus and SATA controller in IDE mode
(0x9000). The platform was likely discontinued shortly after release,
though at least one regional motherboard used it (and some evaluation boards).
I did not include PCI IDs for the VX900 (0x9041) and VT8261 (0x9040) in RAID
mode in the patch.
I am aware of only two board models with RAID mode option in the BIOS
for the VX900,
and only one of them has two SATA ports. Therefore, this ID does not seem
particularly relevant, though it could be added for completeness if you wish.
The VT8261 RAID mode is likely even less relevant due to the rarity of the
southbridge and the availability of IDE mode.
Additionally, I found that faking VT6410 enable bits is not a good solution for
add-in cards. While the controller is identified, the hard drives remain
undetected because those channels are actually disabled. A better approach is
to enable them directly. The only downside is that some motherboards may
provide a BIOS option to control this, and we would override it, though such
cases appear to be rare (typically controller is fully disabled, not
visible to OS).
This does not apply to the VT6415, where faking remains the "best" solution so
far. It uses a different and undocumented register structure compared to other
VIA controllers.
You can refer to the NetBSD viaide(4) driver for details.
Regards,
Andrius V
diff --git a/sys/dev/pci/pcidevs b/sys/dev/pci/pcidevs
index b8046192dc9..0e301eb0c7c 100644
--- a/sys/dev/pci/pcidevs
+++ b/sys/dev/pci/pcidevs
@@ -9915,6 +9915,7 @@ product VIATECH VT8653_PCI 0x3101 VT8653 PCI
product VIATECH VT6202 0x3104 VT6202 USB
product VIATECH VT6105 0x3106 VT6105 RhineIII
product VIATECH UNICHROME 0x3108 S3 Unichrome PRO IGP
+product VIATECH VT8233C_ISA 0x3109 VT8233C ISA
product VIATECH VT8361_PCI 0x3112 VT8361 PCI
product VIATECH VT8101_PPB 0x3113 VT8101 VPX-64
product VIATECH VT8375 0x3116 VT8375 PCI
@@ -9964,6 +9965,7 @@ product VIATECH CHROME9_HC 0x3371 Chrome9 HC IGP
product VIATECH VT8237S_ISA 0x3372 VT8237S ISA
product VIATECH VT8237A_PPB_1 0x337a VT8237A
product VIATECH VT8237A_PPB_2 0x337b VT8237A
+product VIATECH VT8261_ISA 0x3402 VT8261 ISA
product VIATECH VX900_DRAM 0x3410 VX900 DRAM
product VIATECH VL80X_XHCI 0x3432 VL80x xHCI
product VIATECH VL805_XHCI 0x3483 VL805 xHCI
@@ -9983,6 +9985,7 @@ product VIATECH VX800_4 0x4353 VX800 Host
product VIATECH P4M900_4 0x4364 P4M900 Host
product VIATECH VX900_1 0x4410 VX900 Host
product VIATECH K8T890_IOAPIC 0x5238 K8T890 IOAPIC
+product VIATECH VT8251_SATA_2 0x5287 VT8251 SATA
product VIATECH PT894_IOAPIC 0x5308 PT894 IOAPIC
product VIATECH CX700_IDE 0x5324 CX700 IDE
product VIATECH P4M890_IOAPIC 0x5327 P4M890 IOAPIC
@@ -10017,6 +10020,7 @@ product VIATECH K8M890_7 0x7336 K8M890 Host
product VIATECH VT3351_7 0x7351 VT3351 Host
product VIATECH VX800_7 0x7353 VX800 Host
product VIATECH P4M900_7 0x7364 P4M900 Host
+product VIATECH VT8237S_SATA_2 0x7372 VT8237S SATA (RAID)
product VIATECH VX900_2 0x7410 VX900 Host
product VIATECH VT8231_ISA 0x8231 VT8231 ISA
product VIATECH VT8231_PWR 0x8235 VT8231 PMG
@@ -10031,6 +10035,7 @@ product VIATECH VT82C597AGP 0x8597 VT82C597 AGP
product VIATECH VT82C598AGP 0x8598 VT82C598 AGP
product VIATECH VT82C601 0x8601 VT82C601 AGP
product VIATECH VT8605_AGP 0x8605 VT8605 AGP
+product VIATECH VT8261_SATA 0x9000 VT8261 SATA
product VIATECH VX900_IDE 0x9001 VX900 IDE
product VIATECH HDA_1 0x9170 HD Audio
product VIATECH VX800_SDMMC 0x9530 VX800 SD/MMC
diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c
index fc925a8f7cb..edefa452ee2 100644
--- a/sys/dev/pci/pciide.c
+++ b/sys/dev/pci/pciide.c
@@ -808,9 +808,21 @@ const struct pciide_product_desc pciide_via_products[] = {
0,
sata_chip_map
},
+ { PCI_PRODUCT_VIATECH_VT8237S_SATA_2, /* VIA VT8237S SATA */
+ 0,
+ sata_chip_map
+ },
{ PCI_PRODUCT_VIATECH_VT8251_SATA, /* VIA VT8251 SATA */
0,
sata_chip_map
+ },
+ { PCI_PRODUCT_VIATECH_VT8251_SATA_2, /* VIA VT8251(CE) SATA */
+ 0,
+ sata_chip_map
+ },
+ { PCI_PRODUCT_VIATECH_VT8261_SATA, /* VIA VT8261 SATA */
+ 0,
+ sata_chip_map
}
};
@@ -3511,12 +3523,17 @@ apollo_chip_map(struct pciide_softc *sc, struct
pci_attach_args *pa)
break;
case PCI_PRODUCT_VIATECH_VT8231_ISA:
case PCI_PRODUCT_VIATECH_VT8233_ISA:
+ case PCI_PRODUCT_VIATECH_VT8233C_ISA:
printf(": ATA100");
sc->sc_wdcdev.UDMA_cap = 5;
break;
case PCI_PRODUCT_VIATECH_VT8233A_ISA:
case PCI_PRODUCT_VIATECH_VT8235_ISA:
case PCI_PRODUCT_VIATECH_VT8237_ISA:
+ case PCI_PRODUCT_VIATECH_VT8237A_ISA:
+ case PCI_PRODUCT_VIATECH_VT8237S_ISA:
+ case PCI_PRODUCT_VIATECH_VT8251_ISA:
+ case PCI_PRODUCT_VIATECH_VT8261_ISA:
printf(": ATA133");
sc->sc_wdcdev.UDMA_cap = 6;
break;