rutigl@gmail.com | defbeed | 2023-03-19 09:19:05 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016-2023, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * Copyright (C) 2022-2023 Nuvoton Ltd. |
| 5 | * |
| 6 | * SPDX-License-Identifier: BSD-3-Clause |
| 7 | */ |
| 8 | |
| 9 | #include <common/interrupt_props.h> |
| 10 | #include <drivers/arm/gicv2.h> |
| 11 | #include <plat/common/platform.h> |
| 12 | #include <platform_def.h> |
| 13 | |
| 14 | static const interrupt_prop_t g0_interrupt_props[] = { |
| 15 | INTR_PROP_DESC(FIQ_SMP_CALL_SGI, GIC_HIGHEST_SEC_PRIORITY, |
| 16 | GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL), |
| 17 | }; |
| 18 | |
| 19 | gicv2_driver_data_t arm_gic_data = { |
| 20 | .gicd_base = BASE_GICD_BASE, |
| 21 | .gicc_base = BASE_GICC_BASE, |
| 22 | .interrupt_props = g0_interrupt_props, |
| 23 | .interrupt_props_num = ARRAY_SIZE(g0_interrupt_props), |
| 24 | }; |
| 25 | |
| 26 | void plat_gic_driver_init(void) |
| 27 | { |
| 28 | gicv2_driver_init(&arm_gic_data); |
| 29 | } |
| 30 | |
| 31 | void plat_gic_init(void) |
| 32 | { |
| 33 | gicv2_distif_init(); |
| 34 | gicv2_pcpu_distif_init(); |
| 35 | gicv2_cpuif_enable(); |
| 36 | } |
| 37 | |
| 38 | void plat_gic_cpuif_enable(void) |
| 39 | { |
| 40 | gicv2_cpuif_enable(); |
| 41 | } |
| 42 | |
| 43 | void plat_gic_cpuif_disable(void) |
| 44 | { |
| 45 | gicv2_cpuif_disable(); |
| 46 | } |
| 47 | |
| 48 | void plat_gic_pcpu_init(void) |
| 49 | { |
| 50 | gicv2_pcpu_distif_init(); |
| 51 | } |