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, [EMAIL PROTECTED], 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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to