Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/3] watchdog: jz4740: Driver update
@ 2019-08-09 11:59 Paul Cercueil
  2019-08-09 11:59 ` [PATCH 1/3] watchdog: jz4740: Use WDT clock provided by TCU driver Paul Cercueil
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Paul Cercueil @ 2019-08-09 11:59 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck; +Cc: od, linux-watchdog, linux-kernel

Hi,

This patchset comes from a bigger patchset that was cut in smaller
pieces for easier integration to mainline.
(The patchset was https://lkml.org/lkml/2019/3/27/1837)

The reviews were kept since the code mostly didn't change. The exception
is the use of device_node_to_regmap() in patch 2/3. This function was
added in a prior patch, now merged in the MIPS tree.

For that reason this patchset is based on the ingenic-tcu-v5.4 branch of
the MIPS tree
(git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git).

Thanks,
-Paul



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/3] watchdog: jz4740: Use WDT clock provided by TCU driver
  2019-08-09 11:59 [PATCH 0/3] watchdog: jz4740: Driver update Paul Cercueil
@ 2019-08-09 11:59 ` Paul Cercueil
  2019-08-09 17:58   ` Guenter Roeck
  2019-08-09 11:59 ` [PATCH 2/3] watchdog: jz4740: Use regmap " Paul Cercueil
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Paul Cercueil @ 2019-08-09 11:59 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck
  Cc: od, linux-watchdog, linux-kernel, Paul Cercueil,
	Mathieu Malaterre, Artur Rojek

Instead of requesting the "ext" clock and handling the watchdog clock
divider and gating in the watchdog driver, we now request and use the
"wdt" clock that is supplied by the ingenic-timer "TCU" driver.

The major benefit is that the watchdog's clock rate and parent can now
be specified from within devicetree, instead of hardcoded in the driver.

Also, this driver won't poke anymore into the TCU registers to
enable/disable the clock, as this is now handled by the TCU driver.

