1 | /* |
2 | * Copyright (c) 2012 Apple Inc. All rights reserved. |
3 | */ |
4 | |
5 | #ifndef _PEXPERT_ARM_AIC_H |
6 | #define _PEXPERT_ARM_AIC_H |
7 | |
8 | #ifndef ASSEMBLER |
9 | |
10 | #include <stdint.h> |
11 | |
12 | static inline uint32_t _aic_read32(uintptr_t addr) |
13 | { |
14 | return (*(volatile uint32_t *)addr); |
15 | } |
16 | |
17 | static inline void _aic_write32(uintptr_t addr, uint32_t data) |
18 | { |
19 | *(volatile uint32_t *)(addr) = data; |
20 | } |
21 | |
22 | #define aic_read32(offset, data) (_aic_read32(pic_base + (offset))) |
23 | #define aic_write32(offset, data) (_aic_write32(pic_base + (offset), (data))) |
24 | |
25 | #endif |
26 | |
27 | // AIC timebase registers (timer base address in DT node is setup as AIC_BASE + 0x1000) |
28 | #define kAICMainTimLo (0x20) |
29 | #define kAICMainTimHi (0x28) |
30 | |
31 | #endif /* ! _PEXPERT_ARM_AIC_H */ |
32 | |
33 | |