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.
This commit is contained in:
marcel 2007-06-10 16:53:01 +00:00
parent 04e1377efe
commit 2a881a553e
2 changed files with 12 additions and 3 deletions

View File

@ -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)
{

View File

@ -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.