On the bad side, we break the ABI with devicetree - as we now request a
different clock. In this very specific case it is still okay, as every
Ingenic JZ47xx-based board out there compile the devicetree within the
kernel; so it's still time to push breaking changes, in order to get a
clean devicetree that won't break once it musn't.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Mathieu Malaterre <malat@debian.org>
Tested-by: Artur Rojek <contact@artur-rojek.eu>
---
 drivers/watchdog/Kconfig      |  1 +
 drivers/watchdog/jz4740_wdt.c | 75 ++++++++++++++---------------------
 2 files changed, 31 insertions(+), 45 deletions(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 8188963a405b..820d8a472310 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1645,6 +1645,7 @@ config INDYDOG
 config JZ4740_WDT
 	tristate "Ingenic jz4740 SoC hardware watchdog"
 	depends on MACH_JZ4740 || MACH_JZ4780
+	depends on COMMON_CLK
 	select WATCHDOG_CORE
 	help
 	  Hardware driver for the built-in watchdog timer on Ingenic jz4740 SoCs.
diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c
index d4a90916dd38..07fbd9d96e84 100644
--- a/drivers/watchdog/jz4740_wdt.c
+++ b/drivers/watchdog/jz4740_wdt.c
@@ -18,19 +18,6 @@
 #include <linux/err.h>
 #include <linux/of.h>
 
-#include <asm/mach-jz4740/timer.h>
-
-#define JZ_WDT_CLOCK_PCLK 0x1
-#define JZ_WDT_CLOCK_RTC  0x2
-#define JZ_WDT_CLOCK_EXT  0x4
-
-#define JZ_WDT_CLOCK_DIV_1    (0 << TCU_TCSR_PRESCALE_LSB)
-#define JZ_WDT_CLOCK_DIV_4    (1 << TCU_TCSR_PRESCALE_LSB)
-#define JZ_WDT_CLOCK_DIV_16   (2 << TCU_TCSR_PRESCALE_LSB)
-#define JZ_WDT_CLOCK_DIV_64   (3 << TCU_TCSR_PRESCALE_LSB)
-#define JZ_WDT_CLOCK_DIV_256  (4 << TCU_TCSR_PRESCALE_LSB)
-#define JZ_WDT_CLOCK_DIV_1024 (5 << TCU_TCSR_PRESCALE_LSB)
-
 #define DEFAULT_HEARTBEAT 5
 #define MAX_HEARTBEAT     2048
 
@@ -50,7 +37,8 @@ MODULE_PARM_DESC(heartbeat,
 struct jz4740_wdt_drvdata {
 	struct watchdog_device wdt;
 	void __iomem *base;
-	struct clk *rtc_clk;
+	struct clk *clk;
+	unsigned long clk_rate;
 };
 
 static int jz4740_wdt_ping(struct watchdog_device *wdt_dev)
@@ -65,32 +53,14 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
 				    unsigned int new_timeout)
 {
 	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
-	unsigned int rtc_clk_rate;
-	unsigned int timeout_value;
-	unsigned short clock_div = JZ_WDT_CLOCK_DIV_1;
+	u16 timeout_value = (u16)(drvdata->clk_rate * new_timeout);
 	u8 tcer;
 
-	rtc_clk_rate = clk_get_rate(drvdata->rtc_clk);
-
-	timeout_value = rtc_clk_rate * new_timeout;
-	while (timeout_value > 0xffff) {
-		if (clock_div == JZ_WDT_CLOCK_DIV_1024) {
-			/* Requested timeout too high;
-			* use highest possible value. */
-			timeout_value = 0xffff;
-			break;
-		}
-		timeout_value >>= 2;
-		clock_div += (1 << TCU_TCSR_PRESCALE_LSB);
-	}
-
 	tcer = readb(drvdata->base + TCU_REG_WDT_TCER);
 	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
-	writew(clock_div, drvdata->base + TCU_REG_WDT_TCSR);
 
 	writew((u16)timeout_value, drvdata->base + TCU_REG_WDT_TDR);
 	writew(0x0, drvdata->base + TCU_REG_WDT_TCNT);
-	writew(clock_div | JZ_WDT_CLOCK_RTC, drvdata->base + TCU_REG_WDT_TCSR);
 
 	if (tcer & TCU_WDT_TCER_TCEN)
 		writeb(TCU_WDT_TCER_TCEN, drvdata->base + TCU_REG_WDT_TCER);
@@ -102,11 +72,15 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
 static int jz4740_wdt_start(struct watchdog_device *wdt_dev)
 {
 	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
+	int ret;
 	u8 tcer;
 
+	ret = clk_prepare_enable(drvdata->clk);
+	if (ret)
+		return ret;
+
 	tcer = readb(drvdata->base + TCU_REG_WDT_TCER);
 
-	jz4740_timer_enable_watchdog();
 	jz4740_wdt_set_timeout(wdt_dev, wdt_dev->timeout);
 
 	/* Start watchdog if it wasn't started already */
@@ -121,7 +95,7 @@ static int jz4740_wdt_stop(struct watchdog_device *wdt_dev)
 	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
 
 	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
-	jz4740_timer_disable_watchdog();
+	clk_disable_unprepare(drvdata->clk);
 
 	return 0;
 }
@@ -162,6 +136,8 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct jz4740_wdt_drvdata *drvdata;
 	struct watchdog_device *jz4740_wdt;
+	struct resource	*res;
+	long rate;
 	int ret;
 
 	drvdata = devm_kzalloc(dev, sizeof(struct jz4740_wdt_drvdata),
@@ -169,15 +145,30 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
 	if (!drvdata)
 		return -ENOMEM;
 
-	if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT)
-		heartbeat = DEFAULT_HEARTBEAT;
+	drvdata->clk = devm_clk_get(&pdev->dev, "wdt");
+	if (IS_ERR(drvdata->clk)) {
+		dev_err(&pdev->dev, "cannot find WDT clock\n");
+		return PTR_ERR(drvdata->clk);
+	}
+
+	/* Set smallest clock possible */
+	rate = clk_round_rate(drvdata->clk, 1);
+	if (rate < 0)
+		return rate;
 
+	ret = clk_set_rate(drvdata->clk, rate);
+	if (ret)
+		return ret;
+
+	drvdata->clk_rate = rate;
 	jz4740_wdt = &drvdata->wdt;
 	jz4740_wdt->info = &jz4740_wdt_info;
 	jz4740_wdt->ops = &jz4740_wdt_ops;
-	jz4740_wdt->timeout = heartbeat;
 	jz4740_wdt->min_timeout = 1;
-	jz4740_wdt->max_timeout = MAX_HEARTBEAT;
+	jz4740_wdt->max_timeout = 0xffff / rate;
+	jz4740_wdt->timeout = clamp(heartbeat,
+				    jz4740_wdt->min_timeout,
+				    jz4740_wdt->max_timeout);
 	jz4740_wdt->parent = dev;
 	watchdog_set_nowayout(jz4740_wdt, nowayout);
 	watchdog_set_drvdata(jz4740_wdt, drvdata);
@@ -186,12 +177,6 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
 	if (IS_ERR(drvdata->base))
 		return PTR_ERR(drvdata->base);
 
-	drvdata->rtc_clk = devm_clk_get(dev, "rtc");
-	if (IS_ERR(drvdata->rtc_clk)) {
-		dev_err(dev, "cannot find RTC clock\n");
-		return PTR_ERR(drvdata->rtc_clk);
-	}
-
 	return devm_watchdog_register_device(dev, &drvdata->wdt);
 }
 
-- 
2.21.0.593.g511ec345e18


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/3] watchdog: jz4740: Use regmap provided by TCU driver
  2019-08-09 11:59 [PATCH 0/3] watchdog: jz4740: Driver update Paul Cercueil
  2019-08-09 11:59 ` [PATCH 1/3] watchdog: jz4740: Use WDT clock provided by TCU driver Paul Cercueil
@ 2019-08-09 11:59 ` " Paul Cercueil
  2019-08-09 17:58   ` Guenter Roeck
  2019-08-09 11:59 ` [PATCH 3/3] watchdog: jz4740: Drop dependency on MACH_JZ47xx Paul Cercueil
  2019-08-09 16:52 ` [PATCH 0/3] watchdog: jz4740: Driver update Guenter Roeck
  3 siblings, 1 reply; 12+ messages in thread
From: Paul Cercueil @ 2019-08-09 11:59 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck
  Cc: od, linux-watchdog, linux-kernel, Paul Cercueil,
	Mathieu Malaterre, Artur Rojek

Since we broke the ABI by changing the clock, the driver was also
updated to use the regmap provided by the TCU driver.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Mathieu Malaterre <malat@debian.org>
Tested-by: Artur Rojek <contact@artur-rojek.eu>
---
 drivers/watchdog/Kconfig      |  1 +
 drivers/watchdog/jz4740_wdt.c | 36 +++++++++++++++++++----------------
 2 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 820d8a472310..78411609048b 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1647,6 +1647,7 @@ config JZ4740_WDT
 	depends on MACH_JZ4740 || MACH_JZ4780
 	depends on COMMON_CLK
 	select WATCHDOG_CORE
+	select MFD_SYSCON
 	help
 	  Hardware driver for the built-in watchdog timer on Ingenic jz4740 SoCs.
 
diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c
index 07fbd9d96e84..bdf9564efa29 100644
--- a/drivers/watchdog/jz4740_wdt.c
+++ b/drivers/watchdog/jz4740_wdt.c
@@ -5,6 +5,7 @@
  */
 
 #include <linux/mfd/ingenic-tcu.h>
+#include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
@@ -17,6 +18,7 @@
 #include <linux/slab.h>
 #include <linux/err.h>
 #include <linux/of.h>
+#include <linux/regmap.h>
 
 #define DEFAULT_HEARTBEAT 5
 #define MAX_HEARTBEAT     2048
@@ -36,7 +38,7 @@ MODULE_PARM_DESC(heartbeat,
 
 struct jz4740_wdt_drvdata {
 	struct watchdog_device wdt;
-	void __iomem *base;
+	struct regmap *map;
 	struct clk *clk;
 	unsigned long clk_rate;
 };
@@ -45,7 +47,8 @@ static int jz4740_wdt_ping(struct watchdog_device *wdt_dev)
 {
 	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
 
-	writew(0x0, drvdata->base + TCU_REG_WDT_TCNT);
+	regmap_write(drvdata->map, TCU_REG_WDT_TCNT, 0);
+
 	return 0;
 }
 
@@ -54,16 +57,16 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
 {
 	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
 	u16 timeout_value = (u16)(drvdata->clk_rate * new_timeout);
-	u8 tcer;
+	unsigned int tcer;
 
-	tcer = readb(drvdata->base + TCU_REG_WDT_TCER);
-	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
+	regmap_read(drvdata->map, TCU_REG_WDT_TCER, &tcer);
+	regmap_write(drvdata->map, TCU_REG_WDT_TCER, 0);
 
-	writew((u16)timeout_value, drvdata->base + TCU_REG_WDT_TDR);
-	writew(0x0, drvdata->base + TCU_REG_WDT_TCNT);
+	regmap_write(drvdata->map, TCU_REG_WDT_TDR, timeout_value);
+	regmap_write(drvdata->map, TCU_REG_WDT_TCNT, 0);
 
 	if (tcer & TCU_WDT_TCER_TCEN)
-		writeb(TCU_WDT_TCER_TCEN, drvdata->base + TCU_REG_WDT_TCER);
+		regmap_write(drvdata->map, TCU_REG_WDT_TCER, TCU_WDT_TCER_TCEN);
 
 	wdt_dev->timeout = new_timeout;
 	return 0;
@@ -72,20 +75,20 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
 static int jz4740_wdt_start(struct watchdog_device *wdt_dev)
 {
 	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
+	unsigned int tcer;
 	int ret;
-	u8 tcer;
 
 	ret = clk_prepare_enable(drvdata->clk);
 	if (ret)
 		return ret;
 
-	tcer = readb(drvdata->base + TCU_REG_WDT_TCER);
+	regmap_read(drvdata->map, TCU_REG_WDT_TCER, &tcer);
 
 	jz4740_wdt_set_timeout(wdt_dev, wdt_dev->timeout);
 
 	/* Start watchdog if it wasn't started already */
 	if (!(tcer & TCU_WDT_TCER_TCEN))
-		writeb(TCU_WDT_TCER_TCEN, drvdata->base + TCU_REG_WDT_TCER);
+		regmap_write(drvdata->map, TCU_REG_WDT_TCER, TCU_WDT_TCER_TCEN);
 
 	return 0;
 }
@@ -94,7 +97,7 @@ static int jz4740_wdt_stop(struct watchdog_device *wdt_dev)
 {
 	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
 
-	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
+	regmap_write(drvdata->map, TCU_REG_WDT_TCER, 0);
 	clk_disable_unprepare(drvdata->clk);
 
 	return 0;
@@ -136,7 +139,6 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct jz4740_wdt_drvdata *drvdata;
 	struct watchdog_device *jz4740_wdt;
-	struct resource	*res;
 	long rate;
 	int ret;
 
@@ -173,9 +175,11 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
 	watchdog_set_nowayout(jz4740_wdt, nowayout);
 	watchdog_set_drvdata(jz4740_wdt, drvdata);
 
-	drvdata->base = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(drvdata->base))
-		return PTR_ERR(drvdata->base);
+	drvdata->map = device_node_to_regmap(dev->parent->of_node);
+	if (!drvdata->map) {
+		dev_err(dev, "regmap not found\n");
+		return -EINVAL;
+	}
 
 	return devm_watchdog_register_device(dev, &drvdata->wdt);
 }
-- 
2.21.0.593.g511ec345e18


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 3/3] watchdog: jz4740: Drop dependency on MACH_JZ47xx
  2019-08-09 11:59 [PATCH 0/3] watchdog: jz4740: Driver update Paul Cercueil
  2019-08-09 11:59 ` [PATCH 1/3] watchdog: jz4740: Use WDT clock provided by TCU driver Paul Cercueil
  2019-08-09 11:59 ` [PATCH 2/3] watchdog: jz4740: Use regmap " Paul Cercueil
@ 2019-08-09 11:59 ` Paul Cercueil
  2019-08-09 17:59   ` Guenter Roeck
  2019-08-09 16:52 ` [PATCH 0/3] watchdog: jz4740: Driver update Guenter Roeck
  3 siblings, 1 reply; 12+ messages in thread
