Browse Source
This initializes the GIC using the Arm GIC drivers in TF-A. The initial FPGA image uses a GIC600 implementation, and so that its power controller is enabled, this platform port calls the corresponding implementation-specific routines. Signed-off-by: Oliver Swede <oli.swede@arm.com> Change-Id: I88d5a073eead4b653b1ca73273182cd98a95e4c5pull/1938/head
Oliver Swede
5 years ago
6 changed files with 123 additions and 7 deletions
@ -0,0 +1,53 @@ |
|||
/*
|
|||
* Copyright (c) 2020, ARM Limited and Contributors. All rights reserved. |
|||
* |
|||
* SPDX-License-Identifier: BSD-3-Clause |
|||
*/ |
|||
|
|||
#include <drivers/arm/gicv3.h> |
|||
#include <drivers/arm/gic_common.h> |
|||
|
|||
#include <plat/common/platform.h> |
|||
#include <platform_def.h> |
|||
|
|||
static const interrupt_prop_t fpga_interrupt_props[] = { |
|||
PLATFORM_G1S_PROPS(INTR_GROUP1S), |
|||
PLATFORM_G0_PROPS(INTR_GROUP0) |
|||
}; |
|||
|
|||
static uintptr_t fpga_rdistif_base_addrs[PLATFORM_CORE_COUNT]; |
|||
|
|||
static unsigned int fpga_mpidr_to_core_pos(unsigned long mpidr) |
|||
{ |
|||
return (unsigned int)plat_core_pos_by_mpidr(mpidr); |
|||
} |
|||
|
|||
static const gicv3_driver_data_t fpga_gicv3_driver_data = { |
|||
.gicd_base = GICD_BASE, |
|||
.gicr_base = GICR_BASE, |
|||
.interrupt_props = fpga_interrupt_props, |
|||
.interrupt_props_num = ARRAY_SIZE(fpga_interrupt_props), |
|||
.rdistif_num = PLATFORM_CORE_COUNT, |
|||
.rdistif_base_addrs = fpga_rdistif_base_addrs, |
|||
.mpidr_to_core_pos = fpga_mpidr_to_core_pos |
|||
}; |
|||
|
|||
void plat_fpga_gic_init(void) |
|||
{ |
|||
gicv3_driver_init(&fpga_gicv3_driver_data); |
|||
gicv3_distif_init(); |
|||
gicv3_rdistif_init(plat_my_core_pos()); |
|||
gicv3_cpuif_enable(plat_my_core_pos()); |
|||
} |
|||
|
|||
void fpga_pwr_gic_on_finish(void) |
|||
{ |
|||
gicv3_rdistif_init(plat_my_core_pos()); |
|||
gicv3_cpuif_enable(plat_my_core_pos()); |
|||
} |
|||
|
|||
void fpga_pwr_gic_off(void) |
|||
{ |
|||
gicv3_cpuif_disable(plat_my_core_pos()); |
|||
gicv3_rdistif_off(plat_my_core_pos()); |
|||
} |
Loading…
Reference in new issue