Skip to contentSkip to conversation

watchdog: ulp_wdog: Remove unused ULP watchdog driver and its references

PATCH New Stefan Roese 2 participants 5 messages May 10, 2019

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: ulp_wdog: Remove unused ULP watchdog driver and its references

The ULP watchdog is not used in mainline U-Boot at all. This patch removes the driver and its references (CONFIG_ULP_WATCHDOG) completely.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/mach-imx/mx7ulp/soc.c |  2 -
 drivers/watchdog/Kconfig       |  5 --
 drivers/watchdog/Makefile      |  1 -
 drivers/watchdog/ulp_wdog.c    | 95 ----------------------------------
 4 files changed, 103 deletions(-)
 delete mode 100644 drivers/watchdog/ulp_wdog.c
arch/arm/mach-imx/mx7ulp/soc.c +0 -2
index c72f0ed3fc..cd7b96b5d8 100644
@@ -108,14 +108,12 @@ void s_init(void)
 	return;
 }
 
-#ifndef CONFIG_ULP_WATCHDOG
 void reset_cpu(ulong addr)
 {
 	setbits_le32(SIM0_RBASE, SIM_SOPT1_A7_SW_RESET);
 	while (1)
 		;
 }
-#endif
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
 const char *get_imx_type(u32 imxtype)
drivers/watchdog/Kconfig +0 -5
index f909d40f45..e2a6a27b2a 100644
@@ -43,11 +43,6 @@ config TANGIER_WATCHDOG
 	  Intel Tangier SoC. If you're using a board with Intel Tangier
 	  SoC, say Y here.
 
-config ULP_WATCHDOG
-	bool "i.MX7ULP watchdog"
-	help
-	  Say Y here to enable i.MX7ULP watchdog driver.
-
 config WDT
 	bool "Enable driver model for watchdog timer drivers"
 	depends on DM
drivers/watchdog/Makefile +0 -1
index 40b2f4bc66..3e3b60b00d 100644
@@ -15,7 +15,6 @@ obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
 obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
 obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
 obj-$(CONFIG_TANGIER_WATCHDOG) += tangier_wdt.o
-obj-$(CONFIG_ULP_WATCHDOG) += ulp_wdog.o
 obj-$(CONFIG_WDT) += wdt-uclass.o
 obj-$(CONFIG_WDT_SANDBOX) += sandbox_wdt.o
 obj-$(CONFIG_WDT_ARMADA_37XX) += armada-37xx-wdt.o
drivers/watchdog/ulp_wdog.c deleted +0 -95

95 lines not on this page · raw message

Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/1 watchdog: bcm2835_wdt: Remove unused BCM283x watchdog driver and its references

The BCM2835/2836 watchdog is not used in mainline U-Boot at all. This patch removes the driver and its references (CONFIG_BCM2835_WDT) completely.

---
 arch/arm/mach-bcm283x/reset.c  |  4 ----
 drivers/watchdog/Kconfig       |  9 ---------
 drivers/watchdog/Makefile      |  1 -
 drivers/watchdog/bcm2835_wdt.c | 34 ----------------------------------
 4 files changed, 48 deletions(-)
 delete mode 100644 drivers/watchdog/bcm2835_wdt.c
arch/arm/mach-bcm283x/reset.c +0 -4
index 7712d4664c..b3da0c7cd6 100644
@@ -23,11 +23,7 @@
 /* max ticks timeout */
 #define BCM2835_WDOG_MAX_TIMEOUT	0x000fffff
 
-#ifdef CONFIG_BCM2835_WDT
-extern void hw_watchdog_disable(void);
-#else
 void hw_watchdog_disable(void) {}
-#endif
 
 __efi_runtime_data struct bcm2835_wdog_regs *wdog_regs =
 	(struct bcm2835_wdog_regs *)BCM2835_WDOG_PHYSADDR;
drivers/watchdog/Kconfig +0 -9
index e2a6a27b2a..ae539d309d 100644
@@ -17,15 +17,6 @@ config WATCHDOG_RESET_DISABLE
 	   Disable reset watchdog, which can let WATCHDOG_RESET invalid, so
 	   that the watchdog will not be fed in u-boot.
 
-config BCM2835_WDT
-	bool "Enable BCM2835/2836 watchdog driver"
-	select HW_WATCHDOG
-	help
-	  Say Y here to enable the BCM2835/2836 watchdog
-
-	  This provides basic infrastructure to support BCM2835/2836 watchdog
-	  hardware, with a max timeout of ~15secs.
-
 config OMAP_WATCHDOG
 	bool "TI OMAP watchdog driver"
 	depends on ARCH_OMAP2PLUS
