aboutsummaryrefslogtreecommitdiff
path: root/include/services/sp_res_desc_def.h
blob: 5a3c50d7f9cd70f2537b2f60eeadeb2613dcb1d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
 * Copyright (c) 2018, Arm Limited. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef SPM_RES_DESC_DEFS_H
#define SPM_RES_DESC_DEFS_H

#include <lib/utils_def.h>

/*******************************************************************************
 * Attribute Section
 ******************************************************************************/

#define RD_ATTR_TYPE_UP_MIGRATABLE	U(0)
#define RD_ATTR_TYPE_UP_PINNED		U(2)
#define RD_ATTR_TYPE_MP			U(1)

#define RD_ATTR_RUNTIME_SEL0		U(0)
#define RD_ATTR_RUNTIME_SEL1		U(1)

#define RD_ATTR_INIT_ONLY		U(0)
#define RD_ATTR_RUNTIME			U(1)

#define RD_ATTR_PANIC_RESTART		U(0)
#define RD_ATTR_PANIC_ONESHOT		U(1)

#define RD_ATTR_XLAT_GRANULE_4KB	U(0)
#define RD_ATTR_XLAT_GRANULE_16KB	U(1)
#define RD_ATTR_XLAT_GRANULE_64KB	U(2)

/*******************************************************************************
 * Memory Region Section
 ******************************************************************************/

#define RD_MEM_REGION_NAME_LEN		U(32)

#define RD_MEM_DEVICE			U(0)
#define RD_MEM_NORMAL_CODE		U(1)
#define RD_MEM_NORMAL_DATA		U(2)
#define RD_MEM_NORMAL_BSS		U(3)
#define RD_MEM_NORMAL_RODATA		U(4)
#define RD_MEM_NORMAL_SPM_SP_SHARED_MEM	U(5)
#define RD_MEM_NORMAL_CLIENT_SHARED_MEM	U(6)
#define RD_MEM_NORMAL_MISCELLANEOUS	U(7)

#define RD_MEM_MASK			U(15)

#define RD_MEM_IS_PIE			(U(1) << 4)

/*******************************************************************************
 * Notification Section
 ******************************************************************************/

#define RD_NOTIF_TYPE_PLATFORM		(U(0) << 31)
#define RD_NOTIF_TYPE_INTERRUPT		(U(1) << 31)

#define RD_NOTIF_PLAT_ID_MASK		U(0xFFFF)
#define RD_NOTIF_PLAT_ID_SHIFT		U(0)

#define RD_NOTIF_PLATFORM(id)						\
	(RD_NOTIF_TYPE_PLATFORM						\
	| (((id) & RD_NOTIF_PLAT_ID_MASK) << RD_NOTIF_PLAT_ID_SHIFT))

#define RD_NOTIF_IRQ_NUM_MASK		U(0xFFFF)
#define RD_NOTIF_IRQ_NUM_SHIFT		U(0)
#define RD_NOTIF_IRQ_PRIO_MASK		U(0xFF)
#define RD_NOTIF_IRQ_PRIO_SHIFT		U(16)

#define RD_NOTIF_IRQ_EDGE_FALLING	U(0)
#define RD_NOTIF_IRQ_EDGE_RISING	U(2)
#define RD_NOTIF_IRQ_LEVEL_LOW		U(1)
#define RD_NOTIF_IRQ_LEVEL_HIGH		U(3)
#define RD_NOTIF_IRQ_TRIGGER_SHIFT	U(24)

#define RD_NOTIF_IRQ(num, prio, trig)					\
	(RD_NOTIF_TYPE_IRQ						\
	| (((num) & RD_NOTIF_IRQ_NUM_MASK) << RD_NOTIF_IRQ_NUM_SHIFT)	\
	| (((prio) & RD_NOTIF_IRQ_PRIO_MASK) << RD_NOTIF_IRQ_PRIO_SHIFT) \
	| (((trig) << RD_NOTIF_IRQ_TRIGGER_SHIFT)))

/*******************************************************************************
 * Service Description Section
 ******************************************************************************/

#define RD_SERV_ACCESS_SECURE		(U(1) << 0)
#define RD_SERV_ACCESS_EL3		(U(1) << 1)
#define RD_SERV_ACCESS_NORMAL		(U(1) << 2)

#define RD_SERV_SUPPORT_BLOCKING	(U(1) << 0)
#define RD_SERV_SUPPORT_NON_BLOCKING	(U(1) << 0)

#endif /* SPM_RES_DESC_DEFS_H */