aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/psim
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2007-12-19 18:00:50 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2007-12-19 18:00:50 +0000
commitde2fa7b8af9fcb685150e9efd6831ee0d126f00d (patch)
tree956e367a9205ea80aea7a55392cb7b817d95191f /sys/powerpc/psim
parent1981bc3b8a582d893ad639d92baf654ddd123fb8 (diff)
downloadsrc-de2fa7b8af9fcb685150e9efd6831ee0d126f00d.tar.gz
src-de2fa7b8af9fcb685150e9efd6831ee0d126f00d.zip
Redefine bus_space_tag_t on PowerPC from a 32-bit integral to
a pointer to struct bus_space. The structure contains function pointers that do the actual bus space access. The reason for this change is that previously all bus space accesses were little endian (i.e. had an explicit byte-swap for multi-byte accesses), because all busses on Macs are little endian. The upcoming support for Book E, and in particular the E500 core, requires support for big-endian busses because all embedded peripherals are in the native byte-order. With this change, there's no distinction between I/O port space and memory mapped I/O. PowerPC doesn't have I/O port space. Busses assign tags based on the byte-order only. For that purpose, two global structures exist (bs_be_tag and bs_le_tag), of which the address can be taken to get a valid tag. Obtained from: Juniper, Semihalf
Notes
Notes: svn path=/head/; revision=174782
Diffstat (limited to 'sys/powerpc/psim')
-rw-r--r--sys/powerpc/psim/iobus.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c
index 30cbeed7cedf..9fc2c57c986e 100644
--- a/sys/powerpc/psim/iobus.c
+++ b/sys/powerpc/psim/iobus.c
@@ -311,7 +311,6 @@ iobus_alloc_resource(device_t bus, device_t child, int type, int *rid,
int needactivate;
struct resource *rv;
struct rman *rm;
- bus_space_tag_t tagval;
sc = device_get_softc(bus);
@@ -322,15 +321,13 @@ iobus_alloc_resource(device_t bus, device_t child, int type, int *rid,
case SYS_RES_MEMORY:
case SYS_RES_IOPORT:
rm = &sc->sc_mem_rman;
- tagval = PPC_BUS_SPACE_MEM;
break;
case SYS_RES_IRQ:
return (bus_alloc_resource(bus, type, rid, start, end, count,
- flags));
- break;
+ flags));
default:
device_printf(bus, "unknown resource request from %s\n",
- device_get_nameunit(child));
+ device_get_nameunit(child));
return (NULL);
}
@@ -342,7 +339,7 @@ iobus_alloc_resource(device_t bus, device_t child, int type, int *rid,
}
rman_set_rid(rv, *rid);
- rman_set_bustag(rv, tagval);
+ rman_set_bustag(rv, &bs_le_tag);
rman_set_bushandle(rv, rman_get_start(rv));
if (needactivate) {