blob: 6ccbd15625187a59b74bff911cfdb5da34ff0b94 [file] [log] [blame]
Varun Wadekar1fd70492018-10-19 11:44:31 -07001/*
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#include <bl_common.h>
9#include <gicv2.h>
10#include <platform_def.h>
11#include <tegra_private.h>
12#include <tegra_def.h>
13#include <utils.h>
14
15/******************************************************************************
16 * Tegra common helper to setup the GICv2 driver data.
17 *****************************************************************************/
18void tegra_gic_setup(tegra_gic_cfg_t *cfg)
19{
20 /*
21 * Tegra GIC configuration settings
22 */
23 static gicv2_driver_data_t tegra_gic_data;
24
25 /*
26 * Register Tegra GICv2 driver
27 */
28 tegra_gic_data.gicd_base = TEGRA_GICD_BASE;
29 tegra_gic_data.gicc_base = TEGRA_GICC_BASE;
30 tegra_gic_data.g0_interrupt_num = cfg->g0_int_num;
31 tegra_gic_data.g0_interrupt_array = cfg->g0_int_array;
32 gicv2_driver_init(&tegra_gic_data);
33}
34
35/******************************************************************************
36 * Tegra common helper to initialize the GICv2 only driver.
37 *****************************************************************************/
38void tegra_gic_init(void)
39{
40 gicv2_distif_init();
41 gicv2_pcpu_distif_init();
42 gicv2_cpuif_enable();
43}
44
45/******************************************************************************
46 * Tegra common helper to disable the GICv2 CPU interface
47 *****************************************************************************/
48void tegra_gic_cpuif_deactivate(void)
49{
50 gicv2_cpuif_disable();
51}
52
53/******************************************************************************
54 * Tegra common helper to initialize the per cpu distributor interface
55 * in GICv2
56 *****************************************************************************/
57void tegra_gic_pcpu_init(void)
58{
59 gicv2_pcpu_distif_init();
60 gicv2_cpuif_enable();
61}