From: Paul Cercueil @ 2019-08-09 11:59 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck
  Cc: od, linux-watchdog, linux-kernel, Paul Cercueil

Depending on MACH_JZ47xx prevent us from creating a generic kernel that
works on more than one MIPS board. Instead, we just depend on MIPS being
set.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/watchdog/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 78411609048b..90e689cbeed3 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1644,7 +1644,7 @@ config INDYDOG
 
 config JZ4740_WDT
 	tristate "Ingenic jz4740 SoC hardware watchdog"
-	depends on MACH_JZ4740 || MACH_JZ4780
+	depends on MIPS
 	depends on COMMON_CLK
 	select WATCHDOG_CORE
 	select MFD_SYSCON
-- 
2.21.0.593.g511ec345e18


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] watchdog: jz4740: Driver update
  2019-08-09 11:59 [PATCH 0/3] watchdog: jz4740: Driver update Paul Cercueil
                   ` (2 preceding siblings ...)
  2019-08-09 11:59 ` [PATCH 3/3] watchdog: jz4740: Drop dependency on MACH_JZ47xx Paul Cercueil
@ 2019-08-09 16:52 ` Guenter Roeck
  2019-08-09 16:55   ` Paul Cercueil
  3 siblings, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2019-08-09 16:52 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wim Van Sebroeck, od, linux-watchdog, linux-kernel

