|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCHv6 20/37] plat/kvm: Initialize device tree for Arm64
From: Wei Chen <Wei.Chen@xxxxxxx>
Arm64 entry code passed the base address of device tree
to _libkvmplat_start. We will check the device tree header
and then save the address for further usage.
Signed-off-by: Wei Chen <Wei.Chen@xxxxxxx>
Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
plat/kvm/Config.uk | 1 +
plat/kvm/arm/setup.c | 15 +++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/plat/kvm/Config.uk b/plat/kvm/Config.uk
index 9f54a23..f097f10 100644
--- a/plat/kvm/Config.uk
+++ b/plat/kvm/Config.uk
@@ -6,6 +6,7 @@ menuconfig PLAT_KVM
select LIBUKALLOC
select LIBUKTIMECONV
select LIBNOLIBC if !HAVE_LIBC
+ select LIBFDT if ARCH_ARM_64
help
Create a Unikraft image that runs as a KVM guest
diff --git a/plat/kvm/arm/setup.c b/plat/kvm/arm/setup.c
index 2fc4538..835307e 100644
--- a/plat/kvm/arm/setup.c
+++ b/plat/kvm/arm/setup.c
@@ -18,9 +18,24 @@
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <libfdt.h>
#include <uk/assert.h>
+void *_libkvmplat_dtb;
+
+static void _init_dtb(void *dtb_pointer)
+{
+ int ret;
+
+ if ((ret = fdt_check_header(dtb_pointer)))
+ UK_CRASH("Invalid DTB: %s\n", fdt_strerror(ret));
+
+ _libkvmplat_dtb = dtb_pointer;
+ uk_printd(DLVL_INFO, "Found device tree on: %p\n", dtb_pointer);
+}
+
void _libkvmplat_start(void *dtb_pointer)
{
+ _init_dtb(dtb_pointer);
UK_BUG();
}
--
2.17.1
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |