arm64: gic-v3-its: Clear the Pending table before enabling LPIs
authorHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Fri, 5 Mar 2021 07:02:35 +0000 (15:02 +0800)
committerTom Rini <trini@konsulko.com>
Tue, 20 Apr 2021 11:31:12 +0000 (07:31 -0400)
commit6f6876a0c0304acc117d075344275d716f8a935a
tree2b4ed6d1b9abcc3f22ee9a6d622d5688d4a7a493
parent612729b178d25b34199e169e8e24689d4fd4a820
arm64: gic-v3-its: Clear the Pending table before enabling LPIs

The GICv3 RM requires "The first 1KB of memory for the LPI Pending tables
must contain only zeros on initial allocation, and this must be visible
to the Redistributors, or else the effect is UNPREDICTABLE".

And as the following statement, we here clear the whole Pending tables
instead of the first 1KB.
"An LPI Pending table that contains only zeros, including in the first 1KB,
indicates that there are no pending LPIs.
The first 1KB of the LPI Pending table is IMPLEMENTATION DEFINED. However,
if the first 1KB of the LPI Pending table and the rest of the table contain
only zeros, this must indicate that there are no pending LPIs."

And there isn't any pending LPI under U-Boot, so it's unnecessary to
load the contents of the Pending table during the enablement, then set
the GICR_PENDBASER.PTZ flag.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com> # NXP LS1028A
Reviewed-by: Wasim Khan <wasim.khan@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
arch/arm/lib/gic-v3-its.c