Bug 118447 - [ata] [patch] Troublesome DMA modes with VIA Apollo VP
Summary: [ata] [patch] Troublesome DMA modes with VIA Apollo VP
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 5.5-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2007-12-05 13:50 UTC by Frank W. Josellis
Modified: 2018-01-03 05:13 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Frank W. Josellis 2007-12-05 13:50:01 UTC
Currently FreeBSD appears to have a problem distinguishing correctly between
the various revisions of the VIA VT82C586 southbridge. The chip id table in 
src/sys/dev/ata/ata-chipset.c assigns rev=0x02 to the 82C586B,

    static struct ata_chip_id ids[] =
    {{ ATA_VIA82C586, 0x02, VIA33,  0x00,    ATA_UDMA2, "82C586B" },
     { ATA_VIA82C586, 0x00, VIA33,  0x00,    ATA_WDMA2, "82C586" },

whereas rev=0x02 actually describes the 82C586A which, unfortunately, is not 
fully UDMA2 compliant. As a consequence, such a system with an Ultra DMA HDD 
attached fails to boot unless ATA DMA is disabled by the loader. By the way,
rev=0x03 was correctly assigned to the 82C586B in FreeBSD 4. 

Thus WDMA2 seems to be a safe setting for the 82C586A. However, in contrast 
to the rev=0x00 chip it offers the possiblity to use a bus master IDE driver.
I couldn't find any related technical documentation at via.com -- maybe it's
gone -- but as my board is actually a FIC PA-2005, I got some information on
this from the manufacturer:

As a side remark, the bus master mode is also what the Linux kernel is using 
here, that's what I see from booting a Linux Live-CD for diagnostics.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2007-12-17 04:19:53 UTC
Responsible Changed
From-To: freebsd-i386->freebsd-bugs

This does not sound i386-specific.
Comment 2 Frank W. Josellis 2008-01-05 15:28:41 UTC
Meanwhile I learned that my southbridge "chip=0x05861106 rev=0x02" is just 
a VT82C586, without a trailing 'A'. There is indeed no such letter marked 
on the chip, and according to the web article [1] the A-chip is actually 
supposed to support UDMA:

The 586 originally had no USB or Ultra DMA.  VIA added these features with 
the 586A, and then ACPI with the 586B.  The 586B is the same as an AMD-645 

Last but not least, the Linux kernel assigns the following revs to the 
various chips:

rev 0x00 - 0x0f -> 82C586
rev 0x20 - 0x2f -> 82C586A
rev 0x30 - 0x4f -> 82C586B

Provided that this is correct, the below patch presumably solves the whole 
problem for FreeBSD.

Frank Josellis

[1] http://www.ds-computing.com/chipset.htm

--- patch begins here ---
--- ata-chipset.c.orig	Wed Jun  1 16:39:01 2005
+++ ata-chipset.c	Sat Jan  5 16:11:28 2008
@@ -2784,7 +2784,7 @@
     struct ata_pci_controller *ctlr = device_get_softc(dev);
     struct ata_chip_id *idx;
     static struct ata_chip_id ids[] =
-    {{ ATA_VIA82C586, 0x02, VIA33,  0x00,   ATA_UDMA2, "VIA 82C586B" },
+    {{ ATA_VIA82C586, 0x20, VIA33,  0x00,   ATA_UDMA2, "VIA 82C586A" },
      { ATA_VIA82C586, 0x00, VIA33,  0x00,   ATA_WDMA2, "VIA 82C586" },
      { ATA_VIA82C596, 0x12, VIA66,  VIACLK, ATA_UDMA4, "VIA 82C596B" },
      { ATA_VIA82C596, 0x00, VIA33,  0x00,   ATA_UDMA2, "VIA 82C596" },
--- patch ends here ---
Comment 3 Remko Lodder freebsd_committer 2008-01-07 17:30:16 UTC
Responsible Changed
From-To: freebsd-bugs->sos

Over to Soren for evaluation
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2009-05-12 05:45:07 UTC
Responsible Changed
From-To: sos->freebsd-bugs

sos@ is not actively working on ATA-related PRs.
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2012-11-09 13:34:56 UTC
Responsible Changed
From-To: freebsd-bugs->eadler

I'll take it.
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2013-01-31 13:58:02 UTC
Responsible Changed
From-To: eadler->freebsd-bugs

sorry I held on to this for so long;   at the moment I have no time to 
look at this PR so return to the pool
Comment 7 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:58 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped