Skip to content

Commit 3ca63f3

Browse files
author
Marc Zyngier
committed
irqchip/gic-v3-its: Add VPENDBASER/VPROPBASER accessors
V{PEND,PROP}BASER being 64bit registers, they need some ad-hoc accessors on 32bit, specially given that VPENDBASER contains a Valid bit, making the access a bit convoluted. Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent eb78192 commit 3ca63f3

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

arch/arm/include/asm/arch_gicv3.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,33 @@ static inline u64 __gic_readq_nonatomic(const volatile void __iomem *addr)
291291
*/
292292
#define gits_write_cwriter(v, c) __gic_writeq_nonatomic(v, c)
293293

294+
/*
295+
* GITS_VPROPBASER - hi and lo bits may be accessed independently.
296+
*/
297+
#define gits_write_vpropbaser(v, c) __gic_writeq_nonatomic(v, c)
298+
299+
/*
300+
* GITS_VPENDBASER - the Valid bit must be cleared before changing
301+
* anything else.
302+
*/
303+
static inline void gits_write_vpendbaser(u64 val, void * __iomem addr)
304+
{
305+
u32 tmp;
306+
307+
tmp = readl_relaxed(addr + 4);
308+
if (tmp & (GICR_VPENDBASER_Valid >> 32)) {
309+
tmp &= ~(GICR_VPENDBASER_Valid >> 32);
310+
writel_relaxed(tmp, addr + 4);
311+
}
312+
313+
/*
314+
* Use the fact that __gic_writeq_nonatomic writes the second
315+
* half of the 64bit quantity after the first.
316+
*/
317+
__gic_writeq_nonatomic(val, addr);
318+
}
319+
320+
#define gits_read_vpendbaser(c) __gic_readq_nonatomic(c)
321+
294322
#endif /* !__ASSEMBLY__ */
295323
#endif /* !__ASM_ARCH_GICV3_H */

arch/arm64/include/asm/arch_gicv3.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,10 @@ static inline void gic_write_bpr1(u32 val)
133133
#define gicr_write_pendbaser(v, c) writeq_relaxed(v, c)
134134
#define gicr_read_pendbaser(c) readq_relaxed(c)
135135

136+
#define gits_write_vpropbaser(v, c) writeq_relaxed(v, c)
137+
138+
#define gits_write_vpendbaser(v, c) writeq_relaxed(v, c)
139+
#define gits_read_vpendbaser(c) readq_relaxed(c)
140+
136141
#endif /* __ASSEMBLY__ */
137142
#endif /* __ASM_ARCH_GICV3_H */

include/linux/irqchip/arm-gic-v3.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@
212212
#define LPI_PROP_GROUP1 (1 << 1)
213213
#define LPI_PROP_ENABLED (1 << 0)
214214

215+
#define GICR_VPENDBASER_Dirty (1ULL << 60)
216+
#define GICR_VPENDBASER_PendingLast (1ULL << 61)
217+
#define GICR_VPENDBASER_IDAI (1ULL << 62)
218+
#define GICR_VPENDBASER_Valid (1ULL << 63)
219+
215220
/*
216221
* ITS registers, offsets from ITS_base
217222
*/

0 commit comments

Comments
 (0)