blob: 945ae1c89c77f948234468fe5d4c6542c7832617 [file] [log] [blame]
Zelalem Awekec8bc23e2021-07-09 15:32:21 -05001/*
Soby Mathew68ea9542022-03-22 13:58:52 +00002 * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
Zelalem Awekec8bc23e2021-07-09 15:32:21 -05003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef TRP_PRIVATE_H
8#define TRP_PRIVATE_H
9
Javier Almansa Sobrino7176a772021-11-24 18:37:37 +000010#include <services/rmmd_svc.h>
Javier Almansa Sobrino4165e842022-04-25 17:18:15 +010011#include <trp_helpers.h>
Zelalem Awekec8bc23e2021-07-09 15:32:21 -050012
Javier Almansa Sobrino7176a772021-11-24 18:37:37 +000013/* Definitions for RMM-EL3 Interface ABI VERSION */
14#define TRP_RMM_EL3_ABI_VERS_MAJOR RMM_EL3_IFC_VERSION_MAJOR
15#define TRP_RMM_EL3_ABI_VERS_MINOR RMM_EL3_IFC_VERSION_MINOR
16#define TRP_RMM_EL3_ABI_VERS (((TRP_RMM_EL3_ABI_VERS_MAJOR & 0x7FFF) << 16) | \
17 (TRP_RMM_EL3_ABI_VERS_MINOR & 0xFFFF))
18
19#define TRP_PLATFORM_CORE_COUNT PLATFORM_CORE_COUNT
20
Zelalem Awekec8bc23e2021-07-09 15:32:21 -050021#ifndef __ASSEMBLER__
22
23#include <stdint.h>
24
Zelalem Awekec8bc23e2021-07-09 15:32:21 -050025#define write_trp_arg(args, offset, val) (((args)->regs[offset >> 3]) \
26 = val)
Subhasish Ghosh3ad16032022-05-12 12:22:17 +010027/* RMI SMC64 FIDs handled by the TRP */
28#define RMI_RMM_REQ_VERSION SMC64_RMI_FID(U(0))
29#define RMI_RMM_GRANULE_DELEGATE SMC64_RMI_FID(U(1))
30#define RMI_RMM_GRANULE_UNDELEGATE SMC64_RMI_FID(U(2))
Soby Mathew68ea9542022-03-22 13:58:52 +000031
Zelalem Awekec8bc23e2021-07-09 15:32:21 -050032/* Definitions for RMI VERSION */
33#define RMI_ABI_VERSION_MAJOR U(0x0)
34#define RMI_ABI_VERSION_MINOR U(0x0)
Javier Almansa Sobrino7176a772021-11-24 18:37:37 +000035#define RMI_ABI_VERSION (((RMI_ABI_VERSION_MAJOR & 0x7FFF) \
36 << 16) | \
37 (RMI_ABI_VERSION_MINOR & 0xFFFF))
38
39#define TRP_RMM_EL3_VERSION_GET_MAJOR(x) \
40 RMM_EL3_IFC_VERSION_GET_MAJOR((x))
41#define TRP_RMM_EL3_VERSION_GET_MINOR(x) \
42 RMM_EL3_IFC_VERSION_GET_MAJOR_MINOR((x))
Zelalem Awekec8bc23e2021-07-09 15:32:21 -050043
44/* Helper to issue SMC calls to BL31 */
45uint64_t trp_smc(trp_args_t *);
46
47/* The main function to executed only by Primary CPU */
48void trp_main(void);
49
50/* Setup TRP. Executed only by Primary CPU */
Javier Almansa Sobrino7176a772021-11-24 18:37:37 +000051void trp_setup(uint64_t x0,
52 uint64_t x1,
53 uint64_t x2,
54 uint64_t x3);
Zelalem Awekec8bc23e2021-07-09 15:32:21 -050055
56#endif /* __ASSEMBLER__ */
57#endif /* TRP_PRIVATE_H */