Re: [PATCH] watchdog: Remove MV64x60 watchdog driver
Hi All, On Mon, Jun 07, 2021 at 04:29:50AM -0700, Guenter Roeck wrote: > On Mon, Jun 07, 2021 at 11:43:26AM +1000, Michael Ellerman wrote: > > Guenter Roeck writes: > > > On 5/17/21 4:17 AM, Michael Ellerman wrote: > > >> Guenter Roeck writes: > > >>> On 3/18/21 10:25 AM, Christophe Leroy wrote: > > Commit 92c8c16f3457 ("powerpc/embedded6xx: Remove C2K board support") > > removed the last selector of CONFIG_MV64X60. > > > > Therefore CONFIG_MV64X60_WDT cannot be selected anymore and > > can be removed. > > > > Signed-off-by: Christophe Leroy > > >>> > > >>> Reviewed-by: Guenter Roeck > > >>> > > --- > > drivers/watchdog/Kconfig | 4 - > > drivers/watchdog/Makefile | 1 - > > drivers/watchdog/mv64x60_wdt.c | 324 > > - > > include/linux/mv643xx.h| 8 - > > 4 files changed, 337 deletions(-) > > delete mode 100644 drivers/watchdog/mv64x60_wdt.c > > >> > > >> I assumed this would go via the watchdog tree, but seems like I > > >> misinterpreted. > > >> > > > > > > Wim didn't send a pull request this time around. > > > > > > Guenter > > > > > >> Should I take this via the powerpc tree for v5.14 ? > > > > I still don't see this in the watchdog tree, should I take it? > > > It is in my personal watchdog-next tree, but afaics Wim hasn't picked any > of it up yet. Wim ? Picking it up right now. Kind regards, Wim.
Re: [PATCH] watchdog: Remove MV64x60 watchdog driver
On Mon, Jun 07, 2021 at 11:43:26AM +1000, Michael Ellerman wrote: > Guenter Roeck writes: > > On 5/17/21 4:17 AM, Michael Ellerman wrote: > >> Guenter Roeck writes: > >>> On 3/18/21 10:25 AM, Christophe Leroy wrote: > Commit 92c8c16f3457 ("powerpc/embedded6xx: Remove C2K board support") > removed the last selector of CONFIG_MV64X60. > > Therefore CONFIG_MV64X60_WDT cannot be selected anymore and > can be removed. > > Signed-off-by: Christophe Leroy > >>> > >>> Reviewed-by: Guenter Roeck > >>> > --- > drivers/watchdog/Kconfig | 4 - > drivers/watchdog/Makefile | 1 - > drivers/watchdog/mv64x60_wdt.c | 324 - > include/linux/mv643xx.h| 8 - > 4 files changed, 337 deletions(-) > delete mode 100644 drivers/watchdog/mv64x60_wdt.c > >> > >> I assumed this would go via the watchdog tree, but seems like I > >> misinterpreted. > >> > > > > Wim didn't send a pull request this time around. > > > > Guenter > > > >> Should I take this via the powerpc tree for v5.14 ? > > I still don't see this in the watchdog tree, should I take it? > It is in my personal watchdog-next tree, but afaics Wim hasn't picked any of it up yet. Wim ? Thanks, Guenter
Re: [PATCH] watchdog: Remove MV64x60 watchdog driver
Guenter Roeck writes: > On 5/17/21 4:17 AM, Michael Ellerman wrote: >> Guenter Roeck writes: >>> On 3/18/21 10:25 AM, Christophe Leroy wrote: Commit 92c8c16f3457 ("powerpc/embedded6xx: Remove C2K board support") removed the last selector of CONFIG_MV64X60. Therefore CONFIG_MV64X60_WDT cannot be selected anymore and can be removed. Signed-off-by: Christophe Leroy >>> >>> Reviewed-by: Guenter Roeck >>> --- drivers/watchdog/Kconfig | 4 - drivers/watchdog/Makefile | 1 - drivers/watchdog/mv64x60_wdt.c | 324 - include/linux/mv643xx.h| 8 - 4 files changed, 337 deletions(-) delete mode 100644 drivers/watchdog/mv64x60_wdt.c >> >> I assumed this would go via the watchdog tree, but seems like I >> misinterpreted. >> > > Wim didn't send a pull request this time around. > > Guenter > >> Should I take this via the powerpc tree for v5.14 ? I still don't see this in the watchdog tree, should I take it? cheers
Re: [PATCH] watchdog: Remove MV64x60 watchdog driver
On 5/17/21 4:17 AM, Michael Ellerman wrote: Guenter Roeck writes: On 3/18/21 10:25 AM, Christophe Leroy wrote: Commit 92c8c16f3457 ("powerpc/embedded6xx: Remove C2K board support") removed the last selector of CONFIG_MV64X60. Therefore CONFIG_MV64X60_WDT cannot be selected anymore and can be removed. Signed-off-by: Christophe Leroy Reviewed-by: Guenter Roeck --- drivers/watchdog/Kconfig | 4 - drivers/watchdog/Makefile | 1 - drivers/watchdog/mv64x60_wdt.c | 324 - include/linux/mv643xx.h| 8 - 4 files changed, 337 deletions(-) delete mode 100644 drivers/watchdog/mv64x60_wdt.c I assumed this would go via the watchdog tree, but seems like I misinterpreted. Wim didn't send a pull request this time around. Guenter Should I take this via the powerpc tree for v5.14 ? cheers
Re: [PATCH] watchdog: Remove MV64x60 watchdog driver
Guenter Roeck writes: > On 3/18/21 10:25 AM, Christophe Leroy wrote: >> Commit 92c8c16f3457 ("powerpc/embedded6xx: Remove C2K board support") >> removed the last selector of CONFIG_MV64X60. >> >> Therefore CONFIG_MV64X60_WDT cannot be selected anymore and >> can be removed. >> >> Signed-off-by: Christophe Leroy > > Reviewed-by: Guenter Roeck > >> --- >> drivers/watchdog/Kconfig | 4 - >> drivers/watchdog/Makefile | 1 - >> drivers/watchdog/mv64x60_wdt.c | 324 - >> include/linux/mv643xx.h| 8 - >> 4 files changed, 337 deletions(-) >> delete mode 100644 drivers/watchdog/mv64x60_wdt.c I assumed this would go via the watchdog tree, but seems like I misinterpreted. Should I take this via the powerpc tree for v5.14 ? cheers
Re: [PATCH] watchdog: Remove MV64x60 watchdog driver
On 3/18/21 10:25 AM, Christophe Leroy wrote: > Commit 92c8c16f3457 ("powerpc/embedded6xx: Remove C2K board support") > removed the last selector of CONFIG_MV64X60. > > Therefore CONFIG_MV64X60_WDT cannot be selected anymore and > can be removed. > > Signed-off-by: Christophe Leroy Reviewed-by: Guenter Roeck > --- > drivers/watchdog/Kconfig | 4 - > drivers/watchdog/Makefile | 1 - > drivers/watchdog/mv64x60_wdt.c | 324 - > include/linux/mv643xx.h| 8 - > 4 files changed, 337 deletions(-) > delete mode 100644 drivers/watchdog/mv64x60_wdt.c > > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig > index 1fe0042a48d2..178296bda151 100644 > --- a/drivers/watchdog/Kconfig > +++ b/drivers/watchdog/Kconfig > @@ -1831,10 +1831,6 @@ config 8xxx_WDT > > For BookE processors (MPC85xx) use the BOOKE_WDT driver instead. > > -config MV64X60_WDT > - tristate "MV64X60 (Marvell Discovery) Watchdog Timer" > - depends on MV64X60 || COMPILE_TEST > - > config PIKA_WDT > tristate "PIKA FPGA Watchdog" > depends on WARP || (PPC64 && COMPILE_TEST) > diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile > index f3a6540e725e..752c6513f731 100644 > --- a/drivers/watchdog/Makefile > +++ b/drivers/watchdog/Makefile > @@ -175,7 +175,6 @@ obj-$(CONFIG_PIC32_DMT) += pic32-dmt.o > # POWERPC Architecture > obj-$(CONFIG_GEF_WDT) += gef_wdt.o > obj-$(CONFIG_8xxx_WDT) += mpc8xxx_wdt.o > -obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o > obj-$(CONFIG_PIKA_WDT) += pika_wdt.o > obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o > obj-$(CONFIG_MEN_A21_WDT) += mena21_wdt.o > diff --git a/drivers/watchdog/mv64x60_wdt.c b/drivers/watchdog/mv64x60_wdt.c > deleted file mode 100644 > index 894aa63488d3.. > --- a/drivers/watchdog/mv64x60_wdt.c > +++ /dev/null > @@ -1,324 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0 > -/* > - * mv64x60_wdt.c - MV64X60 (Marvell Discovery) watchdog userspace interface > - * > - * Author: James Chapman > - * > - * Platform-specific setup code should configure the dog to generate > - * interrupt or reset as required. This code only enables/disables > - * and services the watchdog. > - * > - * Derived from mpc8xx_wdt.c, with the following copyright. > - * > - * 2002 (c) Florian Schirmer > - */ > - > -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > - > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > -#define MV64x60_WDT_WDC_OFFSET 0 > - > -/* > - * The watchdog configuration register contains a pair of 2-bit fields, > - * 1. a reload field, bits 27-26, which triggers a reload of > - * the countdown register, and > - * 2. an enable field, bits 25-24, which toggles between > - * enabling and disabling the watchdog timer. > - * Bit 31 is a read-only field which indicates whether the > - * watchdog timer is currently enabled. > - * > - * The low 24 bits contain the timer reload value. > - */ > -#define MV64x60_WDC_ENABLE_SHIFT 24 > -#define MV64x60_WDC_SERVICE_SHIFT26 > -#define MV64x60_WDC_ENABLED_SHIFT31 > - > -#define MV64x60_WDC_ENABLED_TRUE 1 > -#define MV64x60_WDC_ENABLED_FALSE0 > - > -/* Flags bits */ > -#define MV64x60_WDOG_FLAG_OPENED 0 > - > -static unsigned long wdt_flags; > -static int wdt_status; > -static void __iomem *mv64x60_wdt_regs; > -static int mv64x60_wdt_timeout; > -static int mv64x60_wdt_count; > -static unsigned int bus_clk; > -static char expect_close; > -static DEFINE_SPINLOCK(mv64x60_wdt_spinlock); > - > -static bool nowayout = WATCHDOG_NOWAYOUT; > -module_param(nowayout, bool, 0); > -MODULE_PARM_DESC(nowayout, > - "Watchdog cannot be stopped once started (default=" > - __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); > - > -static int mv64x60_wdt_toggle_wdc(int enabled_predicate, int field_shift) > -{ > - u32 data; > - u32 enabled; > - int ret = 0; > - > - spin_lock(_wdt_spinlock); > - data = readl(mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET); > - enabled = (data >> MV64x60_WDC_ENABLED_SHIFT) & 1; > - > - /* only toggle the requested field if enabled state matches predicate */ > - if ((enabled ^ enabled_predicate) == 0) { > - /* We write a 1, then a 2 -- to the appropriate field */ > - data = (1 << field_shift) | mv64x60_wdt_count; > - writel(data, mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET); > - > - data = (2 << field_shift) | mv64x60_wdt_count; > - writel(data, mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET); > - ret = 1; > - } > - spin_unlock(_wdt_spinlock); > - > - return ret; > -} > - > -static void mv64x60_wdt_service(void) > -{ > - mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_TRUE, > -MV64x60_WDC_SERVICE_SHIFT); > -} > - > -static void mv64x60_wdt_handler_enable(void) >
[PATCH] watchdog: Remove MV64x60 watchdog driver
Commit 92c8c16f3457 ("powerpc/embedded6xx: Remove C2K board support") removed the last selector of CONFIG_MV64X60. Therefore CONFIG_MV64X60_WDT cannot be selected anymore and can be removed. Signed-off-by: Christophe Leroy --- drivers/watchdog/Kconfig | 4 - drivers/watchdog/Makefile | 1 - drivers/watchdog/mv64x60_wdt.c | 324 - include/linux/mv643xx.h| 8 - 4 files changed, 337 deletions(-) delete mode 100644 drivers/watchdog/mv64x60_wdt.c diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 1fe0042a48d2..178296bda151 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -1831,10 +1831,6 @@ config 8xxx_WDT For BookE processors (MPC85xx) use the BOOKE_WDT driver instead. -config MV64X60_WDT - tristate "MV64X60 (Marvell Discovery) Watchdog Timer" - depends on MV64X60 || COMPILE_TEST - config PIKA_WDT tristate "PIKA FPGA Watchdog" depends on WARP || (PPC64 && COMPILE_TEST) diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index f3a6540e725e..752c6513f731 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile @@ -175,7 +175,6 @@ obj-$(CONFIG_PIC32_DMT) += pic32-dmt.o # POWERPC Architecture obj-$(CONFIG_GEF_WDT) += gef_wdt.o obj-$(CONFIG_8xxx_WDT) += mpc8xxx_wdt.o -obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o obj-$(CONFIG_PIKA_WDT) += pika_wdt.o obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o obj-$(CONFIG_MEN_A21_WDT) += mena21_wdt.o diff --git a/drivers/watchdog/mv64x60_wdt.c b/drivers/watchdog/mv64x60_wdt.c deleted file mode 100644 index 894aa63488d3.. --- a/drivers/watchdog/mv64x60_wdt.c +++ /dev/null @@ -1,324 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * mv64x60_wdt.c - MV64X60 (Marvell Discovery) watchdog userspace interface - * - * Author: James Chapman - * - * Platform-specific setup code should configure the dog to generate - * interrupt or reset as required. This code only enables/disables - * and services the watchdog. - * - * Derived from mpc8xx_wdt.c, with the following copyright. - * - * 2002 (c) Florian Schirmer - */ - -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MV64x60_WDT_WDC_OFFSET 0 - -/* - * The watchdog configuration register contains a pair of 2-bit fields, - * 1. a reload field, bits 27-26, which triggers a reload of - * the countdown register, and - * 2. an enable field, bits 25-24, which toggles between - * enabling and disabling the watchdog timer. - * Bit 31 is a read-only field which indicates whether the - * watchdog timer is currently enabled. - * - * The low 24 bits contain the timer reload value. - */ -#define MV64x60_WDC_ENABLE_SHIFT 24 -#define MV64x60_WDC_SERVICE_SHIFT 26 -#define MV64x60_WDC_ENABLED_SHIFT 31 - -#define MV64x60_WDC_ENABLED_TRUE 1 -#define MV64x60_WDC_ENABLED_FALSE 0 - -/* Flags bits */ -#define MV64x60_WDOG_FLAG_OPENED 0 - -static unsigned long wdt_flags; -static int wdt_status; -static void __iomem *mv64x60_wdt_regs; -static int mv64x60_wdt_timeout; -static int mv64x60_wdt_count; -static unsigned int bus_clk; -static char expect_close; -static DEFINE_SPINLOCK(mv64x60_wdt_spinlock); - -static bool nowayout = WATCHDOG_NOWAYOUT; -module_param(nowayout, bool, 0); -MODULE_PARM_DESC(nowayout, - "Watchdog cannot be stopped once started (default=" - __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); - -static int mv64x60_wdt_toggle_wdc(int enabled_predicate, int field_shift) -{ - u32 data; - u32 enabled; - int ret = 0; - - spin_lock(_wdt_spinlock); - data = readl(mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET); - enabled = (data >> MV64x60_WDC_ENABLED_SHIFT) & 1; - - /* only toggle the requested field if enabled state matches predicate */ - if ((enabled ^ enabled_predicate) == 0) { - /* We write a 1, then a 2 -- to the appropriate field */ - data = (1 << field_shift) | mv64x60_wdt_count; - writel(data, mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET); - - data = (2 << field_shift) | mv64x60_wdt_count; - writel(data, mv64x60_wdt_regs + MV64x60_WDT_WDC_OFFSET); - ret = 1; - } - spin_unlock(_wdt_spinlock); - - return ret; -} - -static void mv64x60_wdt_service(void) -{ - mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_TRUE, - MV64x60_WDC_SERVICE_SHIFT); -} - -static void mv64x60_wdt_handler_enable(void) -{ - if (mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_FALSE, - MV64x60_WDC_ENABLE_SHIFT)) { - mv64x60_wdt_service(); - pr_notice("watchdog activated\n"); - } -} - -static void mv64x60_wdt_handler_disable(void) -{ - if