Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Oct 1999 13:02:14 -0400 (EDT)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        sos@freebsd.org
Cc:        freebsd-alpha@freebsd.org
Subject:   ata busmaster i/o port on alpha
Message-ID:  <14348.40785.536064.278837@grasshopper.cs.duke.edu>

next in thread | raw e-mail | index | archive | help

S=F8ren,

I'm trying to get the on-board IDE controllers in some AlphaServer
DS10 machines working well w/FreeBSD-current.  They use the Acer
AladdinV IDE controller in combination with a FUJITSU MPD3108AT ATA-4
disk.

The problem is with where the "Bios" (aka the SRM console) puts the
busmaster address:

<12:45pm>opal/root:~#pciconf -r 'pci0:13:0' 0x20
0x00010111

When you read the bus master address you mask off the upper 16 bits
entirely and we see the address as 0x110 where as it should really be=20=

0x10110.  When this happens, the disk is of course unusable.  After
5 retries, I see I/O errors when I try to access the disk.

If I apply the following patch, DMA works:

Index: ata-all.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/dev/ata/ata-all.c,v
retrieving revision 1.28
diff -u -r1.28 ata-all.c
--- ata-all.c=091999/10/16 09:00:49=091.28
+++ ata-all.c=091999/10/19 16:51:36
@@ -262,9 +262,9 @@
 =09irq1 =3D 14;
     }=20
     else {
-=09iobase_1 =3D pci_read_config(dev, 0x10, 4) & 0xfffc;
-=09altiobase_1 =3D pci_read_config(dev, 0x14, 4) & 0xfffc;
-=09bmaddr_1 =3D pci_read_config(dev, 0x20, 4) & 0xfffc;
+=09iobase_1 =3D pci_read_config(dev, 0x10, 4) & 0xfffffffc;
+=09altiobase_1 =3D pci_read_config(dev, 0x14, 4) & 0xfffffffc;
+=09bmaddr_1 =3D pci_read_config(dev, 0x20, 4) & 0xfffffffc;
 =09irq1 =3D pci_read_config(dev, PCI_INTERRUPT_REG, 4) & 0xff;
     }
=20
@@ -274,9 +274,9 @@
 =09irq2 =3D 15;
     }
     else {
-=09iobase_2 =3D pci_read_config(dev, 0x18, 4) & 0xfffc;
-=09altiobase_2 =3D pci_read_config(dev, 0x1c, 4) & 0xfffc;
-=09bmaddr_2 =3D (pci_read_config(dev, 0x20, 4) & 0xfffc) + ATA_BM_OFFS=
ET1;
+=09iobase_2 =3D pci_read_config(dev, 0x18, 4) & 0xfffffffc;
+=09altiobase_2 =3D pci_read_config(dev, 0x1c, 4) & 0xfffffffc;
+=09bmaddr_2 =3D (pci_read_config(dev, 0x20, 4) & 0xfffffffc) + ATA_BM_=
OFFSET1;
 =09irq2 =3D pci_read_config(dev, PCI_INTERRUPT_REG, 4) & 0xff;
     }
=20
@@ -285,7 +285,7 @@
 =09/* is busmastering support turned on ? */
 =09if ((pci_read_config(dev, PCI_COMMAND_STATUS_REG, 4) & 5) =3D=3D 5)=
 {
 =09    /* is there a valid port range to connect to ? */
-=09    if ((bmaddr_1 =3D pci_read_config(dev, 0x20, 4) & 0xfffc)) {
+=09    if ((bmaddr_1 =3D pci_read_config(dev, 0x20, 4) & 0xfffffffc)) =
{
 =09=09bmaddr_2 =3D bmaddr_1 + ATA_BM_OFFSET1;
 =09=09printf("ata-pci%d: Busmastering DMA supported\n", unit);
 =09    }


And works pretty well, at that:
              -------Sequential Output-------- ---Sequential Input-- --=
Random--
              -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --=
Seeks---
Machine    MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /=
sec %CPU
         1024  9235 91.9  9160 12.0  4111  6.6  6617 98.7 14360 14.5 12=
2.2  1.2

So, my question:  Is are you loosing the upper 16 bits for a reason,
or is it valid to look at the upper 16 bits on all platforms?

Thanks,

Drew
-----------------------------------------------------------------------=
-------
Andrew Gallatin, Sr Systems Programmer=09http://www.cs.duke.edu/~gallat=
in
Duke University=09=09=09=09Email: gallatin@cs.duke.edu
Department of Computer Science=09=09Phone: (919) 660-6590



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




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