Migrate to libfdt

Replace our custom FDT parser implementation with libfdt while retaining
the original API as a thin wrapper around libfdt. This minimizes the
changes to the rest of our code base and hides differences in coding
styles.

As a byproduct, this fixes an issue with unaligned memory accesses while
parsing as libfdt handles these correctly.

Bug: 150587116
Change-Id: I8d305d7094b1be04608048009d73d7c448a578a0
diff --git a/src/boot_flow/linux.c b/src/boot_flow/linux.c
index a3dff65..ffbfbec 100644
--- a/src/boot_flow/linux.c
+++ b/src/boot_flow/linux.c
@@ -18,6 +18,7 @@
 #include "hf/cpio.h"
 #include "hf/dlog.h"
 #include "hf/fdt_handler.h"
+#include "hf/fdt_patch.h"
 #include "hf/plat/boot_flow.h"
 #include "hf/std.h"
 
@@ -45,10 +46,10 @@
 /**
  * Load initrd range from the board FDT.
  */
-bool plat_boot_flow_get_initrd_range(const struct fdt_node *fdt_root,
-				     paddr_t *begin, paddr_t *end)
+bool plat_boot_flow_get_initrd_range(const struct fdt *fdt, paddr_t *begin,
+				     paddr_t *end)
 {
-	return fdt_find_initrd(fdt_root, begin, end);
+	return fdt_find_initrd(fdt, begin, end);
 }
 
 bool plat_boot_flow_update(struct mm_stage1_locked stage1_locked,