summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2007-06-10 16:53:01 +0000
committermarcel <marcel@FreeBSD.org>2007-06-10 16:53:01 +0000
commit2a881a553e67fa066b2dc74064c17ff8c9ecb927 (patch)
tree638b80c62762bb3f62a658cdea4ff94f66c3a85e
parent04e1377efe2f5b2f45bf05519aabdc394d0892f3 (diff)
downloadFreeBSD-src-2a881a553e67fa066b2dc74064c17ff8c9ecb927.zip
FreeBSD-src-2a881a553e67fa066b2dc74064c17ff8c9ecb927.tar.gz
Work around a firmware bug in the HP rx2660, where in ACPI an I/O port
is really a memory mapped I/O address. The bug is in the GAS that describes the address and in particular the SpaceId field. The field should not say the address is an I/O port when it clearly is not. With an additional check for the IA64_BUS_SPACE_IO case in the bus access functions, and the fact that I/O ports pretty much not used in general on ia64, make the calculation of the I/O port address a function. This avoids inlining the work-around into every driver, and also helps reduce overall code bloat.
-rw-r--r--sys/ia64/ia64/machdep.c10
-rw-r--r--sys/ia64/include/cpufunc.h5
2 files changed, 12 insertions, 3 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c
index ab49f48..6b8ec5a 100644
--- a/sys/ia64/ia64/machdep.c
+++ b/sys/ia64/ia64/machdep.c
@@ -817,6 +817,16 @@ ia64_init(void)
/* NOTREACHED */
}
+__volatile void *
+ia64_ioport_address(u_int port)
+{
+ uint64_t addr;
+
+ addr = (port > 0xffff) ? IA64_PHYS_TO_RR6((uint64_t)port) :
+ ia64_port_base | ((port & 0xfffc) << 10) | (port & 0xFFF);
+ return ((__volatile void *)addr);
+}
+
uint64_t
ia64_get_hcdp(void)
{
diff --git a/sys/ia64/include/cpufunc.h b/sys/ia64/include/cpufunc.h
index 27d66ef..339bd95 100644
--- a/sys/ia64/include/cpufunc.h
+++ b/sys/ia64/include/cpufunc.h
@@ -54,10 +54,9 @@ breakpoint(void)
#define HAVE_INLINE_FFS
#define ffs(x) __builtin_ffs(x)
-extern uint64_t ia64_port_base;
#define __MEMIO_ADDR(x) (__volatile void*)(IA64_PHYS_TO_RR6(x))
-#define __PIO_ADDR(x) (__volatile void*)(ia64_port_base | \
- (((x) & 0xFFFC) << 10) | ((x) & 0xFFF))
+extern __volatile void *ia64_ioport_address(u_int);
+#define __PIO_ADDR(x) ia64_ioport_address(x)
/*
* I/O port reads with ia32 semantics.
OpenPOWER on IntegriCloud