drivers/watchdog/Makefile +0 -1
index 3e3b60b00d..48fe3c64a9 100644
@@ -20,7 +20,6 @@ obj-$(CONFIG_WDT_SANDBOX) += sandbox_wdt.o
 obj-$(CONFIG_WDT_ARMADA_37XX) += armada-37xx-wdt.o
 obj-$(CONFIG_WDT_ASPEED) += ast_wdt.o
 obj-$(CONFIG_WDT_BCM6345) += bcm6345_wdt.o
-obj-$(CONFIG_BCM2835_WDT)       += bcm2835_wdt.o
 obj-$(CONFIG_WDT_ORION) += orion_wdt.o
 obj-$(CONFIG_WDT_CDNS) += cdns_wdt.o
 obj-$(CONFIG_WDT_MPC8xx) += mpc8xx_wdt.o
drivers/watchdog/bcm2835_wdt.c deleted +0 -34
deleted file mode 100644
index 6cffcb15e0..0000000000
@@ -1,34 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Watchdog driver for Broadcom BCM2835
- *
- * Copyright (C) 2017 Paolo Pisati <[email protected]>
- */
-
-#include <common.h>
-#include <efi_loader.h>
-#include <asm/io.h>
-#include <asm/arch/wdog.h>
-
-#define SECS_TO_WDOG_TICKS(x) ((x) << 16)
-#define MAX_TIMEOUT   0xf /* ~15s */
-
-static __efi_runtime_data bool enabled = true;
-
-extern void reset_cpu(ulong ticks);
-
-void hw_watchdog_reset(void)
-{
-	if (enabled)
-		reset_cpu(SECS_TO_WDOG_TICKS(MAX_TIMEOUT));
-}
-
-void hw_watchdog_init(void)
-{
-	hw_watchdog_reset();
-}
-
-void __efi_runtime hw_watchdog_disable(void)
-{
-	enabled = false;
-}
Signature · 1 line
2.21.0
#2 lore raw

PATCH 1/1 watchdog: ulp_wdog: Remove unused ULP watchdog driver and its references

In reply to Stefan Roese

Hi Stefan,

Quoted 2 lines

Subject: [PATCH] watchdog: ulp_wdog: Remove unused ULP watchdog driver and its references

We will convert it do DM, please keep it for a while.

Thanks,
Peng.

Quoted 166 lines

The ULP watchdog is not used in mainline U-Boot at all. This patch removes the driver and its references (CONFIG_ULP_WATCHDOG) completely.

Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/mach-imx/mx7ulp/soc.c |  2 -
 drivers/watchdog/Kconfig       |  5 --
 drivers/watchdog/Makefile      |  1 -
 drivers/watchdog/ulp_wdog.c    | 95 ----------------------------------
 4 files changed, 103 deletions(-)
 delete mode 100644 drivers/watchdog/ulp_wdog.c
(quoted diff) +0 -0

b/arch/arm/mach-imx/mx7ulp/soc.c index c72f0ed3fc..cd7b96b5d8 100644

arch/arm/mach-imx/mx7ulp/soc.c +0 -2
@@ -108,14 +108,12 @@ void s_init(void)
 	return;
 }
 
-#ifndef CONFIG_ULP_WATCHDOG
 void reset_cpu(ulong addr)
 {
 	setbits_le32(SIM0_RBASE, SIM_SOPT1_A7_SW_RESET);
 	while (1)
 		;
 }
-#endif
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
 const char *get_imx_type(u32 imxtype)
drivers/watchdog/Kconfig index renamed from drivers/watchdog/Kconfig +0 -0

f909d40f45..e2a6a27b2a 100644

drivers/watchdog/Kconfig +0 -5
@@ -43,11 +43,6 @@ config TANGIER_WATCHDOG
 	  Intel Tangier SoC. If you're using a board with Intel Tangier
 	  SoC, say Y here.
 
-config ULP_WATCHDOG
-	bool "i.MX7ULP watchdog"
-	help
-	  Say Y here to enable i.MX7ULP watchdog driver.
-
 config WDT
 	bool "Enable driver model for watchdog timer drivers"
 	depends on DM
drivers/watchdog/Makefile index renamed from drivers/watchdog/Makefile +0 -0

40b2f4bc66..3e3b60b00d 100644

drivers/watchdog/Makefile +0 -0
@@ -15,7 +15,6 @@ obj-$(CONFIG_XILINX_TB_WATCHDOG) +=

xilinx_tb_wdt.o
obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o obj-$(CONFIG_TANGIER_WATCHDOG) += tangier_wdt.o
-obj-$(CONFIG_ULP_WATCHDOG) += ulp_wdog.o
obj-$(CONFIG_WDT) += wdt-uclass.o
obj-$(CONFIG_WDT_SANDBOX) += sandbox_wdt.o obj-$(CONFIG_WDT_ARMADA_37XX) += armada-37xx-wdt.o diff --git
a/drivers/watchdog/ulp_wdog.c b/drivers/watchdog/ulp_wdog.c deleted file mode 100644 index 313019f152..0000000000

