Skip to contentSkip to conversation

nds32: Support timer DM.

PATCH New Andes 1 participant 1 message Dec 1, 2016

lore
Share & tools
lore

Andes

author
#0 lore raw

PATCH 1/1 nds32: Support timer DM.

From: rick <[email protected]>

Add ag101p baord timer DM driver.

---
 arch/nds32/cpu/n1213/ag101/timer.c |    3 +-
 arch/nds32/dts/ag101p.dts          |    1 +
 configs/adp-ag101p_defconfig       |    2 +
 drivers/timer/Kconfig              |    6 ++
 drivers/timer/Makefile             |    1 +
 drivers/timer/ag101p_timer.c       |  122 ++++++++++++++++++++++++++++++++++++
 6 files changed, 134 insertions(+), 1 deletion(-)
 create mode 100644 drivers/timer/ag101p_timer.c
arch/nds32/cpu/n1213/ag101/timer.c +2 -1
index 758b354..0c03a10 100644
@@ -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 +1 -0
index 07f7c98..8099665 100644
@@ -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 {
configs/adp-ag101p_defconfig +2 -0
index eb46e3f..8c2fc0b 100644
@@ -14,3 +14,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
index cb18f12..c2aa440 100644
@@ -46,4 +46,10 @@ config OMAP_TIMER
 	help
 	  Select this to enable an timer for Omap devices.
 
+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
index f351fbb..bf19355 100644
@@ -9,3 +9,4 @@ obj-$(CONFIG_ALTERA_TIMER)	+= altera_timer.o
 obj-$(CONFIG_SANDBOX_TIMER)	+= sandbox_timer.o
 obj-$(CONFIG_X86_TSC_TIMER)	+= tsc_timer.o
 obj-$(CONFIG_OMAP_TIMER)	+= omap-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