mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 01:54:22 +00:00
Tegra: introduce support for GICv3
This patch provides the platform level support to enable GICv3 drivers on future Tegra platforms. Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Change-Id: I966a4502b2a4a7bd1ce66da843997c9ed605c59f
This commit is contained in:
parent
9935047b20
commit
5e1b83aa74
2 changed files with 85 additions and 0 deletions
|
@ -14,6 +14,12 @@ PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS}
|
|||
|
||||
COMMON_DIR := plat/nvidia/tegra/common
|
||||
|
||||
# Include GICv3 driver files
|
||||
include drivers/arm/gic/v3/gicv3.mk
|
||||
TEGRA_GICv3_SOURCES := $(GICV3_SOURCES) \
|
||||
plat/common/plat_gicv3.c \
|
||||
${COMMON_DIR}/tegra_gicv3.c
|
||||
|
||||
TEGRA_GICv2_SOURCES := drivers/arm/gic/common/gic_common.c \
|
||||
drivers/arm/gic/v2/gicv2_main.c \
|
||||
drivers/arm/gic/v2/gicv2_helpers.c \
|
||||
|
|
79
plat/nvidia/tegra/common/tegra_gicv3.c
Normal file
79
plat/nvidia/tegra/common/tegra_gicv3.c
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* Copyright (c) 2020, NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <common/bl_common.h>
|
||||
#include <drivers/arm/gicv3.h>
|
||||
#include <lib/utils.h>
|
||||
|
||||
#include <plat/common/platform.h>
|
||||
#include <platform_def.h>
|
||||
#include <tegra_private.h>
|
||||
#include <tegra_def.h>
|
||||
|
||||
/* The GICv3 driver only needs to be initialized in EL3 */
|
||||
static uintptr_t rdistif_base_addrs[PLATFORM_CORE_COUNT];
|
||||
|
||||
static unsigned int plat_tegra_mpidr_to_core_pos(unsigned long mpidr)
|
||||
{
|
||||
return (unsigned int)plat_core_pos_by_mpidr(mpidr);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Tegra common helper to setup the GICv3 driver data.
|
||||
*****************************************************************************/
|
||||
void tegra_gic_setup(const interrupt_prop_t *interrupt_props,
|
||||
unsigned int interrupt_props_num)
|
||||
{
|
||||
/*
|
||||
* Tegra GIC configuration settings
|
||||
*/
|
||||
static gicv3_driver_data_t tegra_gic_data;
|
||||
|
||||
/*
|
||||
* Register Tegra GICv3 driver
|
||||
*/
|
||||
tegra_gic_data.gicd_base = TEGRA_GICD_BASE;
|
||||
tegra_gic_data.gicr_base = TEGRA_GICR_BASE;
|
||||
tegra_gic_data.rdistif_num = PLATFORM_CORE_COUNT;
|
||||
tegra_gic_data.rdistif_base_addrs = rdistif_base_addrs;
|
||||
tegra_gic_data.mpidr_to_core_pos = plat_tegra_mpidr_to_core_pos;
|
||||
tegra_gic_data.interrupt_props = interrupt_props;
|
||||
tegra_gic_data.interrupt_props_num = interrupt_props_num;
|
||||
gicv3_driver_init(&tegra_gic_data);
|
||||
|
||||
/* initialize the GICD and GICR */
|
||||
tegra_gic_init();
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Tegra common helper to initialize the GICv3 only driver.
|
||||
*****************************************************************************/
|
||||
void tegra_gic_init(void)
|
||||
{
|
||||
gicv3_distif_init();
|
||||
gicv3_rdistif_init(plat_my_core_pos());
|
||||
gicv3_cpuif_enable(plat_my_core_pos());
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Tegra common helper to disable the GICv3 CPU interface
|
||||
*****************************************************************************/
|
||||
void tegra_gic_cpuif_deactivate(void)
|
||||
{
|
||||
gicv3_cpuif_disable(plat_my_core_pos());
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Tegra common helper to initialize the per cpu distributor interface
|
||||
* in GICv3
|
||||
*****************************************************************************/
|
||||
void tegra_gic_pcpu_init(void)
|
||||
{
|
||||
gicv3_rdistif_init(plat_my_core_pos());
|
||||
gicv3_cpuif_enable(plat_my_core_pos());
|
||||
}
|
Loading…
Add table
Reference in a new issue