diff options
author | Alex Iacobucci <alexiacobucci@google.com> | 2023-05-11 22:24:36 +0000 |
---|---|---|
committer | Alex Iacobucci <alexiacobucci@google.com> | 2023-07-14 14:13:01 +0000 |
commit | 509a9573ada096ff90812243669896902ed35523 (patch) | |
tree | b41ce96c8b1db193754a175acee041d46b92b1b4 /aoc_firmware.h | |
parent | 997a693de9062e9302aa50bf7430dc5de157f9d7 (diff) | |
download | aoc-509a9573ada096ff90812243669896902ed35523.tar.gz |
aoc: configure iommu from fw headers
Bug: 282063178
Test: tested on device
Change-Id: I4c867c878683d1aa42d7493c74eda085502c5bf2
Signed-off-by: Alex Iacobucci <alexiacobucci@google.com>
Diffstat (limited to 'aoc_firmware.h')
-rw-r--r-- | aoc_firmware.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/aoc_firmware.h b/aoc_firmware.h index b481087..2b5834c 100644 --- a/aoc_firmware.h +++ b/aoc_firmware.h @@ -15,6 +15,15 @@ #define AOC_AUTH_HEADER_SIZE 4096 +struct sysmmu_entry { + uint64_t value; +}; + +/* Access macros to decode SYSMMU entry */ +#define SYSMMU_VADDR(v) ((((v) >> 0) & 0x000FFFFF) << 12) +#define SYSMMU_PADDR(v) ((((v) >> 20) & 0x00FFFFFF) << 12) +#define SYSMMU_SIZE(v) ((((v) >> 44) & 0x000FFFFF) << 12) + /* Dev builds bypass the UUID check on load */ bool _aoc_fw_is_release(const struct firmware *fw); @@ -32,3 +41,15 @@ u32 _aoc_fw_ipc_offset(const struct firmware *fw); const char *_aoc_fw_version(const struct firmware *fw); bool _aoc_fw_commit(const struct firmware *fw, void *dest); + +uint16_t _aoc_fw_sysmmu_offset(const struct firmware *fw); + +uint16_t _aoc_fw_sysmmu_size(const struct firmware *fw); + +bool _aoc_fw_is_valid_sysmmu_size(const struct firmware *fw); + +struct sysmmu_entry *_aoc_fw_sysmmu_entry(const struct firmware *fw); + +struct aoc_image_config *_aoc_fw_image_config(const struct firmware *fw); + +u32 _aoc_fw_get_header_version(const struct firmware *fw); |