summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/powermac
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2007-12-19 18:00:50 +0000
committermarcel <marcel@FreeBSD.org>2007-12-19 18:00:50 +0000
commitc932130a316381031c153a6d005ad368b4e06f25 (patch)
tree956e367a9205ea80aea7a55392cb7b817d95191f /sys/powerpc/powermac
parent93ea7f35941531199bafe14cc0f05096516fe4ad (diff)
downloadFreeBSD-src-c932130a316381031c153a6d005ad368b4e06f25.zip
FreeBSD-src-c932130a316381031c153a6d005ad368b4e06f25.tar.gz
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
Diffstat (limited to 'sys/powerpc/powermac')
-rw-r--r--sys/powerpc/powermac/grackle.c7
-rw-r--r--sys/powerpc/powermac/macio.c6
-rw-r--r--sys/powerpc/powermac/uninorth.c8
3 files changed, 6 insertions, 15 deletions
diff --git a/sys/powerpc/powermac/grackle.c b/sys/powerpc/powermac/grackle.c
index f606b65..03e15f0 100644
--- a/sys/powerpc/powermac/grackle.c
+++ b/sys/powerpc/powermac/grackle.c
@@ -43,6 +43,7 @@
#include <machine/bus.h>
#include <machine/md_var.h>
#include <machine/nexusvar.h>
+#include <machine/pio.h>
#include <machine/resource.h>
#include <sys/rman.h>
@@ -363,7 +364,6 @@ grackle_alloc_resource(device_t bus, device_t child, int type, int *rid,
struct grackle_softc *sc;
struct resource *rv;
struct rman *rm;
- bus_space_tag_t bt;
int needactivate;
needactivate = flags & RF_ACTIVE;
@@ -374,18 +374,15 @@ grackle_alloc_resource(device_t bus, device_t child, int type, int *rid,
switch (type) {
case SYS_RES_MEMORY:
rm = &sc->sc_mem_rman;
- bt = PPC_BUS_SPACE_MEM;
break;
case SYS_RES_IOPORT:
rm = &sc->sc_io_rman;
- bt = PPC_BUS_SPACE_IO;
break;
case SYS_RES_IRQ:
return (bus_alloc_resource(bus, type, rid, start, end, count,
flags));
- break;
default:
device_printf(bus, "unknown resource request from %s\n",
@@ -401,7 +398,7 @@ grackle_alloc_resource(device_t bus, device_t child, int type, int *rid,
}
rman_set_rid(rv, *rid);
- rman_set_bustag(rv, bt);
+ rman_set_bustag(rv, &bs_le_tag);
rman_set_bushandle(rv, rman_get_start(rv));
if (needactivate) {
diff --git a/sys/powerpc/powermac/macio.c b/sys/powerpc/powermac/macio.c
index d3d3dd4..36ef06e 100644
--- a/sys/powerpc/powermac/macio.c
+++ b/sys/powerpc/powermac/macio.c
@@ -369,7 +369,6 @@ macio_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;
u_long adjstart, adjend, adjcount;
struct macio_devinfo *dinfo;
struct resource_list_entry *rle;
@@ -408,8 +407,6 @@ macio_alloc_resource(device_t bus, device_t child, int type, int *rid,
adjcount = adjend - adjstart;
rm = &sc->sc_mem_rman;
-
- tagval = PPC_BUS_SPACE_MEM;
break;
case SYS_RES_IRQ:
@@ -431,7 +428,6 @@ macio_alloc_resource(device_t bus, device_t child, int type, int *rid,
return (resource_list_alloc(&dinfo->mdi_resources, bus, child,
type, rid, start, end, count, flags));
- break;
default:
device_printf(bus, "unknown resource request from %s\n",
@@ -449,7 +445,7 @@ macio_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) {
diff --git a/sys/powerpc/powermac/uninorth.c b/sys/powerpc/powermac/uninorth.c
index f3b0996..3510983 100644
--- a/sys/powerpc/powermac/uninorth.c
+++ b/sys/powerpc/powermac/uninorth.c
@@ -41,6 +41,7 @@
#include <machine/bus.h>
#include <machine/md_var.h>
#include <machine/nexusvar.h>
+#include <machine/pio.h>
#include <machine/resource.h>
#include <sys/rman.h>
@@ -347,7 +348,6 @@ uninorth_alloc_resource(device_t bus, device_t child, int type, int *rid,
struct uninorth_softc *sc;
struct resource *rv;
struct rman *rm;
- bus_space_tag_t bt;
int needactivate;
needactivate = flags & RF_ACTIVE;
@@ -358,18 +358,16 @@ uninorth_alloc_resource(device_t bus, device_t child, int type, int *rid,
switch (type) {
case SYS_RES_MEMORY:
rm = &sc->sc_mem_rman;
- bt = PPC_BUS_SPACE_MEM;
break;
case SYS_RES_IOPORT:
rm = &sc->sc_io_rman;
- bt = PPC_BUS_SPACE_IO;
break;
case SYS_RES_IRQ:
return (bus_alloc_resource(bus, type, rid, start, end, count,
flags));
- break;
+
default:
device_printf(bus, "unknown resource request from %s\n",
device_get_nameunit(child));
@@ -384,7 +382,7 @@ uninorth_alloc_resource(device_t bus, device_t child, int type, int *rid,
}
rman_set_rid(rv, *rid);
- rman_set_bustag(rv, bt);
+ rman_set_bustag(rv, &bs_le_tag);
rman_set_bushandle(rv, rman_get_start(rv));
if (needactivate) {
OpenPOWER on IntegriCloud