Skip to contentSkip to conversation

watchdog/denali: Adding DesignWare watchdog driver support

PATCH Superseded Chin Liang See 1 participant 1 message Feb 21, 2014

Subsystems (2)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 watchdog/denali: Adding DesignWare watchdog driver support

To add the DesignWare watchdog driver support. It required information such as register base address and clock info from configuration header file within include/configs folder.

Cc Anatolij Gustschin <[email protected]>
Cc Albert Aribaud <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Tom Rini <[email protected]>

---
Changes for v2
- Enable this driver at socfpga_cyclone5 board

---
 .../include/asm/arch-socfpga/socfpga_base_addrs.h  |    1 +
 drivers/watchdog/Makefile                          |    1 +
 drivers/watchdog/designware_wdt.c                  |   73 ++++++++++++++++++++
 include/configs/socfpga_cyclone5.h                 |   13 ++++
 4 files changed, 88 insertions(+)
 create mode 100644 drivers/watchdog/designware_wdt.c
arch/arm/include/asm/arch-socfpga/socfpga_base_addrs.h +1 -0
index 20f12e0..5f73824 100644
@@ -11,6 +11,7 @@
 #define SOCFPGA_UART0_ADDRESS 0xffc02000
 #define SOCFPGA_UART1_ADDRESS 0xffc03000
 #define SOCFPGA_OSC1TIMER0_ADDRESS 0xffd00000
+#define SOCFPGA_L4WD0_ADDRESS 0xffd02000
 #define SOCFPGA_CLKMGR_ADDRESS 0xffd04000
 #define SOCFPGA_RSTMGR_ADDRESS 0xffd05000
 #define SOCFPGA_SYSMGR_ADDRESS 0xffd08000
drivers/watchdog/Makefile +1 -0
index 06ced10..0276a10 100644
@@ -15,3 +15,4 @@ obj-$(CONFIG_S5P)               += s5p_wdt.o
 obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
 obj-$(CONFIG_BFIN_WATCHDOG)  += bfin_wdt.o
 obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
+obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
drivers/watchdog/designware_wdt.c new file +73 -0

73 lines not on this page · raw message

include/configs/socfpga_cyclone5.h +13 -0
index fc921ee..1b78ccb 100644
@@ -207,6 +207,16 @@
 #define CONFIG_ENV_IS_NOWHERE
 
 /*
+ * L4 Watchdog
+ */
+#define CONFIG_HW_WATCHDOG
+#define CONFIG_HW_WATCHDOG_TIMEOUT_MS	2000
+#define CONFIG_DESIGNWARE_WATCHDOG
+#define CONFIG_DW_WDT_BASE		SOCFPGA_L4WD0_ADDRESS
+/* Clocks source frequency to watchdog timer */
+#define CONFIG_DW_WDT_CLOCK_KHZ		25000
+
+/*
  * SPL "Second Program Loader" aka Initial Software
  */
 
@@ -238,4 +248,7 @@
 /* Support for lib/libgeneric.o in SPL binary */
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
 
+/* Support for watchdog */
+#define CONFIG_SPL_WATCHDOG_SUPPORT
+
 #endif	/* __CONFIG_H */
Signature · 1 line
1.7.9.5