On Fri, Aug 09, 2019 at 01:59:27PM +0200, Paul Cercueil wrote:
> Hi,
> 
> This patchset comes from a bigger patchset that was cut in smaller
> pieces for easier integration to mainline.
> (The patchset was https://lkml.org/lkml/2019/3/27/1837)
> 
> The reviews were kept since the code mostly didn't change. The exception
> is the use of device_node_to_regmap() in patch 2/3. This function was
> added in a prior patch, now merged in the MIPS tree.
> 
> For that reason this patchset is based on the ingenic-tcu-v5.4 branch of
> the MIPS tree
> (git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git).
> 

What is the expectation here ? Should the series be sent upstream
through the watchdog tree, or through some other tree ?

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] watchdog: jz4740: Driver update
  2019-08-09 16:52 ` [PATCH 0/3] watchdog: jz4740: Driver update Guenter Roeck
@ 2019-08-09 16:55   ` Paul Cercueil
  2019-08-09 17:29     ` Guenter Roeck
  0 siblings, 1 reply; 12+ messages in thread
From: Paul Cercueil @ 2019-08-09 16:55 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Wim Van Sebroeck, od, linux-watchdog, linux-kernel

Hi Guenter,


Le ven. 9 août 2019 à 18:52, Guenter Roeck <linux@roeck-us.net> a 
écrit :
> On Fri, Aug 09, 2019 at 01:59:27PM +0200, Paul Cercueil wrote:
>>  Hi,
>> 
>>  This patchset comes from a bigger patchset that was cut in smaller
>>  pieces for easier integration to mainline.
>>  (The patchset was https://lkml.org/lkml/2019/3/27/1837)
>> 
>>  The reviews were kept since the code mostly didn't change. The 
>> exception
>>  is the use of device_node_to_regmap() in patch 2/3. This function 
>> was
>>  added in a prior patch, now merged in the MIPS tree.
>> 
>>  For that reason this patchset is based on the ingenic-tcu-v5.4 
>> branch of
>>  the MIPS tree
>>  (git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git).
>> 
> 
> What is the expectation here ? Should the series be sent upstream
> through the watchdog tree, or through some other tree ?

You can get it through the watchdog tree if you merge the 
ingenic-tcu-v5.4
branch from the MIPS tree. If you'd rather not do that, I can get it 
merged
through the MIPS tree.

Thanks,
-Paul



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] watchdog: jz4740: Driver update
  2019-08-09 16:55   ` Paul Cercueil
@ 2019-08-09 17:29     ` Guenter Roeck
  2019-08-09 17:34       ` Paul Cercueil
  0 siblings, 1 reply; 12+ messages in thread
From: Guenter Roeck @ 2019-08-09 17:29 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wim Van Sebroeck, od, linux-watchdog, linux-kernel

