Varun Wadekar | bef02f0 | 2020-04-17 19:09:21 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2020, NVIDIA Corporation. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | /* SDEI configuration for Tegra platforms */ |
| 8 | |
| 9 | #include <platform_def.h> |
| 10 | |
| 11 | #include <bl31/ehf.h> |
| 12 | #include <common/bl_common.h> |
| 13 | #include <common/debug.h> |
| 14 | #include <lib/utils_def.h> |
| 15 | #include <services/sdei.h> |
| 16 | |
| 17 | /* Private event mappings */ |
| 18 | static sdei_ev_map_t tegra_sdei_private[] = { |
| 19 | /* Event 0 definition */ |
| 20 | SDEI_DEFINE_EVENT_0(TEGRA_SDEI_SGI_PRIVATE), |
| 21 | |
| 22 | /* Dynamic private events */ |
| 23 | SDEI_PRIVATE_EVENT(TEGRA_SDEI_DP_EVENT_0, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC), |
| 24 | SDEI_PRIVATE_EVENT(TEGRA_SDEI_DP_EVENT_1, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC), |
| 25 | SDEI_PRIVATE_EVENT(TEGRA_SDEI_DP_EVENT_2, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC), |
| 26 | |
| 27 | /* General purpose explicit events */ |
| 28 | SDEI_EXPLICIT_EVENT(TEGRA_SDEI_EP_EVENT_0, SDEI_MAPF_CRITICAL), |
| 29 | SDEI_EXPLICIT_EVENT(TEGRA_SDEI_EP_EVENT_1, SDEI_MAPF_CRITICAL), |
| 30 | SDEI_EXPLICIT_EVENT(TEGRA_SDEI_EP_EVENT_2, SDEI_MAPF_CRITICAL), |
| 31 | SDEI_EXPLICIT_EVENT(TEGRA_SDEI_EP_EVENT_3, SDEI_MAPF_CRITICAL), |
| 32 | SDEI_EXPLICIT_EVENT(TEGRA_SDEI_EP_EVENT_4, SDEI_MAPF_CRITICAL), |
| 33 | SDEI_EXPLICIT_EVENT(TEGRA_SDEI_EP_EVENT_5, SDEI_MAPF_CRITICAL), |
| 34 | SDEI_EXPLICIT_EVENT(TEGRA_SDEI_EP_EVENT_6, SDEI_MAPF_CRITICAL), |
| 35 | SDEI_EXPLICIT_EVENT(TEGRA_SDEI_EP_EVENT_7, SDEI_MAPF_CRITICAL), |
| 36 | SDEI_EXPLICIT_EVENT(TEGRA_SDEI_EP_EVENT_8, SDEI_MAPF_CRITICAL), |
| 37 | SDEI_EXPLICIT_EVENT(TEGRA_SDEI_EP_EVENT_9, SDEI_MAPF_CRITICAL), |
| 38 | SDEI_EXPLICIT_EVENT(TEGRA_SDEI_EP_EVENT_10, SDEI_MAPF_CRITICAL), |
| 39 | SDEI_EXPLICIT_EVENT(TEGRA_SDEI_EP_EVENT_11, SDEI_MAPF_CRITICAL) |
| 40 | }; |
| 41 | |
| 42 | /* Shared event mappings */ |
| 43 | static sdei_ev_map_t tegra_sdei_shared[] = { |
| 44 | /* Dynamic shared events */ |
| 45 | SDEI_SHARED_EVENT(TEGRA_SDEI_DS_EVENT_0, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC), |
| 46 | SDEI_SHARED_EVENT(TEGRA_SDEI_DS_EVENT_1, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC), |
| 47 | SDEI_SHARED_EVENT(TEGRA_SDEI_DS_EVENT_2, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC) |
| 48 | }; |
| 49 | |
| 50 | void plat_sdei_setup(void) |
| 51 | { |
| 52 | INFO("SDEI platform setup\n"); |
| 53 | } |
| 54 | |
| 55 | /* Export Tegra SDEI events */ |
| 56 | REGISTER_SDEI_MAP(tegra_sdei_private, tegra_sdei_shared); |