mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-01 08:27:59 +00:00
Make FDT-using parts of ofw_machdep.c condition on options FDT. This fixes
the kernel build when options FDT is absent.
This commit is contained in:
parent
cf268a8302
commit
35feca377d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=330754
@ -223,6 +223,7 @@ parse_ofw_memory(phandle_t node, const char *prop, struct mem_region *output)
|
||||
return (sz);
|
||||
}
|
||||
|
||||
#ifdef FDT
|
||||
static int
|
||||
excise_fdt_reserved(struct mem_region *avail, int asz)
|
||||
{
|
||||
@ -310,6 +311,7 @@ excise_fdt_reserved(struct mem_region *avail, int asz)
|
||||
|
||||
return (asz);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is called during powerpc_init, before the system is really initialized.
|
||||
@ -348,9 +350,11 @@ ofw_mem_regions(struct mem_region *memp, int *memsz,
|
||||
asz += res/sizeof(struct mem_region);
|
||||
}
|
||||
|
||||
#ifdef FDT
|
||||
phandle = OF_finddevice("/chosen");
|
||||
if (OF_hasprop(phandle, "fdtmemreserv"))
|
||||
asz = excise_fdt_reserved(availp, asz);
|
||||
#endif
|
||||
|
||||
*memsz = msz;
|
||||
*availsz = asz;
|
||||
@ -409,6 +413,7 @@ OF_bootstrap()
|
||||
} else
|
||||
#endif
|
||||
if (fdt != NULL) {
|
||||
#ifdef FDT
|
||||
#ifdef AIM
|
||||
bus_space_tag_t fdt_bt;
|
||||
vm_offset_t tmp_fdt_ptr;
|
||||
@ -445,6 +450,7 @@ OF_bootstrap()
|
||||
err = OF_init((void *)fdt_va);
|
||||
#else
|
||||
err = OF_init(fdt);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user