On Fri, Aug 09, 2019 at 06:55:26PM +0200, Paul Cercueil wrote:
> Hi Guenter,
> 
> 
> Le ven. 9 août 2019 à 18:52, Guenter Roeck <linux@roeck-us.net> a écrit :
> >On Fri, Aug 09, 2019 at 01:59:27PM +0200, Paul Cercueil wrote:
> >> Hi,
> >>
> >> This patchset comes from a bigger patchset that was cut in smaller
> >> pieces for easier integration to mainline.
> >> (The patchset was https://lkml.org/lkml/2019/3/27/1837)
> >>
> >> The reviews were kept since the code mostly didn't change. The
> >>exception
> >> is the use of device_node_to_regmap() in patch 2/3. This function was
> >> added in a prior patch, now merged in the MIPS tree.
> >>
> >> For that reason this patchset is based on the ingenic-tcu-v5.4 branch
> >>of
> >> the MIPS tree
> >> (git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git).
> >>
> >
> >What is the expectation here ? Should the series be sent upstream
> >through the watchdog tree, or through some other tree ?
> 
> You can get it through the watchdog tree if you merge the ingenic-tcu-v5.4
> branch from the MIPS tree. If you'd rather not do that, I can get it merged
> through the MIPS tree.
> 
I would prefer a merge through the mips tree.

Guenter

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] watchdog: jz4740: Driver update
  2019-08-09 17:29     ` Guenter Roeck
@ 2019-08-09 17:34       ` Paul Cercueil
  2019-08-09 17:57         ` Guenter Roeck
  0 siblings, 1 reply; 12+ messages in thread
From: Paul Cercueil @ 2019-08-09 17:34 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Wim Van Sebroeck, od, linux-watchdog, linux-kernel



Le ven. 9 août 2019 à 19:29, Guenter Roeck <linux@roeck-us.net> a 
écrit :
> On Fri, Aug 09, 2019 at 06:55:26PM +0200, Paul Cercueil wrote:
>>  Hi Guenter,
>> 
>> 
>>  Le ven. 9 août 2019 à 18:52, Guenter Roeck <linux@roeck-us.net> a 
>> écrit :
>>  >On Fri, Aug 09, 2019 at 01:59:27PM +0200, Paul Cercueil wrote:
>>  >> Hi,
>>  >>
>>  >> This patchset comes from a bigger patchset that was cut in 
>> smaller
>>  >> pieces for easier integration to mainline.
>>  >> (The patchset was https://lkml.org/lkml/2019/3/27/1837)
>>  >>
>>  >> The reviews were kept since the code mostly didn't change. The
>>  >>exception
>>  >> is the use of device_node_to_regmap() in patch 2/3. This 
>> function was
>>  >> added in a prior patch, now merged in the MIPS tree.
>>  >>
>>  >> For that reason this patchset is based on the ingenic-tcu-v5.4 
>> branch
>>  >>of
>>  >> the MIPS tree
>>  >> (git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git).
>>  >>
>>  >
>>  >What is the expectation here ? Should the series be sent upstream
>>  >through the watchdog tree, or through some other tree ?
>> 
>>  You can get it through the watchdog tree if you merge the 
>> ingenic-tcu-v5.4
>>  branch from the MIPS tree. If you'd rather not do that, I can get 
>> it merged
>>  through the MIPS tree.
>> 
> I would prefer a merge through the mips tree.
> 
> Guenter

Ok; Can I get some signatures then? ;)

Thanks,
-Paul



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/3] watchdog: jz4740: Driver update
  2019-08-09 17:34       ` Paul Cercueil
@ 2019-08-09 17:57         ` Guenter Roeck
  0 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2019-08-09 17:57 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wim Van Sebroeck, od, linux-watchdog, linux-kernel

On Fri, Aug 09, 2019 at 07:34:49PM +0200, Paul Cercueil wrote:
> 
> 
> Le ven. 9 août 2019 à 19:29, Guenter Roeck <linux@roeck-us.net> a écrit :
> >On Fri, Aug 09, 2019 at 06:55:26PM +0200, Paul Cercueil wrote:
> >> Hi Guenter,
> >>
> >>
> >> Le ven. 9 août 2019 à 18:52, Guenter Roeck <linux@roeck-us.net> a écrit
> >>:
> >> >On Fri, Aug 09, 2019 at 01:59:27PM +0200, Paul Cercueil wrote:
> >> >> Hi,
> >> >>
> >> >> This patchset comes from a bigger patchset that was cut in smaller
> >> >> pieces for easier integration to mainline.
> >> >> (The patchset was https://lkml.org/lkml/2019/3/27/1837)
> >> >>
> >> >> The reviews were kept since the code mostly didn't change. The
> >> >>exception
> >> >> is the use of device_node_to_regmap() in patch 2/3. This function
> >>was
> >> >> added in a prior patch, now merged in the MIPS tree.
> >> >>
> >> >> For that reason this patchset is based on the ingenic-tcu-v5.4
> >>branch
> >> >>of
> >> >> the MIPS tree
> >> >> (git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git).
> >> >>
> >> >
> >> >What is the expectation here ? Should the series be sent upstream
> >> >through the watchdog tree, or through some other tree ?
> >>
> >> You can get it through the watchdog tree if you merge the
> >>ingenic-tcu-v5.4
> >> branch from the MIPS tree. If you'd rather not do that, I can get it
> >>merged
> >> through the MIPS tree.
> >>
> >I would prefer a merge through the mips tree.
> >
> >Guenter
> 
> Ok; Can I get some signatures then? ;)
> 

They are already tagged with my Reviewed-by:. Do you want an Acked-by:
as well ? Sure, no problem.

Guenter

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] watchdog: jz4740: Use WDT clock provided by TCU driver
  2019-08-09 11:59 ` [PATCH 1/3] watchdog: jz4740: Use WDT clock provided by TCU driver Paul Cercueil
