1 /* 2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #include <assert.h> 8 9 #include <platform_def.h> 10 11 #include <common/bl_common.h> 12 #include <drivers/arm/gicv2.h> 13 #include <lib/utils.h> 14 15 #include <tegra_private.h> 16 #include <tegra_def.h> 17 18 /****************************************************************************** 19 * Tegra common helper to setup the GICv2 driver data. 20 *****************************************************************************/ tegra_gic_setup(const interrupt_prop_t * interrupt_props,unsigned int interrupt_props_num)21void tegra_gic_setup(const interrupt_prop_t *interrupt_props, 22 unsigned int interrupt_props_num) 23 { 24 /* 25 * Tegra GIC configuration settings 26 */ 27 static gicv2_driver_data_t tegra_gic_data; 28 29 /* 30 * Register Tegra GICv2 driver 31 */ 32 tegra_gic_data.gicd_base = TEGRA_GICD_BASE; 33 tegra_gic_data.gicc_base = TEGRA_GICC_BASE; 34 tegra_gic_data.interrupt_props = interrupt_props; 35 tegra_gic_data.interrupt_props_num = interrupt_props_num; 36 gicv2_driver_init(&tegra_gic_data); 37 } 38 39 /****************************************************************************** 40 * Tegra common helper to initialize the GICv2 only driver. 41 *****************************************************************************/ tegra_gic_init(void)42void tegra_gic_init(void) 43 { 44 gicv2_distif_init(); 45 gicv2_pcpu_distif_init(); 46 gicv2_cpuif_enable(); 47 } 48 49 /****************************************************************************** 50 * Tegra common helper to disable the GICv2 CPU interface 51 *****************************************************************************/ tegra_gic_cpuif_deactivate(void)52void tegra_gic_cpuif_deactivate(void) 53 { 54 gicv2_cpuif_disable(); 55 } 56 57 /****************************************************************************** 58 * Tegra common helper to initialize the per cpu distributor interface 59 * in GICv2 60 *****************************************************************************/ tegra_gic_pcpu_init(void)61void tegra_gic_pcpu_init(void) 62 { 63 gicv2_pcpu_distif_init(); 64 gicv2_cpuif_enable(); 65 } 66