]> git.baikalelectronics.ru Git - kernel.git/commit
irqchip/gic-v3: Probe for SCR_EL3 being clear before resetting AP0Rn
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 20 Mar 2018 09:46:42 +0000 (09:46 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Thu, 22 Mar 2018 13:46:18 +0000 (13:46 +0000)
commit7f6d4b465e2c723dae30608d1511eb3afc2fe044
tree3cfda95aa133f0ff49d11bf5682647eb4faec367
parentdf07666a2e9a9b39a4abb25378bef5b146f36855
irqchip/gic-v3: Probe for SCR_EL3 being clear before resetting AP0Rn

We would like to reset the Group-0 Active Priority Registers
at boot time if they are available to us. They would be available
if SCR_EL3.FIQ was not set, but we cannot directly probe this bit,
and short of checking, we may end-up trapping to EL3, and the
firmware may not be please to get such an exception. Yes, this
is dumb.

Instead, let's use PMR to find out if its value gets affected by
SCR_EL3.FIQ being set. We use the fact that when SCR_EL3.FIQ is
set, the LSB of the priority is lost due to the shifting back and
forth of the actual priority. If we read back a 0, we know that
Group0 is unavailable. In case we read a non-zero value, we can
safely reset the AP0Rn register.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm/include/asm/arch_gicv3.h
arch/arm64/include/asm/arch_gicv3.h
drivers/irqchip/irq-gic-v3.c