From nobody@FreeBSD.ORG  Thu Sep 28 11:17:37 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 43E6537B422; Thu, 28 Sep 2000 11:17:37 -0700 (PDT)
Message-Id: <20000928181737.43E6537B422@hub.freebsd.org>
Date: Thu, 28 Sep 2000 11:17:37 -0700 (PDT)
From: roland@serv.ch
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: Chipset SiS630E / ATA SiS 5591
X-Send-Pr-Version: www-1.0

>Number:         21627
>Category:       kern
>Synopsis:       Chipset SiS630E / ATA SiS 5591
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 28 11:20:00 PDT 2000
>Closed-Date:    Tue Nov 14 01:06:44 PST 2000
>Last-Modified:  Mon Jul  9 11:00:01 PDT 2001
>Originator:     Roland Schneider
>Release:        4.1.1 STABLE
>Organization:
>Environment:
FreeBSD ***** 4.1.1-STABLE FreeBSD 4.1.1-STABLE #0: Thu Sep 28 18:03:48 CEST 2000     ***@******:/mnt/install/src/sys/compile/kernel  i386

>Description:
The SiS630E (recognized as SiS 5591) Driver will do only UDMA33.

>How-To-Repeat:
Install FreeBSD on a ASUS CUSI-FX with UDMA66-Disk.

>Fix:
Its not a fix but adds UDMA66 to the SiS 5591 for the
primary master.
Dont use a UDMA33-Device there because it will fallback
to plain PIO later and I dont know where to fix this...
Bonnie shows no difference between UDMA33 and UDMA66.

Insert the following in sys/dev/ata/ata-dma.c just bevore line #409:

if (udmamode >= 4 && scp->unit == 0 && device == ATA_MASTER ) {
  error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
    ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
  if (bootverbose)
  ata_printf(scp, device, "%s setting UDMA4 on SiS chip\n",
    (error) ? "failed" : "success");
  if (!error) {
    pci_write_config(parent, 0x40 + (devno << 1), 0xa301, 2);
    scp->mode[ATA_DEV(device)] = ATA_UDMA4;
    return;
  }
}


From /var/run/dmesg.boot:

ata0-master: success setting UDMA4 on SiS chip
ad0: <QUANTUM FIREBALLP LM15/A35.0700> ATA-5 disk at ata0 as master
ad0: 14324MB (29336832 sectors), 29104 cyls, 16 heads, 63 S/T, 512 B/S
ad0: 16 secs/int, 1 depth queue, UDMA66
ad0: piomode=4 dmamode=2 udmamode=4 cblid=1

ata1-master: success setting UDMA2 on SiS chip
ad2: <ST313032A/3.09> ATA-4 disk at ata1 as master
ad2: 12419MB (25434228 sectors), 25232 cyls, 16 heads, 63 S/T, 512 B/S
ad2: 16 secs/int, 1 depth queue, UDMA33
ad2: piomode=4 dmamode=2 udmamode=4 cblid=1


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: johan 
Responsible-Changed-When: Fri Oct 6 13:07:32 PDT 2000 
Responsible-Changed-Why:  
Over to ATA maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21627 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Tue Nov 14 01:06:44 PST 2000 
State-Changed-Why:  
This patch is bogus, it just sets ATA33 mode timing and pretends 
to be ATA66. Reeal support is coming as soon as I get docs from 
SiS 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21627 

From: Steve Simmons <scs@uu.net>
To: freebsd-gnats-submit@FreeBSD.org, roland@serv.ch
Cc:  
Subject: Re: kern/21627: Chipset SiS630E / ATA SiS 5591
Date: Mon, 09 Jul 2001 13:56:05 -0400

 I have verified this problem still exists in the 4.3 stable release.
 My workaround was to unset the UDMA mode in the bios, which at least
 made the drive reachable.  Motherboard in question is a new (as of
 7/1/2001) ASUS CUSI-FX, using SIS-630E chip set, BIOS release 1007m.
 
 However, I was never able to successfully format and partition IDE
 drives in this unit.  All attempts to write labels failed with messages
 about slice 4 being too large to fit in the drive.  The only way I got a
 successful install was to move the drive to another machine, format,
 partition, and newfs it there, then return it to the CUSI-FX.  This
 problem occurred with two different Seagate drives, one 10.005GB, one
 8.4GB.
 
 FYI, there were two other problems with this board.
 
 The first was failure to properly recognize the (admittedly ancient)
 CD-ROM.  Workaround was to manually set various BIOS options for it;
 details on request.
 
 The second (which I have not given up on) is failure to activate all
 the USB ports.  Currently I have only been able to get activity on
 the lower built-in port.  USB devices attached to other ports are not
 seen by FreeBSD, and the devices themselves do not see the system
 unless attached to that single port.  I continue to investigate.
 -- 
    "The optimist proclaims that we live in the best of all possible worlds;
 and the pessimist fears this is true."
 	      -- James Branch Cabell, from 'The Silver Stallion', 1926.
>Unformatted:
