Skip to contentSkip to conversation

watchdog: omap_wdt: Convert watchdog driver to use DT and DM

PATCH Superseded sunil.m at techveda.org 2 participants 2 messages Jul 12, 2019 – Jul 18, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 watchdog: omap_wdt: Convert watchdog driver to use DT and DM

From: Suniel Mahesh <[email protected]>

This patch adds device tree and driver model watchdog support, converts the legacy omap watchdog driver to driver model for TI AM335x chipsets. The following compile warning is removed:

===================== WARNING ====================== This board does not use CONFIG_WDT (DM watchdog support). Please update the board to use CONFIG_WDT before the v2019.10 release.
Failure to update by the deadline may result in board removal. See doc/driver-model/MIGRATION.txt for more info.
====================================================

DM watchdog support if enabled in SPL, spl image doesn't fit into SRAM because of size constraints and build breaks with an overflow. For this reason DM watchdog support should be disabled in SPL. The driver code should be adjusted accordingly to serve this purpose. Tested on BeagleboneBlack board.

---
Notes:
- DM watchdog support if enabled in SPL, spl image doesn't fit into SRAM because of size constraints.
- Disabling DM watchdog support in SPL, another patch follows.
- This patch series is heavily dependant on:
https://patchwork.ozlabs.org/patch/1112591/
waiting for it to get applied.

---
 arch/arm/include/asm/ti-common/omap_wdt.h |   5 ++
 configs/am335x_evm_defconfig              |   2 +
 drivers/watchdog/Kconfig                  |  10 ++-
 drivers/watchdog/Makefile                 |   1 +
 drivers/watchdog/omap_wdt.c               | 114 ++++++++++++++++++++++++++++++
 5 files changed, 131 insertions(+), 1 deletion(-)
arch/arm/include/asm/ti-common/omap_wdt.h +5 -0
index 7d72e3a..fbc421b 100644
@@ -56,4 +56,9 @@ struct wd_timer {
 	unsigned int wdt_unfr;	/* offset 0x100 */
 };
 
+struct omap3_wdt_priv {
+	struct wd_timer *regs;
+	unsigned int wdt_trgr_pattern;
+};
+
 #endif /* __OMAP_WDT_H__ */
configs/am335x_evm_defconfig +2 -0
index ff96f19..fa6b030 100644
@@ -58,6 +58,8 @@ CONFIG_DM_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_TIMER=y
 CONFIG_OMAP_TIMER=y
+CONFIG_WDT=y
+CONFIG_WDT_OMAP3=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_DM_USB_GADGET=y
drivers/watchdog/Kconfig +9 -1
index e5a7bb3..93ebc47 100644
@@ -37,7 +37,7 @@ config OMAP_WATCHDOG
 	bool "TI OMAP watchdog driver"
 	depends on ARCH_OMAP2PLUS
 	select HW_WATCHDOG
-	default y if AM33XX
+	default y if !AM33XX
 	help
 	  Say Y here to enable the OMAP3+ watchdog driver.
 
@@ -122,6 +122,14 @@ config WDT_MTK
 	  The watchdog timer is stopped when initialized.
 	  It performs full SoC reset.
 
+config WDT_OMAP3
+        bool "TI OMAP watchdog timer support"
+        depends on WDT && ARCH_OMAP2PLUS
+        default y if AM33XX
+        help
+	  This enables OMAP3+ watchdog timer driver, which can be
+	  found on some TI chipsets and inline with driver model.
+
 config WDT_ORION
 	bool "Orion watchdog timer support"
 	depends on WDT
drivers/watchdog/Makefile +1 -0
index 97aa6a8..c40667a 100644
@@ -26,6 +26,7 @@ obj-$(CONFIG_WDT_CDNS) += cdns_wdt.o
 obj-$(CONFIG_WDT_MPC8xx) += mpc8xx_wdt.o
 obj-$(CONFIG_WDT_MT7621) += mt7621_wdt.o
 obj-$(CONFIG_WDT_MTK) += mtk_wdt.o
+obj-$(CONFIG_WDT_OMAP3) += omap_wdt.o
 obj-$(CONFIG_WDT_SP805) += sp805_wdt.o
 obj-$(CONFIG_WDT_STM32MP) += stm32mp_wdt.o
 obj-$(CONFIG_WDT_TANGIER) += tangier_wdt.o
drivers/watchdog/omap_wdt.c +114 -0

127 lines not on this page · raw message

Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 watchdog: omap_wdt: Convert watchdog driver to use DT and DM

Quoted 14 lines · sunil.m at techveda.org

From: Suniel Mahesh <[email protected]>

This patch adds device tree and driver model watchdog support, converts the legacy omap watchdog driver to driver model for TI AM335x chipsets. The following compile warning is removed:

===================== WARNING ====================== This board does not use CONFIG_WDT (DM watchdog support). Please update the board to use CONFIG_WDT before the v2019.10 release.
Failure to update by the deadline may result in board removal. See doc/driver-model/MIGRATION.txt for more info.
====================================================

Quoted 7 lines

DM watchdog support if enabled in SPL, spl image doesn't fit into SRAM because of size constraints and build breaks with an overflow. For this reason DM watchdog support should be disabled in SPL. The driver code should be adjusted accordingly to serve this purpose. Tested on BeagleboneBlack board.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190718/3b803315/attachment.sig>