svn commit: r277991 - head/sys/boot/powerpc/kboot
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Sat Jan 31 19:18:10 UTC 2015
Author: nwhitehorn
Date: Sat Jan 31 19:18:09 2015
New Revision: 277991
URL: https://svnweb.freebsd.org/changeset/base/277991
Log:
Add FDT reservations for memory areas used by OPAL or RTAS runtime firmware.
This allows a kexec'ed kernel to boot multiuser under PHYP.
Modified:
head/sys/boot/powerpc/kboot/kbootfdt.c
Modified: head/sys/boot/powerpc/kboot/kbootfdt.c
==============================================================================
--- head/sys/boot/powerpc/kboot/kbootfdt.c Sat Jan 31 19:16:51 2015 (r277990)
+++ head/sys/boot/powerpc/kboot/kbootfdt.c Sat Jan 31 19:18:09 2015 (r277991)
@@ -110,12 +110,32 @@ fdt_linux_fixups(void *fdtp)
*/
offset = fdt_path_offset(fdtp, "/memory at 0");
- if (offset > 0) {
+ if (offset > 0)
fdt_delprop(fdtp, offset, "available");
- /*
- * XXX: add real available properties to reflect RTAS, etc.
- * reservations?
- */
+
+ /*
+ * Add reservations for OPAL and RTAS state if present
+ */
+
+ offset = fdt_path_offset(fdtp, "/ibm,opal");
+ if (offset > 0) {
+ uint64_t *base, *size;
+ base = fdt_getprop(fdtp, offset, "opal-base-address",
+ &len);
+ size = fdt_getprop(fdtp, offset, "opal-runtime-size",
+ &len);
+ if (base != NULL && size != NULL)
+ fdt_add_mem_rsv(fdtp, fdt64_to_cpu(*base),
+ fdt64_to_cpu(*size));
+ }
+ offset = fdt_path_offset(fdtp, "/rtas");
+ if (offset > 0) {
+ uint32_t *base, *size;
+ base = fdt_getprop(fdtp, offset, "linux,rtas-base", &len);
+ size = fdt_getprop(fdtp, offset, "rtas-size", &len);
+ if (base != NULL && size != NULL)
+ fdt_add_mem_rsv(fdtp, fdt32_to_cpu(*base),
+ fdt32_to_cpu(*size));
}
/*
More information about the svn-src-head
mailing list