Jeenu Viswambharan | a5acc0a | 2017-09-22 08:32:10 +0100 | [diff] [blame] | 1 | /* |
Balint Dobszay | d0dbd5e | 2019-12-18 15:28:00 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved. |
Jeenu Viswambharan | a5acc0a | 2017-09-22 08:32:10 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | /* SDEI configuration for ARM platforms */ |
| 8 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 9 | #include <bl31/ehf.h> |
Balint Dobszay | d0dbd5e | 2019-12-18 15:28:00 +0100 | [diff] [blame] | 10 | #include <common/debug.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 11 | #include <services/sdei.h> |
Jeenu Viswambharan | a5acc0a | 2017-09-22 08:32:10 +0100 | [diff] [blame] | 12 | |
Balint Dobszay | d0dbd5e | 2019-12-18 15:28:00 +0100 | [diff] [blame] | 13 | #if SDEI_IN_FCONF |
| 14 | #include <plat/arm/common/fconf_sdei_getter.h> |
| 15 | #endif |
| 16 | #include <plat/common/platform.h> |
| 17 | #include <platform_def.h> |
| 18 | |
| 19 | |
| 20 | #if SDEI_IN_FCONF |
| 21 | /* Private event mappings */ |
| 22 | static sdei_ev_map_t arm_sdei_private[PLAT_SDEI_DP_EVENT_MAX_CNT + 1] = { 0 }; |
| 23 | |
| 24 | /* Shared event mappings */ |
| 25 | static sdei_ev_map_t arm_sdei_shared[PLAT_SDEI_DS_EVENT_MAX_CNT] = { 0 }; |
| 26 | |
| 27 | void plat_sdei_setup(void) |
| 28 | { |
| 29 | uint32_t i; |
| 30 | |
| 31 | arm_sdei_private[0] = (sdei_ev_map_t)SDEI_DEFINE_EVENT_0(ARM_SDEI_SGI); |
| 32 | |
| 33 | for (i = 0; i < FCONF_GET_PROPERTY(sdei, dyn_config, private_ev_cnt); i++) { |
| 34 | arm_sdei_private[i + 1] = (sdei_ev_map_t)SDEI_PRIVATE_EVENT( |
| 35 | FCONF_GET_PROPERTY(sdei, dyn_config, private_ev_nums[i]), |
| 36 | FCONF_GET_PROPERTY(sdei, dyn_config, private_ev_intrs[i]), |
| 37 | FCONF_GET_PROPERTY(sdei, dyn_config, private_ev_flags[i])); |
| 38 | } |
| 39 | |
| 40 | for (i = 0; i < FCONF_GET_PROPERTY(sdei, dyn_config, shared_ev_cnt); i++) { |
| 41 | arm_sdei_shared[i] = (sdei_ev_map_t)SDEI_SHARED_EVENT( \ |
| 42 | FCONF_GET_PROPERTY(sdei, dyn_config, shared_ev_nums[i]), |
| 43 | FCONF_GET_PROPERTY(sdei, dyn_config, shared_ev_intrs[i]), |
| 44 | FCONF_GET_PROPERTY(sdei, dyn_config, shared_ev_flags[i])); |
| 45 | } |
| 46 | INFO("FCONF: SDEI platform setup\n"); |
| 47 | } |
| 48 | #else |
Jeenu Viswambharan | a5acc0a | 2017-09-22 08:32:10 +0100 | [diff] [blame] | 49 | /* Private event mappings */ |
Jeenu Viswambharan | 6e28446 | 2017-12-08 10:38:24 +0000 | [diff] [blame] | 50 | static sdei_ev_map_t arm_sdei_private[] = { |
| 51 | PLAT_ARM_PRIVATE_SDEI_EVENTS |
Jeenu Viswambharan | a5acc0a | 2017-09-22 08:32:10 +0100 | [diff] [blame] | 52 | }; |
| 53 | |
| 54 | /* Shared event mappings */ |
Jeenu Viswambharan | 6e28446 | 2017-12-08 10:38:24 +0000 | [diff] [blame] | 55 | static sdei_ev_map_t arm_sdei_shared[] = { |
| 56 | PLAT_ARM_SHARED_SDEI_EVENTS |
Jeenu Viswambharan | a5acc0a | 2017-09-22 08:32:10 +0100 | [diff] [blame] | 57 | }; |
| 58 | |
Balint Dobszay | d0dbd5e | 2019-12-18 15:28:00 +0100 | [diff] [blame] | 59 | void plat_sdei_setup(void) |
| 60 | { |
| 61 | INFO("SDEI platform setup\n"); |
| 62 | } |
| 63 | #endif /* SDEI_IN_FCONF */ |
| 64 | |
Jeenu Viswambharan | a5acc0a | 2017-09-22 08:32:10 +0100 | [diff] [blame] | 65 | /* Export ARM SDEI events */ |
Jeenu Viswambharan | 6e28446 | 2017-12-08 10:38:24 +0000 | [diff] [blame] | 66 | REGISTER_SDEI_MAP(arm_sdei_private, arm_sdei_shared); |