blob: 5a3c50d7f9cd70f2537b2f60eeadeb2613dcb1d2 [file] [log] [blame]
Antonio Nino Diaz5e7b0172018-11-27 09:36:22 +00001/*
2 * Copyright (c) 2018, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef SPM_RES_DESC_DEFS_H
8#define SPM_RES_DESC_DEFS_H
9
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000010#include <lib/utils_def.h>
Antonio Nino Diaz5e7b0172018-11-27 09:36:22 +000011
12/*******************************************************************************
13 * Attribute Section
14 ******************************************************************************/
15
16#define RD_ATTR_TYPE_UP_MIGRATABLE U(0)
17#define RD_ATTR_TYPE_UP_PINNED U(2)
18#define RD_ATTR_TYPE_MP U(1)
19
20#define RD_ATTR_RUNTIME_SEL0 U(0)
21#define RD_ATTR_RUNTIME_SEL1 U(1)
22
23#define RD_ATTR_INIT_ONLY U(0)
24#define RD_ATTR_RUNTIME U(1)
25
26#define RD_ATTR_PANIC_RESTART U(0)
27#define RD_ATTR_PANIC_ONESHOT U(1)
28
29#define RD_ATTR_XLAT_GRANULE_4KB U(0)
30#define RD_ATTR_XLAT_GRANULE_16KB U(1)
31#define RD_ATTR_XLAT_GRANULE_64KB U(2)
32
33/*******************************************************************************
34 * Memory Region Section
35 ******************************************************************************/
36
37#define RD_MEM_REGION_NAME_LEN U(32)
38
39#define RD_MEM_DEVICE U(0)
40#define RD_MEM_NORMAL_CODE U(1)
41#define RD_MEM_NORMAL_DATA U(2)
42#define RD_MEM_NORMAL_BSS U(3)
43#define RD_MEM_NORMAL_RODATA U(4)
44#define RD_MEM_NORMAL_SPM_SP_SHARED_MEM U(5)
45#define RD_MEM_NORMAL_CLIENT_SHARED_MEM U(6)
46#define RD_MEM_NORMAL_MISCELLANEOUS U(7)
47
48#define RD_MEM_MASK U(15)
49
50#define RD_MEM_IS_PIE (U(1) << 4)
51
52/*******************************************************************************
53 * Notification Section
54 ******************************************************************************/
55
56#define RD_NOTIF_TYPE_PLATFORM (U(0) << 31)
57#define RD_NOTIF_TYPE_INTERRUPT (U(1) << 31)
58
59#define RD_NOTIF_PLAT_ID_MASK U(0xFFFF)
60#define RD_NOTIF_PLAT_ID_SHIFT U(0)
61
62#define RD_NOTIF_PLATFORM(id) \
63 (RD_NOTIF_TYPE_PLATFORM \
64 | (((id) & RD_NOTIF_PLAT_ID_MASK) << RD_NOTIF_PLAT_ID_SHIFT))
65
66#define RD_NOTIF_IRQ_NUM_MASK U(0xFFFF)
67#define RD_NOTIF_IRQ_NUM_SHIFT U(0)
68#define RD_NOTIF_IRQ_PRIO_MASK U(0xFF)
69#define RD_NOTIF_IRQ_PRIO_SHIFT U(16)
70
71#define RD_NOTIF_IRQ_EDGE_FALLING U(0)
72#define RD_NOTIF_IRQ_EDGE_RISING U(2)
73#define RD_NOTIF_IRQ_LEVEL_LOW U(1)
74#define RD_NOTIF_IRQ_LEVEL_HIGH U(3)
75#define RD_NOTIF_IRQ_TRIGGER_SHIFT U(24)
76
77#define RD_NOTIF_IRQ(num, prio, trig) \
78 (RD_NOTIF_TYPE_IRQ \
79 | (((num) & RD_NOTIF_IRQ_NUM_MASK) << RD_NOTIF_IRQ_NUM_SHIFT) \
80 | (((prio) & RD_NOTIF_IRQ_PRIO_MASK) << RD_NOTIF_IRQ_PRIO_SHIFT) \
81 | (((trig) << RD_NOTIF_IRQ_TRIGGER_SHIFT)))
82
83/*******************************************************************************
84 * Service Description Section
85 ******************************************************************************/
86
87#define RD_SERV_ACCESS_SECURE (U(1) << 0)
88#define RD_SERV_ACCESS_EL3 (U(1) << 1)
89#define RD_SERV_ACCESS_NORMAL (U(1) << 2)
90
91#define RD_SERV_SUPPORT_BLOCKING (U(1) << 0)
92#define RD_SERV_SUPPORT_NON_BLOCKING (U(1) << 0)
93
94#endif /* SPM_RES_DESC_DEFS_H */