Make AIM early-boot code function correctly without Open Firmware.

This commit is contained in:
nwhitehorn 2010-11-09 23:53:47 +00:00
parent 10425d51e7
commit 023e6598a8
3 changed files with 12 additions and 10 deletions

View File

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

View File

@ -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
*/

View File

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