@ 2019-08-09 17:58   ` Guenter Roeck
  0 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2019-08-09 17:58 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wim Van Sebroeck, od, linux-watchdog, linux-kernel,
	Mathieu Malaterre, Artur Rojek

On Fri, Aug 09, 2019 at 01:59:28PM +0200, Paul Cercueil wrote:
> Instead of requesting the "ext" clock and handling the watchdog clock
> divider and gating in the watchdog driver, we now request and use the
> "wdt" clock that is supplied by the ingenic-timer "TCU" driver.
> 
> The major benefit is that the watchdog's clock rate and parent can now
> be specified from within devicetree, instead of hardcoded in the driver.
> 
> Also, this driver won't poke anymore into the TCU registers to
> enable/disable the clock, as this is now handled by the TCU driver.
> 
> On the bad side, we break the ABI with devicetree - as we now request a
> different clock. In this very specific case it is still okay, as every
> Ingenic JZ47xx-based board out there compile the devicetree within the
> kernel; so it's still time to push breaking changes, in order to get a
> clean devicetree that won't break once it musn't.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Tested-by: Mathieu Malaterre <malat@debian.org>
> Tested-by: Artur Rojek <contact@artur-rojek.eu>

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/Kconfig      |  1 +
>  drivers/watchdog/jz4740_wdt.c | 75 ++++++++++++++---------------------
>  2 files changed, 31 insertions(+), 45 deletions(-)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 8188963a405b..820d8a472310 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1645,6 +1645,7 @@ config INDYDOG
>  config JZ4740_WDT
>  	tristate "Ingenic jz4740 SoC hardware watchdog"
>  	depends on MACH_JZ4740 || MACH_JZ4780
> +	depends on COMMON_CLK
>  	select WATCHDOG_CORE
>  	help
>  	  Hardware driver for the built-in watchdog timer on Ingenic jz4740 SoCs.
> diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c
> index d4a90916dd38..07fbd9d96e84 100644
> --- a/drivers/watchdog/jz4740_wdt.c
> +++ b/drivers/watchdog/jz4740_wdt.c
> @@ -18,19 +18,6 @@
>  #include <linux/err.h>
>  #include <linux/of.h>
>  
> -#include <asm/mach-jz4740/timer.h>
> -
> -#define JZ_WDT_CLOCK_PCLK 0x1
> -#define JZ_WDT_CLOCK_RTC  0x2
> -#define JZ_WDT_CLOCK_EXT  0x4
> -
> -#define JZ_WDT_CLOCK_DIV_1    (0 << TCU_TCSR_PRESCALE_LSB)
> -#define JZ_WDT_CLOCK_DIV_4    (1 << TCU_TCSR_PRESCALE_LSB)
> -#define JZ_WDT_CLOCK_DIV_16   (2 << TCU_TCSR_PRESCALE_LSB)
> -#define JZ_WDT_CLOCK_DIV_64   (3 << TCU_TCSR_PRESCALE_LSB)
> -#define JZ_WDT_CLOCK_DIV_256  (4 << TCU_TCSR_PRESCALE_LSB)
> -#define JZ_WDT_CLOCK_DIV_1024 (5 << TCU_TCSR_PRESCALE_LSB)
> -
>  #define DEFAULT_HEARTBEAT 5
>  #define MAX_HEARTBEAT     2048
>  
> @@ -50,7 +37,8 @@ MODULE_PARM_DESC(heartbeat,
>  struct jz4740_wdt_drvdata {
>  	struct watchdog_device wdt;
>  	void __iomem *base;
> -	struct clk *rtc_clk;
> +	struct clk *clk;
> +	unsigned long clk_rate;
>  };
>  
>  static int jz4740_wdt_ping(struct watchdog_device *wdt_dev)
> @@ -65,32 +53,14 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
>  				    unsigned int new_timeout)
>  {
>  	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
> -	unsigned int rtc_clk_rate;
> -	unsigned int timeout_value;
> -	unsigned short clock_div = JZ_WDT_CLOCK_DIV_1;
> +	u16 timeout_value = (u16)(drvdata->clk_rate * new_timeout);
>  	u8 tcer;
>  
> -	rtc_clk_rate = clk_get_rate(drvdata->rtc_clk);
> -
> -	timeout_value = rtc_clk_rate * new_timeout;
> -	while (timeout_value > 0xffff) {
> -		if (clock_div == JZ_WDT_CLOCK_DIV_1024) {
> -			/* Requested timeout too high;
> -			* use highest possible value. */
> -			timeout_value = 0xffff;
> -			break;
> -		}
> -		timeout_value >>= 2;
> -		clock_div += (1 << TCU_TCSR_PRESCALE_LSB);
> -	}
> -
>  	tcer = readb(drvdata->base + TCU_REG_WDT_TCER);
>  	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
> -	writew(clock_div, drvdata->base + TCU_REG_WDT_TCSR);
>  
>  	writew((u16)timeout_value, drvdata->base + TCU_REG_WDT_TDR);
>  	writew(0x0, drvdata->base + TCU_REG_WDT_TCNT);
> -	writew(clock_div | JZ_WDT_CLOCK_RTC, drvdata->base + TCU_REG_WDT_TCSR);
>  
>  	if (tcer & TCU_WDT_TCER_TCEN)
>  		writeb(TCU_WDT_TCER_TCEN, drvdata->base + TCU_REG_WDT_TCER);
> @@ -102,11 +72,15 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
>  static int jz4740_wdt_start(struct watchdog_device *wdt_dev)
>  {
>  	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
> +	int ret;
>  	u8 tcer;
>  
> +	ret = clk_prepare_enable(drvdata->clk);
> +	if (ret)
> +		return ret;
> +
>  	tcer = readb(drvdata->base + TCU_REG_WDT_TCER);
>  
> -	jz4740_timer_enable_watchdog();
>  	jz4740_wdt_set_timeout(wdt_dev, wdt_dev->timeout);
>  
>  	/* Start watchdog if it wasn't started already */
> @@ -121,7 +95,7 @@ static int jz4740_wdt_stop(struct watchdog_device *wdt_dev)
>  	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
>  
>  	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
> -	jz4740_timer_disable_watchdog();
> +	clk_disable_unprepare(drvdata->clk);
>  
>  	return 0;
>  }
> @@ -162,6 +136,8 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct jz4740_wdt_drvdata *drvdata;
>  	struct watchdog_device *jz4740_wdt;
> +	struct resource	*res;
> +	long rate;
>  	int ret;
>  
>  	drvdata = devm_kzalloc(dev, sizeof(struct jz4740_wdt_drvdata),
> @@ -169,15 +145,30 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
>  	if (!drvdata)
>  		return -ENOMEM;
>  
> -	if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT)
> -		heartbeat = DEFAULT_HEARTBEAT;
> +	drvdata->clk = devm_clk_get(&pdev->dev, "wdt");
> +	if (IS_ERR(drvdata->clk)) {
> +		dev_err(&pdev->dev, "cannot find WDT clock\n");
> +		return PTR_ERR(drvdata->clk);
> +	}
> +
> +	/* Set smallest clock possible */
> +	rate = clk_round_rate(drvdata->clk, 1);
> +	if (rate < 0)
> +		return rate;
>  
> +	ret = clk_set_rate(drvdata->clk, rate);
> +	if (ret)
> +		return ret;
> +
> +	drvdata->clk_rate = rate;
>  	jz4740_wdt = &drvdata->wdt;
>  	jz4740_wdt->info = &jz4740_wdt_info;
>  	jz4740_wdt->ops = &jz4740_wdt_ops;
> -	jz4740_wdt->timeout = heartbeat;
>  	jz4740_wdt->min_timeout = 1;
> -	jz4740_wdt->max_timeout = MAX_HEARTBEAT;
> +	jz4740_wdt->max_timeout = 0xffff / rate;
> +	jz4740_wdt->timeout = clamp(heartbeat,
> +				    jz4740_wdt->min_timeout,
> +				    jz4740_wdt->max_timeout);
>  	jz4740_wdt->parent = dev;
>  	watchdog_set_nowayout(jz4740_wdt, nowayout);
>  	watchdog_set_drvdata(jz4740_wdt, drvdata);
> @@ -186,12 +177,6 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
>  	if (IS_ERR(drvdata->base))
>  		return PTR_ERR(drvdata->base);
>  
> -	drvdata->rtc_clk = devm_clk_get(dev, "rtc");
> -	if (IS_ERR(drvdata->rtc_clk)) {
> -		dev_err(dev, "cannot find RTC clock\n");
> -		return PTR_ERR(drvdata->rtc_clk);
> -	}
> -
>  	return devm_watchdog_register_device(dev, &drvdata->wdt);
>  }
>  

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] watchdog: jz4740: Use regmap provided by TCU driver
  2019-08-09 11:59 ` [PATCH 2/3] watchdog: jz4740: Use regmap " Paul Cercueil
