aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/aim
diff options
context:
space:
mode:
authorNathan Whitehorn <nwhitehorn@FreeBSD.org>2010-11-09 23:53:47 +0000
committerNathan Whitehorn <nwhitehorn@FreeBSD.org>2010-11-09 23:53:47 +0000
commit2824d5d2f4b13a66a7216cca00cc0eaedc7d187e (patch)
treefaf5ab76271ee105b6233905a0931c41514409fa /sys/powerpc/aim
parentbf4724fa19cae8b182425f6a55b31c4dd19a471a (diff)
downloadsrc-2824d5d2f4b13a66a7216cca00cc0eaedc7d187e.tar.gz
src-2824d5d2f4b13a66a7216cca00cc0eaedc7d187e.zip
Make AIM early-boot code function correctly without Open Firmware.
Notes
Notes: svn path=/head/; revision=215067
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r--sys/powerpc/aim/mmu_oea64.c8
-rw-r--r--sys/powerpc/aim/nexus.c6
-rw-r--r--sys/powerpc/aim/ofw_machdep.c8
3 files changed, 12 insertions, 10 deletions
diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c
index cfb822e421c1..3e336c9e6ab6 100644
--- a/sys/powerpc/aim/mmu_oea64.c
+++ b/sys/powerpc/aim/mmu_oea64.c
@@ -274,7 +274,6 @@ static struct mem_region *regions;
static struct mem_region *pregions;
static u_int phys_avail_count;
static int regions_sz, pregions_sz;
-extern int ofw_real_mode;
extern struct pmap ofw_pmap;
@@ -1118,7 +1117,8 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
* mode.
*/
- if (!ofw_real_mode) {
+ chosen = OF_finddevice("/chosen");
+ if (chosen != -1 && OF_getprop(chosen, "mmu", &mmui, 4) != -1) {
#ifndef __powerpc64__
moea64_pinit(mmup, &ofw_pmap);
@@ -1126,10 +1126,6 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
ofw_pmap.pm_sr[i] = kernel_pmap->pm_sr[i];
#endif
- if ((chosen = OF_finddevice("/chosen")) == -1)
- panic("moea64_bootstrap: can't find /chosen");
- OF_getprop(chosen, "mmu", &mmui, 4);
-
if ((mmu = OF_instance_to_package(mmui)) == -1)
panic("moea64_bootstrap: can't get mmu package");
if ((sz = OF_getproplen(mmu, "translations")) == -1)
diff --git a/sys/powerpc/aim/nexus.c b/sys/powerpc/aim/nexus.c
index b17de11eccc6..203ae81db754 100644
--- a/sys/powerpc/aim/nexus.c
+++ b/sys/powerpc/aim/nexus.c
@@ -213,9 +213,6 @@ nexus_attach(device_t dev)
struct nexus_softc *sc;
u_long start, end;
- if ((root = OF_peer(0)) == -1)
- panic("nexus_probe: OF_peer failed.");
-
sc = device_get_softc(dev);
start = 0;
@@ -229,6 +226,9 @@ nexus_attach(device_t dev)
rman_manage_region(&sc->sc_rman, start, end))
panic("nexus_probe IRQ rman");
+ if ((root = OF_peer(0)) == 0)
+ return (bus_generic_attach(dev));
+
/*
* Now walk the OFW tree to locate top-level devices
*/
diff --git a/sys/powerpc/aim/ofw_machdep.c b/sys/powerpc/aim/ofw_machdep.c
index e0bf50575214..1ebcd0cb7d85 100644
--- a/sys/powerpc/aim/ofw_machdep.c
+++ b/sys/powerpc/aim/ofw_machdep.c
@@ -333,6 +333,12 @@ OF_initial_setup(void *fdt_ptr, void *junk, int (*openfirm)(void *))
#endif
fdt = fdt_ptr;
+
+ #ifdef FDT_DTB_STATIC
+ /* Check for a statically included blob */
+ if (fdt == NULL)
+ fdt = &fdt_static_dtb;
+ #endif
}
boolean_t
@@ -361,7 +367,7 @@ OF_bootstrap()
* background processes.
*/
ofw_quiesce();
- } else {
+ } else if (fdt != NULL) {
status = OF_install(OFW_FDT, 0);
if (status != TRUE)