summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/ofw
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2009-04-04 00:22:44 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2009-04-04 00:22:44 +0000
commitef1e56b6d485dbe76218164db7b0414e30ab423c (patch)
treed2c385231a9dbcaffdd618abd8accd1c9a2a8559 /sys/powerpc/ofw
parent86b18dc38b6aaf20c8399264b992273cf312d727 (diff)
downloadFreeBSD-src-ef1e56b6d485dbe76218164db7b0414e30ab423c.zip
FreeBSD-src-ef1e56b6d485dbe76218164db7b0414e30ab423c.tar.gz
Add support for 64-bit PowerPC CPUs operating in the 64-bit bridge mode
provided, for example, on the PowerPC 970 (G5), as well as on related CPUs like the POWER3 and POWER4. This also adds support for various built-in hardware found on Apple G5 hardware (e.g. the IBM CPC925 northbridge). Reviewed by: grehan
Diffstat (limited to 'sys/powerpc/ofw')
-rw-r--r--sys/powerpc/ofw/ofw_syscons.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/sys/powerpc/ofw/ofw_syscons.c b/sys/powerpc/ofw/ofw_syscons.c
index 1080dad..5ab5939 100644
--- a/sys/powerpc/ofw/ofw_syscons.c
+++ b/sys/powerpc/ofw/ofw_syscons.c
@@ -216,6 +216,7 @@ ofwfb_configure(int flags)
phandle_t chosen;
ihandle_t stdout;
phandle_t node;
+ bus_addr_t fb_phys;
int depth;
int disable;
int len;
@@ -270,10 +271,16 @@ ofwfb_configure(int flags)
OF_getprop(node, "linebytes", &sc->sc_stride, sizeof(sc->sc_stride));
/*
- * XXX the physical address of the frame buffer is assumed to be
- * BAT-mapped so it can be accessed directly
+ * Grab the physical address of the framebuffer, and then map it
+ * into our memory space. If the MMU is not yet up, it will be
+ * remapped for us when relocation turns on.
+ *
+ * XXX We assume #address-cells is 1 at this point.
*/
- OF_getprop(node, "address", &sc->sc_addr, sizeof(sc->sc_addr));
+ OF_getprop(node, "address", &fb_phys, sizeof(fb_phys));
+
+ bus_space_map(&bs_be_tag, fb_phys, sc->sc_height * sc->sc_stride,
+ 0, &sc->sc_addr);
/*
* Get the PCI addresses of the adapter. The node may be the
@@ -283,8 +290,8 @@ ofwfb_configure(int flags)
len = OF_getprop(node, "assigned-addresses", sc->sc_pciaddrs,
sizeof(sc->sc_pciaddrs));
if (len == -1) {
- len = OF_getprop(OF_parent(node), "assigned-addresses", sc->sc_pciaddrs,
- sizeof(sc->sc_pciaddrs));
+ len = OF_getprop(OF_parent(node), "assigned-addresses",
+ sc->sc_pciaddrs, sizeof(sc->sc_pciaddrs));
}
if (len != -1) {
@@ -941,13 +948,17 @@ ofwfb_scidentify(driver_t *driver, device_t parent)
static int
ofwfb_scprobe(device_t dev)
{
- /* This is a fake device, so make sure there is no OF node for it */
- if (ofw_bus_get_node(dev) != -1)
- return ENXIO;
-
+ int error;
+
device_set_desc(dev, "System console");
- return (sc_probe_unit(device_get_unit(dev),
- device_get_flags(dev) | SC_AUTODETECT_KBD));
+
+ error = sc_probe_unit(device_get_unit(dev),
+ device_get_flags(dev) | SC_AUTODETECT_KBD);
+ if (error != 0)
+ return (error);
+
+ /* This is a fake device, so make sure we added it ourselves */
+ return (BUS_PROBE_NOWILDCARD);
}
static int
OpenPOWER on IntegriCloud