blob: fabed370f0a2cab002e8429c689711ee52438a56 [file] [log] [blame]
Yann Gautier9d135e42018-07-16 19:36:06 +02001/*
2 * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Yann Gautier9d135e42018-07-16 19:36:06 +02007#include <platform_def.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00008
9#include <common/bl_common.h>
10#include <drivers/arm/gicv2.h>
11#include <lib/utils.h>
12#include <plat/common/platform.h>
Yann Gautier9d135e42018-07-16 19:36:06 +020013
14#include <stm32mp1_private.h>
15
16/******************************************************************************
17 * On a GICv2 system, the Group 1 secure interrupts are treated as Group 0
18 * interrupts.
19 *****************************************************************************/
20static const interrupt_prop_t stm32mp1_interrupt_props[] = {
21 PLATFORM_G1S_PROPS(GICV2_INTR_GROUP0),
22 PLATFORM_G0_PROPS(GICV2_INTR_GROUP0)
23};
24
25static unsigned int target_mask_array[PLATFORM_CORE_COUNT];
26
27static const gicv2_driver_data_t platform_gic_data = {
28 .gicd_base = STM32MP1_GICD_BASE,
29 .gicc_base = STM32MP1_GICC_BASE,
30 .interrupt_props = stm32mp1_interrupt_props,
31 .interrupt_props_num = ARRAY_SIZE(stm32mp1_interrupt_props),
32 .target_masks = target_mask_array,
33 .target_masks_num = ARRAY_SIZE(target_mask_array),
34};
35
36void stm32mp1_gic_init(void)
37{
38 gicv2_driver_init(&platform_gic_data);
39 gicv2_distif_init();
40
41 stm32mp1_gic_pcpu_init();
42}
43
44void stm32mp1_gic_pcpu_init(void)
45{
46 gicv2_pcpu_distif_init();
47 gicv2_set_pe_target_mask(plat_my_core_pos());
48 gicv2_cpuif_enable();
49}