Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Dec 2001 09:44:29 +0100 (CET)
From:      Søren Schmidt <sos@freebsd.dk>
To:        rsharpe@ns.aus.com
Cc:        Greg Lehey <grog@FreeBSD.ORG>, Zwane Mwaikambo <zwane@linux.realnet.co.sz>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: UDMA33 and SiS5591 on FreeBSD 4.4-RELEASE
Message-ID:  <200112020844.fB28iTi52838@freebsd.dk>
In-Reply-To: <3C09D6F9.7070504@ns.aus.com>

next in thread | previous in thread | raw e-mail | index | archive | help
It seems Richard Sharpe wrote:
> Attached is the patch I am using, which is based on what Greg gave me. 
> It tries UDMA5 first, and steps down ...

The following patch is bogus, it doesn't set the chip to the prober
mode (always sets it to UDMA2), it just set the disk, this wont 
work guys...

I have a SiS patch in the works (for current that is), that should
take care of the ATA mode setup...

The geometry is a different matter....

> Richard Sharpe, rsharpe@ns.aus.com, LPIC-1
> www.samba.org, www.ethereal.com, SAMS Teach Yourself Samba
> in 24 Hours, Special Edition, Using Samba

> --- ata-dma.c.orig	Wed Oct 31 07:29:52 2001
> +++ ata-dma.c	Fri Nov 30 14:38:52 2001
> @@ -519,30 +519,61 @@
>  	break;
>  
>      case 0x55131039:	/* SiS 5591 */
> -	if (udmamode >= 2 && pci_get_revid(parent) > 0xc1) {
> -	    error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
> -				ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
> -	    if (bootverbose)
> -		ata_printf(scp, device,
> -			   "%s setting UDMA2 on SiS chip\n",
> -			   (error) ? "failed" : "success");
> -	    if (!error) {
> -		pci_write_config(parent, 0x40 + (devno << 1), 0xa301, 2);
> -		scp->mode[ATA_DEV(device)] = ATA_UDMA2;
> -		return;
> +	if (bootverbose)
> +	    printf ("SiS 5513/5591, udmamode %d\n", udmamode);
> +	if (pci_get_revid(parent) > 0xc1) {
> +	    udmamode = 5;                   /* Force it to 100 */
> +	    if (udmamode >= 5) {            /* Claims UDMA 100 */
> +		error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
> +				    ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
> +		if (bootverbose)
> +		    ata_printf(scp, device,
> +			       "%s setting UDMA5 on SiS chip\n",
> +			       (error) ? "failed" : "success");
> +		if (!error) {
> +		    pci_write_config(parent, 0x40 + (devno << 1), 0xa301, 2);
> +		    scp->mode[ATA_DEV(device)] = ATA_UDMA5;
> +		    return;
> +		}
>  	    }
> -	}
> -	if (wdmamode >=2 && apiomode >= 4) {
> -	    error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
> -				ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
> -	    if (bootverbose)
> -		ata_printf(scp, device,
> -			   "%s setting WDMA2 on SiS chip\n",
> -			   (error) ? "failed" : "success");
> -	    if (!error) {
> -		pci_write_config(parent, 0x40 + (devno << 1), 0x0301, 2);
> -		scp->mode[ATA_DEV(device)] = ATA_WDMA2;
> -		return;
> +	    if (udmamode >= 4) {            /* Claims UDMA 66 */
> +		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;
> +		}
> +	    }
> +	    if (udmamode >= 2) {
> +		error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
> +				    ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
> +		if (bootverbose)
> +		    ata_printf(scp, device,
> +			       "%s setting UDMA2 on SiS chip\n",
> +			       (error) ? "failed" : "success");
> +		if (!error) {
> +		    pci_write_config(parent, 0x40 + (devno << 1), 0xa301, 2);
> +		    scp->mode[ATA_DEV(device)] = ATA_UDMA2;
> +		    return;
> +		}
> +	    }
> +	    if (wdmamode >=2 && apiomode >= 4) {
> +		error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
> +				    ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
> +		if (bootverbose)
> +		    ata_printf(scp, device,
> +			       "%s setting WDMA2 on SiS chip\n",
> +			       (error) ? "failed" : "success");
> +		if (!error) {
> +		    pci_write_config(parent, 0x40 + (devno << 1), 0x0301, 2);
> +		    scp->mode[ATA_DEV(device)] = ATA_WDMA2;
> +		    return;
> +		}
>  	    }
>  	}
>  	/* we could set PIO mode timings, but we assume the BIOS did that */

-Søren

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112020844.fB28iTi52838>