@ 2019-08-09 17:58   ` Guenter Roeck
  0 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2019-08-09 17:58 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Wim Van Sebroeck, od, linux-watchdog, linux-kernel,
	Mathieu Malaterre, Artur Rojek

On Fri, Aug 09, 2019 at 01:59:29PM +0200, Paul Cercueil wrote:
> Since we broke the ABI by changing the clock, the driver was also
> updated to use the regmap provided by the TCU driver.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Tested-by: Mathieu Malaterre <malat@debian.org>
> Tested-by: Artur Rojek <contact@artur-rojek.eu>

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/Kconfig      |  1 +
>  drivers/watchdog/jz4740_wdt.c | 36 +++++++++++++++++++----------------
>  2 files changed, 21 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 820d8a472310..78411609048b 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1647,6 +1647,7 @@ config JZ4740_WDT
>  	depends on MACH_JZ4740 || MACH_JZ4780
>  	depends on COMMON_CLK
>  	select WATCHDOG_CORE
> +	select MFD_SYSCON
>  	help
>  	  Hardware driver for the built-in watchdog timer on Ingenic jz4740 SoCs.
>  
> diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c
> index 07fbd9d96e84..bdf9564efa29 100644
> --- a/drivers/watchdog/jz4740_wdt.c
> +++ b/drivers/watchdog/jz4740_wdt.c
> @@ -5,6 +5,7 @@
>   */
>  
>  #include <linux/mfd/ingenic-tcu.h>
> +#include <linux/mfd/syscon.h>
>  #include <linux/module.h>
>  #include <linux/moduleparam.h>
>  #include <linux/types.h>
> @@ -17,6 +18,7 @@
>  #include <linux/slab.h>
>  #include <linux/err.h>
>  #include <linux/of.h>
> +#include <linux/regmap.h>
>  
>  #define DEFAULT_HEARTBEAT 5
>  #define MAX_HEARTBEAT     2048
> @@ -36,7 +38,7 @@ MODULE_PARM_DESC(heartbeat,
>  
>  struct jz4740_wdt_drvdata {
>  	struct watchdog_device wdt;
> -	void __iomem *base;
> +	struct regmap *map;
>  	struct clk *clk;
>  	unsigned long clk_rate;
>  };
> @@ -45,7 +47,8 @@ static int jz4740_wdt_ping(struct watchdog_device *wdt_dev)
>  {
>  	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
>  
> -	writew(0x0, drvdata->base + TCU_REG_WDT_TCNT);
> +	regmap_write(drvdata->map, TCU_REG_WDT_TCNT, 0);
> +
>  	return 0;
>  }
>  
> @@ -54,16 +57,16 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
>  {
>  	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
>  	u16 timeout_value = (u16)(drvdata->clk_rate * new_timeout);
> -	u8 tcer;
> +	unsigned int tcer;
>  
> -	tcer = readb(drvdata->base + TCU_REG_WDT_TCER);
> -	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
> +	regmap_read(drvdata->map, TCU_REG_WDT_TCER, &tcer);
> +	regmap_write(drvdata->map, TCU_REG_WDT_TCER, 0);
>  
> -	writew((u16)timeout_value, drvdata->base + TCU_REG_WDT_TDR);
> -	writew(0x0, drvdata->base + TCU_REG_WDT_TCNT);
> +	regmap_write(drvdata->map, TCU_REG_WDT_TDR, timeout_value);
> +	regmap_write(drvdata->map, TCU_REG_WDT_TCNT, 0);
>  
>  	if (tcer & TCU_WDT_TCER_TCEN)
> -		writeb(TCU_WDT_TCER_TCEN, drvdata->base + TCU_REG_WDT_TCER);
> +		regmap_write(drvdata->map, TCU_REG_WDT_TCER, TCU_WDT_TCER_TCEN);
>  
>  	wdt_dev->timeout = new_timeout;
>  	return 0;
> @@ -72,20 +75,20 @@ static int jz4740_wdt_set_timeout(struct watchdog_device *wdt_dev,
>  static int jz4740_wdt_start(struct watchdog_device *wdt_dev)
>  {
>  	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
> +	unsigned int tcer;
>  	int ret;
> -	u8 tcer;
>  
>  	ret = clk_prepare_enable(drvdata->clk);
>  	if (ret)
>  		return ret;
>  
> -	tcer = readb(drvdata->base + TCU_REG_WDT_TCER);
> +	regmap_read(drvdata->map, TCU_REG_WDT_TCER, &tcer);
>  
>  	jz4740_wdt_set_timeout(wdt_dev, wdt_dev->timeout);
>  
>  	/* Start watchdog if it wasn't started already */
>  	if (!(tcer & TCU_WDT_TCER_TCEN))
> -		writeb(TCU_WDT_TCER_TCEN, drvdata->base + TCU_REG_WDT_TCER);
> +		regmap_write(drvdata->map, TCU_REG_WDT_TCER, TCU_WDT_TCER_TCEN);
>  
>  	return 0;
>  }
> @@ -94,7 +97,7 @@ static int jz4740_wdt_stop(struct watchdog_device *wdt_dev)
>  {
>  	struct jz4740_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev);
>  
> -	writeb(0x0, drvdata->base + TCU_REG_WDT_TCER);
> +	regmap_write(drvdata->map, TCU_REG_WDT_TCER, 0);
>  	clk_disable_unprepare(drvdata->clk);
>  
>  	return 0;
> @@ -136,7 +139,6 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct jz4740_wdt_drvdata *drvdata;
>  	struct watchdog_device *jz4740_wdt;
> -	struct resource	*res;
>  	long rate;
>  	int ret;
>  
> @@ -173,9 +175,11 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
>  	watchdog_set_nowayout(jz4740_wdt, nowayout);
>  	watchdog_set_drvdata(jz4740_wdt, drvdata);
>  
> -	drvdata->base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(drvdata->base))
> -		return PTR_ERR(drvdata->base);
> +	drvdata->map = device_node_to_regmap(dev->parent->of_node);
> +	if (!drvdata->map) {
> +		dev_err(dev, "regmap not found\n");
> +		return -EINVAL;
> +	}
>  
>  	return devm_watchdog_register_device(dev, &drvdata->wdt);
>  }

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] watchdog: jz4740: Drop dependency on MACH_JZ47xx
  2019-08-09 11:59 ` [PATCH 3/3] watchdog: jz4740: Drop dependency on MACH_JZ47xx Paul Cercueil
