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øren,
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
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
===================================================================
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 1999/10/16 09:00:49 1.28
+++ ata-all.c 1999/10/19 16:51:36
@@ -262,9 +262,9 @@
irq1 = 14;
}
else {
- iobase_1 = pci_read_config(dev, 0x10, 4) & 0xfffc;
- altiobase_1 = pci_read_config(dev, 0x14, 4) & 0xfffc;
- bmaddr_1 = pci_read_config(dev, 0x20, 4) & 0xfffc;
+ iobase_1 = pci_read_config(dev, 0x10, 4) & 0xfffffffc;
+ altiobase_1 = pci_read_config(dev, 0x14, 4) & 0xfffffffc;
+ bmaddr_1 = pci_read_config(dev, 0x20, 4) & 0xfffffffc;
irq1 = pci_read_config(dev, PCI_INTERRUPT_REG, 4) & 0xff;
}
@@ -274,9 +274,9 @@
irq2 = 15;
}
else {
- iobase_2 = pci_read_config(dev, 0x18, 4) & 0xfffc;
- altiobase_2 = pci_read_config(dev, 0x1c, 4) & 0xfffc;
- bmaddr_2 = (pci_read_config(dev, 0x20, 4) & 0xfffc) + ATA_BM_OFFSET1;
+ iobase_2 = pci_read_config(dev, 0x18, 4) & 0xfffffffc;
+ altiobase_2 = pci_read_config(dev, 0x1c, 4) & 0xfffffffc;
+ bmaddr_2 = (pci_read_config(dev, 0x20, 4) & 0xfffffffc) + ATA_BM_OFFSET1;
irq2 = pci_read_config(dev, PCI_INTERRUPT_REG, 4) & 0xff;
}
@@ -285,7 +285,7 @@
/* is busmastering support turned on ? */
if ((pci_read_config(dev, PCI_COMMAND_STATUS_REG, 4) & 5) == 5) {
/* is there a valid port range to connect to ? */
- if ((bmaddr_1 = pci_read_config(dev, 0x20, 4) & 0xfffc)) {
+ if ((bmaddr_1 = pci_read_config(dev, 0x20, 4) & 0xfffffffc)) {
bmaddr_2 = bmaddr_1 + ATA_BM_OFFSET1;
printf("ata-pci%d: Busmastering DMA supported\n", unit);
}
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 122.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 http://www.cs.duke.edu/~gallatin
Duke University Email: gallatin@cs.duke.edu
Department of Computer Science Phone: (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>
