blob: 7edef469b166774413172448e87817eeeb162020 [file] [log] [blame]
Javier Almansa Sobrino1d0ca402022-04-25 17:18:15 +01001/*
2 * Copyright (c) 2022, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef RMM_CORE_MANIFEST_H
8#define RMM_CORE_MANIFEST_H
9
10#include <assert.h>
11#include <stddef.h>
12#include <stdint.h>
13
14#include <lib/cassert.h>
15
16#define RMMD_MANIFEST_VERSION_MAJOR U(0)
17#define RMMD_MANIFEST_VERSION_MINOR U(1)
18
19/*
20 * Manifest version encoding:
21 * - Bit[31] RES0
22 * - Bits [30:16] Major version
23 * - Bits [15:0] Minor version
24 */
25#define _RMMD_MANIFEST_VERSION(_major, _minor) \
26 ((((_major) & 0x7FFF) << 16) | ((_minor) & 0xFFFF))
27
28#define RMMD_MANIFEST_VERSION _RMMD_MANIFEST_VERSION( \
29 RMMD_MANIFEST_VERSION_MAJOR, \
30 RMMD_MANIFEST_VERSION_MINOR)
31
32#define RMMD_GET_MANIFEST_VERSION_MAJOR(_version) \
33 ((_version >> 16) & 0x7FFF)
34
35#define RMMD_GET_MANIFEST_VERSION_MINOR(_version) \
36 (_version & 0xFFFF)
37
38/* Boot manifest core structure as per v0.1 */
39typedef struct rmm_manifest {
40 uint32_t version; /* Manifest version */
Javier Almansa Sobrinodc0ca642022-12-01 17:20:45 +000041 uint32_t padding; /* RES0 */
Javier Almansa Sobrino1d0ca402022-04-25 17:18:15 +010042 uintptr_t plat_data; /* Manifest platform data */
43} rmm_manifest_t;
44
45CASSERT(offsetof(rmm_manifest_t, version) == 0,
46 rmm_manifest_t_version_unaligned);
47CASSERT(offsetof(rmm_manifest_t, plat_data) == 8,
48 rmm_manifest_t_plat_data_unaligned);
49
50#endif /* RMM_CORE_MANIFEST_H */