@ 2019-08-09 17:59   ` Guenter Roeck
  0 siblings, 0 replies; 12+ messages in thread
From: Guenter Roeck @ 2019-08-09 17:59 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Wim Van Sebroeck, od, linux-watchdog, linux-kernel

On Fri, Aug 09, 2019 at 01:59:30PM +0200, Paul Cercueil wrote:
> Depending on MACH_JZ47xx prevent us from creating a generic kernel that
> works on more than one MIPS board. Instead, we just depend on MIPS being
> set.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Acked-by: Guenter Roeck <linux@roeck-us.net>

[ with the assumption that the series will be applied through the mips tree. ]

> ---
>  drivers/watchdog/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 78411609048b..90e689cbeed3 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1644,7 +1644,7 @@ config INDYDOG
>  
>  config JZ4740_WDT
>  	tristate "Ingenic jz4740 SoC hardware watchdog"
> -	depends on MACH_JZ4740 || MACH_JZ4780
> +	depends on MIPS
>  	depends on COMMON_CLK
>  	select WATCHDOG_CORE
>  	select MFD_SYSCON

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, back to index

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09 11:59 [PATCH 0/3] watchdog: jz4740: Driver update Paul Cercueil
2019-08-09 11:59 ` [PATCH 1/3] watchdog: jz4740: Use WDT clock provided by TCU driver Paul Cercueil
2019-08-09 17:58   ` Guenter Roeck
2019-08-09 11:59 ` [PATCH 2/3] watchdog: jz4740: Use regmap " Paul Cercueil
2019-08-09 17:58   ` Guenter Roeck
2019-08-09 11:59 ` [PATCH 3/3] watchdog: jz4740: Drop dependency on MACH_JZ47xx Paul Cercueil
2019-08-09 17:59   ` Guenter Roeck
2019-08-09 16:52 ` [PATCH 0/3] watchdog: jz4740: Driver update Guenter Roeck
2019-08-09 16:55   ` Paul Cercueil
2019-08-09 17:29     ` Guenter Roeck
2019-08-09 17:34       ` Paul Cercueil
2019-08-09 17:57         ` Guenter Roeck

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org linux-watchdog@archiver.kernel.org
	public-inbox-index linux-watchdog


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/ public-inbox