arm_sdei.c 1.77 KB
Newer Older
1
/*
2
 * Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved.
3
4
5
6
7
8
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

/* SDEI configuration for ARM platforms */

9
#include <bl31/ehf.h>
10
#include <common/debug.h>
11
#include <services/sdei.h>
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
#if SDEI_IN_FCONF
#include <plat/arm/common/fconf_sdei_getter.h>
#endif
#include <plat/common/platform.h>
#include <platform_def.h>


#if SDEI_IN_FCONF
/* Private event mappings */
static sdei_ev_map_t arm_sdei_private[PLAT_SDEI_DP_EVENT_MAX_CNT + 1] = { 0 };

/* Shared event mappings */
static sdei_ev_map_t arm_sdei_shared[PLAT_SDEI_DS_EVENT_MAX_CNT] = { 0 };

void plat_sdei_setup(void)
{
	uint32_t i;

	arm_sdei_private[0] = (sdei_ev_map_t)SDEI_DEFINE_EVENT_0(ARM_SDEI_SGI);

	for (i = 0; i < FCONF_GET_PROPERTY(sdei, dyn_config, private_ev_cnt); i++) {
		arm_sdei_private[i + 1] = (sdei_ev_map_t)SDEI_PRIVATE_EVENT(
			FCONF_GET_PROPERTY(sdei, dyn_config, private_ev_nums[i]),
			FCONF_GET_PROPERTY(sdei, dyn_config, private_ev_intrs[i]),
			FCONF_GET_PROPERTY(sdei, dyn_config, private_ev_flags[i]));
	}

	for (i = 0; i < FCONF_GET_PROPERTY(sdei, dyn_config, shared_ev_cnt); i++) {
		arm_sdei_shared[i] = (sdei_ev_map_t)SDEI_SHARED_EVENT( \
			FCONF_GET_PROPERTY(sdei, dyn_config, shared_ev_nums[i]),
			FCONF_GET_PROPERTY(sdei, dyn_config, shared_ev_intrs[i]),
			FCONF_GET_PROPERTY(sdei, dyn_config, shared_ev_flags[i]));
	}
	INFO("FCONF: SDEI platform setup\n");
}
#else
49
/* Private event mappings */
50
51
static sdei_ev_map_t arm_sdei_private[] = {
	PLAT_ARM_PRIVATE_SDEI_EVENTS
52
53
54
};

/* Shared event mappings */
55
56
static sdei_ev_map_t arm_sdei_shared[] = {
	PLAT_ARM_SHARED_SDEI_EVENTS
57
58
};

59
60
61
62
63
64
void plat_sdei_setup(void)
{
	INFO("SDEI platform setup\n");
}
#endif /* SDEI_IN_FCONF */

65
/* Export ARM SDEI events */
66
REGISTER_SDEI_MAP(arm_sdei_private, arm_sdei_shared);