config: Support physical address in device region
Support `physical-address` property in the device region of the SP
manifest. The value of the property is passed through by the SPMC
without any change.
For now the support is only available for FFA boot info version 1.1.
The change was tested successfully with OP-TEE SPMC.
Signed-off-by: Michael Zhao <michael.zhao2@arm.com>
Change-Id: I6a9db39a1d2ffdd331a6d7a4455fc99d99a6fb5a
diff --git a/components/config/loader/sp/sp_config_loader.c b/components/config/loader/sp/sp_config_loader.c
index bebb4b4..4d9da9f 100644
--- a/components/config/loader/sp/sp_config_loader.c
+++ b/components/config/loader/sp/sp_config_loader.c
@@ -190,6 +190,7 @@
fdt_for_each_subnode(subnode, fdt, node) {
struct device_region device_region = {0};
uint64_t base_addr = 0;
+ uint64_t phys_addr = 0;
uint32_t page_cnt = 0;
const char *subnode_name = fdt_get_name(fdt, subnode, NULL);
size_t name_length = 0;
@@ -204,6 +205,10 @@
return false;
}
+ if(!dt_get_u64(fdt, subnode, "physical-address", &phys_addr)) {
+ DMSG("physical-address is not configured");
+ }
+
if (!dt_get_u32(fdt, subnode, "pages-count", &page_cnt)) {
EMSG("pages-count is missing");
return false;
@@ -217,6 +222,7 @@
memcpy(device_region.dev_class, subnode_name, name_length);
device_region.base_addr = base_addr;
+ device_region.phys_addr = phys_addr;
device_region.io_region_size = page_cnt * FFA_SP_MANIFEST_PAGE_SIZE;
device_region.dev_instance = 0;
diff --git a/platform/interface/device_region.h b/platform/interface/device_region.h
index 8bbf203..3b1b1e3 100644
--- a/platform/interface/device_region.h
+++ b/platform/interface/device_region.h
@@ -24,6 +24,7 @@
char dev_class[16]; /**< Identifier for class of device e.g. 'trng' */
int dev_instance; /**< Instance of the class of device on a platform */
uintptr_t base_addr; /**< Base address or region */
+ uintptr_t phys_addr; /**< Physical address of the region */
size_t io_region_size; /**< Size of I/O region in bytes */
};