developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 1 | /* |
Antonio Nino Diaz | 42eef85 | 2018-09-24 17:15:54 +0100 | [diff] [blame] | 2 | * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved. |
developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 7 | #include <platform_def.h> |
| 8 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 9 | #include <common/interrupt_props.h> |
| 10 | #include <drivers/arm/gicv2.h> |
| 11 | #include <plat/common/platform.h> |
| 12 | |
Antonio Nino Diaz | 42eef85 | 2018-09-24 17:15:54 +0100 | [diff] [blame] | 13 | static const interrupt_prop_t g0_interrupt_props[] = { |
| 14 | INTR_PROP_DESC(FIQ_SMP_CALL_SGI, GIC_HIGHEST_SEC_PRIORITY, |
| 15 | GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL), |
developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 16 | }; |
| 17 | |
| 18 | gicv2_driver_data_t arm_gic_data = { |
| 19 | .gicd_base = BASE_GICD_BASE, |
| 20 | .gicc_base = BASE_GICC_BASE, |
Antonio Nino Diaz | 42eef85 | 2018-09-24 17:15:54 +0100 | [diff] [blame] | 21 | .interrupt_props = g0_interrupt_props, |
| 22 | .interrupt_props_num = ARRAY_SIZE(g0_interrupt_props), |
developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 23 | }; |
| 24 | |
| 25 | void plat_mt_gic_driver_init(void) |
| 26 | { |
| 27 | gicv2_driver_init(&arm_gic_data); |
| 28 | } |
| 29 | |
| 30 | void plat_mt_gic_init(void) |
| 31 | { |
| 32 | gicv2_distif_init(); |
| 33 | gicv2_pcpu_distif_init(); |
| 34 | gicv2_cpuif_enable(); |
| 35 | } |
| 36 | |
| 37 | void plat_mt_gic_cpuif_enable(void) |
| 38 | { |
| 39 | gicv2_cpuif_enable(); |
| 40 | } |
| 41 | |
| 42 | void plat_mt_gic_cpuif_disable(void) |
| 43 | { |
| 44 | gicv2_cpuif_disable(); |
| 45 | } |
| 46 | |
| 47 | void plat_mt_gic_pcpu_init(void) |
| 48 | { |
| 49 | gicv2_pcpu_distif_init(); |
| 50 | } |