irqchip: mips-gic: Provide VP ID accessor

Provide a gic_read_local_vp_id() function to read the VCNUM field of the
GICs local VP_IDENT register. This will be used by a further patch to
check that the value reported by the GIC matches up with the kernels
calculation.

Signed-off-by: Paul Burton <[email protected]>
Acked-by: Jason Cooper <[email protected]>
Cc: Andrew Bresticker <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: James Hogan <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/12334/
Signed-off-by: Ralf Baechle <[email protected]>
This commit is contained in:
Paul Burton 2016-02-03 03:15:28 +00:00 • committed by Ralf Baechle
commit 835d2b4529
2 changed files with 25 additions and 0 deletions

View file

@ -246,6 +246,14 @@ void gic_stop_count(void)
#endif
unsigned gic_read_local_vp_id(void)
{
unsigned long ident;
ident = gic_read(GIC_REG(VPE_LOCAL, GIC_VP_IDENT));
return ident & GIC_VP_IDENT_VCNUM_MSK;
}
static bool gic_local_irq_is_routable(int intr)
{
u32 vpe_ctl;