test(manifest): relative address integration tests
* Add a memory region defined by `relative-address` to
`partition_manifest_service_sp1.dts`
Change-Id: I33667b606dfb58fb4f5a2e9dc9703c8ce5af7a03
diff --git a/test/hftest/service_common.c b/test/hftest/service_common.c
index bf3464d..a429beb 100644
--- a/test/hftest/service_common.c
+++ b/test/hftest/service_common.c
@@ -106,9 +106,17 @@
EXPECT_TRUE(fdt_read_number(&ffa_node, "pages-count",
&number));
cur_region->page_count = (uint32_t)number;
- EXPECT_TRUE(fdt_read_number(&ffa_node, "base-address",
- &number));
- cur_region->base_address = number;
+
+ if (!fdt_read_number(&ffa_node, "base-address",
+ &cur_region->base_address)) {
+ EXPECT_TRUE(fdt_read_number(&ffa_node,
+ "relative-address",
+ &number));
+ cur_region->base_address =
+ ctx->partition_manifest.load_addr +
+ number;
+ }
+
EXPECT_TRUE(fdt_read_number(&ffa_node, "attributes",
&number));
cur_region->attributes = (uint32_t)number;
diff --git a/test/vmapi/fvp-base-spmc.dts b/test/vmapi/fvp-base-spmc.dts
index 5707cec..45bd0a3 100644
--- a/test/vmapi/fvp-base-spmc.dts
+++ b/test/vmapi/fvp-base-spmc.dts
@@ -75,6 +75,6 @@
memory@1 {
device_type = "ns-memory";
- reg = <0x0 0x80000000 0x7f000000>;
+ reg = <0x0 0x90010000 0x70000000>;
};
};
diff --git a/test/vmapi/primary_with_secondaries/services/arch/aarch64/secure/partition_manifest_service_sp1.dts b/test/vmapi/primary_with_secondaries/services/arch/aarch64/secure/partition_manifest_service_sp1.dts
index cef53e8..9532d0e 100644
--- a/test/vmapi/primary_with_secondaries/services/arch/aarch64/secure/partition_manifest_service_sp1.dts
+++ b/test/vmapi/primary_with_secondaries/services/arch/aarch64/secure/partition_manifest_service_sp1.dts
@@ -33,17 +33,24 @@
};
memory-regions {
+
compatible = "arm,ffa-manifest-memory-regions";
+ test-memory {
+ relative-address = <0x300000>; /* effective address = 0x6780000 */
+ pages-count = <1>;
+ attributes = <0x3>;
+ };
+
secure-memory {
base-address = <0x00000000 0x7100000>;
pages-count = <1>;
attributes = <0x3>; /* read-write */
};
ns-memory {
- base-address = <0x00000000 0x8000F000>;
+ base-address = <0x00000000 0x9001F000>;
pages-count = <1>;
- attributes = <0xb>;
+ attributes = <0xb>; /* read-write and NS */
};
};
};