summaryrefslogtreecommitdiffstats
path: root/sys/boot/ofw/libofw/openfirm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/ofw/libofw/openfirm.c')
-rw-r--r--sys/boot/ofw/libofw/openfirm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/boot/ofw/libofw/openfirm.c b/sys/boot/ofw/libofw/openfirm.c
index 8786d5d..4b84fa1 100644
--- a/sys/boot/ofw/libofw/openfirm.c
+++ b/sys/boot/ofw/libofw/openfirm.c
@@ -80,8 +80,13 @@ OF_init(int (*openfirm)(void *))
if ((chosen = OF_finddevice("/chosen")) == -1)
OF_exit();
- if (OF_getprop(chosen, "memory", &memory, sizeof(memory)) == -1)
- OF_exit();
+ if (OF_getprop(chosen, "memory", &memory, sizeof(memory)) == -1) {
+ memory = OF_open("/memory");
+ if (memory == -1)
+ memory = OF_open("/memory@0");
+ if (memory == -1)
+ OF_exit();
+ }
if (OF_getprop(chosen, "mmu", &mmu, sizeof(mmu)) == -1)
OF_exit();
}
OpenPOWER on IntegriCloud