diff options
author | Vladimir Murzin <vladimir.murzin@arm.com> | 2016-11-02 07:54:07 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2016-11-29 04:14:48 -0500 |
commit | 92116b804a02a9869fb8ef843473a5673ed64d3c (patch) | |
tree | ee9c5fcfc2be36aad7889772b9bd2db17560345f | |
parent | 0968a61918a9140d39959a318f796412354ec24d (diff) |
ARM: gic-v3-its: Add 32bit support to GICv3 ITS
Wire-up flush_dcache, readq- and writeq-like gic-v3-its assessors, so
GICv3 ITS gets all it needs to be built and run.
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r-- | arch/arm/include/asm/arch_gicv3.h | 54 |
1 files changed, 47 insertions, 7 deletions
diff --git a/arch/arm/include/asm/arch_gicv3.h b/arch/arm/include/asm/arch_gicv3.h index a8088290b778..27475904e096 100644 --- a/arch/arm/include/asm/arch_gicv3.h +++ b/arch/arm/include/asm/arch_gicv3.h | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <asm/barrier.h> | 24 | #include <asm/barrier.h> |
25 | #include <asm/cacheflush.h> | ||
25 | #include <asm/cp15.h> | 26 | #include <asm/cp15.h> |
26 | 27 | ||
27 | #define ICC_EOIR1 __ACCESS_CP15(c12, 0, c12, 1) | 28 | #define ICC_EOIR1 __ACCESS_CP15(c12, 0, c12, 1) |
@@ -230,19 +231,14 @@ static inline void gic_write_bpr1(u32 val) | |||
230 | * AArch32, since the syndrome register doesn't provide any information for | 231 | * AArch32, since the syndrome register doesn't provide any information for |
231 | * them. | 232 | * them. |
232 | * Consequently, the following IO helpers use 32bit accesses. | 233 | * Consequently, the following IO helpers use 32bit accesses. |
233 | * | ||
234 | * There are only two registers that need 64bit accesses in this driver: | ||
235 | * - GICD_IROUTERn, contain the affinity values associated to each interrupt. | ||
236 | * The upper-word (aff3) will always be 0, so there is no need for a lock. | ||
237 | * - GICR_TYPER is an ID register and doesn't need atomicity. | ||
238 | */ | 234 | */ |
239 | static inline void gic_write_irouter(u64 val, volatile void __iomem *addr) | 235 | static inline void __gic_writeq_nonatomic(u64 val, volatile void __iomem *addr) |
240 | { | 236 | { |
241 | writel_relaxed((u32)val, addr); | 237 | writel_relaxed((u32)val, addr); |
242 | writel_relaxed((u32)(val >> 32), addr + 4); | 238 | writel_relaxed((u32)(val >> 32), addr + 4); |
243 | } | 239 | } |
244 | 240 | ||
245 | static inline u64 gic_read_typer(const volatile void __iomem *addr) | 241 | static inline u64 __gic_readq_nonatomic(const volatile void __iomem *addr) |
246 | { | 242 | { |
247 | u64 val; | 243 | u64 val; |
248 | 244 | ||
@@ -251,5 +247,49 @@ static inline u64 gic_read_typer(const volatile void __iomem *addr) | |||
251 | return val; | 247 | return val; |
252 | } | 248 | } |
253 | 249 | ||
250 | #define gic_flush_dcache_to_poc(a,l) __cpuc_flush_dcache_area((a), (l)) | ||
251 | |||
252 | /* | ||
253 | * GICD_IROUTERn, contain the affinity values associated to each interrupt. | ||
254 | * The upper-word (aff3) will always be 0, so there is no need for a lock. | ||
255 | */ | ||
256 | #define gic_write_irouter(v, c) __gic_writeq_nonatomic(v, c) | ||
257 | |||
258 | /* | ||
259 | * GICR_TYPER is an ID register and doesn't need atomicity. | ||
260 | */ | ||
261 | #define gic_read_typer(c) __gic_readq_nonatomic(c) | ||
262 | |||
263 | /* | ||
264 | * GITS_BASER - hi and lo bits may be accessed independently. | ||
265 | */ | ||
266 | #define gits_read_baser(c) __gic_readq_nonatomic(c) | ||
267 | #define gits_write_baser(v, c) __gic_writeq_nonatomic(v, c) | ||
268 | |||
269 | /* | ||
270 | * GICR_PENDBASER and GICR_PROPBASE are changed with LPIs disabled, so they | ||
271 | * won't be being used during any updates and can be changed non-atomically | ||
272 | */ | ||
273 | #define gicr_read_propbaser(c) __gic_readq_nonatomic(c) | ||
274 | #define gicr_write_propbaser(v, c) __gic_writeq_nonatomic(v, c) | ||
275 | #define gicr_read_pendbaser(c) __gic_readq_nonatomic(c) | ||
276 | #define gicr_write_pendbaser(v, c) __gic_writeq_nonatomic(v, c) | ||
277 | |||
278 | /* | ||
279 | * GITS_TYPER is an ID register and doesn't need atomicity. | ||
280 | */ | ||
281 | #define gits_read_typer(c) __gic_readq_nonatomic(c) | ||
282 | |||
283 | /* | ||
284 | * GITS_CBASER - hi and lo bits may be accessed independently. | ||
285 | */ | ||
286 | #define gits_read_cbaser(c) __gic_readq_nonatomic(c) | ||
287 | #define gits_write_cbaser(v, c) __gic_writeq_nonatomic(v, c) | ||
288 | |||
289 | /* | ||
290 | * GITS_CWRITER - hi and lo bits may be accessed independently. | ||
291 | */ | ||
292 | #define gits_write_cwriter(v, c) __gic_writeq_nonatomic(v, c) | ||
293 | |||
254 | #endif /* !__ASSEMBLY__ */ | 294 | #endif /* !__ASSEMBLY__ */ |
255 | #endif /* !__ASM_ARCH_GICV3_H */ | 295 | #endif /* !__ASM_ARCH_GICV3_H */ |