Merge "fix(gicv3): do not assume redistributors are powered down" into integration

This commit is contained in:
Olivier Deprez 2025-01-30 16:27:44 +01:00 committed by TrustedFirmware Code Review
commit cf084b3620

View file

@ -35,11 +35,22 @@ uintptr_t gicv3_get_multichip_base(uint32_t spi_id, uintptr_t gicd_base)
*****************************************************************************/
void gicv3_rdistif_mark_core_awake(uintptr_t gicr_base)
{
uint32_t waker = gicr_read_waker(gicr_base);
/* Only try to mark it as awake when it is asleep. */
if ((waker & WAKER_PS_BIT) == 0U) {
return;
}
/*
* The WAKER_PS_BIT should be changed to 0
* only when WAKER_CA_BIT is 1.
* ProcessorSleep must only be changed when ChildrenAsleep is 1.
* If PS is 1 and CA isn't, wait for that to happen, but warn.
*/
assert((gicr_read_waker(gicr_base) & WAKER_CA_BIT) != 0U);
if ((waker & WAKER_CA_BIT) == 0U) {
WARN("GICR_WAKER.ChildrenAsleep unexpectedly set, waiting...\n");
while ((gicr_read_waker(gicr_base) & WAKER_CA_BIT) == 0U) {
}
}
/* Mark the connected core as awake */
gicr_write_waker(gicr_base, gicr_read_waker(gicr_base) & ~WAKER_PS_BIT);