drivers/watchdog/ulp_wdog.c deleted +0 -25
@@ -1,95 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2016 Freescale Semiconductor, Inc.
- */
-
-#include <common.h>
-#include <asm/io.h>
-#include <asm/arch/imx-regs.h>
-
-/*
- * MX7ULP WDOG Register Map
- */
-struct wdog_regs {
-	u8 cs1;
-	u8 cs2;
-	u16 reserve0;
-	u32 cnt;
-	u32 toval;
-	u32 win;
-};
-
-#ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS
-#define CONFIG_WATCHDOG_TIMEOUT_MSECS 0x1500 -#endif
-
-#define REFRESH_WORD0 0xA602 /* 1st refresh word */ -#define

REFRESH_WORD1 0xB480 /* 2nd refresh word */

drivers/watchdog/ulp_wdog.c deleted +0 -2
-
-#define UNLOCK_WORD0 0xC520 /* 1st unlock word */ -#define

UNLOCK_WORD1 0xD928 /* 2nd unlock word */

drivers/watchdog/ulp_wdog.c deleted +0 -44
-
-#define WDGCS1_WDGE                      (1<<7)
-#define WDGCS1_WDGUPDATE                 (1<<5)
-
-#define WDGCS2_FLG                       (1<<6)
-
-#define WDG_BUS_CLK                      (0x0)
-#define WDG_LPO_CLK                      (0x1)
-#define WDG_32KHZ_CLK                    (0x2)
-#define WDG_EXT_CLK                      (0x3)
-
-void hw_watchdog_set_timeout(u16 val)
-{
-	/* setting timeout value */
-	struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE_ADDR;
-
-	writel(val, &wdog->toval);
-}
-
-void hw_watchdog_reset(void)
-{
-	struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE_ADDR;
-
-	writel(REFRESH_WORD0, &wdog->cnt);
-	writel(REFRESH_WORD1, &wdog->cnt);
-}
-
-void hw_watchdog_init(void)
-{
-	u8 val;
-	struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE_ADDR;
-
-	writel(UNLOCK_WORD0, &wdog->cnt);
-	writel(UNLOCK_WORD1, &wdog->cnt);
-
-	val = readb(&wdog->cs2);
-	val |= WDGCS2_FLG;
-	writeb(val, &wdog->cs2);
-
-	hw_watchdog_set_timeout(CONFIG_WATCHDOG_TIMEOUT_MSECS);
-	writel(0, &wdog->win);
-
-	writeb(WDG_LPO_CLK, &wdog->cs2);/* setting 1-kHz clock source */
-	writeb((WDGCS1_WDGE | WDGCS1_WDGUPDATE), &wdog->cs1);/*

enable counter running */

drivers/watchdog/ulp_wdog.c deleted +0 -22
-
-	hw_watchdog_reset();
-}
-
-void reset_cpu(ulong addr)
-{
-	struct wdog_regs *wdog = (struct wdog_regs *)WDOG_BASE_ADDR;
-
-	writel(UNLOCK_WORD0, &wdog->cnt);
-	writel(UNLOCK_WORD1, &wdog->cnt);
-
-	hw_watchdog_set_timeout(5); /* 5ms timeout */
-	writel(0, &wdog->win);
-
-	writeb(WDG_LPO_CLK, &wdog->cs2);/* setting 1-kHz clock source */
-	writeb(WDGCS1_WDGE, &wdog->cs1);/* enable counter running */
-
-	hw_watchdog_reset();
-
-	while (1);
-}
--

2.21.0

#3 lore raw

PATCH 1/1 watchdog: ulp_wdog: Remove unused ULP watchdog driver and its references

Hi Peng,

Quoted 6 lines · Peng Fan

Hi Stefan,

Quoted 2 lines

Subject: [PATCH] watchdog: ulp_wdog: Remove unused ULP watchdog driver and its references

We will convert it do DM, please keep it for a while.

Conversion alone is not enough in this case. You need to actually use it in one or more board ports. Currently its completely unused. So please make sure to also add a user for this driver.

Thanks,
Stefan

#4 lore raw

PATCH 1/1 watchdog: ulp_wdog: Remove unused ULP watchdog driver and its references

Quoted 9 lines

Subject: Re: [PATCH] watchdog: ulp_wdog: Remove unused ULP watchdog driver and its references

Hi Peng,

Quoted 2 lines · Peng Fan

Hi Stefan,

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Subject: [PATCH] watchdog: ulp_wdog: Remove unused ULP watchdog driver and its references

We will convert it do DM, please keep it for a while.

Conversion alone is not enough in this case. You need to actually use it in one or more board ports. Currently its completely unused.
So please make sure to also add a user for this driver.

Mostly doing i.MX8 related upstream recently, did not put much time on ULP. Understand your point, will check more in vendor tree and
Then decide to convert or remove.

Thanks for your understanding.

Thanks,
Peng.

Quoted 3 lines

Thanks,
Stefan