aboutsummaryrefslogtreecommitdiff
path: root/plat
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2020-07-09 12:33:17 +0100
committerAndre Przywara <andre.przywara@arm.com>2020-07-17 11:35:24 +0100
commit5a430c0219681afde74a8362665fe583473f0b0f (patch)
treef0772e91a3aaf28188ffa31045f4367a291da78a /plat
parent2bdb4611ad6efdb3da2ff0d2de7fee4c43e95aeb (diff)
downloadtrusted-firmware-a-5a430c0219681afde74a8362665fe583473f0b0f.tar.gz
rpi4/fdt: Move dtb_size() function to fdt_wrappers.h
Getting the actual size of a DTB blob is useful beyond the Raspberry Pi port, so let's move this helper to a common header. Change-Id: Ia5be46e9353ca859a1e5ad9e3c057a322dfe22e2 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'plat')
-rw-r--r--plat/rpi/rpi4/rpi4_bl31_setup.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/plat/rpi/rpi4/rpi4_bl31_setup.c b/plat/rpi/rpi4/rpi4_bl31_setup.c
index 0a49d81b21..cfacd1fe1e 100644
--- a/plat/rpi/rpi4/rpi4_bl31_setup.c
+++ b/plat/rpi/rpi4/rpi4_bl31_setup.c
@@ -17,6 +17,7 @@
#include <lib/xlat_tables/xlat_tables_v2.h>
#include <plat/common/platform.h>
#include <common/fdt_fixup.h>
+#include <common/fdt_wrappers.h>
#include <libfdt.h>
#include <drivers/arm/gicv2.h>
@@ -200,13 +201,6 @@ void bl31_plat_arch_setup(void)
enable_mmu_el3(0);
}
-static uint32_t dtb_size(const void *dtb)
-{
- const uint32_t *dtb_header = dtb;
-
- return fdt32_to_cpu(dtb_header[1]);
-}
-
static void rpi4_prepare_dtb(void)
{
void *dtb = (void *)rpi4_get_dtb_address();
@@ -250,7 +244,7 @@ static void rpi4_prepare_dtb(void)
if (ret < 0)
ERROR("Failed to pack Device Tree at %p: error %d\n", dtb, ret);
- clean_dcache_range((uintptr_t)dtb, dtb_size(dtb));
+ clean_dcache_range((uintptr_t)dtb, fdt_blob_size(dtb));
INFO("Changed device tree to advertise PSCI.\n");
}