Skip to content

Commit b3251b8

Browse files
Fu Weimrutland-arm
authored andcommitted
clocksource: arm_arch_timer: add structs to describe MMIO timer
In preparation for ACPI GTDT support, this patch adds structs to describe the MMIO timers indepedent of the firmware interface. Subsequent patches will use these to split the FW/HW probing logic, so that the HW probing logic can be shared by ACPI and DT. Signed-off-by: Fu Wei <fu.wei@linaro.org> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
1 parent ca0e1b5 commit b3251b8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

include/clocksource/arm_arch_timer.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ enum arch_timer_spi_nr {
5757
#define ARCH_TIMER_MEM_PHYS_ACCESS 2
5858
#define ARCH_TIMER_MEM_VIRT_ACCESS 3
5959

60+
#define ARCH_TIMER_MEM_MAX_FRAMES 8
61+
6062
#define ARCH_TIMER_USR_PCT_ACCESS_EN (1 << 0) /* physical counter */
6163
#define ARCH_TIMER_USR_VCT_ACCESS_EN (1 << 1) /* virtual counter */
6264
#define ARCH_TIMER_VIRT_EVT_EN (1 << 2)
@@ -72,6 +74,20 @@ struct arch_timer_kvm_info {
7274
int virtual_irq;
7375
};
7476

77+
struct arch_timer_mem_frame {
78+
bool valid;
79+
phys_addr_t cntbase;
80+
size_t size;
81+
int phys_irq;
82+
int virt_irq;
83+
};
84+
85+
struct arch_timer_mem {
86+
phys_addr_t cntctlbase;
87+
size_t size;
88+
struct arch_timer_mem_frame frame[ARCH_TIMER_MEM_MAX_FRAMES];
89+
};
90+
7591
#ifdef CONFIG_ARM_ARCH_TIMER
7692

7793
extern u32 arch_timer_get_rate(void);

0 commit comments

Comments
 (0)