From rushani@FreeBSD.org  Sun Aug 24 08:56:06 2003
Return-Path: <rushani@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 503A016A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 24 Aug 2003 08:56:06 -0700 (PDT)
Received: from wasley.bl.mmtr.or.jp (wasley.bl.mmtr.or.jp [210.228.173.142])
	by mx1.FreeBSD.org (Postfix) with SMTP id 4C50143FF2
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 24 Aug 2003 08:56:04 -0700 (PDT)
	(envelope-from rushani@FreeBSD.org)
Received: (qmail 22253 invoked from network); 25 Aug 2003 00:56:02 +0900
Received: from unknown (HELO localhost) (202.229.16.132)
  by mx.bl.mmtr.or.jp with SMTP; 25 Aug 2003 00:56:02 +0900
Message-Id: <20030825.005515.82158510.rushani@FreeBSD.org>
Date: Mon, 25 Aug 2003 00:55:15 +0900 (JST)
From: Hideyuki KURASHINA <rushani@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: sos@FreeBSD.org, SHIOTA Shoichi <BYP06654@nifty.com>
Subject: [PATCH] VIA VT8237 support
X-Send-Pr-Version: 3.113

>Number:         55926
>Category:       kern
>Synopsis:       [PATCH] VIA VT8237 support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 24 09:00:21 PDT 2003
>Closed-Date:    Thu Oct 30 23:40:05 PST 2003
>Last-Modified:  Thu Oct 30 23:40:05 PST 2003
>Originator:     Hideyuki KURASHINA
>Release:        
>Organization:
>Environment:

>Description:

	I received a mail at FreeBSD mailing list in Japan, which is
	related to VIA VT8237.  SHIOTA-san, who is original reporter,
	bought ASUS A7V600 that has KT600 Chipset.  Unfortunately,
	FreeBSD 5.1-CURRENT recognizes that chip as follows;

	  ad0: 114473MB <ST3120026A> [232581/16/63] at ata0-master PIO4
	  acd0: DVD-ROM <ASUS DVD-ROM E612> at ata1-master PIO4

	He made a simple patch that attached at end of this mail, applying to
	his system results like following;

	  atapci0: <VIA 8237 UDMA133 controller> port 0xa400-0xa4ff,0xa800-0xa80f,0xb000-0xb003, 0xb400-0xb407,0xb800-0xb803,0xd000-0xd007 irq 3 at device 15.0 on pci0
	  ata2: at 0xd000 on atapci0
	  ata3: at 0xb400 on atapci0
	  atapci1: <VIA 8237 UDMA133 controller> port 0xa000-0xa00f  at device 15.1 on pci0
	  ata0: at 0x1f0 irq 14 on atapci1
	  ata1: at 0x170 irq 15 on atapci1
	  ad0: 114473MB <ST3120026A> [232581/16/63] at ata0-master UDMA100
	  ata1-master: DMA limited to UDMA33, non-ATA66 cable or device
	  acd0: DVD-ROM <ASUS DVD-ROM E612> at ata1-master UDMA33

	According to SHIOTA-san's testing, this change yields 12 times faster
	than before.

	I've checked VIA's web site,

	  IDE Support, Linux Application Notes
	    http://www.viaarena.com/?PageID=297

	and then downloaded

	  VT8237 South Bridge SATA RAID controller
	    http://downloads.viaarena.com/LinuxApplicationNotes/Aug03/VIA%20RH7.2%20SATA%20Device%20ver0.8.gz

	then extracted it.  The file `pcitable' in distfile shows

	  0x1106  0x3149  "viasraid"      "VIATECH|VIA VT6420 RAID Controller"

	It seems that 0x3149 is sufficient for VT8237, I think.

	Could you please commit this?

>How-To-Repeat:
	
>Fix:

	Apply following patch;

Index: ata-chipset.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-chipset.c,v
retrieving revision 1.34
diff -u -r1.34 ata-chipset.c
--- ata-chipset.c	24 Aug 2003 09:22:26 -0000	1.34
+++ ata-chipset.c	24 Aug 2003 15:33:41 -0000
@@ -2052,6 +2052,7 @@
      { ATA_VIA8233C,  0x00, VIA100, 0x00,   ATA_UDMA5, "VIA 8233C" },
      { ATA_VIA8233A,  0x00, VIA133, 0x00,   ATA_UDMA6, "VIA 8233A" },
      { ATA_VIA8235,   0x00, VIA133, 0x00,   ATA_UDMA6, "VIA 8235" },
+     { ATA_VIA8237,   0x00, VIA133, 0x00,   ATA_UDMA6, "VIA 8237" },
      { 0, 0, 0, 0, 0, 0 }};
     char buffer[64];
 
Index: ata-pci.h
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-pci.h,v
retrieving revision 1.13
diff -u -r1.13 ata-pci.h
--- ata-pci.h	24 Aug 2003 09:22:26 -0000	1.13
+++ ata-pci.h	24 Aug 2003 15:34:38 -0000
@@ -215,6 +215,7 @@
 #define ATA_VIA8233A		0x31471106
 #define ATA_VIA8233C		0x31091106
 #define ATA_VIA8235		0x31771106
+#define ATA_VIA8237		0x31491106
 #define ATA_VIA8361		0x31121106
 #define ATA_VIA8363		0x03051106
 #define ATA_VIA8371		0x03911106
>Release-Note:
>Audit-Trail:

From: Ceri Davies <ceri@FreeBSD.org>
To: FreeBSD Gnats Submit <freebsd-gnats-submit@FreeBSD.org>
Cc:  
Subject: Re: kern/55926: [PATCH] VIA VT8237 support
Date: Mon, 25 Aug 2003 20:01:06 +0100

 Adding to audit trail, from misfiled PR kern/55927:
 
 Date: Sun, 24 Aug 2003 18:00:10 +0200 (CEST)
 From: Soren Schmidt <sos@spider.deepcore.dk>
 Message-Id: <200308241600.h7OG0A4g083706@spider.deepcore.dk>
 In-Reply-To: <20030825.005515.82158510.rushani@FreeBSD.org>
 
  It seems Hideyuki KURASHINA wrote:
  > 	Could you please commit this?
  
  I need to see some docs first, as long as we dont know the chipset
  there is no way to know if this actually works. 
  Since the BIOS sets up the max mode the disk supports, we cannot
  tell if we actually set the mode, or if we are just shooting bits
  in non-existing registers and then just using what the BIOS did.
  
  -Sren
 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Thu Oct 30 23:36:18 PST 2003 
State-Changed-Why:  
Via 8237 support has been comitted to -current, there is a bit more to it 
than this patch though. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=55926 
>Unformatted:
