Skip to content

Commit 21f4f92

Browse files
vlsunilpalmer-dabbelt
authored andcommitted
clocksource/timer-riscv: Add ACPI support
Initialize the timer driver based on RHCT table on ACPI based platforms. Currently, ACPI doesn't support a flag to indicate that the timer interrupt can wake up the cpu irrespective of its power state. It will be added in future update. Signed-off-by: Sunil V L <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent cd12d20 commit 21f4f92

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/clocksource/timer-riscv.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#define pr_fmt(fmt) "riscv-timer: " fmt
1212

13+
#include <linux/acpi.h>
1314
#include <linux/clocksource.h>
1415
#include <linux/clockchips.h>
1516
#include <linux/cpu.h>
@@ -207,3 +208,13 @@ static int __init riscv_timer_init_dt(struct device_node *n)
207208
}
208209

209210
TIMER_OF_DECLARE(riscv_timer, "riscv", riscv_timer_init_dt);
211+
212+
#ifdef CONFIG_ACPI
213+
static int __init riscv_timer_acpi_init(struct acpi_table_header *table)
214+
{
215+
return riscv_timer_init_common();
216+
}
217+
218+
TIMER_ACPI_DECLARE(aclint_mtimer, ACPI_SIG_RHCT, riscv_timer_acpi_init);
219+
220+
#endif

0 commit comments

Comments
 (0)