diff options
author | AlexeiFedorov <Alexei.Fedorov@arm.com> | 2022-12-14 17:28:11 +0000 |
---|---|---|
committer | AlexeiFedorov <Alexei.Fedorov@arm.com> | 2023-01-17 16:35:41 +0000 |
commit | a97bfa5ff18b2682e3b9c528cbd5fb16ceec3393 (patch) | |
tree | 8842c02c815f33da83af7b51bf9e9eff1e065a06 /include/services | |
parent | 018552394851415685aa408dcbd91b30bb9bffac (diff) | |
download | arm-trusted-firmware-a97bfa5ff18b2682e3b9c528cbd5fb16ceec3393.tar.gz |
feat(rme): set DRAM information in Boot Manifest platform data
This patch adds support for setting configuration of DRAM banks
for FVP model in RMM-EL3 Boot Manifest structure.
Structure 'rmm_manifest' is extended with 'plat_dram' structure
which contains information about platform's DRAM layout:
- number of DRAM banks;
- pointer to 'dram_bank[]' array;
- check sum: two's complement 64-bit value of the sum of
data in 'plat_dram' and 'dram_bank[] array.
Each 'dram_bank' structure holds information about DRAM
bank base address and its size. This values must be aligned
to 4KB page size.
The patch increases Boot Manifest minor version to 2 and
removes 'typedef rmm_manifest_t' as per
"3.4.15.1. Avoid anonymous typedefs of structs/enums in headers" of
https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-style.html
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: I5176caa5780e27d1e0daeb5dea3e40cf6ad5fd12
Diffstat (limited to 'include/services')
-rw-r--r-- | include/services/rmm_core_manifest.h | 52 | ||||
-rw-r--r-- | include/services/trp/platform_trp.h | 4 |
2 files changed, 43 insertions, 13 deletions
diff --git a/include/services/rmm_core_manifest.h b/include/services/rmm_core_manifest.h index 7edef469b..a59788392 100644 --- a/include/services/rmm_core_manifest.h +++ b/include/services/rmm_core_manifest.h @@ -14,7 +14,7 @@ #include <lib/cassert.h> #define RMMD_MANIFEST_VERSION_MAJOR U(0) -#define RMMD_MANIFEST_VERSION_MINOR U(1) +#define RMMD_MANIFEST_VERSION_MINOR U(2) /* * Manifest version encoding: @@ -35,16 +35,44 @@ #define RMMD_GET_MANIFEST_VERSION_MINOR(_version) \ (_version & 0xFFFF) -/* Boot manifest core structure as per v0.1 */ -typedef struct rmm_manifest { - uint32_t version; /* Manifest version */ - uint32_t padding; /* RES0 */ - uintptr_t plat_data; /* Manifest platform data */ -} rmm_manifest_t; - -CASSERT(offsetof(rmm_manifest_t, version) == 0, - rmm_manifest_t_version_unaligned); -CASSERT(offsetof(rmm_manifest_t, plat_data) == 8, - rmm_manifest_t_plat_data_unaligned); +/* DRAM bank structure */ +struct dram_bank { + uintptr_t base; /* Base address */ + uint64_t size; /* Size of bank */ +}; + +CASSERT(offsetof(struct dram_bank, base) == 0, + rmm_manifest_base_unaligned); +CASSERT(offsetof(struct dram_bank, size) == 8, + rmm_manifest_size_unaligned); + +/* DRAM layout info structure */ +struct dram_info { + uint64_t banks_num; /* Number of DRAM banks */ + struct dram_bank *dram_data; /* Pointer to dram_bank[] */ + uint64_t check_sum; /* Checksum of dram_info data */ +}; + +CASSERT(offsetof(struct dram_info, banks_num) == 0, + rmm_manifest_banks_num_unaligned); +CASSERT(offsetof(struct dram_info, dram_data) == 8, + rmm_manifest_dram_data_unaligned); +CASSERT(offsetof(struct dram_info, check_sum) == 16, + rmm_manifest_check_sum_unaligned); + +/* Boot manifest core structure as per v0.2 */ +struct rmm_manifest { + uint32_t version; /* Manifest version */ + uint32_t padding; /* RES0 */ + uintptr_t plat_data; /* Manifest platform data */ + struct dram_info plat_dram; /* Platform DRAM data */ +}; + +CASSERT(offsetof(struct rmm_manifest, version) == 0, + rmm_manifest_version_unaligned); +CASSERT(offsetof(struct rmm_manifest, plat_data) == 8, + rmm_manifest_plat_data_unaligned); +CASSERT(offsetof(struct rmm_manifest, plat_dram) == 16, + rmm_manifest_plat_dram_unaligned); #endif /* RMM_CORE_MANIFEST_H */ diff --git a/include/services/trp/platform_trp.h b/include/services/trp/platform_trp.h index 1c963c851..756e9db6c 100644 --- a/include/services/trp/platform_trp.h +++ b/include/services/trp/platform_trp.h @@ -9,9 +9,11 @@ #include <services/rmm_core_manifest.h> +struct rmm_manifest; + /******************************************************************************* * Mandatory TRP functions (only if platform contains a TRP) ******************************************************************************/ -void trp_early_platform_setup(rmm_manifest_t *manifest); +void trp_early_platform_setup(struct rmm_manifest *manifest); #endif /* PLATFORM_TRP_H */ |