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 |
13 | _aic_read32(uintptr_t addr) |
14 | { |
15 | return *(volatile uint32_t *)addr; |
16 | } |
17 | |
18 | static inline void |
19 | _aic_write32(uintptr_t addr, uint32_t data) |
20 | { |
21 | *(volatile uint32_t *)(addr) = data; |
22 | } |
23 | |
24 | #define aic_read32(offset, data) (_aic_read32(pic_base + (offset))) |
25 | #define aic_write32(offset, data) (_aic_write32(pic_base + (offset), (data))) |
26 | |
27 | #endif |
28 | |
29 | // AIC timebase registers (timer base address in DT node is setup as AIC_BASE + 0x1000) |
30 | #define kAICMainTimLo (0x20) |
31 | #define kAICMainTimHi (0x28) |
32 | |
33 | #endif /* ! _PEXPERT_ARM_AIC_H */ |
34 | |