From 79953190bc856ac3f47281029a80e5129bb4437d Mon Sep 17 00:00:00 2001 From: Jay Buddhabhatti Date: Thu, 5 Oct 2023 05:21:50 -0700 Subject: [PATCH 1/9] fix(xilinx): rename macros to align with ARM Use generic macro name as per common ARM GIC macro name for Versal and Versal NET. Signed-off-by: Jay Buddhabhatti Change-Id: I2987ff2f612993fc80979f0179c04d316259ed1d --- plat/xilinx/common/pm_service/pm_api_sys.c | 2 +- plat/xilinx/versal/include/plat_macros.S | 4 ++-- plat/xilinx/versal/include/platform_def.h | 4 ++-- plat/xilinx/versal/versal_gicv3.c | 4 ++-- plat/xilinx/versal_net/include/plat_macros.S | 4 ++-- plat/xilinx/versal_net/include/platform_def.h | 10 +++++----- plat/xilinx/versal_net/versal_net_gicv3.c | 8 ++++---- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/plat/xilinx/common/pm_service/pm_api_sys.c b/plat/xilinx/common/pm_service/pm_api_sys.c index ffc39bbef..36ea8ed8c 100644 --- a/plat/xilinx/common/pm_service/pm_api_sys.c +++ b/plat/xilinx/common/pm_service/pm_api_sys.c @@ -50,7 +50,7 @@ void pm_client_set_wakeup_sources(uint32_t node_id) { uint32_t reg_num, device_id; uint8_t pm_wakeup_nodes_set[XPM_NODEIDX_DEV_MAX] = {0U}; - uint32_t isenabler1 = PLAT_GICD_BASE_VALUE + GICD_ISENABLER + 4U; + uint32_t isenabler1 = PLAT_ARM_GICD_BASE + GICD_ISENABLER + 4U; zeromem(&pm_wakeup_nodes_set, (u_register_t)sizeof(pm_wakeup_nodes_set)); diff --git a/plat/xilinx/versal/include/plat_macros.S b/plat/xilinx/versal/include/plat_macros.S index 41193a51e..38f47f669 100644 --- a/plat/xilinx/versal/include/plat_macros.S +++ b/plat/xilinx/versal/include/plat_macros.S @@ -103,8 +103,8 @@ exit_print_gic_regs: * --------------------------------------------- */ .macro plat_crash_print_regs - mov_imm x17, PLAT_GICD_BASE_VALUE - mov_imm x16, PLAT_GICR_BASE_VALUE + mov_imm x17, PLAT_ARM_GICD_BASE + mov_imm x16, PLAT_ARM_GICR_BASE versal_print_gic_regs .endm diff --git a/plat/xilinx/versal/include/platform_def.h b/plat/xilinx/versal/include/platform_def.h index 286a706c4..0ea21b26b 100644 --- a/plat/xilinx/versal/include/platform_def.h +++ b/plat/xilinx/versal/include/platform_def.h @@ -103,8 +103,8 @@ #define CACHE_WRITEBACK_SHIFT 6 #define CACHE_WRITEBACK_GRANULE (1 << CACHE_WRITEBACK_SHIFT) -#define PLAT_GICD_BASE_VALUE U(0xF9000000) -#define PLAT_GICR_BASE_VALUE U(0xF9080000) +#define PLAT_ARM_GICD_BASE U(0xF9000000) +#define PLAT_ARM_GICR_BASE U(0xF9080000) /* * Define a list of Group 1 Secure and Group 0 interrupts as per GICv3 diff --git a/plat/xilinx/versal/versal_gicv3.c b/plat/xilinx/versal/versal_gicv3.c index 197d047fb..1750d351a 100644 --- a/plat/xilinx/versal/versal_gicv3.c +++ b/plat/xilinx/versal/versal_gicv3.c @@ -62,8 +62,8 @@ static uint32_t versal_gicv3_mpidr_hash(u_register_t mpidr) } static const gicv3_driver_data_t versal_gic_data __unused = { - .gicd_base = PLAT_GICD_BASE_VALUE, - .gicr_base = PLAT_GICR_BASE_VALUE, + .gicd_base = PLAT_ARM_GICD_BASE, + .gicr_base = PLAT_ARM_GICR_BASE, .interrupt_props = versal_interrupt_props, .interrupt_props_num = ARRAY_SIZE(versal_interrupt_props), .rdistif_num = PLATFORM_CORE_COUNT, diff --git a/plat/xilinx/versal_net/include/plat_macros.S b/plat/xilinx/versal_net/include/plat_macros.S index db7e42b35..57f8336b8 100644 --- a/plat/xilinx/versal_net/include/plat_macros.S +++ b/plat/xilinx/versal_net/include/plat_macros.S @@ -109,8 +109,8 @@ exit_print_gic_regs: * Uncomment it when versions are stable */ /* - mov_imm x17, PLAT_GICD_BASE_VALUE - mov_imm x16, PLAT_GICR_BASE_VALUE + mov_imm x17, PLAT_ARM_GICD_BASE + mov_imm x16, PLAT_ARM_GICR_BASE versal_net_print_gic_regs */ .endm diff --git a/plat/xilinx/versal_net/include/platform_def.h b/plat/xilinx/versal_net/include/platform_def.h index 872b6eeb8..334714b26 100644 --- a/plat/xilinx/versal_net/include/platform_def.h +++ b/plat/xilinx/versal_net/include/platform_def.h @@ -107,8 +107,8 @@ #define CACHE_WRITEBACK_SHIFT U(6) #define CACHE_WRITEBACK_GRANULE (1 << CACHE_WRITEBACK_SHIFT) -#define PLAT_GICD_BASE_VALUE U(0xE2000000) -#define PLAT_GICR_BASE_VALUE U(0xE2060000) +#define PLAT_ARM_GICD_BASE U(0xE2000000) +#define PLAT_ARM_GICR_BASE U(0xE2060000) /* * Define a list of Group 1 Secure and Group 0 interrupts as per GICv3 @@ -118,13 +118,13 @@ #define PLAT_VERSAL_NET_IPI_IRQ 89 #define PLAT_VERSAL_IPI_IRQ PLAT_VERSAL_NET_IPI_IRQ -#define PLAT_VERSAL_NET_G1S_IRQ_PROPS(grp) \ +#define PLAT_ARM_G1S_IRQ_PROPS(grp) \ INTR_PROP_DESC(VERSAL_NET_IRQ_SEC_PHY_TIMER, GIC_HIGHEST_SEC_PRIORITY, grp, \ GIC_INTR_CFG_LEVEL) -#define PLAT_VERSAL_NET_G0_IRQ_PROPS(grp) \ +#define PLAT_ARM_G0_IRQ_PROPS(grp) \ INTR_PROP_DESC(PLAT_VERSAL_IPI_IRQ, GIC_HIGHEST_SEC_PRIORITY, grp, \ - GIC_INTR_CFG_EDGE), \ + GIC_INTR_CFG_EDGE) #define IRQ_MAX 200U diff --git a/plat/xilinx/versal_net/versal_net_gicv3.c b/plat/xilinx/versal_net/versal_net_gicv3.c index 2fdef12e8..6916e50ec 100644 --- a/plat/xilinx/versal_net/versal_net_gicv3.c +++ b/plat/xilinx/versal_net/versal_net_gicv3.c @@ -31,8 +31,8 @@ static uintptr_t rdistif_base_addrs[PLATFORM_CORE_COUNT]; static const interrupt_prop_t versal_net_interrupt_props[] = { - PLAT_VERSAL_NET_G1S_IRQ_PROPS(INTR_GROUP1S), - PLAT_VERSAL_NET_G0_IRQ_PROPS(INTR_GROUP0) + PLAT_ARM_G1S_IRQ_PROPS(INTR_GROUP1S), + PLAT_ARM_G0_IRQ_PROPS(INTR_GROUP0) }; /* @@ -63,8 +63,8 @@ static uint32_t versal_net_gicv3_mpidr_hash(u_register_t mpidr) } static const gicv3_driver_data_t versal_net_gic_data __unused = { - .gicd_base = PLAT_GICD_BASE_VALUE, - .gicr_base = PLAT_GICR_BASE_VALUE, + .gicd_base = PLAT_ARM_GICD_BASE, + .gicr_base = PLAT_ARM_GICR_BASE, .interrupt_props = versal_net_interrupt_props, .interrupt_props_num = ARRAY_SIZE(versal_net_interrupt_props), .rdistif_num = PLATFORM_CORE_COUNT, From b2259261815961042d2a994401929bc76a0d3ee9 Mon Sep 17 00:00:00 2001 From: Jay Buddhabhatti Date: Thu, 5 Oct 2023 21:55:28 -0700 Subject: [PATCH 2/9] fix(versal-net): use arm common GIC handlers Currently SGI interrupts are not received in secondary cores because of issue in GIC configuration. In current Versal NET specific GIC functions, redistributor configuration is not happening properly. Because of that SGI interrupt from one processor to another processor is not transferring. So, use common GIC handlers which will iterate over all GIC redistributor frames and discovers per cpu redistributor frame. Also, it initializes corresponding interface in GICv3. Signed-off-by: Jay Buddhabhatti Change-Id: I1433260b8520d6a315fdf5df86bd0688f92d211a --- .../versal_net/aarch64/versal_net_helpers.S | 11 + .../xilinx/versal_net/bl31_versal_net_setup.c | 4 +- plat/xilinx/versal_net/plat_psci.c | 4 +- plat/xilinx/versal_net/plat_psci_pm.c | 14 +- plat/xilinx/versal_net/platform.mk | 3 +- plat/xilinx/versal_net/versal_net_gicv3.c | 189 ------------------ 6 files changed, 24 insertions(+), 201 deletions(-) delete mode 100644 plat/xilinx/versal_net/versal_net_gicv3.c diff --git a/plat/xilinx/versal_net/aarch64/versal_net_helpers.S b/plat/xilinx/versal_net/aarch64/versal_net_helpers.S index dab871795..1ae879f3e 100644 --- a/plat/xilinx/versal_net/aarch64/versal_net_helpers.S +++ b/plat/xilinx/versal_net/aarch64/versal_net_helpers.S @@ -12,6 +12,7 @@ #include + .globl plat_arm_calc_core_pos .globl plat_secondary_cold_boot_setup .globl plat_is_my_cpu_primary .globl platform_mem_init @@ -58,6 +59,16 @@ func plat_my_core_pos b plat_core_pos_by_mpidr endfunc plat_my_core_pos + /* ----------------------------------------------------- + * unsigned int plat_arm_calc_core_pos(u_register_t mpidr) + * This function uses the plat_core_pos_by_mpidr() + * definition to get the index of the calling CPU. + * ----------------------------------------------------- + */ +func plat_arm_calc_core_pos + b plat_core_pos_by_mpidr +endfunc plat_arm_calc_core_pos + /* --------------------------------------------------------------------- * We don't need to carry out any memory initialization on Versal NET * platform. The Secure RAM is accessible straight away. diff --git a/plat/xilinx/versal_net/bl31_versal_net_setup.c b/plat/xilinx/versal_net/bl31_versal_net_setup.c index 283fee31c..614d6d233 100644 --- a/plat/xilinx/versal_net/bl31_versal_net_setup.c +++ b/plat/xilinx/versal_net/bl31_versal_net_setup.c @@ -216,8 +216,8 @@ void bl31_platform_setup(void) prepare_dtb(); /* Initialize the gic cpu and distributor interfaces */ - plat_versal_net_gic_driver_init(); - plat_versal_net_gic_init(); + plat_arm_gic_driver_init(); + plat_arm_gic_init(); } void bl31_plat_runtime_setup(void) diff --git a/plat/xilinx/versal_net/plat_psci.c b/plat/xilinx/versal_net/plat_psci.c index 6e556cdf0..fcb32b97f 100644 --- a/plat/xilinx/versal_net/plat_psci.c +++ b/plat/xilinx/versal_net/plat_psci.c @@ -108,8 +108,8 @@ static void zynqmp_pwr_domain_suspend(const psci_power_state_t *target_state) static void zynqmp_pwr_domain_on_finish(const psci_power_state_t *target_state) { - plat_versal_net_gic_pcpu_init(); - plat_versal_net_gic_cpuif_enable(); + plat_arm_gic_pcpu_init(); + plat_arm_gic_cpuif_enable(); } static void zynqmp_pwr_domain_suspend_finish(const psci_power_state_t *target_state) diff --git a/plat/xilinx/versal_net/plat_psci_pm.c b/plat/xilinx/versal_net/plat_psci_pm.c index 87e25bcdb..219fb6866 100644 --- a/plat/xilinx/versal_net/plat_psci_pm.c +++ b/plat/xilinx/versal_net/plat_psci_pm.c @@ -66,7 +66,7 @@ static void versal_net_pwr_domain_off(const psci_power_state_t *target_state) } /* Prevent interrupts from spuriously waking up this cpu */ - plat_versal_net_gic_cpuif_disable(); + plat_arm_gic_cpuif_disable(); /* * Send request to PMC to power down the appropriate APU CPU @@ -114,10 +114,10 @@ static void versal_net_pwr_domain_suspend(const psci_power_state_t *target_state __func__, i, target_state->pwr_domain_state[i]); } - plat_versal_net_gic_cpuif_disable(); + plat_arm_gic_cpuif_disable(); if (target_state->pwr_domain_state[1] > PLAT_MAX_RET_STATE) { - plat_versal_net_gic_save(); + plat_arm_gic_save(); } state = target_state->pwr_domain_state[1] > PLAT_MAX_RET_STATE ? @@ -135,10 +135,10 @@ static void versal_net_pwr_domain_on_finish(const psci_power_state_t *target_sta (void)target_state; /* Enable the gic cpu interface */ - plat_versal_net_gic_pcpu_init(); + plat_arm_gic_pcpu_init(); /* Program the gic per-cpu distributor or re-distributor interface */ - plat_versal_net_gic_cpuif_enable(); + plat_arm_gic_cpuif_enable(); } /** @@ -163,10 +163,10 @@ static void versal_net_pwr_domain_suspend_finish(const psci_power_state_t *targe /* APU was turned off, so restore GIC context */ if (target_state->pwr_domain_state[1] > PLAT_MAX_RET_STATE) { - plat_versal_net_gic_resume(); + plat_arm_gic_resume(); } - plat_versal_net_gic_cpuif_enable(); + plat_arm_gic_cpuif_enable(); } /** diff --git a/plat/xilinx/versal_net/platform.mk b/plat/xilinx/versal_net/platform.mk index ad1ee2b04..b2acecae1 100644 --- a/plat/xilinx/versal_net/platform.mk +++ b/plat/xilinx/versal_net/platform.mk @@ -121,6 +121,7 @@ BL31_SOURCES += plat/xilinx/common/plat_fdt.c \ ${PLAT_PATH}/bl31_versal_net_setup.c \ common/fdt_fixup.c \ common/fdt_wrappers.c \ + plat/arm/common/arm_gicv3.c \ ${LIBFDT_SRCS} \ ${PLAT_PATH}/sip_svc_setup.c \ - ${PLAT_PATH}/versal_net_gicv3.c + ${XLAT_TABLES_LIB_SRCS} diff --git a/plat/xilinx/versal_net/versal_net_gicv3.c b/plat/xilinx/versal_net/versal_net_gicv3.c deleted file mode 100644 index 6916e50ec..000000000 --- a/plat/xilinx/versal_net/versal_net_gicv3.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2018-2019, Arm Limited and Contributors. All rights reserved. - * Copyright (c) 2018-2022, Xilinx, Inc. All rights reserved. - * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include -#include -#include -#include -#include - -#include -#include - -/****************************************************************************** - * The following functions are defined as weak to allow a platform to override - * the way the GICv3 driver is initialised and used. - *****************************************************************************/ -#pragma weak plat_versal_net_gic_driver_init -#pragma weak plat_versal_net_gic_init -#pragma weak plat_versal_net_gic_cpuif_enable -#pragma weak plat_versal_net_gic_cpuif_disable -#pragma weak plat_versal_net_gic_pcpu_init -#pragma weak plat_versal_net_gic_redistif_on -#pragma weak plat_versal_net_gic_redistif_off - -/* The GICv3 driver only needs to be initialized in EL3 */ -static uintptr_t rdistif_base_addrs[PLATFORM_CORE_COUNT]; - -static const interrupt_prop_t versal_net_interrupt_props[] = { - PLAT_ARM_G1S_IRQ_PROPS(INTR_GROUP1S), - PLAT_ARM_G0_IRQ_PROPS(INTR_GROUP0) -}; - -/* - * We save and restore the GICv3 context on system suspend. Allocate the - * data in the designated EL3 Secure carve-out memory. - */ -static gicv3_redist_ctx_t rdist_ctx __section(".versal_net_el3_tzc_dram"); -static gicv3_dist_ctx_t dist_ctx __section(".versal_net_el3_tzc_dram"); - -/* - * MPIDR hashing function for translating MPIDRs read from GICR_TYPER register - * to core position. - * - * Calculating core position is dependent on MPIDR_EL1.MT bit. However, affinity - * values read from GICR_TYPER don't have an MT field. To reuse the same - * translation used for CPUs, we insert MT bit read from the PE's MPIDR into - * that read from GICR_TYPER. - * - * Assumptions: - * - * - All CPUs implemented in the system have MPIDR_EL1.MT bit set; - * - No CPUs implemented in the system use affinity level 3. - */ -static uint32_t versal_net_gicv3_mpidr_hash(u_register_t mpidr) -{ - mpidr |= (read_mpidr_el1() & MPIDR_MT_MASK); - return plat_core_pos_by_mpidr(mpidr); -} - -static const gicv3_driver_data_t versal_net_gic_data __unused = { - .gicd_base = PLAT_ARM_GICD_BASE, - .gicr_base = PLAT_ARM_GICR_BASE, - .interrupt_props = versal_net_interrupt_props, - .interrupt_props_num = ARRAY_SIZE(versal_net_interrupt_props), - .rdistif_num = PLATFORM_CORE_COUNT, - .rdistif_base_addrs = rdistif_base_addrs, - .mpidr_to_core_pos = versal_net_gicv3_mpidr_hash -}; - -void __init plat_versal_net_gic_driver_init(void) -{ - /* - * The GICv3 driver is initialized in EL3 and does not need - * to be initialized again in SEL1. This is because the S-EL1 - * can use GIC system registers to manage interrupts and does - * not need GIC interface base addresses to be configured. - */ -#if IMAGE_BL31 - gicv3_driver_init(&versal_net_gic_data); -#endif -} - -/****************************************************************************** - * Versal NET common helper to initialize the GIC. Only invoked by BL31 - *****************************************************************************/ -void __init plat_versal_net_gic_init(void) -{ - gicv3_distif_init(); - gicv3_rdistif_init(plat_my_core_pos()); - gicv3_cpuif_enable(plat_my_core_pos()); -} - -/****************************************************************************** - * Versal NET common helper to enable the GIC CPU interface - *****************************************************************************/ -void plat_versal_net_gic_cpuif_enable(void) -{ - gicv3_cpuif_enable(plat_my_core_pos()); -} - -/****************************************************************************** - * Versal NET common helper to disable the GIC CPU interface - *****************************************************************************/ -void plat_versal_net_gic_cpuif_disable(void) -{ - gicv3_cpuif_disable(plat_my_core_pos()); -} - -/****************************************************************************** - * Versal NET common helper to initialize the per-cpu redistributor interface in - * GICv3 - *****************************************************************************/ -void plat_versal_net_gic_pcpu_init(void) -{ - gicv3_rdistif_init(plat_my_core_pos()); -} - -/****************************************************************************** - * Versal NET common helpers to power GIC redistributor interface - *****************************************************************************/ -void plat_versal_net_gic_redistif_on(void) -{ - gicv3_rdistif_on(plat_my_core_pos()); -} - -void plat_versal_net_gic_redistif_off(void) -{ - gicv3_rdistif_off(plat_my_core_pos()); -} - -/****************************************************************************** - * Versal NET common helper to save & restore the GICv3 on resume from system - * suspend - *****************************************************************************/ -void plat_versal_net_gic_save(void) -{ - /* - * If an ITS is available, save its context before - * the Redistributor using: - * gicv3_its_save_disable(gits_base, &its_ctx[i]) - * Additionnaly, an implementation-defined sequence may - * be required to save the whole ITS state. - */ - - /* - * Save the GIC Redistributors and ITS contexts before the - * Distributor context. As we only handle SYSTEM SUSPEND API, - * we only need to save the context of the CPU that is issuing - * the SYSTEM SUSPEND call, i.e. the current CPU. - */ - gicv3_rdistif_save(plat_my_core_pos(), &rdist_ctx); - - /* Save the GIC Distributor context */ - gicv3_distif_save(&dist_ctx); - - /* - * From here, all the components of the GIC can be safely powered down - * as long as there is an alternate way to handle wakeup interrupt - * sources. - */ -} - -void plat_versal_net_gic_resume(void) -{ - /* Restore the GIC Distributor context */ - gicv3_distif_init_restore(&dist_ctx); - - /* - * Restore the GIC Redistributor and ITS contexts after the - * Distributor context. As we only handle SYSTEM SUSPEND API, - * we only need to restore the context of the CPU that issued - * the SYSTEM SUSPEND call. - */ - gicv3_rdistif_init_restore(plat_my_core_pos(), &rdist_ctx); - - /* - * If an ITS is available, restore its context after - * the Redistributor using: - * gicv3_its_restore(gits_base, &its_ctx[i]) - * An implementation-defined sequence may be required to - * restore the whole ITS state. The ITS must also be - * re-enabled after this sequence has been executed. - */ -} From 3dd118cf9d60e1eab97af505eb63a2cdc044d747 Mon Sep 17 00:00:00 2001 From: Jay Buddhabhatti Date: Tue, 25 Apr 2023 04:15:51 -0700 Subject: [PATCH 3/9] feat(xilinx): add wrapper to handle cpu power down req Firmware sends CPU power down request to TF-A through NOTIFY_CB callback. It indicates CPU needs to power down. Add wrapper to handle CPU power down request from firmware through IPI callback. Signed-off-by: Jay Buddhabhatti Change-Id: Ic4aff874dd29da057c5ffde1899c7f0e5cdf6733 --- plat/xilinx/common/pm_service/pm_svc_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/plat/xilinx/common/pm_service/pm_svc_main.c b/plat/xilinx/common/pm_service/pm_svc_main.c index 1e5808cfd..622dc24ec 100644 --- a/plat/xilinx/common/pm_service/pm_svc_main.c +++ b/plat/xilinx/common/pm_service/pm_svc_main.c @@ -31,11 +31,13 @@ #define INVALID_SGI 0xFFU #define PM_INIT_SUSPEND_CB (30U) #define PM_NOTIFY_CB (32U) +#define EVENT_CPU_PWRDWN (4U) DEFINE_RENAME_SYSREG_RW_FUNCS(icc_asgi1r_el1, S3_0_C12_C11_6) /* pm_up = true - UP, pm_up = false - DOWN */ static bool pm_up; static uint32_t sgi = (uint32_t)INVALID_SGI; +static bool pwrdwn_req_received; static void notify_os(void) { @@ -48,6 +50,12 @@ static void notify_os(void) write_icc_asgi1r_el1(reg); } +static void request_cpu_pwrdwn(void) +{ + VERBOSE("CPU power down request received\n"); + pm_ipi_irq_clear(primary_proc); +} + static uint64_t ipi_fiq_handler(uint32_t id, uint32_t flags, void *handle, void *cookie) { @@ -65,8 +73,21 @@ static uint64_t ipi_fiq_handler(uint32_t id, uint32_t flags, void *handle, switch (payload[0]) { case PM_INIT_SUSPEND_CB: + if (sgi != INVALID_SGI) { + notify_os(); + } + break; case PM_NOTIFY_CB: if (sgi != INVALID_SGI) { + if (payload[2] == EVENT_CPU_PWRDWN) { + if (pwrdwn_req_received) { + pwrdwn_req_received = false; + request_cpu_pwrdwn(); + break; + } else { + pwrdwn_req_received = true; + } + } notify_os(); } break; From ade92a64e4d2fbb5f246e6ad891465d10e0d9b26 Mon Sep 17 00:00:00 2001 From: Jay Buddhabhatti Date: Tue, 25 Apr 2023 04:34:51 -0700 Subject: [PATCH 4/9] feat(xilinx): add handler for power down req sgi irq On receiving CPU power down callback, TF-A raises SGI interrupt to all active cores to power down each active cores. Add handler for this SGI IRQ. By default TF-A uses SGI 6 for CPU power down request. This can be configurable through CPU_PWRDWN_SGI build flag. e.g., If user wants to use SGI 7 instead of SGI 6 then provide build flag CPU_PWRDWN_SGI=7 Signed-off-by: Jay Buddhabhatti Change-Id: Id0df32187d1de3f0af4486eb4d4930cb3ab01dbd --- docs/plat/xilinx-versal-net.rst | 13 +++++++++++++ docs/plat/xilinx-versal.rst | 13 +++++++++++++ plat/xilinx/common/include/plat_common.h | 12 ++++++++++++ plat/xilinx/common/pm_service/pm_svc_main.c | 19 +++++++++++++++++++ plat/xilinx/versal/include/platform_def.h | 3 +++ plat/xilinx/versal/platform.mk | 2 ++ plat/xilinx/versal_net/include/platform_def.h | 3 +++ plat/xilinx/versal_net/platform.mk | 2 ++ 8 files changed, 67 insertions(+) diff --git a/docs/plat/xilinx-versal-net.rst b/docs/plat/xilinx-versal-net.rst index 1db7695b1..3f31d40c9 100644 --- a/docs/plat/xilinx-versal-net.rst +++ b/docs/plat/xilinx-versal-net.rst @@ -40,3 +40,16 @@ Xilinx Versal NET platform specific build options * `TFA_NO_PM` : Platform Management support. - 0 : Enable Platform Management (Default) - 1 : Disable Platform Management + +* `CPU_PWRDWN_SGI`: Select the SGI for triggering CPU power down request to + secondary cores on receiving power down callback from + firmware. Options: + + - `0` : SGI 0 + - `1` : SGI 1 + - `2` : SGI 2 + - `3` : SGI 3 + - `4` : SGI 4 + - `5` : SGI 5 + - `6` : SGI 6 (Default) + - `7` : SGI 7 diff --git a/docs/plat/xilinx-versal.rst b/docs/plat/xilinx-versal.rst index e76b95574..aa094f757 100644 --- a/docs/plat/xilinx-versal.rst +++ b/docs/plat/xilinx-versal.rst @@ -56,6 +56,19 @@ Xilinx Versal platform specific build options - `spp_itr6` : SPP ITR6 - `emu_itr6` : EMU ITR6 +* `CPU_PWRDWN_SGI`: Select the SGI for triggering CPU power down request to + secondary cores on receiving power down callback from + firmware. Options: + + - `0` : SGI 0 + - `1` : SGI 1 + - `2` : SGI 2 + - `3` : SGI 3 + - `4` : SGI 4 + - `5` : SGI 5 + - `6` : SGI 6 (Default) + - `7` : SGI 7 + # PLM->TF-A Parameter Passing ------------------------------ The PLM populates a data structure with image information for the TF-A. The TF-A diff --git a/plat/xilinx/common/include/plat_common.h b/plat/xilinx/common/include/plat_common.h index 676baa2c7..2958868fc 100644 --- a/plat/xilinx/common/include/plat_common.h +++ b/plat/xilinx/common/include/plat_common.h @@ -14,4 +14,16 @@ (typeof(_mask))(((_reg) & (_mask)) >> __bf_shf(_mask)); \ }) +/******************************************************************************* + * interrupt handling related constants + ******************************************************************************/ +#define ARM_IRQ_SEC_SGI_0 8U +#define ARM_IRQ_SEC_SGI_1 9U +#define ARM_IRQ_SEC_SGI_2 10U +#define ARM_IRQ_SEC_SGI_3 11U +#define ARM_IRQ_SEC_SGI_4 12U +#define ARM_IRQ_SEC_SGI_5 13U +#define ARM_IRQ_SEC_SGI_6 14U +#define ARM_IRQ_SEC_SGI_7 15U + #endif /* PLAT_COMMON_H */ diff --git a/plat/xilinx/common/pm_service/pm_svc_main.c b/plat/xilinx/common/pm_service/pm_svc_main.c index 622dc24ec..8ff4949a0 100644 --- a/plat/xilinx/common/pm_service/pm_svc_main.c +++ b/plat/xilinx/common/pm_service/pm_svc_main.c @@ -50,6 +50,19 @@ static void notify_os(void) write_icc_asgi1r_el1(reg); } +static uint64_t cpu_pwrdwn_req_handler(uint32_t id, uint32_t flags, + void *handle, void *cookie) +{ + uint32_t cpu_id = plat_my_core_pos(); + + VERBOSE("Powering down CPU %d\n", cpu_id); + + /* Deactivate CPU power down SGI */ + plat_ic_end_of_interrupt(CPU_PWR_DOWN_REQ_INTR); + + return psci_cpu_off(); +} + static void request_cpu_pwrdwn(void) { VERBOSE("CPU power down request received\n"); @@ -160,6 +173,12 @@ int32_t pm_setup(void) pm_ipi_init(primary_proc); pm_up = true; + /* register SGI handler for CPU power down request */ + ret = request_intr_type_el3(CPU_PWR_DOWN_REQ_INTR, cpu_pwrdwn_req_handler); + if (ret != 0) { + WARN("BL31: registering SGI interrupt failed\n"); + } + /* * Enable IPI IRQ * assume the rich OS is OK to handle callback IRQs now. diff --git a/plat/xilinx/versal/include/platform_def.h b/plat/xilinx/versal/include/platform_def.h index 0ea21b26b..d3a734be5 100644 --- a/plat/xilinx/versal/include/platform_def.h +++ b/plat/xilinx/versal/include/platform_def.h @@ -9,6 +9,7 @@ #define PLATFORM_DEF_H #include +#include #include "versal_def.h" /******************************************************************************* @@ -122,6 +123,8 @@ #define PLAT_VERSAL_G0_IRQ_PROPS(grp) \ INTR_PROP_DESC(PLAT_VERSAL_IPI_IRQ, GIC_HIGHEST_SEC_PRIORITY, grp, \ GIC_INTR_CFG_EDGE), \ + INTR_PROP_DESC(CPU_PWR_DOWN_REQ_INTR, GIC_HIGHEST_SEC_PRIORITY, grp, \ + GIC_INTR_CFG_EDGE) #define IRQ_MAX 142U diff --git a/plat/xilinx/versal/platform.mk b/plat/xilinx/versal/platform.mk index 35d6bc7e7..2f0799698 100644 --- a/plat/xilinx/versal/platform.mk +++ b/plat/xilinx/versal/platform.mk @@ -11,6 +11,8 @@ override RESET_TO_BL31 := 1 PL011_GENERIC_UART := 1 IPI_CRC_CHECK := 0 HARDEN_SLS_ALL := 0 +CPU_PWRDWN_SGI ?= 6 +$(eval $(call add_define_val,CPU_PWR_DOWN_REQ_INTR,ARM_IRQ_SEC_SGI_${CPU_PWRDWN_SGI})) # A72 Erratum for SoC ERRATA_A72_859971 := 1 diff --git a/plat/xilinx/versal_net/include/platform_def.h b/plat/xilinx/versal_net/include/platform_def.h index 334714b26..8cb7deb1d 100644 --- a/plat/xilinx/versal_net/include/platform_def.h +++ b/plat/xilinx/versal_net/include/platform_def.h @@ -10,6 +10,7 @@ #define PLATFORM_DEF_H #include +#include #include "versal_net_def.h" /******************************************************************************* @@ -124,6 +125,8 @@ #define PLAT_ARM_G0_IRQ_PROPS(grp) \ INTR_PROP_DESC(PLAT_VERSAL_IPI_IRQ, GIC_HIGHEST_SEC_PRIORITY, grp, \ + GIC_INTR_CFG_EDGE), \ + INTR_PROP_DESC(CPU_PWR_DOWN_REQ_INTR, GIC_HIGHEST_SEC_PRIORITY, grp, \ GIC_INTR_CFG_EDGE) #define IRQ_MAX 200U diff --git a/plat/xilinx/versal_net/platform.mk b/plat/xilinx/versal_net/platform.mk index b2acecae1..da91abc82 100644 --- a/plat/xilinx/versal_net/platform.mk +++ b/plat/xilinx/versal_net/platform.mk @@ -21,6 +21,8 @@ IPI_CRC_CHECK := 0 GIC_ENABLE_V4_EXTN := 0 GICV3_SUPPORT_GIC600 := 1 TFA_NO_PM := 0 +CPU_PWRDWN_SGI ?= 6 +$(eval $(call add_define_val,CPU_PWR_DOWN_REQ_INTR,ARM_IRQ_SEC_SGI_${CPU_PWRDWN_SGI})) override CTX_INCLUDE_AARCH32_REGS := 0 From c3280df1bb95ed09b5d5f91f8977bbe99c6a923b Mon Sep 17 00:00:00 2001 From: Jay Buddhabhatti Date: Tue, 25 Apr 2023 05:09:15 -0700 Subject: [PATCH 5/9] feat(xilinx): power down all cores on receiving cpu pwrdwn req On receiving CPU power down request from firmware, TF-A raises SGI interrupt to all active cores for entering in power down state. So add support for power down core on receiving CPU power down request. PWRDWN_WAIT_TIMEOUT is the timeout value in milliseconds for the other cores to transition to power down state. Signed-off-by: Jay Buddhabhatti Change-Id: I29760a2098852c546fa5a1324262a62c3d75b391 --- plat/xilinx/common/pm_service/pm_svc_main.c | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/plat/xilinx/common/pm_service/pm_svc_main.c b/plat/xilinx/common/pm_service/pm_svc_main.c index 8ff4949a0..3a01dd265 100644 --- a/plat/xilinx/common/pm_service/pm_svc_main.c +++ b/plat/xilinx/common/pm_service/pm_svc_main.c @@ -17,6 +17,8 @@ #include #include +#include +#include #include #include @@ -32,6 +34,8 @@ #define PM_INIT_SUSPEND_CB (30U) #define PM_NOTIFY_CB (32U) #define EVENT_CPU_PWRDWN (4U) +/* 1 sec of wait timeout for secondary core down */ +#define PWRDWN_WAIT_TIMEOUT (1000U) DEFINE_RENAME_SYSREG_RW_FUNCS(icc_asgi1r_el1, S3_0_C12_C11_6) /* pm_up = true - UP, pm_up = false - DOWN */ @@ -63,10 +67,35 @@ static uint64_t cpu_pwrdwn_req_handler(uint32_t id, uint32_t flags, return psci_cpu_off(); } +/** + * raise_pwr_down_interrupt() - Callback function to raise SGI. + * @mpidr: MPIDR for the target CPU. + * + * Raise SGI interrupt to trigger the CPU power down sequence on all the + * online secondary cores. + */ +static void raise_pwr_down_interrupt(u_register_t mpidr) +{ + plat_ic_raise_el3_sgi(CPU_PWR_DOWN_REQ_INTR, mpidr); +} + static void request_cpu_pwrdwn(void) { + enum pm_ret_status ret; + VERBOSE("CPU power down request received\n"); + + /* Send powerdown request to online secondary core(s) */ + ret = psci_stop_other_cores(PWRDWN_WAIT_TIMEOUT, raise_pwr_down_interrupt); + if (ret != PSCI_E_SUCCESS) { + ERROR("Failed to powerdown secondary core(s)\n"); + } + + /* Clear IPI IRQ */ pm_ipi_irq_clear(primary_proc); + + /* Deactivate IPI IRQ */ + plat_ic_end_of_interrupt(PLAT_VERSAL_IPI_IRQ); } static uint64_t ipi_fiq_handler(uint32_t id, uint32_t flags, void *handle, @@ -96,6 +125,7 @@ static uint64_t ipi_fiq_handler(uint32_t id, uint32_t flags, void *handle, if (pwrdwn_req_received) { pwrdwn_req_received = false; request_cpu_pwrdwn(); + (void)psci_cpu_off(); break; } else { pwrdwn_req_received = true; From 88ee0816a7429689890659f69b895ac84e48f141 Mon Sep 17 00:00:00 2001 From: Jay Buddhabhatti Date: Mon, 19 Jun 2023 05:08:54 -0700 Subject: [PATCH 6/9] feat(xilinx): request cpu power down from reset Send subsystem restart notification to firmware when TF-A receives system reset PSCI call. On receiving subsystem restart call, firmware will send CPU idle callback to TF-A for powering down all cores. Wait for CPU idle callback from firmware and raise power down request to all cores after it receives CPU idle callback to power down core. Signed-off-by: Jay Buddhabhatti Change-Id: I50f417ae228017f38b648740dc90b2e8f1872620 --- plat/xilinx/common/include/pm_svc_main.h | 3 ++ plat/xilinx/common/pm_service/pm_svc_main.c | 4 +-- plat/xilinx/versal/plat_psci.c | 31 +++++++++++++++++++-- plat/xilinx/versal_net/plat_psci_pm.c | 30 ++++++++++++++++++-- 4 files changed, 60 insertions(+), 8 deletions(-) diff --git a/plat/xilinx/common/include/pm_svc_main.h b/plat/xilinx/common/include/pm_svc_main.h index 4cf77276e..67fbeae63 100644 --- a/plat/xilinx/common/include/pm_svc_main.h +++ b/plat/xilinx/common/include/pm_svc_main.h @@ -10,6 +10,8 @@ #include +extern bool pwrdwn_req_received; + /******************************************************************************/ /** * SECURE_REDUNDANT_CALL() - Adds redundancy to the function call. This is to @@ -30,6 +32,7 @@ status_tmp = function(__VA_ARGS__); \ } +void request_cpu_pwrdwn(void); int32_t pm_setup(void); uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, const void *cookie, void *handle, diff --git a/plat/xilinx/common/pm_service/pm_svc_main.c b/plat/xilinx/common/pm_service/pm_svc_main.c index 3a01dd265..9df9eb2be 100644 --- a/plat/xilinx/common/pm_service/pm_svc_main.c +++ b/plat/xilinx/common/pm_service/pm_svc_main.c @@ -41,7 +41,7 @@ DEFINE_RENAME_SYSREG_RW_FUNCS(icc_asgi1r_el1, S3_0_C12_C11_6) /* pm_up = true - UP, pm_up = false - DOWN */ static bool pm_up; static uint32_t sgi = (uint32_t)INVALID_SGI; -static bool pwrdwn_req_received; +bool pwrdwn_req_received; static void notify_os(void) { @@ -79,7 +79,7 @@ static void raise_pwr_down_interrupt(u_register_t mpidr) plat_ic_raise_el3_sgi(CPU_PWR_DOWN_REQ_INTR, mpidr); } -static void request_cpu_pwrdwn(void) +void request_cpu_pwrdwn(void) { enum pm_ret_status ret; diff --git a/plat/xilinx/versal/plat_psci.c b/plat/xilinx/versal/plat_psci.c index 56d98f79e..9c34d0d2c 100644 --- a/plat/xilinx/versal/plat_psci.c +++ b/plat/xilinx/versal/plat_psci.c @@ -14,10 +14,13 @@ #include #include +#include "drivers/delay_timer.h" #include #include "pm_api_sys.h" #include "pm_client.h" #include +#include "pm_ipi.h" +#include "pm_svc_main.h" static uintptr_t versal_sec_entry; @@ -145,9 +148,31 @@ static void __dead2 versal_system_off(void) */ static void __dead2 versal_system_reset(void) { - /* Send the system reset request to the PMC */ - (void)pm_system_shutdown(XPM_SHUTDOWN_TYPE_RESET, - pm_get_shutdown_scope(), SECURE_FLAG); + uint32_t ret, timeout = 10000U; + + request_cpu_pwrdwn(); + + /* + * Send the system reset request to the firmware if power down request + * is not received from firmware. + */ + if (!pwrdwn_req_received) { + (void)pm_system_shutdown(XPM_SHUTDOWN_TYPE_RESET, + pm_get_shutdown_scope(), SECURE_FLAG); + + /* + * Wait for system shutdown request completed and idle callback + * not received. + */ + do { + ret = ipi_mb_enquire_status(primary_proc->ipi->local_ipi_id, + primary_proc->ipi->remote_ipi_id); + udelay(100); + timeout--; + } while ((ret != IPI_MB_STATUS_RECV_PENDING) && (timeout > 0U)); + } + + (void)psci_cpu_off(); while (1) { wfi(); diff --git a/plat/xilinx/versal_net/plat_psci_pm.c b/plat/xilinx/versal_net/plat_psci_pm.c index 219fb6866..2cf3bf269 100644 --- a/plat/xilinx/versal_net/plat_psci_pm.c +++ b/plat/xilinx/versal_net/plat_psci_pm.c @@ -14,10 +14,12 @@ #include #include +#include #include #include "pm_api_sys.h" #include "pm_client.h" #include +#include "pm_ipi.h" #include "pm_svc_main.h" #include "versal_net_def.h" @@ -88,9 +90,31 @@ static void versal_net_pwr_domain_off(const psci_power_state_t *target_state) */ static void __dead2 versal_net_system_reset(void) { - /* Send the system reset request to the PMC */ - pm_system_shutdown(XPM_SHUTDOWN_TYPE_RESET, - pm_get_shutdown_scope(), SECURE_FLAG); + uint32_t ret, timeout = 10000U; + + request_cpu_pwrdwn(); + + /* + * Send the system reset request to the firmware if power down request + * is not received from firmware. + */ + if (!pwrdwn_req_received) { + (void)pm_system_shutdown(XPM_SHUTDOWN_TYPE_RESET, + pm_get_shutdown_scope(), SECURE_FLAG); + + /* + * Wait for system shutdown request completed and idle callback + * not received. + */ + do { + ret = ipi_mb_enquire_status(primary_proc->ipi->local_ipi_id, + primary_proc->ipi->remote_ipi_id); + udelay(100); + timeout--; + } while ((ret != IPI_MB_STATUS_RECV_PENDING) && (timeout > 0U)); + } + + (void)psci_cpu_off(); while (1) { wfi(); From 5949701600c7f3c3a6589d0efd743615156c34b6 Mon Sep 17 00:00:00 2001 From: Jay Buddhabhatti Date: Mon, 11 Sep 2023 23:50:06 -0700 Subject: [PATCH 7/9] feat(xilinx): add new state to identify cpu power down Currently there is only 1 state for CPU idle which is used while CPU power down from Linux CPU idle feature. But CPU power down when firmware send CPU power down request needs new state in self suspend to distinguish in firmware for CPU power down from power down request or CPU power down from Linux CPU idle. So add new state PM_STATE_CPU_OFF to indicate CPU power down from power down request from firmware. PM_STATE_CPU_OFF state is supported from self-suspend version 3. So added feature check which sends new state in case of new firmware and old state i.e. PM_STATE_CPU_IDLE in case of old firmware. Signed-off-by: Jay Buddhabhatti Change-Id: I4118e1b813e5f76fca7b7e9ca1cc598715203fb0 --- plat/xilinx/common/include/pm_defs.h | 1 + plat/xilinx/versal/plat_psci.c | 14 ++++++++++++-- plat/xilinx/versal_net/plat_psci_pm.c | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/plat/xilinx/common/include/pm_defs.h b/plat/xilinx/common/include/pm_defs.h index 9cdb0ba07..c1872d0bf 100644 --- a/plat/xilinx/common/include/pm_defs.h +++ b/plat/xilinx/common/include/pm_defs.h @@ -18,6 +18,7 @@ /* State arguments of the self suspend */ #define PM_STATE_CPU_IDLE 0x0U +#define PM_STATE_CPU_OFF 0x1U #define PM_STATE_SUSPEND_TO_RAM 0xFU #define MAX_LATENCY (~0U) diff --git a/plat/xilinx/versal/plat_psci.c b/plat/xilinx/versal/plat_psci.c index 9c34d0d2c..45b1f1c21 100644 --- a/plat/xilinx/versal/plat_psci.c +++ b/plat/xilinx/versal/plat_psci.c @@ -186,6 +186,7 @@ static void __dead2 versal_system_reset(void) */ static void versal_pwr_domain_off(const psci_power_state_t *target_state) { + uint32_t ret, fw_api_version, version[PAYLOAD_ARG_CNT] = {0U}; uint32_t cpu_id = plat_my_core_pos(); const struct pm_proc *proc = pm_get_proc(cpu_id); @@ -205,8 +206,17 @@ static void versal_pwr_domain_off(const psci_power_state_t *target_state) * invoking CPU_on function, during which resume address will * be set. */ - (void)pm_self_suspend(proc->node_id, MAX_LATENCY, PM_STATE_CPU_IDLE, 0, - SECURE_FLAG); + ret = pm_feature_check((uint32_t)PM_SELF_SUSPEND, &version[0], SECURE_FLAG); + if (ret == PM_RET_SUCCESS) { + fw_api_version = version[0] & 0xFFFFU; + if (fw_api_version >= 3U) { + (void)pm_self_suspend(proc->node_id, MAX_LATENCY, PM_STATE_CPU_OFF, 0, + SECURE_FLAG); + } else { + (void)pm_self_suspend(proc->node_id, MAX_LATENCY, PM_STATE_CPU_IDLE, 0, + SECURE_FLAG); + } + } } /** diff --git a/plat/xilinx/versal_net/plat_psci_pm.c b/plat/xilinx/versal_net/plat_psci_pm.c index 2cf3bf269..94cb7f58d 100644 --- a/plat/xilinx/versal_net/plat_psci_pm.c +++ b/plat/xilinx/versal_net/plat_psci_pm.c @@ -59,6 +59,7 @@ static int32_t versal_net_pwr_domain_on(u_register_t mpidr) */ static void versal_net_pwr_domain_off(const psci_power_state_t *target_state) { + uint32_t ret, fw_api_version, version[PAYLOAD_ARG_CNT] = {0U}; uint32_t cpu_id = plat_my_core_pos(); const struct pm_proc *proc = pm_get_proc(cpu_id); @@ -78,8 +79,17 @@ static void versal_net_pwr_domain_off(const psci_power_state_t *target_state) * invoking CPU_on function, during which resume address will * be set. */ - pm_self_suspend(proc->node_id, MAX_LATENCY, PM_STATE_CPU_IDLE, 0, - SECURE_FLAG); + ret = pm_feature_check((uint32_t)PM_SELF_SUSPEND, &version[0], SECURE_FLAG); + if (ret == PM_RET_SUCCESS) { + fw_api_version = version[0] & 0xFFFFU; + if (fw_api_version >= 3U) { + (void)pm_self_suspend(proc->node_id, MAX_LATENCY, PM_STATE_CPU_OFF, 0, + SECURE_FLAG); + } else { + (void)pm_self_suspend(proc->node_id, MAX_LATENCY, PM_STATE_CPU_IDLE, 0, + SECURE_FLAG); + } + } } /** From 427e46ddea1e528d4c57b1d8215482055bd79c3e Mon Sep 17 00:00:00 2001 From: Jay Buddhabhatti Date: Mon, 11 Sep 2023 23:50:53 -0700 Subject: [PATCH 8/9] fix(xilinx): fix sending sgi to linux Currently in Versal NET TF-A writing 32 bits in icc_asgi1r_el1 register to raise SGI to Linux but this register is of 64 bits. Also its writing only CPU number and SGI number to this register but along with that it needs to write cluster number and other information. Which is not happening currently. So use generic function plat_ic_raise_ns_sgi() to raise SGI to Linux. Signed-off-by: Jay Buddhabhatti Change-Id: I6f5146c8315a321b705ed2ef79e2dc927b805ffb --- plat/xilinx/common/pm_service/pm_svc_main.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/plat/xilinx/common/pm_service/pm_svc_main.c b/plat/xilinx/common/pm_service/pm_svc_main.c index 9df9eb2be..b62b2713c 100644 --- a/plat/xilinx/common/pm_service/pm_svc_main.c +++ b/plat/xilinx/common/pm_service/pm_svc_main.c @@ -45,13 +45,7 @@ bool pwrdwn_req_received; static void notify_os(void) { - int32_t cpu; - uint32_t reg; - - cpu = plat_my_core_pos() + 1U; - - reg = (cpu | (sgi << XSCUGIC_SGIR_EL1_INITID_SHIFT)); - write_icc_asgi1r_el1(reg); + plat_ic_raise_ns_sgi(sgi, read_mpidr_el1()); } static uint64_t cpu_pwrdwn_req_handler(uint32_t id, uint32_t flags, From 7ec53afaade308b35f546480990dbc9304e06e7d Mon Sep 17 00:00:00 2001 From: Jay Buddhabhatti Date: Sun, 8 Oct 2023 22:08:02 -0700 Subject: [PATCH 9/9] fix(xilinx): add console_flush() before shutdown Add console_flush() call before shutting down in order to ensure that console output is flushed. Signed-off-by: Jay Buddhabhatti Change-Id: I5397105d2d7bf317f199b6326593bdb1c3cc75e2 --- plat/xilinx/common/pm_service/pm_svc_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plat/xilinx/common/pm_service/pm_svc_main.c b/plat/xilinx/common/pm_service/pm_svc_main.c index b62b2713c..f9917a012 100644 --- a/plat/xilinx/common/pm_service/pm_svc_main.c +++ b/plat/xilinx/common/pm_service/pm_svc_main.c @@ -100,6 +100,7 @@ static uint64_t ipi_fiq_handler(uint32_t id, uint32_t flags, void *handle, VERBOSE("Received IPI FIQ from firmware\n"); + console_flush(); (void)plat_ic_acknowledge_interrupt(); ret = pm_get_callbackdata(payload, ARRAY_SIZE(payload), 0, 0);