[PATCH 38/38] m68k: Rename CONFIG_WATCHDOG_TIMEOUT to CONFIG_WATCHDOG_TIMEOUT_MSECS

Tom Rini trini at konsulko.com
Sun Nov 20 00:45:45 CET 2022


In practice, it is clear that the usage in m68k of
CONFIG_WATCHDOG_TIMEOUT is setting a value in milliseconds. Rename this
to the existing symbol and move to Kconfig.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
 arch/m68k/cpu/mcf523x/cpu.c        |  2 +-
 arch/m68k/cpu/mcf52x2/cpu.c        |  6 +++---
 arch/m68k/cpu/mcf532x/cpu.c        |  2 +-
 configs/M5208EVBE_defconfig        |  1 +
 configs/M5235EVB_Flash32_defconfig |  1 +
 configs/M5235EVB_defconfig         |  1 +
 configs/M5272C3_defconfig          |  1 +
 configs/M53017EVB_defconfig        |  1 +
 configs/M5329AFEE_defconfig        |  1 +
 configs/M5329BFEE_defconfig        |  1 +
 configs/M5373EVB_defconfig         |  1 +
 configs/astro_mcf5373l_defconfig   |  1 +
 include/configs/M5208EVBE.h        |  2 --
 include/configs/M5235EVB.h         |  2 --
 include/configs/M5272C3.h          |  2 --
 include/configs/M53017EVB.h        |  2 --
 include/configs/M5329EVB.h         |  2 --
 include/configs/M5373EVB.h         |  2 --
 include/configs/astro_mcf5373l.h   | 10 ----------
 include/configs/cobra5272.h        | 12 ------------
 20 files changed, 14 insertions(+), 39 deletions(-)

diff --git a/arch/m68k/cpu/mcf523x/cpu.c b/arch/m68k/cpu/mcf523x/cpu.c
index 6d87908965d2..838b71a2ea48 100644
--- a/arch/m68k/cpu/mcf523x/cpu.c
+++ b/arch/m68k/cpu/mcf523x/cpu.c
@@ -92,7 +92,7 @@ int watchdog_init(void)
 	u32 wdog_module = 0;
 
 	/* set timeout and enable watchdog */
-	wdog_module = ((CFG_SYS_CLK / CONFIG_SYS_HZ) * CONFIG_WATCHDOG_TIMEOUT);
+	wdog_module = ((CFG_SYS_CLK / CONFIG_SYS_HZ) * CONFIG_WATCHDOG_TIMEOUT_MSEC);
 	wdog_module |= (wdog_module / 8192);
 	out_be16(&wdp->mr, wdog_module);
 
