nds32: Support AG101P timer DM.
PATCH 2/3 nds32: Support AG101P timer DM.
From: rick <[email protected]>
Support AG101P timer device tree flow.
Signed-off-by rick <[email protected]>
--- arch/nds32/cpu/n1213/ag101/timer.c | 3 +- arch/nds32/dts/ag101p.dts | 8 +++ configs/adp-ag101p_defconfig | 2 + drivers/timer/Kconfig | 6 ++ drivers/timer/Makefile | 1 + drivers/timer/ag101p_timer.c | 122 ++++++++++++++++++++++++++++++++++++ 6 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 drivers/timer/ag101p_timer.c
arch/nds32/cpu/n1213/ag101/timer.c +2 -1
@@ -8,7 +8,7 @@* * SPDX-License-Identifier: GPL-2.0+ */ - +#ifndef CONFIG_TIMER #include <common.h> #include <asm/io.h> #include <faraday/fttmr010.h>
@@ -189,3 +189,4 @@ ulong get_tbclk(void)return CONFIG_SYS_CLK_FREQ ; #endif } +#endif /* CONFIG_TIMER */
arch/nds32/dts/ag101p.dts +8 -0
@@ -13,6 +13,7 @@ /* bootargs = "console=ttyS0,38400n8 earlyprintk=uart8250-32bit,0x99600000 debug bootmem_debug memblock=debug loglevel=7"; */ bootargs = "console=ttyS0,38400n8 earlyprintk=uart8250-32bit,0x99600000 debug loglevel=7"; stdout-path = "uart0:38400n8"; + tick-timer = &timer0; }; memory at 0 {
@@ -46,4 +47,11 @@ no-loopback-test = <1>; }; + timer0: timer at 98400000 { + compatible = "andestech,attmr010"; + reg = <0x98400000 0x1000>; + interrupts = <19 4>; + clock-frequency = <15000000>; + }; + };
configs/adp-ag101p_defconfig +2 -0
@@ -18,3 +18,5 @@ CONFIG_OF_CONTROL=y CONFIG_DM=y CONFIG_DM_SERIAL=y CONFIG_SYS_NS16550=y +CONFIG_TIMER=y +CONFIG_AG101P_TIMER=y
drivers/timer/Kconfig +6 -0
@@ -74,4 +74,10 @@ config ARC_TIMER usually at least one of them exists. Either of them is supported in U-Boot. +config AG101P_TIMER + bool "Ag101p timer support" + depends on TIMER + help + Select this to enable a timer for Ag101p devices. + endmenu
drivers/timer/Makefile +1 -0
@@ -12,3 +12,4 @@ obj-$(CONFIG_OMAP_TIMER) += omap-timer.o obj-$(CONFIG_AST_TIMER) += ast_timer.o obj-$(CONFIG_STI_TIMER) += sti-timer.o obj-$(CONFIG_ARC_TIMER) += arc_timer.o +obj-$(CONFIG_AG101P_TIMER) += ag101p_timer.o
drivers/timer/ag101p_timer.c new file +122 -0
122 lines not on this page · raw message
Signature · 1 line
1.7.9.5