diff --git a/arch/m68k/cpu/mcf52x2/cpu.c b/arch/m68k/cpu/mcf52x2/cpu.c
index d21d82fef758..25fc56c5276f 100644
--- a/arch/m68k/cpu/mcf52x2/cpu.c
+++ b/arch/m68k/cpu/mcf52x2/cpu.c
@@ -87,7 +87,7 @@ int watchdog_init(void)
 
 	/* set timeout and enable watchdog */
 	out_be16(&wdt->mr,
-		(CONFIG_WATCHDOG_TIMEOUT * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
+		(CONFIG_WATCHDOG_TIMEOUT_MSEC * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
 
 	/* reset watchdog counter */
 	out_be16(&wdt->sr, 0x5555);
@@ -253,7 +253,7 @@ int watchdog_init(void)
 
 	/* set timeout and enable watchdog */
 	out_be16(&wdt->wdog_wrrr,
-		(CONFIG_WATCHDOG_TIMEOUT * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
+		(CONFIG_WATCHDOG_TIMEOUT_MSEC * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
 
 	/* reset watchdog counter */
 	out_be16(&wdt->wdog_wcr, 0);
@@ -323,7 +323,7 @@ int watchdog_init(void)
 
 	/* set timeout and enable watchdog */
 	out_be16(&wdt->wmr,
-		(CONFIG_WATCHDOG_TIMEOUT * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
+		(CONFIG_WATCHDOG_TIMEOUT_MSEC * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
 
 	/* reset watchdog counter */
 	out_be16(&wdt->wsr, 0x5555);
diff --git a/arch/m68k/cpu/mcf532x/cpu.c b/arch/m68k/cpu/mcf532x/cpu.c
index 8a48d73475c8..014fbc43cb65 100644
--- a/arch/m68k/cpu/mcf532x/cpu.c
+++ b/arch/m68k/cpu/mcf532x/cpu.c
@@ -131,7 +131,7 @@ int watchdog_init(void)
 	u32 wdog_module = 0;
 
 	/* set timeout and enable watchdog */
-	wdog_module = ((CFG_SYS_CLK / 1000) * CONFIG_WATCHDOG_TIMEOUT);
+	wdog_module = ((CFG_SYS_CLK / 1000) * CONFIG_WATCHDOG_TIMEOUT_MSEC);
 #ifdef CONFIG_M5329
 	out_be16(&wdp->mr, wdog_module / 8192);
 #else
diff --git a/configs/M5208EVBE_defconfig b/configs/M5208EVBE_defconfig
index fd219cbaebc5..680c2d43671b 100644
--- a/configs/M5208EVBE_defconfig
+++ b/configs/M5208EVBE_defconfig
@@ -43,3 +43,4 @@ CONFIG_SYS_MAX_FLASH_SECT=254
 CONFIG_MCFFEC=y
 CONFIG_MII=y
 CONFIG_MCFUART=y
+CONFIG_WATCHDOG_TIMEOUT_MSECS=5000
diff --git a/configs/M5235EVB_Flash32_defconfig b/configs/M5235EVB_Flash32_defconfig
index 1b7b1568003e..c0087aa67f95 100644
--- a/configs/M5235EVB_Flash32_defconfig
+++ b/configs/M5235EVB_Flash32_defconfig
@@ -50,3 +50,4 @@ CONFIG_SYS_MAX_FLASH_SECT=137
 CONFIG_MCFFEC=y
 CONFIG_MII=y
 CONFIG_MCFUART=y
+CONFIG_WATCHDOG_TIMEOUT_MSECS=5000
diff --git a/configs/M5235EVB_defconfig b/configs/M5235EVB_defconfig
index fffcdddd4912..b099e986067b 100644
--- a/configs/M5235EVB_defconfig
+++ b/configs/M5235EVB_defconfig
@@ -50,3 +50,4 @@ CONFIG_SYS_MAX_FLASH_SECT=137
 CONFIG_MCFFEC=y
 CONFIG_MII=y
 CONFIG_MCFUART=y
+CONFIG_WATCHDOG_TIMEOUT_MSECS=5000
diff --git a/configs/M5272C3_defconfig b/configs/M5272C3_defconfig
index 5e7d40144f96..a321b1c5c244 100644
--- a/configs/M5272C3_defconfig
+++ b/configs/M5272C3_defconfig
@@ -62,3 +62,4 @@ CONFIG_SYS_MAX_FLASH_SECT=137
 CONFIG_MCFFEC=y
 CONFIG_MII=y
 CONFIG_MCFUART=y
+CONFIG_WATCHDOG_TIMEOUT_MSECS=10000
diff --git a/configs/M53017EVB_defconfig b/configs/M53017EVB_defconfig
index 6586f0468b20..32d195808801 100644
--- a/configs/M53017EVB_defconfig
+++ b/configs/M53017EVB_defconfig
@@ -49,3 +49,4 @@ CONFIG_MII=y
 CONFIG_MCFRTC=y
 CONFIG_SYS_MCFRTC_BASE=0xFC0A8000
 CONFIG_MCFUART=y
+CONFIG_WATCHDOG_TIMEOUT_MSECS=5000
diff --git a/configs/M5329AFEE_defconfig b/configs/M5329AFEE_defconfig
index bf1d70f832cc..9f0b4196392b 100644
--- a/configs/M5329AFEE_defconfig
+++ b/configs/M5329AFEE_defconfig
@@ -48,3 +48,4 @@ CONFIG_MII=y
 CONFIG_MCFRTC=y
 CONFIG_SYS_MCFRTC_BASE=0xFC0A8000
 CONFIG_MCFUART=y
+CONFIG_WATCHDOG_TIMEOUT_MSECS=5000
diff --git a/configs/M5329BFEE_defconfig b/configs/M5329BFEE_defconfig
index b83b542f8f83..05388796fb11 100644
--- a/configs/M5329BFEE_defconfig
+++ b/configs/M5329BFEE_defconfig
@@ -50,3 +50,4 @@ CONFIG_MII=y
 CONFIG_MCFRTC=y
 CONFIG_SYS_MCFRTC_BASE=0xFC0A8000
 CONFIG_MCFUART=y
+CONFIG_WATCHDOG_TIMEOUT_MSECS=5000
diff --git a/configs/M5373EVB_defconfig b/configs/M5373EVB_defconfig
index 181f79b1e906..90d83216489a 100644
--- a/configs/M5373EVB_defconfig
+++ b/configs/M5373EVB_defconfig
@@ -50,3 +50,4 @@ CONFIG_MII=y
 CONFIG_MCFRTC=y
 CONFIG_SYS_MCFRTC_BASE=0xFC0A8000
 CONFIG_MCFUART=y
+CONFIG_WATCHDOG_TIMEOUT_MSECS=3360
diff --git a/configs/astro_mcf5373l_defconfig b/configs/astro_mcf5373l_defconfig
index afbcb86c034b..9e5665a12b84 100644
--- a/configs/astro_mcf5373l_defconfig
+++ b/configs/astro_mcf5373l_defconfig
@@ -50,3 +50,4 @@ CONFIG_MCFRTC=y
 CONFIG_SYS_MCFRTC_BASE=0xFC0A8000
 CONFIG_MCFUART=y
 CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_TIMEOUT_MSECS=3355
diff --git a/include/configs/M5208EVBE.h b/include/configs/M5208EVBE.h
index 246437a51e2f..b360238b332a 100644
--- a/include/configs/M5208EVBE.h
+++ b/include/configs/M5208EVBE.h
@@ -15,8 +15,6 @@
  */
 #define CFG_SYS_UART_PORT		(0)
 
-#define CONFIG_WATCHDOG_TIMEOUT		5000
-
 /* I2C */
 
 #ifdef CONFIG_MCFFEC
diff --git a/include/configs/M5235EVB.h b/include/configs/M5235EVB.h
index 128ef50b476f..ed45eccb62c9 100644
--- a/include/configs/M5235EVB.h
+++ b/include/configs/M5235EVB.h
@@ -20,8 +20,6 @@
 
 #define CFG_SYS_UART_PORT		(0)
 
-#define CONFIG_WATCHDOG_TIMEOUT	5000	/* timeout in milliseconds, max timeout is 6.71sec */
-
 /* I2C */
 #define CFG_SYS_I2C_PINMUX_REG	(gpio->par_qspi)
 #define CFG_SYS_I2C_PINMUX_CLR	~(GPIO_PAR_FECI2C_SCL_MASK | GPIO_PAR_FECI2C_SDA_MASK)
diff --git a/include/configs/M5272C3.h b/include/configs/M5272C3.h
index 847b4c2593d8..a9339e505257 100644
--- a/include/configs/M5272C3.h
+++ b/include/configs/M5272C3.h
@@ -19,8 +19,6 @@
 
 #define CFG_SYS_UART_PORT		(0)
 
-#define CONFIG_WATCHDOG_TIMEOUT 10000	/* timeout in milliseconds */
-
 #undef CONFIG_MONITOR_IS_IN_RAM	/* define if monitor is started from a pre-loader */
 
 /* Configuration for environment
diff --git a/include/configs/M53017EVB.h b/include/configs/M53017EVB.h
index 0e9ba4c3ada8..42b74aeb9b5d 100644
--- a/include/configs/M53017EVB.h
+++ b/include/configs/M53017EVB.h
@@ -20,8 +20,6 @@
 
 #define CFG_SYS_UART_PORT		(0)
 
-#define CONFIG_WATCHDOG_TIMEOUT		5000
-
 #ifdef CONFIG_MCFFEC
 #	define CFG_SYS_TX_ETH_BUFFER	8
 #	define CFG_SYS_FEC_BUF_USE_SRAM
diff --git a/include/configs/M5329EVB.h b/include/configs/M5329EVB.h
index 8f83810f165e..72f0c63a1e21 100644
--- a/include/configs/M5329EVB.h
+++ b/include/configs/M5329EVB.h
@@ -20,8 +20,6 @@
 
 #define CFG_SYS_UART_PORT		(0)
 
-#define CONFIG_WATCHDOG_TIMEOUT	5000	/* timeout in milliseconds, max timeout is 6.71sec */
-
 /* I2C */
 
 #ifdef CONFIG_MCFFEC
diff --git a/include/configs/M5373EVB.h b/include/configs/M5373EVB.h
index 43c642edeb18..4e8b54e01f4e 100644
--- a/include/configs/M5373EVB.h
+++ b/include/configs/M5373EVB.h
@@ -22,8 +22,6 @@
 
 #define CFG_SYS_UART_PORT		(0)
 
-#define CONFIG_WATCHDOG_TIMEOUT	3360	/* timeout in ms, max is 3.36 sec */
-
 /* I2C */
 
 #ifdef CONFIG_MCFFEC
diff --git a/include/configs/astro_mcf5373l.h b/include/configs/astro_mcf5373l.h
index f5922fc416eb..62aa99342a0e 100644
--- a/include/configs/astro_mcf5373l.h
+++ b/include/configs/astro_mcf5373l.h
@@ -69,16 +69,6 @@
 #define CFG_SYS_UART_PORT		(2)
 #define CFG_SYS_UART2_ALT3_GPIO
 
-/*
- * Watchdog configuration; Watchdog is disabled for running from RAM
- * and set to highest possible value else. Beware there is no check
- * in the watchdog code to validate the timeout value set here!
- */
-
-#ifndef CONFIG_MONITOR_IS_IN_RAM
-#define CONFIG_WATCHDOG_TIMEOUT 3355	/* timeout in milliseconds */
-#endif
-
 /*
  * Configuration for environment
  * Environment is located in the last sector of the flash
diff --git a/include/configs/cobra5272.h b/include/configs/cobra5272.h
index 01828ea2011c..6d6e2fc69620 100644
--- a/include/configs/cobra5272.h
+++ b/include/configs/cobra5272.h
@@ -42,18 +42,6 @@
 
 #define CFG_SYS_UART_PORT		(0)
 
-/* ---
- * set "#if 0" to "#if 1" if (Hardware)-WATCHDOG should be enabled & change
- * timeout acc. to your needs
- * #define CONFIG_WATCHDOG_TIMEOUT x , x is timeout in milliseconds, e. g. 10000
- * for 10 sec
- * ---
- */
-
-#if 0
-#define CONFIG_WATCHDOG_TIMEOUT 10000	/* timeout in milliseconds */
-#endif
-
 /* ---
  * CONFIG_MONITOR_IS_IN_RAM defines if u-boot is started from a different
  * bootloader residing in flash ('chainloading'); if you want to use
-- 
2.25.1



More information about the U-Boot mailing list