All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-12 17:44 ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

Dear All,

this series has been around for some time as RFC, and it has collected
useful comments from the community along the way.
The solution proposed by this patch set works for most R-Car Gen2 and
RZ/G1 devices, but not all of them. We now know that for some R-Car
Gen2 early revisions there is no proper software fix. Anyway, no
product has been built around early revisions, but development boards
mounting early revisions (basically prototypes) are still out there.
As a result, this series isn't enabling the internal watchdog on R-Car
Gen2 boards, developers may enable it in board specific device trees
if needed.
This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
and Koelsch boards.

The problem
===========
To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
to ICRAM1 and we program the [S]BAR registers so that when we turn ON
the non-boot CPUs they are redirected to the reset vector installed by
Linux in ICRAM1, and eventually they continue the execution to RAM,
where the SMP bring-up code will take care of the rest.
The content of the [S]BAR registers survives a watchdog triggered reset,
and as such after the watchdog fires the boot core will try and execute
the SMP bring-up code instead of jumping to the bootrom code.

The fix
=======
The main strategy for the solution is to let the reset vector decide
if it needs to jump to shmobile_boot_fn or to the bootrom code.
In a watchdog triggered reset scenario, since the [S]BAR registers keep
their values, the boot CPU will jump into the newly designed reset
vector, the assembly routine will eventually test WOVF (a bit in register
RWTCSRA that indicates if the watchdog counter has overflown, the value
of this bit gets retained in this scenario), and jump to the bootrom code
which will in turn load up the bootloader, etc.
When bringing up SMP or using CPU hotplug, the reset vector will jump
to shmobile_boot_fn instead.

Thank you All for your help.

Best regards,

Fabrizio Castro (26):
  ARM: shmobile: Add watchdog support
  ARM: dts: r8a7743: Adjust SMP routine size
  ARM: dts: r8a7745: Adjust SMP routine size
  ARM: dts: r8a7790: Adjust SMP routine size
  ARM: dts: r8a7791: Adjust SMP routine size
  ARM: dts: r8a7792: Adjust SMP routine size
  ARM: dts: r8a7793: Adjust SMP routine size
  ARM: dts: r8a7794: Adjust SMP routine size
  soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
  ARM: shmobile: rcar-gen2: Add watchdog support
  dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
  watchdog: renesas_wdt: Add R-Car Gen2 support
  watchdog: renesas_wdt: Add restart handler
  ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
  clk: renesas: r8a7743: Add rwdt clock
  clk: renesas: r8a7745: Add rwdt clock
  clk: renesas: r8a7790: Add rwdt clock
  clk: renesas: r8a7791/r8a7793: Add rwdt clock
  clk: renesas: r8a7794: Add rwdt clock
  ARM: dts: r8a7743: Add watchdog support to SoC dtsi
  ARM: dts: r8a7745: Add watchdog support to SoC dtsi
  ARM: dts: r8a7790: Add watchdog support to SoC dtsi
  ARM: dts: r8a7791: Add watchdog support to SoC dtsi
  ARM: dts: r8a7794: Add watchdog support to SoC dtsi
  ARM: dts: iwg20m: Add watchdog support to SoM dtsi
  ARM: dts: iwg22m: Add watchdog support to SoM dtsi

 .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
 arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
 arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
 arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
 arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
 arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
 arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
 arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
 arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
 arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
 arch/arm/configs/shmobile_defconfig                |  1 +
 arch/arm/mach-shmobile/common.h                    |  6 +++
 arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
 arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
 arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
 drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
 drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
 drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
 drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
 drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
 drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
 drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
 22 files changed, 229 insertions(+), 26 deletions(-)

-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-12 17:44 ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

Dear All,

this series has been around for some time as RFC, and it has collected
useful comments from the community along the way.
The solution proposed by this patch set works for most R-Car Gen2 and
RZ/G1 devices, but not all of them. We now know that for some R-Car
Gen2 early revisions there is no proper software fix. Anyway, no
product has been built around early revisions, but development boards
mounting early revisions (basically prototypes) are still out there.
As a result, this series isn't enabling the internal watchdog on R-Car
Gen2 boards, developers may enable it in board specific device trees
if needed.
This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
and Koelsch boards.

The problem
===========
To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
to ICRAM1 and we program the [S]BAR registers so that when we turn ON
the non-boot CPUs they are redirected to the reset vector installed by
Linux in ICRAM1, and eventually they continue the execution to RAM,
where the SMP bring-up code will take care of the rest.
The content of the [S]BAR registers survives a watchdog triggered reset,
and as such after the watchdog fires the boot core will try and execute
the SMP bring-up code instead of jumping to the bootrom code.

The fix
=======
The main strategy for the solution is to let the reset vector decide
if it needs to jump to shmobile_boot_fn or to the bootrom code.
In a watchdog triggered reset scenario, since the [S]BAR registers keep
their values, the boot CPU will jump into the newly designed reset
vector, the assembly routine will eventually test WOVF (a bit in register
RWTCSRA that indicates if the watchdog counter has overflown, the value
of this bit gets retained in this scenario), and jump to the bootrom code
which will in turn load up the bootloader, etc.
When bringing up SMP or using CPU hotplug, the reset vector will jump
to shmobile_boot_fn instead.

Thank you All for your help.

Best regards,

Fabrizio Castro (26):
  ARM: shmobile: Add watchdog support
  ARM: dts: r8a7743: Adjust SMP routine size
  ARM: dts: r8a7745: Adjust SMP routine size
  ARM: dts: r8a7790: Adjust SMP routine size
  ARM: dts: r8a7791: Adjust SMP routine size
  ARM: dts: r8a7792: Adjust SMP routine size
  ARM: dts: r8a7793: Adjust SMP routine size
  ARM: dts: r8a7794: Adjust SMP routine size
  soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
  ARM: shmobile: rcar-gen2: Add watchdog support
  dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
  watchdog: renesas_wdt: Add R-Car Gen2 support
  watchdog: renesas_wdt: Add restart handler
  ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
  clk: renesas: r8a7743: Add rwdt clock
  clk: renesas: r8a7745: Add rwdt clock
  clk: renesas: r8a7790: Add rwdt clock
  clk: renesas: r8a7791/r8a7793: Add rwdt clock
  clk: renesas: r8a7794: Add rwdt clock
  ARM: dts: r8a7743: Add watchdog support to SoC dtsi
  ARM: dts: r8a7745: Add watchdog support to SoC dtsi
  ARM: dts: r8a7790: Add watchdog support to SoC dtsi
  ARM: dts: r8a7791: Add watchdog support to SoC dtsi
  ARM: dts: r8a7794: Add watchdog support to SoC dtsi
  ARM: dts: iwg20m: Add watchdog support to SoM dtsi
  ARM: dts: iwg22m: Add watchdog support to SoM dtsi

 .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
 arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
 arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
 arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
 arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
 arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
 arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
 arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
 arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
 arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
 arch/arm/configs/shmobile_defconfig                |  1 +
 arch/arm/mach-shmobile/common.h                    |  6 +++
 arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
 arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
 arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
 drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
 drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
 drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
 drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
 drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
 drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
 drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
 22 files changed, 229 insertions(+), 26 deletions(-)

-- 
2.7.4


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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-12 17:44 ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

Dear All,

this series has been around for some time as RFC, and it has collected
useful comments from the community along the way.
The solution proposed by this patch set works for most R-Car Gen2 and
RZ/G1 devices, but not all of them. We now know that for some R-Car
Gen2 early revisions there is no proper software fix. Anyway, no
product has been built around early revisions, but development boards
mounting early revisions (basically prototypes) are still out there.
As a result, this series isn't enabling the internal watchdog on R-Car
Gen2 boards, developers may enable it in board specific device trees
if needed.
This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
and Koelsch boards.

The problem
===========
To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
to ICRAM1 and we program the [S]BAR registers so that when we turn ON
the non-boot CPUs they are redirected to the reset vector installed by
Linux in ICRAM1, and eventually they continue the execution to RAM,
where the SMP bring-up code will take care of the rest.
The content of the [S]BAR registers survives a watchdog triggered reset,
and as such after the watchdog fires the boot core will try and execute
the SMP bring-up code instead of jumping to the bootrom code.

The fix
=======
The main strategy for the solution is to let the reset vector decide
if it needs to jump to shmobile_boot_fn or to the bootrom code.
In a watchdog triggered reset scenario, since the [S]BAR registers keep
their values, the boot CPU will jump into the newly designed reset
vector, the assembly routine will eventually test WOVF (a bit in register
RWTCSRA that indicates if the watchdog counter has overflown, the value
of this bit gets retained in this scenario), and jump to the bootrom code
which will in turn load up the bootloader, etc.
When bringing up SMP or using CPU hotplug, the reset vector will jump
to shmobile_boot_fn instead.

Thank you All for your help.

Best regards,

Fabrizio Castro (26):
  ARM: shmobile: Add watchdog support
  ARM: dts: r8a7743: Adjust SMP routine size
  ARM: dts: r8a7745: Adjust SMP routine size
  ARM: dts: r8a7790: Adjust SMP routine size
  ARM: dts: r8a7791: Adjust SMP routine size
  ARM: dts: r8a7792: Adjust SMP routine size
  ARM: dts: r8a7793: Adjust SMP routine size
  ARM: dts: r8a7794: Adjust SMP routine size
  soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
  ARM: shmobile: rcar-gen2: Add watchdog support
  dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
  watchdog: renesas_wdt: Add R-Car Gen2 support
  watchdog: renesas_wdt: Add restart handler
  ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
  clk: renesas: r8a7743: Add rwdt clock
  clk: renesas: r8a7745: Add rwdt clock
  clk: renesas: r8a7790: Add rwdt clock
  clk: renesas: r8a7791/r8a7793: Add rwdt clock
  clk: renesas: r8a7794: Add rwdt clock
  ARM: dts: r8a7743: Add watchdog support to SoC dtsi
  ARM: dts: r8a7745: Add watchdog support to SoC dtsi
  ARM: dts: r8a7790: Add watchdog support to SoC dtsi
  ARM: dts: r8a7791: Add watchdog support to SoC dtsi
  ARM: dts: r8a7794: Add watchdog support to SoC dtsi
  ARM: dts: iwg20m: Add watchdog support to SoM dtsi
  ARM: dts: iwg22m: Add watchdog support to SoM dtsi

 .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
 arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
 arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
 arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
 arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
 arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
 arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
 arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
 arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
 arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
 arch/arm/configs/shmobile_defconfig                |  1 +
 arch/arm/mach-shmobile/common.h                    |  6 +++
 arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
 arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
 arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
 drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
 drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
 drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
 drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
 drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
 drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
 drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
 22 files changed, 229 insertions(+), 26 deletions(-)

-- 
2.7.4

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

* [PATCH v5 01/26] ARM: shmobile: Add watchdog support
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
boot CPUs run a routine designed to bring up SMP and deal with hot plug.
The value contained in the SBAR registers is not initialized by a WDT
triggered reset, which means that after a WDT triggered reset we jump
to the SMP bring up routine, preventing the system from executing the
bootrom code.

The purpose of this patch is to jump to the bootrom code in case of a
WDT triggered reset, and keep the SMP functionality untouched.
In order to tell if the code had been called due to the WDT overflowing
we are testing WOVF from register RWTCSRA.

The new function shmobile_boot_vector_gen2 isn't replacing
shmobile_boot_vector for backward compatibility reasons. The kernel
will install the best option (either shmobile_boot_vector or
shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
according to the amount of memory available.

Since shmobile_boot_vector has become bigger, "reg" property of nodes
compatible with "renesas,smp-sram" now need to be set to a value
greater or equal to "<0 0x60>".

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
---
v4->v5:
* no change

 arch/arm/mach-shmobile/common.h  |  6 +++++
 arch/arm/mach-shmobile/headsmp.S | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+)

diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index a8fa4f7..d8c11f5 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -7,6 +7,12 @@ extern void shmobile_init_delay(void);
 extern void shmobile_boot_vector(void);
 extern unsigned long shmobile_boot_fn;
 extern unsigned long shmobile_boot_size;
+#ifdef CONFIG_ARCH_RCAR_GEN2
+extern void shmobile_boot_vector_gen2(void);
+extern unsigned long shmobile_boot_fn_gen2;
+extern unsigned long shmobile_boot_cpu_gen2;
+extern unsigned long shmobile_boot_size_gen2;
+#endif /* CONFIG_ARCH_RCAR_GEN2 */
 extern void shmobile_smp_boot(void);
 extern void shmobile_smp_sleep(void);
 extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 32e0bf6..cef8e8c 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -16,6 +16,11 @@
 #include <asm/assembler.h>
 #include <asm/memory.h>
 
+#define SCTLR_MMU	0x01
+#define BOOTROM_ADDRESS	0xE6340000
+#define RWTCSRA_ADDRESS 0xE6020004
+#define RWTCSRA_WOVF	0x10
+
 /*
  * Reset vector for secondary CPUs.
  * This will be mapped at address 0 by SBAR register.
@@ -37,6 +42,56 @@ shmobile_boot_fn:
 shmobile_boot_size:
 	.long	. - shmobile_boot_vector
 
+#ifdef CONFIG_ARCH_RCAR_GEN2
+/*
+ * Reset vector for R-Car Gen2 and RZ/G1 secondary CPUs.
+ * This will be mapped at address 0 by SBAR register.
+ */
+ENTRY(shmobile_boot_vector_gen2)
+	mrc	p15, 0, r0, c0, c0, 5		@ r0 = MPIDR
+	ldr	r1, shmobile_boot_cpu_gen2
+	cmp	r0, r1
+	bne	shmobile_smp_continue_gen2
+
+	mrc	p15, 0, r1, c1, c0, 0		@ r1 = SCTLR
+	and	r0, r1, #SCTLR_MMU
+	cmp	r0, #SCTLR_MMU
+	beq	shmobile_smp_continue_gen2
+
+	ldr	r0, rwtcsra
+	mov	r1, #0
+	ldrb	r1, [r0]
+	and	r0, r1, #RWTCSRA_WOVF
+	cmp	r0, #RWTCSRA_WOVF
+	bne	shmobile_smp_continue_gen2
+
+	ldr	r0, bootrom
+	bx	r0
+
+shmobile_smp_continue_gen2:
+	ldr     r1, shmobile_boot_fn_gen2
+	bx	r1
+
+ENDPROC(shmobile_boot_vector_gen2)
+
+	.align	4
+rwtcsra:
+	.word	RWTCSRA_ADDRESS
+bootrom:
+	.word	BOOTROM_ADDRESS
+	.globl	shmobile_boot_cpu_gen2
+shmobile_boot_cpu_gen2:
+	.word	0x00000000
+
+	.align	2
+	.globl	shmobile_boot_fn_gen2
+shmobile_boot_fn_gen2:
+	.space	4
+	.globl	shmobile_boot_size_gen2
+shmobile_boot_size_gen2:
+	.long	. - shmobile_boot_vector_gen2
+#endif /* CONFIG_ARCH_RCAR_GEN2 */
+
 /*
  * Per-CPU SMP boot function/argument selection code based on MPIDR
  */
-- 
2.7.4


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

* [PATCH v5 01/26] ARM: shmobile: Add watchdog support
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
boot CPUs run a routine designed to bring up SMP and deal with hot plug.
The value contained in the SBAR registers is not initialized by a WDT
triggered reset, which means that after a WDT triggered reset we jump
to the SMP bring up routine, preventing the system from executing the
bootrom code.

The purpose of this patch is to jump to the bootrom code in case of a
WDT triggered reset, and keep the SMP functionality untouched.
In order to tell if the code had been called due to the WDT overflowing
we are testing WOVF from register RWTCSRA.

The new function shmobile_boot_vector_gen2 isn't replacing
shmobile_boot_vector for backward compatibility reasons. The kernel
will install the best option (either shmobile_boot_vector or
shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
according to the amount of memory available.

Since shmobile_boot_vector has become bigger, "reg" property of nodes
compatible with "renesas,smp-sram" now need to be set to a value
greater or equal to "<0 0x60>".

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
---
v4->v5:
* no change

 arch/arm/mach-shmobile/common.h  |  6 +++++
 arch/arm/mach-shmobile/headsmp.S | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+)

diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index a8fa4f7..d8c11f5 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -7,6 +7,12 @@ extern void shmobile_init_delay(void);
 extern void shmobile_boot_vector(void);
 extern unsigned long shmobile_boot_fn;
 extern unsigned long shmobile_boot_size;
+#ifdef CONFIG_ARCH_RCAR_GEN2
+extern void shmobile_boot_vector_gen2(void);
+extern unsigned long shmobile_boot_fn_gen2;
+extern unsigned long shmobile_boot_cpu_gen2;
+extern unsigned long shmobile_boot_size_gen2;
+#endif /* CONFIG_ARCH_RCAR_GEN2 */
 extern void shmobile_smp_boot(void);
 extern void shmobile_smp_sleep(void);
 extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 32e0bf6..cef8e8c 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -16,6 +16,11 @@
 #include <asm/assembler.h>
 #include <asm/memory.h>
 
+#define SCTLR_MMU	0x01
+#define BOOTROM_ADDRESS	0xE6340000
+#define RWTCSRA_ADDRESS 0xE6020004
+#define RWTCSRA_WOVF	0x10
+
 /*
  * Reset vector for secondary CPUs.
  * This will be mapped at address 0 by SBAR register.
@@ -37,6 +42,56 @@ shmobile_boot_fn:
 shmobile_boot_size:
 	.long	. - shmobile_boot_vector
 
+#ifdef CONFIG_ARCH_RCAR_GEN2
+/*
+ * Reset vector for R-Car Gen2 and RZ/G1 secondary CPUs.
+ * This will be mapped at address 0 by SBAR register.
+ */
+ENTRY(shmobile_boot_vector_gen2)
+	mrc	p15, 0, r0, c0, c0, 5		@ r0 = MPIDR
+	ldr	r1, shmobile_boot_cpu_gen2
+	cmp	r0, r1
+	bne	shmobile_smp_continue_gen2
+
+	mrc	p15, 0, r1, c1, c0, 0		@ r1 = SCTLR
+	and	r0, r1, #SCTLR_MMU
+	cmp	r0, #SCTLR_MMU
+	beq	shmobile_smp_continue_gen2
+
+	ldr	r0, rwtcsra
+	mov	r1, #0
+	ldrb	r1, [r0]
+	and	r0, r1, #RWTCSRA_WOVF
+	cmp	r0, #RWTCSRA_WOVF
+	bne	shmobile_smp_continue_gen2
+
+	ldr	r0, bootrom
+	bx	r0
+
+shmobile_smp_continue_gen2:
+	ldr     r1, shmobile_boot_fn_gen2
+	bx	r1
+
+ENDPROC(shmobile_boot_vector_gen2)
+
+	.align	4
+rwtcsra:
+	.word	RWTCSRA_ADDRESS
+bootrom:
+	.word	BOOTROM_ADDRESS
+	.globl	shmobile_boot_cpu_gen2
+shmobile_boot_cpu_gen2:
+	.word	0x00000000
+
+	.align	2
+	.globl	shmobile_boot_fn_gen2
+shmobile_boot_fn_gen2:
+	.space	4
+	.globl	shmobile_boot_size_gen2
+shmobile_boot_size_gen2:
+	.long	. - shmobile_boot_vector_gen2
+#endif /* CONFIG_ARCH_RCAR_GEN2 */
+
 /*
  * Per-CPU SMP boot function/argument selection code based on MPIDR
  */
-- 
2.7.4

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

* [PATCH v5 02/26] ARM: dts: r8a7743: Adjust SMP routine size
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7743.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7743.dtsi b/arch/arm/boot/dts/r8a7743.dtsi
index 47b62f6..c2943d7 100644
--- a/arch/arm/boot/dts/r8a7743.dtsi
+++ b/arch/arm/boot/dts/r8a7743.dtsi
@@ -973,7 +973,7 @@
 
 			smp-sram@0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4

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

* [PATCH v5 02/26] ARM: dts: r8a7743: Adjust SMP routine size
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7743.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7743.dtsi b/arch/arm/boot/dts/r8a7743.dtsi
index 47b62f6..c2943d7 100644
--- a/arch/arm/boot/dts/r8a7743.dtsi
+++ b/arch/arm/boot/dts/r8a7743.dtsi
@@ -973,7 +973,7 @@
 
 			smp-sram at 0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4

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

* [PATCH v5 03/26] ARM: dts: r8a7745: Adjust SMP routine size
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7745.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7745.dtsi b/arch/arm/boot/dts/r8a7745.dtsi
index ddc3da2..6bc1cf4 100644
--- a/arch/arm/boot/dts/r8a7745.dtsi
+++ b/arch/arm/boot/dts/r8a7745.dtsi
@@ -755,7 +755,7 @@
 
 			smp-sram@0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4


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

* [PATCH v5 03/26] ARM: dts: r8a7745: Adjust SMP routine size
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7745.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7745.dtsi b/arch/arm/boot/dts/r8a7745.dtsi
index ddc3da2..6bc1cf4 100644
--- a/arch/arm/boot/dts/r8a7745.dtsi
+++ b/arch/arm/boot/dts/r8a7745.dtsi
@@ -755,7 +755,7 @@
 
 			smp-sram at 0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4

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

* [PATCH v5 04/26] ARM: dts: r8a7790: Adjust SMP routine size
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7790.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 3bbcc0b..a84bf35 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -443,7 +443,7 @@
 
 			smp-sram@0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4


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

* [PATCH v5 04/26] ARM: dts: r8a7790: Adjust SMP routine size
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7790.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 3bbcc0b..a84bf35 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -443,7 +443,7 @@
 
 			smp-sram at 0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4

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

* [PATCH v5 05/26] ARM: dts: r8a7791: Adjust SMP routine size
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-12 17:44     ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7791.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index dc65935..d2a4546 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -407,7 +407,7 @@
 
 			smp-sram@0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 05/26] ARM: dts: r8a7791: Adjust SMP routine size
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7791.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index dc65935..d2a4546 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -407,7 +407,7 @@
 
 			smp-sram@0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4


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

* [PATCH v5 05/26] ARM: dts: r8a7791: Adjust SMP routine size
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7791.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index dc65935..d2a4546 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -407,7 +407,7 @@
 
 			smp-sram at 0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4

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

* [PATCH v5 06/26] ARM: dts: r8a7792: Adjust SMP routine size
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-12 17:44     ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7792.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7792.dtsi b/arch/arm/boot/dts/r8a7792.dtsi
index 268987f..bea0f12 100644
--- a/arch/arm/boot/dts/r8a7792.dtsi
+++ b/arch/arm/boot/dts/r8a7792.dtsi
@@ -341,7 +341,7 @@
 
 			smp-sram@0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 06/26] ARM: dts: r8a7792: Adjust SMP routine size
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7792.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7792.dtsi b/arch/arm/boot/dts/r8a7792.dtsi
index 268987f..bea0f12 100644
--- a/arch/arm/boot/dts/r8a7792.dtsi
+++ b/arch/arm/boot/dts/r8a7792.dtsi
@@ -341,7 +341,7 @@
 
 			smp-sram@0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4


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

* [PATCH v5 06/26] ARM: dts: r8a7792: Adjust SMP routine size
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7792.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7792.dtsi b/arch/arm/boot/dts/r8a7792.dtsi
index 268987f..bea0f12 100644
--- a/arch/arm/boot/dts/r8a7792.dtsi
+++ b/arch/arm/boot/dts/r8a7792.dtsi
@@ -341,7 +341,7 @@
 
 			smp-sram at 0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4

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

* [PATCH v5 07/26] ARM: dts: r8a7793: Adjust SMP routine size
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7793.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index aa7d779..bde6969 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -392,7 +392,7 @@
 
 			smp-sram@0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4

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

* [PATCH v5 07/26] ARM: dts: r8a7793: Adjust SMP routine size
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7793.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index aa7d779..bde6969 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -392,7 +392,7 @@
 
 			smp-sram at 0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4

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

* [PATCH v5 08/26] ARM: dts: r8a7794: Adjust SMP routine size
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-12 17:44     ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7794.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index d588efa..e47c5f4 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -348,7 +348,7 @@
 
 			smp-sram@0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 08/26] ARM: dts: r8a7794: Adjust SMP routine size
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7794.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index d588efa..e47c5f4 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -348,7 +348,7 @@
 
 			smp-sram@0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4


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

* [PATCH v5 08/26] ARM: dts: r8a7794: Adjust SMP routine size
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adjusts the definition of the SMP routine size according
to the latest changes made by commit:
"ARM: shmobile: Add watchdog support"

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7794.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index d588efa..e47c5f4 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -348,7 +348,7 @@
 
 			smp-sram at 0 {
 				compatible = "renesas,smp-sram";
-				reg = <0 0x10>;
+				reg = <0 0x100>;
 			};
 		};
 
-- 
2.7.4

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

* [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-12 17:44     ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch allows for platform specific quirks as some of the SoC need
further customization for the watchdog to work properly, like for R-Car
Gen2 and for RZ/G.

Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
---
v4->v5:
* no change

 drivers/soc/renesas/rcar-rst.c | 35 +++++++++++++++++++++++++++++------
 1 file changed, 29 insertions(+), 6 deletions(-)

diff --git a/drivers/soc/renesas/rcar-rst.c b/drivers/soc/renesas/rcar-rst.c
index 3316b02..93febe6 100644
--- a/drivers/soc/renesas/rcar-rst.c
+++ b/drivers/soc/renesas/rcar-rst.c
@@ -13,8 +13,18 @@
 #include <linux/of_address.h>
 #include <linux/soc/renesas/rcar-rst.h>
 
+#define WDTRSTCR_RESET		0xA55A0002
+#define WDTRSTCR		0x0054
+
+static int rcar_rst_enable_wdt_reset(void __iomem *base)
+{
+	iowrite32(WDTRSTCR_RESET, base + WDTRSTCR);
+	return 0;
+}
+
 struct rst_config {
-	unsigned int modemr;	/* Mode Monitoring Register Offset */
+	unsigned int modemr;		/* Mode Monitoring Register Offset */
+	int (*configure)(void *base);	/* Platform specific configuration */
 };
 
 static const struct rst_config rcar_rst_gen1 __initconst = {
@@ -23,6 +33,11 @@ static const struct rst_config rcar_rst_gen1 __initconst = {
 
 static const struct rst_config rcar_rst_gen2 __initconst = {
 	.modemr = 0x60,
+	.configure = rcar_rst_enable_wdt_reset,
+};
+
+static const struct rst_config rcar_rst_gen3 __initconst = {
+	.modemr = 0x60,
 };
 
 static const struct of_device_id rcar_rst_matches[] __initconst = {
@@ -38,11 +53,11 @@ static const struct of_device_id rcar_rst_matches[] __initconst = {
 	{ .compatible = "renesas,r8a7792-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a7793-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a7794-rst", .data = &rcar_rst_gen2 },
-	/* R-Car Gen3 is handled like R-Car Gen2 */
-	{ .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen2 },
+	/* R-Car Gen3 */
+	{ .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen3 },
 	{ /* sentinel */ }
 };
 
@@ -71,6 +86,14 @@ static int __init rcar_rst_init(void)
 	rcar_rst_base = base;
 	cfg = match->data;
 	saved_mode = ioread32(base + cfg->modemr);
+	if (cfg->configure) {
+		error = cfg->configure(base);
+		if (error) {
+			pr_warn("%pOF: Cannot run SoC specific configuration\n",
+				np);
+			goto out_put;
+		}
+	}
 
 	pr_debug("%pOF: MODE = 0x%08x\n", np, saved_mode);
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch allows for platform specific quirks as some of the SoC need
further customization for the watchdog to work properly, like for R-Car
Gen2 and for RZ/G.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
---
v4->v5:
* no change

 drivers/soc/renesas/rcar-rst.c | 35 +++++++++++++++++++++++++++++------
 1 file changed, 29 insertions(+), 6 deletions(-)

diff --git a/drivers/soc/renesas/rcar-rst.c b/drivers/soc/renesas/rcar-rst.c
index 3316b02..93febe6 100644
--- a/drivers/soc/renesas/rcar-rst.c
+++ b/drivers/soc/renesas/rcar-rst.c
@@ -13,8 +13,18 @@
 #include <linux/of_address.h>
 #include <linux/soc/renesas/rcar-rst.h>
 
+#define WDTRSTCR_RESET		0xA55A0002
+#define WDTRSTCR		0x0054
+
+static int rcar_rst_enable_wdt_reset(void __iomem *base)
+{
+	iowrite32(WDTRSTCR_RESET, base + WDTRSTCR);
+	return 0;
+}
+
 struct rst_config {
-	unsigned int modemr;	/* Mode Monitoring Register Offset */
+	unsigned int modemr;		/* Mode Monitoring Register Offset */
+	int (*configure)(void *base);	/* Platform specific configuration */
 };
 
 static const struct rst_config rcar_rst_gen1 __initconst = {
@@ -23,6 +33,11 @@ static const struct rst_config rcar_rst_gen1 __initconst = {
 
 static const struct rst_config rcar_rst_gen2 __initconst = {
 	.modemr = 0x60,
+	.configure = rcar_rst_enable_wdt_reset,
+};
+
+static const struct rst_config rcar_rst_gen3 __initconst = {
+	.modemr = 0x60,
 };
 
 static const struct of_device_id rcar_rst_matches[] __initconst = {
@@ -38,11 +53,11 @@ static const struct of_device_id rcar_rst_matches[] __initconst = {
 	{ .compatible = "renesas,r8a7792-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a7793-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a7794-rst", .data = &rcar_rst_gen2 },
-	/* R-Car Gen3 is handled like R-Car Gen2 */
-	{ .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen2 },
+	/* R-Car Gen3 */
+	{ .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen3 },
 	{ /* sentinel */ }
 };
 
@@ -71,6 +86,14 @@ static int __init rcar_rst_init(void)
 	rcar_rst_base = base;
 	cfg = match->data;
 	saved_mode = ioread32(base + cfg->modemr);
+	if (cfg->configure) {
+		error = cfg->configure(base);
+		if (error) {
+			pr_warn("%pOF: Cannot run SoC specific configuration\n",
+				np);
+			goto out_put;
+		}
+	}
 
 	pr_debug("%pOF: MODE = 0x%08x\n", np, saved_mode);
 
-- 
2.7.4


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

* [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch allows for platform specific quirks as some of the SoC need
further customization for the watchdog to work properly, like for R-Car
Gen2 and for RZ/G.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
---
v4->v5:
* no change

 drivers/soc/renesas/rcar-rst.c | 35 +++++++++++++++++++++++++++++------
 1 file changed, 29 insertions(+), 6 deletions(-)

diff --git a/drivers/soc/renesas/rcar-rst.c b/drivers/soc/renesas/rcar-rst.c
index 3316b02..93febe6 100644
--- a/drivers/soc/renesas/rcar-rst.c
+++ b/drivers/soc/renesas/rcar-rst.c
@@ -13,8 +13,18 @@
 #include <linux/of_address.h>
 #include <linux/soc/renesas/rcar-rst.h>
 
+#define WDTRSTCR_RESET		0xA55A0002
+#define WDTRSTCR		0x0054
+
+static int rcar_rst_enable_wdt_reset(void __iomem *base)
+{
+	iowrite32(WDTRSTCR_RESET, base + WDTRSTCR);
+	return 0;
+}
+
 struct rst_config {
-	unsigned int modemr;	/* Mode Monitoring Register Offset */
+	unsigned int modemr;		/* Mode Monitoring Register Offset */
+	int (*configure)(void *base);	/* Platform specific configuration */
 };
 
 static const struct rst_config rcar_rst_gen1 __initconst = {
@@ -23,6 +33,11 @@ static const struct rst_config rcar_rst_gen1 __initconst = {
 
 static const struct rst_config rcar_rst_gen2 __initconst = {
 	.modemr = 0x60,
+	.configure = rcar_rst_enable_wdt_reset,
+};
+
+static const struct rst_config rcar_rst_gen3 __initconst = {
+	.modemr = 0x60,
 };
 
 static const struct of_device_id rcar_rst_matches[] __initconst = {
@@ -38,11 +53,11 @@ static const struct of_device_id rcar_rst_matches[] __initconst = {
 	{ .compatible = "renesas,r8a7792-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a7793-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a7794-rst", .data = &rcar_rst_gen2 },
-	/* R-Car Gen3 is handled like R-Car Gen2 */
-	{ .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen2 },
+	/* R-Car Gen3 */
+	{ .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen3 },
 	{ /* sentinel */ }
 };
 
@@ -71,6 +86,14 @@ static int __init rcar_rst_init(void)
 	rcar_rst_base = base;
 	cfg = match->data;
 	saved_mode = ioread32(base + cfg->modemr);
+	if (cfg->configure) {
+		error = cfg->configure(base);
+		if (error) {
+			pr_warn("%pOF: Cannot run SoC specific configuration\n",
+				np);
+			goto out_put;
+		}
+	}
 
 	pr_debug("%pOF: MODE = 0x%08x\n", np, saved_mode);
 
-- 
2.7.4

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

* [PATCH v5 10/26] ARM: shmobile: rcar-gen2: Add watchdog support
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-12 17:44     ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adds watchdog support by installing shmobile_boot_vector_gen2
to ICRAM1 when enough memory is available, in which case we also keep a
copy of MPIDR to complete the reset vector logic.

Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
---
v4->v5:
* reworked comment style

 arch/arm/mach-shmobile/platsmp-apmu.c |  1 +
 arch/arm/mach-shmobile/pm-rcar-gen2.c | 15 ++++++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
index 4422b61..ba732ef 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -191,6 +191,7 @@ static void __init shmobile_smp_apmu_setup_boot(void)
 {
 	/* install boot code shared by all CPUs */
 	shmobile_boot_fn = __pa_symbol(shmobile_smp_boot);
+	shmobile_boot_fn_gen2 = shmobile_boot_fn;
 }
 
 void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus,
diff --git a/arch/arm/mach-shmobile/pm-rcar-gen2.c b/arch/arm/mach-shmobile/pm-rcar-gen2.c
index e5f215c..5a798b4 100644
--- a/arch/arm/mach-shmobile/pm-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/pm-rcar-gen2.c
@@ -17,6 +17,7 @@
 #include <linux/smp.h>
 #include <linux/soc/renesas/rcar-sysc.h>
 #include <asm/io.h>
+#include <asm/cputype.h>
 #include "common.h"
 #include "rcar-gen2.h"
 
@@ -37,7 +38,6 @@
 #define CA7RESCNT_CODE	0x5a5a0000
 #define CA7RESCNT_CPUS	0xf		/* CPU0-3 */
 
-
 /* On-chip RAM */
 #define ICRAM1		0xe63c0000	/* Inter Connect RAM1 (4 KiB) */
 
@@ -119,8 +119,17 @@ void __init rcar_gen2_pm_init(void)
 	p = ioremap(res.start, resource_size(&res));
 	if (!p)
 		return;
-
-	memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
+	/*
+	 * install the reset vector, use the largest version if we have enough
+	 * memory available
+	 */
+	if (resource_size(&res) >= shmobile_boot_size_gen2) {
+		shmobile_boot_cpu_gen2 = read_cpuid_mpidr();
+		memcpy_toio(p, shmobile_boot_vector_gen2,
+			    shmobile_boot_size_gen2);
+	} else {
+		memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
+	}
 	iounmap(p);
 
 	/* setup reset vectors */
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 10/26] ARM: shmobile: rcar-gen2: Add watchdog support
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adds watchdog support by installing shmobile_boot_vector_gen2
to ICRAM1 when enough memory is available, in which case we also keep a
copy of MPIDR to complete the reset vector logic.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
---
v4->v5:
* reworked comment style

 arch/arm/mach-shmobile/platsmp-apmu.c |  1 +
 arch/arm/mach-shmobile/pm-rcar-gen2.c | 15 ++++++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
index 4422b61..ba732ef 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -191,6 +191,7 @@ static void __init shmobile_smp_apmu_setup_boot(void)
 {
 	/* install boot code shared by all CPUs */
 	shmobile_boot_fn = __pa_symbol(shmobile_smp_boot);
+	shmobile_boot_fn_gen2 = shmobile_boot_fn;
 }
 
 void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus,
diff --git a/arch/arm/mach-shmobile/pm-rcar-gen2.c b/arch/arm/mach-shmobile/pm-rcar-gen2.c
index e5f215c..5a798b4 100644
--- a/arch/arm/mach-shmobile/pm-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/pm-rcar-gen2.c
@@ -17,6 +17,7 @@
 #include <linux/smp.h>
 #include <linux/soc/renesas/rcar-sysc.h>
 #include <asm/io.h>
+#include <asm/cputype.h>
 #include "common.h"
 #include "rcar-gen2.h"
 
@@ -37,7 +38,6 @@
 #define CA7RESCNT_CODE	0x5a5a0000
 #define CA7RESCNT_CPUS	0xf		/* CPU0-3 */
 
-
 /* On-chip RAM */
 #define ICRAM1		0xe63c0000	/* Inter Connect RAM1 (4 KiB) */
 
@@ -119,8 +119,17 @@ void __init rcar_gen2_pm_init(void)
 	p = ioremap(res.start, resource_size(&res));
 	if (!p)
 		return;
-
-	memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
+	/*
+	 * install the reset vector, use the largest version if we have enough
+	 * memory available
+	 */
+	if (resource_size(&res) >= shmobile_boot_size_gen2) {
+		shmobile_boot_cpu_gen2 = read_cpuid_mpidr();
+		memcpy_toio(p, shmobile_boot_vector_gen2,
+			    shmobile_boot_size_gen2);
+	} else {
+		memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
+	}
 	iounmap(p);
 
 	/* setup reset vectors */
-- 
2.7.4


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

* [PATCH v5 10/26] ARM: shmobile: rcar-gen2: Add watchdog support
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds watchdog support by installing shmobile_boot_vector_gen2
to ICRAM1 when enough memory is available, in which case we also keep a
copy of MPIDR to complete the reset vector logic.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
---
v4->v5:
* reworked comment style

 arch/arm/mach-shmobile/platsmp-apmu.c |  1 +
 arch/arm/mach-shmobile/pm-rcar-gen2.c | 15 ++++++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
index 4422b61..ba732ef 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -191,6 +191,7 @@ static void __init shmobile_smp_apmu_setup_boot(void)
 {
 	/* install boot code shared by all CPUs */
 	shmobile_boot_fn = __pa_symbol(shmobile_smp_boot);
+	shmobile_boot_fn_gen2 = shmobile_boot_fn;
 }
 
 void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus,
diff --git a/arch/arm/mach-shmobile/pm-rcar-gen2.c b/arch/arm/mach-shmobile/pm-rcar-gen2.c
index e5f215c..5a798b4 100644
--- a/arch/arm/mach-shmobile/pm-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/pm-rcar-gen2.c
@@ -17,6 +17,7 @@
 #include <linux/smp.h>
 #include <linux/soc/renesas/rcar-sysc.h>
 #include <asm/io.h>
+#include <asm/cputype.h>
 #include "common.h"
 #include "rcar-gen2.h"
 
@@ -37,7 +38,6 @@
 #define CA7RESCNT_CODE	0x5a5a0000
 #define CA7RESCNT_CPUS	0xf		/* CPU0-3 */
 
-
 /* On-chip RAM */
 #define ICRAM1		0xe63c0000	/* Inter Connect RAM1 (4 KiB) */
 
@@ -119,8 +119,17 @@ void __init rcar_gen2_pm_init(void)
 	p = ioremap(res.start, resource_size(&res));
 	if (!p)
 		return;
-
-	memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
+	/*
+	 * install the reset vector, use the largest version if we have enough
+	 * memory available
+	 */
+	if (resource_size(&res) >= shmobile_boot_size_gen2) {
+		shmobile_boot_cpu_gen2 = read_cpuid_mpidr();
+		memcpy_toio(p, shmobile_boot_vector_gen2,
+			    shmobile_boot_size_gen2);
+	} else {
+		memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
+	}
 	iounmap(p);
 
 	/* setup reset vectors */
-- 
2.7.4

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

* [PATCH v5 11/26] dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-12 17:44     ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This commit documents the compatibility with R-Car Gen2 and RZ/G
devices by defining the generic compatible string "renesas,rcar-gen2-wdt".
Also, this patch expands the list of SoC-specific compatible strings to
include RZ/G and R-Car Gen2 devices.

Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
Reviewed-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Reviewed-by: Wolfram Sang <wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>
---
v4->v5:
* no change

 .../devicetree/bindings/watchdog/renesas-wdt.txt      | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt b/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt
index bf6d1ca..4815128 100644
--- a/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt
@@ -1,17 +1,26 @@
 Renesas Watchdog Timer (WDT) Controller
 
 Required properties:
-- compatible : Should be "renesas,<soctype>-wdt", and
-	       "renesas,rcar-gen3-wdt" or "renesas,rza-wdt" as fallback.
+ - compatible : Must be "renesas,<soctype>-wdt", followed by a generic
+		fallback compatible string when compatible with the generic
+		version.
 	       Examples with soctypes are:
+		 - "renesas,r8a7743-wdt" (RZ/G1M)
+		 - "renesas,r8a7745-wdt" (RZ/G1E)
+	         - "renesas,r8a7790-wdt" (R-Car H2)
+	         - "renesas,r8a7791-wdt" (R-Car M2-W)
+	         - "renesas,r8a7792-wdt" (R-Car V2H)
+	         - "renesas,r8a7793-wdt" (R-Car M2-N)
+	         - "renesas,r8a7794-wdt" (R-Car E2)
 	         - "renesas,r8a7795-wdt" (R-Car H3)
 	         - "renesas,r8a7796-wdt" (R-Car M3-W)
 	         - "renesas,r8a77995-wdt" (R-Car D3)
 	         - "renesas,r7s72100-wdt" (RZ/A1)
+		The generic compatible string must be:
+		 - "renesas,rza-wdt" for RZ/A
+		 - "renesas,rcar-gen2-wdt" for R-Car Gen2 and RZ/G
+		 - "renesas,rcar-gen3-wdt" for R-Car Gen3
 
-  When compatible with the generic version, nodes must list the SoC-specific
-  version corresponding to the platform first, followed by the generic
-  version.
 
 - reg : Should contain WDT registers location and length
 - clocks : the clock feeding the watchdog timer.
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 11/26] dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This commit documents the compatibility with R-Car Gen2 and RZ/G
devices by defining the generic compatible string "renesas,rcar-gen2-wdt".
Also, this patch expands the list of SoC-specific compatible strings to
include RZ/G and R-Car Gen2 devices.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 .../devicetree/bindings/watchdog/renesas-wdt.txt      | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt b/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt
index bf6d1ca..4815128 100644
--- a/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt
@@ -1,17 +1,26 @@
 Renesas Watchdog Timer (WDT) Controller
 
 Required properties:
-- compatible : Should be "renesas,<soctype>-wdt", and
-	       "renesas,rcar-gen3-wdt" or "renesas,rza-wdt" as fallback.
+ - compatible : Must be "renesas,<soctype>-wdt", followed by a generic
+		fallback compatible string when compatible with the generic
+		version.
 	       Examples with soctypes are:
+		 - "renesas,r8a7743-wdt" (RZ/G1M)
+		 - "renesas,r8a7745-wdt" (RZ/G1E)
+	         - "renesas,r8a7790-wdt" (R-Car H2)
+	         - "renesas,r8a7791-wdt" (R-Car M2-W)
+	         - "renesas,r8a7792-wdt" (R-Car V2H)
+	         - "renesas,r8a7793-wdt" (R-Car M2-N)
+	         - "renesas,r8a7794-wdt" (R-Car E2)
 	         - "renesas,r8a7795-wdt" (R-Car H3)
 	         - "renesas,r8a7796-wdt" (R-Car M3-W)
 	         - "renesas,r8a77995-wdt" (R-Car D3)
 	         - "renesas,r7s72100-wdt" (RZ/A1)
+		The generic compatible string must be:
+		 - "renesas,rza-wdt" for RZ/A
+		 - "renesas,rcar-gen2-wdt" for R-Car Gen2 and RZ/G
+		 - "renesas,rcar-gen3-wdt" for R-Car Gen3
 
-  When compatible with the generic version, nodes must list the SoC-specific
-  version corresponding to the platform first, followed by the generic
-  version.
 
 - reg : Should contain WDT registers location and length
 - clocks : the clock feeding the watchdog timer.
-- 
2.7.4


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

* [PATCH v5 11/26] dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This commit documents the compatibility with R-Car Gen2 and RZ/G
devices by defining the generic compatible string "renesas,rcar-gen2-wdt".
Also, this patch expands the list of SoC-specific compatible strings to
include RZ/G and R-Car Gen2 devices.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 .../devicetree/bindings/watchdog/renesas-wdt.txt      | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt b/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt
index bf6d1ca..4815128 100644
--- a/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt
@@ -1,17 +1,26 @@
 Renesas Watchdog Timer (WDT) Controller
 
 Required properties:
-- compatible : Should be "renesas,<soctype>-wdt", and
-	       "renesas,rcar-gen3-wdt" or "renesas,rza-wdt" as fallback.
+ - compatible : Must be "renesas,<soctype>-wdt", followed by a generic
+		fallback compatible string when compatible with the generic
+		version.
 	       Examples with soctypes are:
+		 - "renesas,r8a7743-wdt" (RZ/G1M)
+		 - "renesas,r8a7745-wdt" (RZ/G1E)
+	         - "renesas,r8a7790-wdt" (R-Car H2)
+	         - "renesas,r8a7791-wdt" (R-Car M2-W)
+	         - "renesas,r8a7792-wdt" (R-Car V2H)
+	         - "renesas,r8a7793-wdt" (R-Car M2-N)
+	         - "renesas,r8a7794-wdt" (R-Car E2)
 	         - "renesas,r8a7795-wdt" (R-Car H3)
 	         - "renesas,r8a7796-wdt" (R-Car M3-W)
 	         - "renesas,r8a77995-wdt" (R-Car D3)
 	         - "renesas,r7s72100-wdt" (RZ/A1)
+		The generic compatible string must be:
+		 - "renesas,rza-wdt" for RZ/A
+		 - "renesas,rcar-gen2-wdt" for R-Car Gen2 and RZ/G
+		 - "renesas,rcar-gen3-wdt" for R-Car Gen3
 
-  When compatible with the generic version, nodes must list the SoC-specific
-  version corresponding to the platform first, followed by the generic
-  version.
 
 - reg : Should contain WDT registers location and length
 - clocks : the clock feeding the watchdog timer.
-- 
2.7.4

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

* [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-12 17:44     ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

Due to commits:
* "ARM: shmobile: Add watchdog support",
* "ARM: shmobile: rcar-gen2: Add watchdog support", and
* "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
we now have everything we needed for the watchdog to work on Gen2 and
RZ/G1.

This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
always ON, when suspending to RAM we need to explicitly disable the
counting by clearing TME from RWTCSRA.

Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
---
v4->v5:
* various improvements suggested by Wolfram

 drivers/watchdog/renesas_wdt.c | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
index 831ef83..e972b7b 100644
--- a/drivers/watchdog/renesas_wdt.c
+++ b/drivers/watchdog/renesas_wdt.c
@@ -203,13 +203,29 @@ static int rwdt_remove(struct platform_device *pdev)
 	return 0;
 }
 
-/*
- * This driver does also fit for R-Car Gen2 (r8a779[0-4]) WDT. However, for SMP
- * to work there, one also needs a RESET (RST) driver which does not exist yet
- * due to HW issues. This needs to be solved before adding compatibles here.
- */
+static int __maybe_unused rwdt_suspend(struct device *dev)
+{
+	struct rwdt_priv *priv = dev_get_drvdata(dev);
+
+	if (watchdog_active(&priv->wdev))
+		rwdt_write(priv, priv->cks, RWTCSRA);
+	return 0;
+}
+
+static int __maybe_unused rwdt_resume(struct device *dev)
+{
+	struct rwdt_priv *priv = dev_get_drvdata(dev);
+
+	if (watchdog_active(&priv->wdev))
+		rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);
+	return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(rwdt_pm_ops, rwdt_suspend, rwdt_resume);
+
 static const struct of_device_id rwdt_ids[] = {
 	{ .compatible = "renesas,rcar-gen3-wdt", },
+	{ .compatible = "renesas,rcar-gen2-wdt", },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, rwdt_ids);
@@ -218,6 +234,7 @@ static struct platform_driver rwdt_driver = {
 	.driver = {
 		.name = "renesas_wdt",
 		.of_match_table = rwdt_ids,
+		.pm = &rwdt_pm_ops,
 	},
 	.probe = rwdt_probe,
 	.remove = rwdt_remove,
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

Due to commits:
* "ARM: shmobile: Add watchdog support",
* "ARM: shmobile: rcar-gen2: Add watchdog support", and
* "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
we now have everything we needed for the watchdog to work on Gen2 and
RZ/G1.

This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
always ON, when suspending to RAM we need to explicitly disable the
counting by clearing TME from RWTCSRA.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
---
v4->v5:
* various improvements suggested by Wolfram

 drivers/watchdog/renesas_wdt.c | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
index 831ef83..e972b7b 100644
--- a/drivers/watchdog/renesas_wdt.c
+++ b/drivers/watchdog/renesas_wdt.c
@@ -203,13 +203,29 @@ static int rwdt_remove(struct platform_device *pdev)
 	return 0;
 }
 
-/*
- * This driver does also fit for R-Car Gen2 (r8a779[0-4]) WDT. However, for SMP
- * to work there, one also needs a RESET (RST) driver which does not exist yet
- * due to HW issues. This needs to be solved before adding compatibles here.
- */
+static int __maybe_unused rwdt_suspend(struct device *dev)
+{
+	struct rwdt_priv *priv = dev_get_drvdata(dev);
+
+	if (watchdog_active(&priv->wdev))
+		rwdt_write(priv, priv->cks, RWTCSRA);
+	return 0;
+}
+
+static int __maybe_unused rwdt_resume(struct device *dev)
+{
+	struct rwdt_priv *priv = dev_get_drvdata(dev);
+
+	if (watchdog_active(&priv->wdev))
+		rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);
+	return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(rwdt_pm_ops, rwdt_suspend, rwdt_resume);
+
 static const struct of_device_id rwdt_ids[] = {
 	{ .compatible = "renesas,rcar-gen3-wdt", },
+	{ .compatible = "renesas,rcar-gen2-wdt", },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, rwdt_ids);
@@ -218,6 +234,7 @@ static struct platform_driver rwdt_driver = {
 	.driver = {
 		.name = "renesas_wdt",
 		.of_match_table = rwdt_ids,
+		.pm = &rwdt_pm_ops,
 	},
 	.probe = rwdt_probe,
 	.remove = rwdt_remove,
-- 
2.7.4


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

* [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

Due to commits:
* "ARM: shmobile: Add watchdog support",
* "ARM: shmobile: rcar-gen2: Add watchdog support", and
* "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
we now have everything we needed for the watchdog to work on Gen2 and
RZ/G1.

This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
always ON, when suspending to RAM we need to explicitly disable the
counting by clearing TME from RWTCSRA.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
---
v4->v5:
* various improvements suggested by Wolfram

 drivers/watchdog/renesas_wdt.c | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
index 831ef83..e972b7b 100644
--- a/drivers/watchdog/renesas_wdt.c
+++ b/drivers/watchdog/renesas_wdt.c
@@ -203,13 +203,29 @@ static int rwdt_remove(struct platform_device *pdev)
 	return 0;
 }
 
-/*
- * This driver does also fit for R-Car Gen2 (r8a779[0-4]) WDT. However, for SMP
- * to work there, one also needs a RESET (RST) driver which does not exist yet
- * due to HW issues. This needs to be solved before adding compatibles here.
- */
+static int __maybe_unused rwdt_suspend(struct device *dev)
+{
+	struct rwdt_priv *priv = dev_get_drvdata(dev);
+
+	if (watchdog_active(&priv->wdev))
+		rwdt_write(priv, priv->cks, RWTCSRA);
+	return 0;
+}
+
+static int __maybe_unused rwdt_resume(struct device *dev)
+{
+	struct rwdt_priv *priv = dev_get_drvdata(dev);
+
+	if (watchdog_active(&priv->wdev))
+		rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);
+	return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(rwdt_pm_ops, rwdt_suspend, rwdt_resume);
+
 static const struct of_device_id rwdt_ids[] = {
 	{ .compatible = "renesas,rcar-gen3-wdt", },
+	{ .compatible = "renesas,rcar-gen2-wdt", },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, rwdt_ids);
@@ -218,6 +234,7 @@ static struct platform_driver rwdt_driver = {
 	.driver = {
 		.name = "renesas_wdt",
 		.of_match_table = rwdt_ids,
+		.pm = &rwdt_pm_ops,
 	},
 	.probe = rwdt_probe,
 	.remove = rwdt_remove,
-- 
2.7.4

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

* [PATCH v5 13/26] watchdog: renesas_wdt: Add restart handler
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-12 17:44     ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

On iWave's boards iwg20d and iwg22d the only way to reboot the system is
by means of the watchdog.
This patch adds a restart handler to rwdt_ops, and also makes sure we
keep its priority to a medium level, in order to not override other more
effective handlers.

Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
---
v4->v5:
* changed rwdt_restart implementation as per Wolfram comments

 drivers/watchdog/renesas_wdt.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
index e972b7b..0f88614 100644
--- a/drivers/watchdog/renesas_wdt.c
+++ b/drivers/watchdog/renesas_wdt.c
@@ -107,6 +107,16 @@ static unsigned int rwdt_get_timeleft(struct watchdog_device *wdev)
 	return DIV_BY_CLKS_PER_SEC(priv, 65536 - val);
 }
 
+static int rwdt_restart(struct watchdog_device *wdev, unsigned long action,
+			void *data)
+{
+	struct rwdt_priv *priv = watchdog_get_drvdata(wdev);
+
+	rwdt_start(wdev);
+	rwdt_write(priv, 0xffff, RWTCNT);
+	return 0;
+}
+
 static const struct watchdog_info rwdt_ident = {
 	.options = WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT,
 	.identity = "Renesas WDT Watchdog",
@@ -118,6 +128,7 @@ static const struct watchdog_ops rwdt_ops = {
 	.stop = rwdt_stop,
 	.ping = rwdt_init_timeout,
 	.get_timeleft = rwdt_get_timeleft,
+	.restart = rwdt_restart,
 };
 
 static int rwdt_probe(struct platform_device *pdev)
@@ -176,6 +187,7 @@ static int rwdt_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, priv);
 	watchdog_set_drvdata(&priv->wdev, priv);
 	watchdog_set_nowayout(&priv->wdev, nowayout);
+	watchdog_set_restart_priority(&priv->wdev, 0);
 
 	/* This overrides the default timeout only if DT configuration was found */
 	ret = watchdog_init_timeout(&priv->wdev, 0, &pdev->dev);
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 13/26] watchdog: renesas_wdt: Add restart handler
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

On iWave's boards iwg20d and iwg22d the only way to reboot the system is
by means of the watchdog.
This patch adds a restart handler to rwdt_ops, and also makes sure we
keep its priority to a medium level, in order to not override other more
effective handlers.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
v4->v5:
* changed rwdt_restart implementation as per Wolfram comments

 drivers/watchdog/renesas_wdt.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
index e972b7b..0f88614 100644
--- a/drivers/watchdog/renesas_wdt.c
+++ b/drivers/watchdog/renesas_wdt.c
@@ -107,6 +107,16 @@ static unsigned int rwdt_get_timeleft(struct watchdog_device *wdev)
 	return DIV_BY_CLKS_PER_SEC(priv, 65536 - val);
 }
 
+static int rwdt_restart(struct watchdog_device *wdev, unsigned long action,
+			void *data)
+{
+	struct rwdt_priv *priv = watchdog_get_drvdata(wdev);
+
+	rwdt_start(wdev);
+	rwdt_write(priv, 0xffff, RWTCNT);
+	return 0;
+}
+
 static const struct watchdog_info rwdt_ident = {
 	.options = WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT,
 	.identity = "Renesas WDT Watchdog",
@@ -118,6 +128,7 @@ static const struct watchdog_ops rwdt_ops = {
 	.stop = rwdt_stop,
 	.ping = rwdt_init_timeout,
 	.get_timeleft = rwdt_get_timeleft,
+	.restart = rwdt_restart,
 };
 
 static int rwdt_probe(struct platform_device *pdev)
@@ -176,6 +187,7 @@ static int rwdt_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, priv);
 	watchdog_set_drvdata(&priv->wdev, priv);
 	watchdog_set_nowayout(&priv->wdev, nowayout);
+	watchdog_set_restart_priority(&priv->wdev, 0);
 
 	/* This overrides the default timeout only if DT configuration was found */
 	ret = watchdog_init_timeout(&priv->wdev, 0, &pdev->dev);
-- 
2.7.4


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

* [PATCH v5 13/26] watchdog: renesas_wdt: Add restart handler
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

On iWave's boards iwg20d and iwg22d the only way to reboot the system is
by means of the watchdog.
This patch adds a restart handler to rwdt_ops, and also makes sure we
keep its priority to a medium level, in order to not override other more
effective handlers.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
v4->v5:
* changed rwdt_restart implementation as per Wolfram comments

 drivers/watchdog/renesas_wdt.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
index e972b7b..0f88614 100644
--- a/drivers/watchdog/renesas_wdt.c
+++ b/drivers/watchdog/renesas_wdt.c
@@ -107,6 +107,16 @@ static unsigned int rwdt_get_timeleft(struct watchdog_device *wdev)
 	return DIV_BY_CLKS_PER_SEC(priv, 65536 - val);
 }
 
+static int rwdt_restart(struct watchdog_device *wdev, unsigned long action,
+			void *data)
+{
+	struct rwdt_priv *priv = watchdog_get_drvdata(wdev);
+
+	rwdt_start(wdev);
+	rwdt_write(priv, 0xffff, RWTCNT);
+	return 0;
+}
+
 static const struct watchdog_info rwdt_ident = {
 	.options = WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT,
 	.identity = "Renesas WDT Watchdog",
@@ -118,6 +128,7 @@ static const struct watchdog_ops rwdt_ops = {
 	.stop = rwdt_stop,
 	.ping = rwdt_init_timeout,
 	.get_timeleft = rwdt_get_timeleft,
+	.restart = rwdt_restart,
 };
 
 static int rwdt_probe(struct platform_device *pdev)
@@ -176,6 +187,7 @@ static int rwdt_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, priv);
 	watchdog_set_drvdata(&priv->wdev, priv);
 	watchdog_set_nowayout(&priv->wdev, nowayout);
+	watchdog_set_restart_priority(&priv->wdev, 0);
 
 	/* This overrides the default timeout only if DT configuration was found */
 	ret = watchdog_init_timeout(&priv->wdev, 0, &pdev->dev);
-- 
2.7.4

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

* [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

R-Car Gen2 and RZ/G1 platforms come with a watchdog IP, therefore enable
its driver by default.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/configs/shmobile_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
index 578434c..d5cdad8 100644
--- a/arch/arm/configs/shmobile_defconfig
+++ b/arch/arm/configs/shmobile_defconfig
@@ -132,6 +132,7 @@ CONFIG_CPU_THERMAL=y
 CONFIG_RCAR_THERMAL=y
 CONFIG_WATCHDOG=y
 CONFIG_DA9063_WATCHDOG=y
+CONFIG_RENESAS_WDT=y
 CONFIG_MFD_AS3711=y
 CONFIG_MFD_DA9063=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
-- 
2.7.4

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

* [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

R-Car Gen2 and RZ/G1 platforms come with a watchdog IP, therefore enable
its driver by default.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/configs/shmobile_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
index 578434c..d5cdad8 100644
--- a/arch/arm/configs/shmobile_defconfig
+++ b/arch/arm/configs/shmobile_defconfig
@@ -132,6 +132,7 @@ CONFIG_CPU_THERMAL=y
 CONFIG_RCAR_THERMAL=y
 CONFIG_WATCHDOG=y
 CONFIG_DA9063_WATCHDOG=y
+CONFIG_RENESAS_WDT=y
 CONFIG_MFD_AS3711=y
 CONFIG_MFD_DA9063=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
-- 
2.7.4

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

* [PATCH v5 15/26] clk: renesas: r8a7743: Add rwdt clock
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

Add "rwdt" clock to r8a7743_mod_clks. Also, since we may need to access
the watchdog registers at any time, declare the clock as critical.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 drivers/clk/renesas/r8a7743-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a7743-cpg-mssr.c b/drivers/clk/renesas/r8a7743-cpg-mssr.c
index 6dc0b30..d3c8b1e 100644
--- a/drivers/clk/renesas/r8a7743-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7743-cpg-mssr.c
@@ -117,6 +117,7 @@ static const struct mssr_mod_clk r8a7743_mod_clks[] __initconst = {
 	DEF_MOD("cmt1",			 329,	R8A7743_CLK_R),
 	DEF_MOD("usbhs-dmac0",		 330,	R8A7743_CLK_HP),
 	DEF_MOD("usbhs-dmac1",		 331,	R8A7743_CLK_HP),
+	DEF_MOD("rwdt",			 402,	R8A7743_CLK_R),
 	DEF_MOD("irqc",			 407,	R8A7743_CLK_CP),
 	DEF_MOD("intc-sys",		 408,	R8A7743_CLK_ZS),
 	DEF_MOD("audio-dmac1",		 501,	R8A7743_CLK_HP),
@@ -195,6 +196,7 @@ static const struct mssr_mod_clk r8a7743_mod_clks[] __initconst = {
 };
 
 static const unsigned int r8a7743_crit_mod_clks[] __initconst = {
+	MOD_CLK_ID(402),	/* RWDT */
 	MOD_CLK_ID(408),	/* INTC-SYS (GIC) */
 };
 
-- 
2.7.4

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

* [PATCH v5 15/26] clk: renesas: r8a7743: Add rwdt clock
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

Add "rwdt" clock to r8a7743_mod_clks. Also, since we may need to access
the watchdog registers at any time, declare the clock as critical.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 drivers/clk/renesas/r8a7743-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a7743-cpg-mssr.c b/drivers/clk/renesas/r8a7743-cpg-mssr.c
index 6dc0b30..d3c8b1e 100644
--- a/drivers/clk/renesas/r8a7743-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7743-cpg-mssr.c
@@ -117,6 +117,7 @@ static const struct mssr_mod_clk r8a7743_mod_clks[] __initconst = {
 	DEF_MOD("cmt1",			 329,	R8A7743_CLK_R),
 	DEF_MOD("usbhs-dmac0",		 330,	R8A7743_CLK_HP),
 	DEF_MOD("usbhs-dmac1",		 331,	R8A7743_CLK_HP),
+	DEF_MOD("rwdt",			 402,	R8A7743_CLK_R),
 	DEF_MOD("irqc",			 407,	R8A7743_CLK_CP),
 	DEF_MOD("intc-sys",		 408,	R8A7743_CLK_ZS),
 	DEF_MOD("audio-dmac1",		 501,	R8A7743_CLK_HP),
@@ -195,6 +196,7 @@ static const struct mssr_mod_clk r8a7743_mod_clks[] __initconst = {
 };
 
 static const unsigned int r8a7743_crit_mod_clks[] __initconst = {
+	MOD_CLK_ID(402),	/* RWDT */
 	MOD_CLK_ID(408),	/* INTC-SYS (GIC) */
 };
 
-- 
2.7.4

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

* [PATCH v5 16/26] clk: renesas: r8a7745: Add rwdt clock
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

Add "rwdt" clock to r8a7745_mod_clks. Also, since we may need to access
the watchdog registers at any time, declare the clock as critical.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 drivers/clk/renesas/r8a7745-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a7745-cpg-mssr.c b/drivers/clk/renesas/r8a7745-cpg-mssr.c
index 2859504..87f5a36 100644
--- a/drivers/clk/renesas/r8a7745-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7745-cpg-mssr.c
@@ -114,6 +114,7 @@ static const struct mssr_mod_clk r8a7745_mod_clks[] __initconst = {
 	DEF_MOD("cmt1",			 329,	R8A7745_CLK_R),
 	DEF_MOD("usbhs-dmac0",		 330,	R8A7745_CLK_HP),
 	DEF_MOD("usbhs-dmac1",		 331,	R8A7745_CLK_HP),
+	DEF_MOD("rwdt",			 402,	R8A7745_CLK_R),
 	DEF_MOD("irqc",			 407,	R8A7745_CLK_CP),
 	DEF_MOD("intc-sys",		 408,	R8A7745_CLK_ZS),
 	DEF_MOD("audio-dmac0",		 502,	R8A7745_CLK_HP),
@@ -180,6 +181,7 @@ static const struct mssr_mod_clk r8a7745_mod_clks[] __initconst = {
 };
 
 static const unsigned int r8a7745_crit_mod_clks[] __initconst = {
+	MOD_CLK_ID(402),	/* RWDT */
 	MOD_CLK_ID(408),	/* INTC-SYS (GIC) */
 };
 
-- 
2.7.4


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

* [PATCH v5 16/26] clk: renesas: r8a7745: Add rwdt clock
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

Add "rwdt" clock to r8a7745_mod_clks. Also, since we may need to access
the watchdog registers at any time, declare the clock as critical.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 drivers/clk/renesas/r8a7745-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a7745-cpg-mssr.c b/drivers/clk/renesas/r8a7745-cpg-mssr.c
index 2859504..87f5a36 100644
--- a/drivers/clk/renesas/r8a7745-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7745-cpg-mssr.c
@@ -114,6 +114,7 @@ static const struct mssr_mod_clk r8a7745_mod_clks[] __initconst = {
 	DEF_MOD("cmt1",			 329,	R8A7745_CLK_R),
 	DEF_MOD("usbhs-dmac0",		 330,	R8A7745_CLK_HP),
 	DEF_MOD("usbhs-dmac1",		 331,	R8A7745_CLK_HP),
+	DEF_MOD("rwdt",			 402,	R8A7745_CLK_R),
 	DEF_MOD("irqc",			 407,	R8A7745_CLK_CP),
 	DEF_MOD("intc-sys",		 408,	R8A7745_CLK_ZS),
 	DEF_MOD("audio-dmac0",		 502,	R8A7745_CLK_HP),
@@ -180,6 +181,7 @@ static const struct mssr_mod_clk r8a7745_mod_clks[] __initconst = {
 };
 
 static const unsigned int r8a7745_crit_mod_clks[] __initconst = {
+	MOD_CLK_ID(402),	/* RWDT */
 	MOD_CLK_ID(408),	/* INTC-SYS (GIC) */
 };
 
-- 
2.7.4

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

* [PATCH v5 17/26] clk: renesas: r8a7790: Add rwdt clock
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-12 17:44     ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

Add "rwdt" clock to r8a7790_mod_clks. Also, since we may need to access
the watchdog registers at any time, declare the clock as critical.

Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Reviewed-by: Wolfram Sang <wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>
---
v4->v5:
* no change

 drivers/clk/renesas/r8a7790-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a7790-cpg-mssr.c b/drivers/clk/renesas/r8a7790-cpg-mssr.c
index 46bb55b..f936cb7 100644
--- a/drivers/clk/renesas/r8a7790-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7790-cpg-mssr.c
@@ -140,6 +140,7 @@ static const struct mssr_mod_clk r8a7790_mod_clks[] __initconst = {
 	DEF_MOD("cmt1",			 329,	R8A7790_CLK_R),
 	DEF_MOD("usbhs-dmac0",		 330,	R8A7790_CLK_HP),
 	DEF_MOD("usbhs-dmac1",		 331,	R8A7790_CLK_HP),
+	DEF_MOD("rwdt",			 402,	R8A7790_CLK_R),
 	DEF_MOD("irqc",			 407,	R8A7790_CLK_CP),
 	DEF_MOD("intc-sys",		 408,	R8A7790_CLK_ZS),
 	DEF_MOD("audio-dmac1",		 501,	R8A7790_CLK_HP),
@@ -211,6 +212,7 @@ static const struct mssr_mod_clk r8a7790_mod_clks[] __initconst = {
 };
 
 static const unsigned int r8a7790_crit_mod_clks[] __initconst = {
+	MOD_CLK_ID(402),	/* RWDT */
 	MOD_CLK_ID(408),	/* INTC-SYS (GIC) */
 };
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 17/26] clk: renesas: r8a7790: Add rwdt clock
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

Add "rwdt" clock to r8a7790_mod_clks. Also, since we may need to access
the watchdog registers at any time, declare the clock as critical.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 drivers/clk/renesas/r8a7790-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a7790-cpg-mssr.c b/drivers/clk/renesas/r8a7790-cpg-mssr.c
index 46bb55b..f936cb7 100644
--- a/drivers/clk/renesas/r8a7790-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7790-cpg-mssr.c
@@ -140,6 +140,7 @@ static const struct mssr_mod_clk r8a7790_mod_clks[] __initconst = {
 	DEF_MOD("cmt1",			 329,	R8A7790_CLK_R),
 	DEF_MOD("usbhs-dmac0",		 330,	R8A7790_CLK_HP),
 	DEF_MOD("usbhs-dmac1",		 331,	R8A7790_CLK_HP),
+	DEF_MOD("rwdt",			 402,	R8A7790_CLK_R),
 	DEF_MOD("irqc",			 407,	R8A7790_CLK_CP),
 	DEF_MOD("intc-sys",		 408,	R8A7790_CLK_ZS),
 	DEF_MOD("audio-dmac1",		 501,	R8A7790_CLK_HP),
@@ -211,6 +212,7 @@ static const struct mssr_mod_clk r8a7790_mod_clks[] __initconst = {
 };
 
 static const unsigned int r8a7790_crit_mod_clks[] __initconst = {
+	MOD_CLK_ID(402),	/* RWDT */
 	MOD_CLK_ID(408),	/* INTC-SYS (GIC) */
 };
 
-- 
2.7.4


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

* [PATCH v5 17/26] clk: renesas: r8a7790: Add rwdt clock
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

Add "rwdt" clock to r8a7790_mod_clks. Also, since we may need to access
the watchdog registers at any time, declare the clock as critical.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 drivers/clk/renesas/r8a7790-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a7790-cpg-mssr.c b/drivers/clk/renesas/r8a7790-cpg-mssr.c
index 46bb55b..f936cb7 100644
--- a/drivers/clk/renesas/r8a7790-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7790-cpg-mssr.c
@@ -140,6 +140,7 @@ static const struct mssr_mod_clk r8a7790_mod_clks[] __initconst = {
 	DEF_MOD("cmt1",			 329,	R8A7790_CLK_R),
 	DEF_MOD("usbhs-dmac0",		 330,	R8A7790_CLK_HP),
 	DEF_MOD("usbhs-dmac1",		 331,	R8A7790_CLK_HP),
+	DEF_MOD("rwdt",			 402,	R8A7790_CLK_R),
 	DEF_MOD("irqc",			 407,	R8A7790_CLK_CP),
 	DEF_MOD("intc-sys",		 408,	R8A7790_CLK_ZS),
 	DEF_MOD("audio-dmac1",		 501,	R8A7790_CLK_HP),
@@ -211,6 +212,7 @@ static const struct mssr_mod_clk r8a7790_mod_clks[] __initconst = {
 };
 
 static const unsigned int r8a7790_crit_mod_clks[] __initconst = {
+	MOD_CLK_ID(402),	/* RWDT */
 	MOD_CLK_ID(408),	/* INTC-SYS (GIC) */
 };
 
-- 
2.7.4

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

* [PATCH v5 18/26] clk: renesas: r8a7791/r8a7793: Add rwdt clock
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-12 17:44     ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

Add "rwdt" clock to r8a7791_mod_clks. Also, since we may need to access
the watchdog registers at any time, declare the clock as critical.

Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Reviewed-by: Wolfram Sang <wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>
---
v4->v5:
* no change

 drivers/clk/renesas/r8a7791-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a7791-cpg-mssr.c b/drivers/clk/renesas/r8a7791-cpg-mssr.c
index c0b51f9..820b220 100644
--- a/drivers/clk/renesas/r8a7791-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7791-cpg-mssr.c
@@ -128,6 +128,7 @@ static const struct mssr_mod_clk r8a7791_mod_clks[] __initconst = {
 	DEF_MOD("cmt1",			 329,	R8A7791_CLK_R),
 	DEF_MOD("usbhs-dmac0",		 330,	R8A7791_CLK_HP),
 	DEF_MOD("usbhs-dmac1",		 331,	R8A7791_CLK_HP),
+	DEF_MOD("rwdt",			 402,	R8A7791_CLK_R),
 	DEF_MOD("irqc",			 407,	R8A7791_CLK_CP),
 	DEF_MOD("intc-sys",		 408,	R8A7791_CLK_ZS),
 	DEF_MOD("audio-dmac1",		 501,	R8A7791_CLK_HP),
@@ -209,6 +210,7 @@ static const struct mssr_mod_clk r8a7791_mod_clks[] __initconst = {
 };
 
 static const unsigned int r8a7791_crit_mod_clks[] __initconst = {
+	MOD_CLK_ID(402),	/* RWDT */
 	MOD_CLK_ID(408),	/* INTC-SYS (GIC) */
 };
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 18/26] clk: renesas: r8a7791/r8a7793: Add rwdt clock
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

Add "rwdt" clock to r8a7791_mod_clks. Also, since we may need to access
the watchdog registers at any time, declare the clock as critical.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 drivers/clk/renesas/r8a7791-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a7791-cpg-mssr.c b/drivers/clk/renesas/r8a7791-cpg-mssr.c
index c0b51f9..820b220 100644
--- a/drivers/clk/renesas/r8a7791-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7791-cpg-mssr.c
@@ -128,6 +128,7 @@ static const struct mssr_mod_clk r8a7791_mod_clks[] __initconst = {
 	DEF_MOD("cmt1",			 329,	R8A7791_CLK_R),
 	DEF_MOD("usbhs-dmac0",		 330,	R8A7791_CLK_HP),
 	DEF_MOD("usbhs-dmac1",		 331,	R8A7791_CLK_HP),
+	DEF_MOD("rwdt",			 402,	R8A7791_CLK_R),
 	DEF_MOD("irqc",			 407,	R8A7791_CLK_CP),
 	DEF_MOD("intc-sys",		 408,	R8A7791_CLK_ZS),
 	DEF_MOD("audio-dmac1",		 501,	R8A7791_CLK_HP),
@@ -209,6 +210,7 @@ static const struct mssr_mod_clk r8a7791_mod_clks[] __initconst = {
 };
 
 static const unsigned int r8a7791_crit_mod_clks[] __initconst = {
+	MOD_CLK_ID(402),	/* RWDT */
 	MOD_CLK_ID(408),	/* INTC-SYS (GIC) */
 };
 
-- 
2.7.4


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

* [PATCH v5 18/26] clk: renesas: r8a7791/r8a7793: Add rwdt clock
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

Add "rwdt" clock to r8a7791_mod_clks. Also, since we may need to access
the watchdog registers at any time, declare the clock as critical.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 drivers/clk/renesas/r8a7791-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a7791-cpg-mssr.c b/drivers/clk/renesas/r8a7791-cpg-mssr.c
index c0b51f9..820b220 100644
--- a/drivers/clk/renesas/r8a7791-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7791-cpg-mssr.c
@@ -128,6 +128,7 @@ static const struct mssr_mod_clk r8a7791_mod_clks[] __initconst = {
 	DEF_MOD("cmt1",			 329,	R8A7791_CLK_R),
 	DEF_MOD("usbhs-dmac0",		 330,	R8A7791_CLK_HP),
 	DEF_MOD("usbhs-dmac1",		 331,	R8A7791_CLK_HP),
+	DEF_MOD("rwdt",			 402,	R8A7791_CLK_R),
 	DEF_MOD("irqc",			 407,	R8A7791_CLK_CP),
 	DEF_MOD("intc-sys",		 408,	R8A7791_CLK_ZS),
 	DEF_MOD("audio-dmac1",		 501,	R8A7791_CLK_HP),
@@ -209,6 +210,7 @@ static const struct mssr_mod_clk r8a7791_mod_clks[] __initconst = {
 };
 
 static const unsigned int r8a7791_crit_mod_clks[] __initconst = {
+	MOD_CLK_ID(402),	/* RWDT */
 	MOD_CLK_ID(408),	/* INTC-SYS (GIC) */
 };
 
-- 
2.7.4

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

* [PATCH v5 19/26] clk: renesas: r8a7794: Add rwdt clock
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

Add "rwdt" clock to r8a7794_mod_clks. Also, since we may need to access
the watchdog registers at any time, declare the clock as critical.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 drivers/clk/renesas/r8a7794-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a7794-cpg-mssr.c b/drivers/clk/renesas/r8a7794-cpg-mssr.c
index ec091a4..2a40bbe 100644
--- a/drivers/clk/renesas/r8a7794-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7794-cpg-mssr.c
@@ -121,6 +121,7 @@ static const struct mssr_mod_clk r8a7794_mod_clks[] __initconst = {
 	DEF_MOD("cmt1",			 329,	R8A7794_CLK_R),
 	DEF_MOD("usbhs-dmac0",		 330,	R8A7794_CLK_HP),
 	DEF_MOD("usbhs-dmac1",		 331,	R8A7794_CLK_HP),
+	DEF_MOD("rwdt",			 402,	R8A7794_CLK_R),
 	DEF_MOD("irqc",			 407,	R8A7794_CLK_CP),
 	DEF_MOD("intc-sys",		 408,	R8A7794_CLK_ZS),
 	DEF_MOD("audio-dmac0",		 502,	R8A7794_CLK_HP),
@@ -190,6 +191,7 @@ static const struct mssr_mod_clk r8a7794_mod_clks[] __initconst = {
 };
 
 static const unsigned int r8a7794_crit_mod_clks[] __initconst = {
+	MOD_CLK_ID(402),	/* RWDT */
 	MOD_CLK_ID(408),	/* INTC-SYS (GIC) */
 };
 
-- 
2.7.4

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

* [PATCH v5 19/26] clk: renesas: r8a7794: Add rwdt clock
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

Add "rwdt" clock to r8a7794_mod_clks. Also, since we may need to access
the watchdog registers at any time, declare the clock as critical.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 drivers/clk/renesas/r8a7794-cpg-mssr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r8a7794-cpg-mssr.c b/drivers/clk/renesas/r8a7794-cpg-mssr.c
index ec091a4..2a40bbe 100644
--- a/drivers/clk/renesas/r8a7794-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7794-cpg-mssr.c
@@ -121,6 +121,7 @@ static const struct mssr_mod_clk r8a7794_mod_clks[] __initconst = {
 	DEF_MOD("cmt1",			 329,	R8A7794_CLK_R),
 	DEF_MOD("usbhs-dmac0",		 330,	R8A7794_CLK_HP),
 	DEF_MOD("usbhs-dmac1",		 331,	R8A7794_CLK_HP),
+	DEF_MOD("rwdt",			 402,	R8A7794_CLK_R),
 	DEF_MOD("irqc",			 407,	R8A7794_CLK_CP),
 	DEF_MOD("intc-sys",		 408,	R8A7794_CLK_ZS),
 	DEF_MOD("audio-dmac0",		 502,	R8A7794_CLK_HP),
@@ -190,6 +191,7 @@ static const struct mssr_mod_clk r8a7794_mod_clks[] __initconst = {
 };
 
 static const unsigned int r8a7794_crit_mod_clks[] __initconst = {
+	MOD_CLK_ID(402),	/* RWDT */
 	MOD_CLK_ID(408),	/* INTC-SYS (GIC) */
 };
 
-- 
2.7.4

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

* [PATCH v5 20/26] ARM: dts: r8a7743: Add watchdog support to SoC dtsi
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adds watchdog support to the r8a7743 SoC dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7743.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7743.dtsi b/arch/arm/boot/dts/r8a7743.dtsi
index c2943d7..1d4505f 100644
--- a/arch/arm/boot/dts/r8a7743.dtsi
+++ b/arch/arm/boot/dts/r8a7743.dtsi
@@ -368,6 +368,16 @@
 			reg = <0 0xe6160000 0 0x100>;
 		};
 
+		rwdt: watchdog@e6020000 {
+			compatible = "renesas,r8a7743-wdt",
+				     "renesas,rcar-gen2-wdt";
+			reg = <0 0xe6020000 0 0x0c>;
+			clocks = <&cpg CPG_MOD 402>;
+			power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
+			resets = <&cpg 402>;
+			status = "disabled";
+		};
+
 		sysc: system-controller@e6180000 {
 			compatible = "renesas,r8a7743-sysc";
 			reg = <0 0xe6180000 0 0x200>;
-- 
2.7.4


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

* [PATCH v5 20/26] ARM: dts: r8a7743: Add watchdog support to SoC dtsi
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds watchdog support to the r8a7743 SoC dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7743.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7743.dtsi b/arch/arm/boot/dts/r8a7743.dtsi
index c2943d7..1d4505f 100644
--- a/arch/arm/boot/dts/r8a7743.dtsi
+++ b/arch/arm/boot/dts/r8a7743.dtsi
@@ -368,6 +368,16 @@
 			reg = <0 0xe6160000 0 0x100>;
 		};
 
+		rwdt: watchdog at e6020000 {
+			compatible = "renesas,r8a7743-wdt",
+				     "renesas,rcar-gen2-wdt";
+			reg = <0 0xe6020000 0 0x0c>;
+			clocks = <&cpg CPG_MOD 402>;
+			power-domains = <&sysc R8A7743_PD_ALWAYS_ON>;
+			resets = <&cpg 402>;
+			status = "disabled";
+		};
+
 		sysc: system-controller at e6180000 {
 			compatible = "renesas,r8a7743-sysc";
 			reg = <0 0xe6180000 0 0x200>;
-- 
2.7.4

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

* [PATCH v5 21/26] ARM: dts: r8a7745: Add watchdog support to SoC dtsi
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch adds watchdog support to the r8a7745 SoC dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7745.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7745.dtsi b/arch/arm/boot/dts/r8a7745.dtsi
index 6bc1cf4..5d1b8f2 100644
--- a/arch/arm/boot/dts/r8a7745.dtsi
+++ b/arch/arm/boot/dts/r8a7745.dtsi
@@ -321,6 +321,16 @@
 			reg = <0 0xe6160000 0 0x100>;
 		};
 
+		rwdt: watchdog@e6020000 {
+			compatible = "renesas,r8a7745-wdt",
+				     "renesas,rcar-gen2-wdt";
+			reg = <0 0xe6020000 0 0x0c>;
+			clocks = <&cpg CPG_MOD 402>;
+			power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
+			resets = <&cpg 402>;
+			status = "disabled";
+		};
+
 		sysc: system-controller@e6180000 {
 			compatible = "renesas,r8a7745-sysc";
 			reg = <0 0xe6180000 0 0x200>;
-- 
2.7.4

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

* [PATCH v5 21/26] ARM: dts: r8a7745: Add watchdog support to SoC dtsi
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds watchdog support to the r8a7745 SoC dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7745.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7745.dtsi b/arch/arm/boot/dts/r8a7745.dtsi
index 6bc1cf4..5d1b8f2 100644
--- a/arch/arm/boot/dts/r8a7745.dtsi
+++ b/arch/arm/boot/dts/r8a7745.dtsi
@@ -321,6 +321,16 @@
 			reg = <0 0xe6160000 0 0x100>;
 		};
 
+		rwdt: watchdog at e6020000 {
+			compatible = "renesas,r8a7745-wdt",
+				     "renesas,rcar-gen2-wdt";
+			reg = <0 0xe6020000 0 0x0c>;
+			clocks = <&cpg CPG_MOD 402>;
+			power-domains = <&sysc R8A7745_PD_ALWAYS_ON>;
+			resets = <&cpg 402>;
+			status = "disabled";
+		};
+
 		sysc: system-controller at e6180000 {
 			compatible = "renesas,r8a7745-sysc";
 			reg = <0 0xe6180000 0 0x200>;
-- 
2.7.4

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

* [PATCH v5 22/26] ARM: dts: r8a7790: Add watchdog support to SoC dtsi
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-12 17:44     ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This commit adds watchdog support to the r8a7790 dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
Acked-by: Wolfram Sang <wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7790.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index a84bf35..83d6704 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -218,6 +218,16 @@
 		#size-cells = <2>;
 		ranges;
 
+		rwdt: watchdog@e6020000 {
+			compatible = "renesas,r8a7790-wdt",
+				     "renesas,rcar-gen2-wdt";
+			reg = <0 0xe6020000 0 0x0c>;
+			clocks = <&cpg CPG_MOD 402>;
+			power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
+			resets = <&cpg 402>;
+			status = "disabled";
+		};
+
 		gpio0: gpio@e6050000 {
 			compatible = "renesas,gpio-r8a7790",
 				     "renesas,rcar-gen2-gpio";
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 22/26] ARM: dts: r8a7790: Add watchdog support to SoC dtsi
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This commit adds watchdog support to the r8a7790 dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7790.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index a84bf35..83d6704 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -218,6 +218,16 @@
 		#size-cells = <2>;
 		ranges;
 
+		rwdt: watchdog@e6020000 {
+			compatible = "renesas,r8a7790-wdt",
+				     "renesas,rcar-gen2-wdt";
+			reg = <0 0xe6020000 0 0x0c>;
+			clocks = <&cpg CPG_MOD 402>;
+			power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
+			resets = <&cpg 402>;
+			status = "disabled";
+		};
+
 		gpio0: gpio@e6050000 {
 			compatible = "renesas,gpio-r8a7790",
 				     "renesas,rcar-gen2-gpio";
-- 
2.7.4


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

* [PATCH v5 22/26] ARM: dts: r8a7790: Add watchdog support to SoC dtsi
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This commit adds watchdog support to the r8a7790 dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7790.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index a84bf35..83d6704 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -218,6 +218,16 @@
 		#size-cells = <2>;
 		ranges;
 
+		rwdt: watchdog at e6020000 {
+			compatible = "renesas,r8a7790-wdt",
+				     "renesas,rcar-gen2-wdt";
+			reg = <0 0xe6020000 0 0x0c>;
+			clocks = <&cpg CPG_MOD 402>;
+			power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
+			resets = <&cpg 402>;
+			status = "disabled";
+		};
+
 		gpio0: gpio at e6050000 {
 			compatible = "renesas,gpio-r8a7790",
 				     "renesas,rcar-gen2-gpio";
-- 
2.7.4

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

* [PATCH v5 23/26] ARM: dts: r8a7791: Add watchdog support to SoC dtsi
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This commit adds watchdog support to the r8a7791 dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7791.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index d2a4546..80e20ecd 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -142,6 +142,16 @@
 		#size-cells = <2>;
 		ranges;
 
+		rwdt: watchdog@e6020000 {
+			compatible = "renesas,r8a7791-wdt",
+				     "renesas,rcar-gen2-wdt";
+			reg = <0 0xe6020000 0 0x0c>;
+			clocks = <&cpg CPG_MOD 402>;
+			power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
+			resets = <&cpg 402>;
+			status = "disabled";
+		};
+
 		gpio0: gpio@e6050000 {
 			compatible = "renesas,gpio-r8a7791",
 				     "renesas,rcar-gen2-gpio";
-- 
2.7.4

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

* [PATCH v5 23/26] ARM: dts: r8a7791: Add watchdog support to SoC dtsi
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This commit adds watchdog support to the r8a7791 dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7791.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index d2a4546..80e20ecd 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -142,6 +142,16 @@
 		#size-cells = <2>;
 		ranges;
 
+		rwdt: watchdog at e6020000 {
+			compatible = "renesas,r8a7791-wdt",
+				     "renesas,rcar-gen2-wdt";
+			reg = <0 0xe6020000 0 0x0c>;
+			clocks = <&cpg CPG_MOD 402>;
+			power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
+			resets = <&cpg 402>;
+			status = "disabled";
+		};
+
 		gpio0: gpio at e6050000 {
 			compatible = "renesas,gpio-r8a7791",
 				     "renesas,rcar-gen2-gpio";
-- 
2.7.4

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

* [PATCH v5 24/26] ARM: dts: r8a7794: Add watchdog support to SoC dtsi
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This commit adds watchdog support to the r8a7794 dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7794.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index e47c5f4..1c9b149 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -119,6 +119,16 @@
 		#size-cells = <2>;
 		ranges;
 
+		rwdt: watchdog@e6020000 {
+			compatible = "renesas,r8a7794-wdt",
+				     "renesas,rcar-gen2-wdt";
+			reg = <0 0xe6020000 0 0x0c>;
+			clocks = <&cpg CPG_MOD 402>;
+			power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
+			resets = <&cpg 402>;
+			status = "disabled";
+		};
+
 		gpio0: gpio@e6050000 {
 			compatible = "renesas,gpio-r8a7794",
 				     "renesas,rcar-gen2-gpio";
-- 
2.7.4


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

* [PATCH v5 24/26] ARM: dts: r8a7794: Add watchdog support to SoC dtsi
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This commit adds watchdog support to the r8a7794 dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7794.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index e47c5f4..1c9b149 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -119,6 +119,16 @@
 		#size-cells = <2>;
 		ranges;
 
+		rwdt: watchdog at e6020000 {
+			compatible = "renesas,r8a7794-wdt",
+				     "renesas,rcar-gen2-wdt";
+			reg = <0 0xe6020000 0 0x0c>;
+			clocks = <&cpg CPG_MOD 402>;
+			power-domains = <&sysc R8A7794_PD_ALWAYS_ON>;
+			resets = <&cpg 402>;
+			status = "disabled";
+		};
+
 		gpio0: gpio at e6050000 {
 			compatible = "renesas,gpio-r8a7794",
 				     "renesas,rcar-gen2-gpio";
-- 
2.7.4

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

* [PATCH v5 25/26] ARM: dts: iwg20m: Add watchdog support to SoM dtsi
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-12 17:44     ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch enables the watchdog from within the iwg20m SoM dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
Reviewed-by: Wolfram Sang <wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7743-iwg20m.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7743-iwg20m.dtsi b/arch/arm/boot/dts/r8a7743-iwg20m.dtsi
index 1d3e950..d364685 100644
--- a/arch/arm/boot/dts/r8a7743-iwg20m.dtsi
+++ b/arch/arm/boot/dts/r8a7743-iwg20m.dtsi
@@ -91,6 +91,11 @@
 	};
 };
 
+&rwdt {
+	timeout-sec = <60>;
+	status = "okay";
+};
+
 &sdhi0 {
 	pinctrl-0 = <&sdhi0_pins>;
 	pinctrl-names = "default";
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v5 25/26] ARM: dts: iwg20m: Add watchdog support to SoM dtsi
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch enables the watchdog from within the iwg20m SoM dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7743-iwg20m.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7743-iwg20m.dtsi b/arch/arm/boot/dts/r8a7743-iwg20m.dtsi
index 1d3e950..d364685 100644
--- a/arch/arm/boot/dts/r8a7743-iwg20m.dtsi
+++ b/arch/arm/boot/dts/r8a7743-iwg20m.dtsi
@@ -91,6 +91,11 @@
 	};
 };
 
+&rwdt {
+	timeout-sec = <60>;
+	status = "okay";
+};
+
 &sdhi0 {
 	pinctrl-0 = <&sdhi0_pins>;
 	pinctrl-names = "default";
-- 
2.7.4


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

* [PATCH v5 25/26] ARM: dts: iwg20m: Add watchdog support to SoM dtsi
@ 2018-02-12 17:44     ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch enables the watchdog from within the iwg20m SoM dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7743-iwg20m.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7743-iwg20m.dtsi b/arch/arm/boot/dts/r8a7743-iwg20m.dtsi
index 1d3e950..d364685 100644
--- a/arch/arm/boot/dts/r8a7743-iwg20m.dtsi
+++ b/arch/arm/boot/dts/r8a7743-iwg20m.dtsi
@@ -91,6 +91,11 @@
 	};
 };
 
+&rwdt {
+	timeout-sec = <60>;
+	status = "okay";
+};
+
 &sdhi0 {
 	pinctrl-0 = <&sdhi0_pins>;
 	pinctrl-names = "default";
-- 
2.7.4

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

* [PATCH v5 26/26] ARM: dts: iwg22m: Add watchdog support to SoM dtsi
  2018-02-12 17:44 ` Fabrizio Castro
@ 2018-02-12 17:44   ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch enables the watchdog from within the iwg20m SoM dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7745-iwg22m.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7745-iwg22m.dtsi b/arch/arm/boot/dts/r8a7745-iwg22m.dtsi
index 8d0a392b..29b6e10 100644
--- a/arch/arm/boot/dts/r8a7745-iwg22m.dtsi
+++ b/arch/arm/boot/dts/r8a7745-iwg22m.dtsi
@@ -91,6 +91,11 @@
 	};
 };
 
+&rwdt {
+	timeout-sec = <60>;
+	status = "okay";
+};
+
 &sdhi1 {
 	pinctrl-0 = <&sdhi1_pins>;
 	pinctrl-names = "default";
-- 
2.7.4

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

* [PATCH v5 26/26] ARM: dts: iwg22m: Add watchdog support to SoM dtsi
@ 2018-02-12 17:44   ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

This patch enables the watchdog from within the iwg20m SoM dtsi.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v4->v5:
* no change

 arch/arm/boot/dts/r8a7745-iwg22m.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7745-iwg22m.dtsi b/arch/arm/boot/dts/r8a7745-iwg22m.dtsi
index 8d0a392b..29b6e10 100644
--- a/arch/arm/boot/dts/r8a7745-iwg22m.dtsi
+++ b/arch/arm/boot/dts/r8a7745-iwg22m.dtsi
@@ -91,6 +91,11 @@
 	};
 };
 
+&rwdt {
+	timeout-sec = <60>;
+	status = "okay";
+};
+
 &sdhi1 {
 	pinctrl-0 = <&sdhi1_pins>;
 	pinctrl-names = "default";
-- 
2.7.4

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

* Re: [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
  2018-02-12 17:44     ` Fabrizio Castro
  (?)
@ 2018-02-12 19:24         ` Guenter Roeck
  -1 siblings, 0 replies; 177+ messages in thread
From: Guenter Roeck @ 2018-02-12 19:24 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das

On Mon, Feb 12, 2018 at 05:44:21PM +0000, Fabrizio Castro wrote:
> Due to commits:
> * "ARM: shmobile: Add watchdog support",
> * "ARM: shmobile: rcar-gen2: Add watchdog support", and
> * "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
> we now have everything we needed for the watchdog to work on Gen2 and
> RZ/G1.
> 
> This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
> Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
> always ON, when suspending to RAM we need to explicitly disable the
> counting by clearing TME from RWTCSRA.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>

Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>

> ---
> v4->v5:
> * various improvements suggested by Wolfram
> 
>  drivers/watchdog/renesas_wdt.c | 27 ++++++++++++++++++++++-----
>  1 file changed, 22 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
> index 831ef83..e972b7b 100644
> --- a/drivers/watchdog/renesas_wdt.c
> +++ b/drivers/watchdog/renesas_wdt.c
> @@ -203,13 +203,29 @@ static int rwdt_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -/*
> - * This driver does also fit for R-Car Gen2 (r8a779[0-4]) WDT. However, for SMP
> - * to work there, one also needs a RESET (RST) driver which does not exist yet
> - * due to HW issues. This needs to be solved before adding compatibles here.
> - */
> +static int __maybe_unused rwdt_suspend(struct device *dev)
> +{
> +	struct rwdt_priv *priv = dev_get_drvdata(dev);
> +
> +	if (watchdog_active(&priv->wdev))
> +		rwdt_write(priv, priv->cks, RWTCSRA);
> +	return 0;
> +}
> +
> +static int __maybe_unused rwdt_resume(struct device *dev)
> +{
> +	struct rwdt_priv *priv = dev_get_drvdata(dev);
> +
> +	if (watchdog_active(&priv->wdev))
> +		rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);
> +	return 0;
> +}
> +
> +static SIMPLE_DEV_PM_OPS(rwdt_pm_ops, rwdt_suspend, rwdt_resume);
> +
>  static const struct of_device_id rwdt_ids[] = {
>  	{ .compatible = "renesas,rcar-gen3-wdt", },
> +	{ .compatible = "renesas,rcar-gen2-wdt", },
>  	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, rwdt_ids);
> @@ -218,6 +234,7 @@ static struct platform_driver rwdt_driver = {
>  	.driver = {
>  		.name = "renesas_wdt",
>  		.of_match_table = rwdt_ids,
> +		.pm = &rwdt_pm_ops,
>  	},
>  	.probe = rwdt_probe,
>  	.remove = rwdt_remove,
> -- 
> 2.7.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
@ 2018-02-12 19:24         ` Guenter Roeck
  0 siblings, 0 replies; 177+ messages in thread
From: Guenter Roeck @ 2018-02-12 19:24 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram

On Mon, Feb 12, 2018 at 05:44:21PM +0000, Fabrizio Castro wrote:
> Due to commits:
> * "ARM: shmobile: Add watchdog support",
> * "ARM: shmobile: rcar-gen2: Add watchdog support", and
> * "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
> we now have everything we needed for the watchdog to work on Gen2 and
> RZ/G1.
> 
> This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
> Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
> always ON, when suspending to RAM we need to explicitly disable the
> counting by clearing TME from RWTCSRA.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

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

> ---
> v4->v5:
> * various improvements suggested by Wolfram
> 
>  drivers/watchdog/renesas_wdt.c | 27 ++++++++++++++++++++++-----
>  1 file changed, 22 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
> index 831ef83..e972b7b 100644
> --- a/drivers/watchdog/renesas_wdt.c
> +++ b/drivers/watchdog/renesas_wdt.c
> @@ -203,13 +203,29 @@ static int rwdt_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -/*
> - * This driver does also fit for R-Car Gen2 (r8a779[0-4]) WDT. However, for SMP
> - * to work there, one also needs a RESET (RST) driver which does not exist yet
> - * due to HW issues. This needs to be solved before adding compatibles here.
> - */
> +static int __maybe_unused rwdt_suspend(struct device *dev)
> +{
> +	struct rwdt_priv *priv = dev_get_drvdata(dev);
> +
> +	if (watchdog_active(&priv->wdev))
> +		rwdt_write(priv, priv->cks, RWTCSRA);
> +	return 0;
> +}
> +
> +static int __maybe_unused rwdt_resume(struct device *dev)
> +{
> +	struct rwdt_priv *priv = dev_get_drvdata(dev);
> +
> +	if (watchdog_active(&priv->wdev))
> +		rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);
> +	return 0;
> +}
> +
> +static SIMPLE_DEV_PM_OPS(rwdt_pm_ops, rwdt_suspend, rwdt_resume);
> +
>  static const struct of_device_id rwdt_ids[] = {
>  	{ .compatible = "renesas,rcar-gen3-wdt", },
> +	{ .compatible = "renesas,rcar-gen2-wdt", },
>  	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, rwdt_ids);
> @@ -218,6 +234,7 @@ static struct platform_driver rwdt_driver = {
>  	.driver = {
>  		.name = "renesas_wdt",
>  		.of_match_table = rwdt_ids,
> +		.pm = &rwdt_pm_ops,
>  	},
>  	.probe = rwdt_probe,
>  	.remove = rwdt_remove,
> -- 
> 2.7.4
> 

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

* [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
@ 2018-02-12 19:24         ` Guenter Roeck
  0 siblings, 0 replies; 177+ messages in thread
From: Guenter Roeck @ 2018-02-12 19:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 12, 2018 at 05:44:21PM +0000, Fabrizio Castro wrote:
> Due to commits:
> * "ARM: shmobile: Add watchdog support",
> * "ARM: shmobile: rcar-gen2: Add watchdog support", and
> * "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
> we now have everything we needed for the watchdog to work on Gen2 and
> RZ/G1.
> 
> This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
> Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
> always ON, when suspending to RAM we need to explicitly disable the
> counting by clearing TME from RWTCSRA.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

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

> ---
> v4->v5:
> * various improvements suggested by Wolfram
> 
>  drivers/watchdog/renesas_wdt.c | 27 ++++++++++++++++++++++-----
>  1 file changed, 22 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
> index 831ef83..e972b7b 100644
> --- a/drivers/watchdog/renesas_wdt.c
> +++ b/drivers/watchdog/renesas_wdt.c
> @@ -203,13 +203,29 @@ static int rwdt_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -/*
> - * This driver does also fit for R-Car Gen2 (r8a779[0-4]) WDT. However, for SMP
> - * to work there, one also needs a RESET (RST) driver which does not exist yet
> - * due to HW issues. This needs to be solved before adding compatibles here.
> - */
> +static int __maybe_unused rwdt_suspend(struct device *dev)
> +{
> +	struct rwdt_priv *priv = dev_get_drvdata(dev);
> +
> +	if (watchdog_active(&priv->wdev))
> +		rwdt_write(priv, priv->cks, RWTCSRA);
> +	return 0;
> +}
> +
> +static int __maybe_unused rwdt_resume(struct device *dev)
> +{
> +	struct rwdt_priv *priv = dev_get_drvdata(dev);
> +
> +	if (watchdog_active(&priv->wdev))
> +		rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);
> +	return 0;
> +}
> +
> +static SIMPLE_DEV_PM_OPS(rwdt_pm_ops, rwdt_suspend, rwdt_resume);
> +
>  static const struct of_device_id rwdt_ids[] = {
>  	{ .compatible = "renesas,rcar-gen3-wdt", },
> +	{ .compatible = "renesas,rcar-gen2-wdt", },
>  	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, rwdt_ids);
> @@ -218,6 +234,7 @@ static struct platform_driver rwdt_driver = {
>  	.driver = {
>  		.name = "renesas_wdt",
>  		.of_match_table = rwdt_ids,
> +		.pm = &rwdt_pm_ops,
>  	},
>  	.probe = rwdt_probe,
>  	.remove = rwdt_remove,
> -- 
> 2.7.4
> 

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

* Re: [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
  2018-02-12 17:44     ` Fabrizio Castro
  (?)
@ 2018-02-12 20:58         ` Wolfram Sang
  -1 siblings, 0 replies; 177+ messages in thread
From: Wolfram Sang @ 2018-02-12 20:58 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju

[-- Attachment #1: Type: text/plain, Size: 985 bytes --]

On Mon, Feb 12, 2018 at 05:44:21PM +0000, Fabrizio Castro wrote:
> Due to commits:
> * "ARM: shmobile: Add watchdog support",
> * "ARM: shmobile: rcar-gen2: Add watchdog support", and
> * "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
> we now have everything we needed for the watchdog to work on Gen2 and
> RZ/G1.
> 
> This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
> Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
> always ON, when suspending to RAM we need to explicitly disable the
> counting by clearing TME from RWTCSRA.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRj3fQ9qLvQP4Q@public.gmane.orgs.com>
> ---
> v4->v5:
> * various improvements suggested by Wolfram
> 

Reviewed-by: Wolfram Sang <wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
@ 2018-02-12 20:58         ` Wolfram Sang
  0 siblings, 0 replies; 177+ messages in thread
From: Wolfram Sang @ 2018-02-12 20:58 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck, devicetree, linux-watchdog,
	linux-renesas-soc, linux-arm-kernel, linux-clk, Chris Paterson,
	Biju Das, Ramesh Shanmugasundaram

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]

On Mon, Feb 12, 2018 at 05:44:21PM +0000, Fabrizio Castro wrote:
> Due to commits:
> * "ARM: shmobile: Add watchdog support",
> * "ARM: shmobile: rcar-gen2: Add watchdog support", and
> * "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
> we now have everything we needed for the watchdog to work on Gen2 and
> RZ/G1.
> 
> This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
> Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
> always ON, when suspending to RAM we need to explicitly disable the
> counting by clearing TME from RWTCSRA.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> ---
> v4->v5:
> * various improvements suggested by Wolfram
> 

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
@ 2018-02-12 20:58         ` Wolfram Sang
  0 siblings, 0 replies; 177+ messages in thread
From: Wolfram Sang @ 2018-02-12 20:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 12, 2018 at 05:44:21PM +0000, Fabrizio Castro wrote:
> Due to commits:
> * "ARM: shmobile: Add watchdog support",
> * "ARM: shmobile: rcar-gen2: Add watchdog support", and
> * "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
> we now have everything we needed for the watchdog to work on Gen2 and
> RZ/G1.
> 
> This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
> Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
> always ON, when suspending to RAM we need to explicitly disable the
> counting by clearing TME from RWTCSRA.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> ---
> v4->v5:
> * various improvements suggested by Wolfram
> 

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180212/961780c2/attachment.sig>

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

* Re: [PATCH v5 13/26] watchdog: renesas_wdt: Add restart handler
  2018-02-12 17:44     ` Fabrizio Castro
  (?)
@ 2018-02-12 20:59       ` Wolfram Sang
  -1 siblings, 0 replies; 177+ messages in thread
From: Wolfram Sang @ 2018-02-12 20:59 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck, devicetree, linux-watchdog,
	linux-renesas-soc, linux-arm-kernel, linux-clk, Chris Paterson,
	Biju

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

On Mon, Feb 12, 2018 at 05:44:22PM +0000, Fabrizio Castro wrote:
> On iWave's boards iwg20d and iwg22d the only way to reboot the system is
> by means of the watchdog.
> This patch adds a restart handler to rwdt_ops, and also makes sure we
> keep its priority to a medium level, in order to not override other more
> effective handlers.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v5 13/26] watchdog: renesas_wdt: Add restart handler
@ 2018-02-12 20:59       ` Wolfram Sang
  0 siblings, 0 replies; 177+ messages in thread
From: Wolfram Sang @ 2018-02-12 20:59 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck, devicetree, linux-watchdog,
	linux-renesas-soc, linux-arm-kernel, linux-clk, Chris Paterson,
	Biju Das, Ramesh Shanmugasundaram

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

On Mon, Feb 12, 2018 at 05:44:22PM +0000, Fabrizio Castro wrote:
> On iWave's boards iwg20d and iwg22d the only way to reboot the system is
> by means of the watchdog.
> This patch adds a restart handler to rwdt_ops, and also makes sure we
> keep its priority to a medium level, in order to not override other more
> effective handlers.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [PATCH v5 13/26] watchdog: renesas_wdt: Add restart handler
@ 2018-02-12 20:59       ` Wolfram Sang
  0 siblings, 0 replies; 177+ messages in thread
From: Wolfram Sang @ 2018-02-12 20:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 12, 2018 at 05:44:22PM +0000, Fabrizio Castro wrote:
> On iWave's boards iwg20d and iwg22d the only way to reboot the system is
> by means of the watchdog.
> This patch adds a restart handler to rwdt_ops, and also makes sure we
> keep its priority to a medium level, in order to not override other more
> effective handlers.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180212/9ad7f346/attachment.sig>

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-13  8:05   ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-13  8:05 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das, Ramesh

On Mon, Feb 12, 2018 at 05:44:09PM +0000, Fabrizio Castro wrote:
> Dear All,
> 
> this series has been around for some time as RFC, and it has collected
> useful comments from the community along the way.
> The solution proposed by this patch set works for most R-Car Gen2 and
> RZ/G1 devices, but not all of them. We now know that for some R-Car
> Gen2 early revisions there is no proper software fix. Anyway, no
> product has been built around early revisions, but development boards
> mounting early revisions (basically prototypes) are still out there.
> As a result, this series isn't enabling the internal watchdog on R-Car
> Gen2 boards, developers may enable it in board specific device trees
> if needed.
> This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> and Koelsch boards.
> 
> The problem
> ===========
> To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> the non-boot CPUs they are redirected to the reset vector installed by
> Linux in ICRAM1, and eventually they continue the execution to RAM,
> where the SMP bring-up code will take care of the rest.
> The content of the [S]BAR registers survives a watchdog triggered reset,
> and as such after the watchdog fires the boot core will try and execute
> the SMP bring-up code instead of jumping to the bootrom code.
> 
> The fix
> =======
> The main strategy for the solution is to let the reset vector decide
> if it needs to jump to shmobile_boot_fn or to the bootrom code.
> In a watchdog triggered reset scenario, since the [S]BAR registers keep
> their values, the boot CPU will jump into the newly designed reset
> vector, the assembly routine will eventually test WOVF (a bit in register
> RWTCSRA that indicates if the watchdog counter has overflown, the value
> of this bit gets retained in this scenario), and jump to the bootrom code
> which will in turn load up the bootloader, etc.
> When bringing up SMP or using CPU hotplug, the reset vector will jump
> to shmobile_boot_fn instead.
> 
> Thank you All for your help.
> 
> Best regards,
> 
> Fabrizio Castro (26):
>   ARM: shmobile: Add watchdog support
>   ARM: dts: r8a7743: Adjust SMP routine size
>   ARM: dts: r8a7745: Adjust SMP routine size
>   ARM: dts: r8a7790: Adjust SMP routine size
>   ARM: dts: r8a7791: Adjust SMP routine size
>   ARM: dts: r8a7792: Adjust SMP routine size
>   ARM: dts: r8a7793: Adjust SMP routine size
>   ARM: dts: r8a7794: Adjust SMP routine size
>   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>   ARM: shmobile: rcar-gen2: Add watchdog support
>   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>   watchdog: renesas_wdt: Add R-Car Gen2 support
>   watchdog: renesas_wdt: Add restart handler
>   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>   clk: renesas: r8a7743: Add rwdt clock
>   clk: renesas: r8a7745: Add rwdt clock
>   clk: renesas: r8a7790: Add rwdt clock
>   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>   clk: renesas: r8a7794: Add rwdt clock
>   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>   ARM: dts: iwg22m: Add watchdog support to SoM dtsi

Thanks, I have applied the above "dts" and "defconfig" patches for v4.17.

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-13  8:05   ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-13  8:05 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram

On Mon, Feb 12, 2018 at 05:44:09PM +0000, Fabrizio Castro wrote:
> Dear All,
> 
> this series has been around for some time as RFC, and it has collected
> useful comments from the community along the way.
> The solution proposed by this patch set works for most R-Car Gen2 and
> RZ/G1 devices, but not all of them. We now know that for some R-Car
> Gen2 early revisions there is no proper software fix. Anyway, no
> product has been built around early revisions, but development boards
> mounting early revisions (basically prototypes) are still out there.
> As a result, this series isn't enabling the internal watchdog on R-Car
> Gen2 boards, developers may enable it in board specific device trees
> if needed.
> This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> and Koelsch boards.
> 
> The problem
> ===========
> To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> the non-boot CPUs they are redirected to the reset vector installed by
> Linux in ICRAM1, and eventually they continue the execution to RAM,
> where the SMP bring-up code will take care of the rest.
> The content of the [S]BAR registers survives a watchdog triggered reset,
> and as such after the watchdog fires the boot core will try and execute
> the SMP bring-up code instead of jumping to the bootrom code.
> 
> The fix
> =======
> The main strategy for the solution is to let the reset vector decide
> if it needs to jump to shmobile_boot_fn or to the bootrom code.
> In a watchdog triggered reset scenario, since the [S]BAR registers keep
> their values, the boot CPU will jump into the newly designed reset
> vector, the assembly routine will eventually test WOVF (a bit in register
> RWTCSRA that indicates if the watchdog counter has overflown, the value
> of this bit gets retained in this scenario), and jump to the bootrom code
> which will in turn load up the bootloader, etc.
> When bringing up SMP or using CPU hotplug, the reset vector will jump
> to shmobile_boot_fn instead.
> 
> Thank you All for your help.
> 
> Best regards,
> 
> Fabrizio Castro (26):
>   ARM: shmobile: Add watchdog support
>   ARM: dts: r8a7743: Adjust SMP routine size
>   ARM: dts: r8a7745: Adjust SMP routine size
>   ARM: dts: r8a7790: Adjust SMP routine size
>   ARM: dts: r8a7791: Adjust SMP routine size
>   ARM: dts: r8a7792: Adjust SMP routine size
>   ARM: dts: r8a7793: Adjust SMP routine size
>   ARM: dts: r8a7794: Adjust SMP routine size
>   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>   ARM: shmobile: rcar-gen2: Add watchdog support
>   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>   watchdog: renesas_wdt: Add R-Car Gen2 support
>   watchdog: renesas_wdt: Add restart handler
>   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>   clk: renesas: r8a7743: Add rwdt clock
>   clk: renesas: r8a7745: Add rwdt clock
>   clk: renesas: r8a7790: Add rwdt clock
>   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>   clk: renesas: r8a7794: Add rwdt clock
>   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>   ARM: dts: iwg22m: Add watchdog support to SoM dtsi

Thanks, I have applied the above "dts" and "defconfig" patches for v4.17.

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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-13  8:05   ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-13  8:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 12, 2018 at 05:44:09PM +0000, Fabrizio Castro wrote:
> Dear All,
> 
> this series has been around for some time as RFC, and it has collected
> useful comments from the community along the way.
> The solution proposed by this patch set works for most R-Car Gen2 and
> RZ/G1 devices, but not all of them. We now know that for some R-Car
> Gen2 early revisions there is no proper software fix. Anyway, no
> product has been built around early revisions, but development boards
> mounting early revisions (basically prototypes) are still out there.
> As a result, this series isn't enabling the internal watchdog on R-Car
> Gen2 boards, developers may enable it in board specific device trees
> if needed.
> This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> and Koelsch boards.
> 
> The problem
> ===========
> To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> the non-boot CPUs they are redirected to the reset vector installed by
> Linux in ICRAM1, and eventually they continue the execution to RAM,
> where the SMP bring-up code will take care of the rest.
> The content of the [S]BAR registers survives a watchdog triggered reset,
> and as such after the watchdog fires the boot core will try and execute
> the SMP bring-up code instead of jumping to the bootrom code.
> 
> The fix
> =======
> The main strategy for the solution is to let the reset vector decide
> if it needs to jump to shmobile_boot_fn or to the bootrom code.
> In a watchdog triggered reset scenario, since the [S]BAR registers keep
> their values, the boot CPU will jump into the newly designed reset
> vector, the assembly routine will eventually test WOVF (a bit in register
> RWTCSRA that indicates if the watchdog counter has overflown, the value
> of this bit gets retained in this scenario), and jump to the bootrom code
> which will in turn load up the bootloader, etc.
> When bringing up SMP or using CPU hotplug, the reset vector will jump
> to shmobile_boot_fn instead.
> 
> Thank you All for your help.
> 
> Best regards,
> 
> Fabrizio Castro (26):
>   ARM: shmobile: Add watchdog support
>   ARM: dts: r8a7743: Adjust SMP routine size
>   ARM: dts: r8a7745: Adjust SMP routine size
>   ARM: dts: r8a7790: Adjust SMP routine size
>   ARM: dts: r8a7791: Adjust SMP routine size
>   ARM: dts: r8a7792: Adjust SMP routine size
>   ARM: dts: r8a7793: Adjust SMP routine size
>   ARM: dts: r8a7794: Adjust SMP routine size
>   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>   ARM: shmobile: rcar-gen2: Add watchdog support
>   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>   watchdog: renesas_wdt: Add R-Car Gen2 support
>   watchdog: renesas_wdt: Add restart handler
>   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>   clk: renesas: r8a7743: Add rwdt clock
>   clk: renesas: r8a7745: Add rwdt clock
>   clk: renesas: r8a7790: Add rwdt clock
>   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>   clk: renesas: r8a7794: Add rwdt clock
>   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>   ARM: dts: iwg22m: Add watchdog support to SoM dtsi

Thanks, I have applied the above "dts" and "defconfig" patches for v4.17.

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

* Re: [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
  2018-02-12 17:44     ` Fabrizio Castro
  (?)
@ 2018-02-13  8:19       ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-13  8:19 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das, Ramesh

On Mon, Feb 12, 2018 at 05:44:18PM +0000, Fabrizio Castro wrote:
> This patch allows for platform specific quirks as some of the SoC need
> further customization for the watchdog to work properly, like for R-Car
> Gen2 and for RZ/G.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

I am fine with this patch but please rebase it on top of
renesas-devel-20180212-v4.16-rc1 (or later).

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

* Re: [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
@ 2018-02-13  8:19       ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-13  8:19 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram

On Mon, Feb 12, 2018 at 05:44:18PM +0000, Fabrizio Castro wrote:
> This patch allows for platform specific quirks as some of the SoC need
> further customization for the watchdog to work properly, like for R-Car
> Gen2 and for RZ/G.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

I am fine with this patch but please rebase it on top of
renesas-devel-20180212-v4.16-rc1 (or later).

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

* [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
@ 2018-02-13  8:19       ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-13  8:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 12, 2018 at 05:44:18PM +0000, Fabrizio Castro wrote:
> This patch allows for platform specific quirks as some of the SoC need
> further customization for the watchdog to work properly, like for R-Car
> Gen2 and for RZ/G.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

I am fine with this patch but please rebase it on top of
renesas-devel-20180212-v4.16-rc1 (or later).

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

* Re: [PATCH v5 10/26] ARM: shmobile: rcar-gen2: Add watchdog support
  2018-02-12 17:44     ` Fabrizio Castro
  (?)
@ 2018-02-13  8:21         ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-13  8:21 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Ramesh

On Mon, Feb 12, 2018 at 05:44:19PM +0000, Fabrizio Castro wrote:
> This patch adds watchdog support by installing shmobile_boot_vector_gen2
> to ICRAM1 when enough memory is available, in which case we also keep a
> copy of MPIDR to complete the reset vector logic.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>

I am marking this patch as deferred as it has dependencies on watchdog driver
and in turn clock changes in this series.
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v5 10/26] ARM: shmobile: rcar-gen2: Add watchdog support
@ 2018-02-13  8:21         ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-13  8:21 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram

On Mon, Feb 12, 2018 at 05:44:19PM +0000, Fabrizio Castro wrote:
> This patch adds watchdog support by installing shmobile_boot_vector_gen2
> to ICRAM1 when enough memory is available, in which case we also keep a
> copy of MPIDR to complete the reset vector logic.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

I am marking this patch as deferred as it has dependencies on watchdog driver
and in turn clock changes in this series.

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

* [PATCH v5 10/26] ARM: shmobile: rcar-gen2: Add watchdog support
@ 2018-02-13  8:21         ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-13  8:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 12, 2018 at 05:44:19PM +0000, Fabrizio Castro wrote:
> This patch adds watchdog support by installing shmobile_boot_vector_gen2
> to ICRAM1 when enough memory is available, in which case we also keep a
> copy of MPIDR to complete the reset vector logic.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

I am marking this patch as deferred as it has dependencies on watchdog driver
and in turn clock changes in this series.

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

* RE: [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
  2018-02-13  8:19       ` Simon Horman
  (?)
  (?)
@ 2018-02-13 12:57         ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-13 12:57 UTC (permalink / raw)
  To: Simon Horman
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel

Hello Simon,

> Subject: Re: [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>
> On Mon, Feb 12, 2018 at 05:44:18PM +0000, Fabrizio Castro wrote:
> > This patch allows for platform specific quirks as some of the SoC need
> > further customization for the watchdog to work properly, like for R-Car
> > Gen2 and for RZ/G.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
>
> I am fine with this patch but please rebase it on top of
> renesas-devel-20180212-v4.16-rc1 (or later).

sure, I will.

Thanks,
Fab



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* RE: [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
@ 2018-02-13 12:57         ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-13 12:57 UTC (permalink / raw)
  To: Simon Horman
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram

Hello Simon,

> Subject: Re: [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>
> On Mon, Feb 12, 2018 at 05:44:18PM +0000, Fabrizio Castro wrote:
> > This patch allows for platform specific quirks as some of the SoC need
> > further customization for the watchdog to work properly, like for R-Car
> > Gen2 and for RZ/G.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
>
> I am fine with this patch but please rebase it on top of
> renesas-devel-20180212-v4.16-rc1 (or later).

sure, I will.

Thanks,
Fab



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* RE: [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
@ 2018-02-13 12:57         ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-13 12:57 UTC (permalink / raw)
  To: Simon Horman
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram

Hello Simon,

> Subject: Re: [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as =
reset trigger for Gen2
>
> On Mon, Feb 12, 2018 at 05:44:18PM +0000, Fabrizio Castro wrote:
> > This patch allows for platform specific quirks as some of the SoC need
> > further customization for the watchdog to work properly, like for R-Car
> > Gen2 and for RZ/G.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.rene=
sas.com>
>
> I am fine with this patch but please rebase it on top of
> renesas-devel-20180212-v4.16-rc1 (or later).

sure, I will.

Thanks,
Fab



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, B=
uckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered=
 No. 04586709.

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

* [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
@ 2018-02-13 12:57         ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-13 12:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Simon,

> Subject: Re: [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>
> On Mon, Feb 12, 2018 at 05:44:18PM +0000, Fabrizio Castro wrote:
> > This patch allows for platform specific quirks as some of the SoC need
> > further customization for the watchdog to work properly, like for R-Car
> > Gen2 and for RZ/G.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
>
> I am fine with this patch but please rebase it on top of
> renesas-devel-20180212-v4.16-rc1 (or later).

sure, I will.

Thanks,
Fab



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* [PATCH v6 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
  2018-02-13  8:19       ` Simon Horman
  (?)
@ 2018-02-13 13:02         ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-13 13:02 UTC (permalink / raw)
  To: Simon Horman
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das, Fabrizi

This patch allows for platform specific quirks as some of the SoC need
further customization for the watchdog to work properly, like for R-Car
Gen2 and for RZ/G.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
---
v5->v6:
* rebased on top of renesas-devel-20180213-v4.16-rc1

 drivers/soc/renesas/rcar-rst.c | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/drivers/soc/renesas/rcar-rst.c b/drivers/soc/renesas/rcar-rst.c
index e2340eb..3413666 100644
--- a/drivers/soc/renesas/rcar-rst.c
+++ b/drivers/soc/renesas/rcar-rst.c
@@ -13,8 +13,18 @@
 #include <linux/of_address.h>
 #include <linux/soc/renesas/rcar-rst.h>
 
+#define WDTRSTCR_RESET		0xA55A0002
+#define WDTRSTCR		0x0054
+
+static int rcar_rst_enable_wdt_reset(void __iomem *base)
+{
+	iowrite32(WDTRSTCR_RESET, base + WDTRSTCR);
+	return 0;
+}
+
 struct rst_config {
-	unsigned int modemr;	/* Mode Monitoring Register Offset */
+	unsigned int modemr;		/* Mode Monitoring Register Offset */
+	int (*configure)(void *base);	/* Platform specific configuration */
 };
 
 static const struct rst_config rcar_rst_gen1 __initconst = {
@@ -23,6 +33,11 @@ static const struct rst_config rcar_rst_gen1 __initconst = {
 
 static const struct rst_config rcar_rst_gen2 __initconst = {
 	.modemr = 0x60,
+	.configure = rcar_rst_enable_wdt_reset,
+};
+
+static const struct rst_config rcar_rst_gen3 __initconst = {
+	.modemr = 0x60,
 };
 
 static const struct of_device_id rcar_rst_matches[] __initconst = {
@@ -38,12 +53,12 @@ static const struct of_device_id rcar_rst_matches[] __initconst = {
 	{ .compatible = "renesas,r8a7792-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a7793-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a7794-rst", .data = &rcar_rst_gen2 },
-	/* R-Car Gen3 is handled like R-Car Gen2 */
-	{ .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77980-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen2 },
+	/* R-Car Gen3 */
+	{ .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77980-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen3 },
 	{ /* sentinel */ }
 };
 
@@ -72,6 +87,14 @@ static int __init rcar_rst_init(void)
 	rcar_rst_base = base;
 	cfg = match->data;
 	saved_mode = ioread32(base + cfg->modemr);
+	if (cfg->configure) {
+		error = cfg->configure(base);
+		if (error) {
+			pr_warn("%pOF: Cannot run SoC specific configuration\n",
+				np);
+			goto out_put;
+		}
+	}
 
 	pr_debug("%pOF: MODE = 0x%08x\n", np, saved_mode);
 
-- 
2.7.4


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

* [PATCH v6 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
@ 2018-02-13 13:02         ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-13 13:02 UTC (permalink / raw)
  To: Simon Horman
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

This patch allows for platform specific quirks as some of the SoC need
further customization for the watchdog to work properly, like for R-Car
Gen2 and for RZ/G.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
---
v5->v6:
* rebased on top of renesas-devel-20180213-v4.16-rc1

 drivers/soc/renesas/rcar-rst.c | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/drivers/soc/renesas/rcar-rst.c b/drivers/soc/renesas/rcar-rst.c
index e2340eb..3413666 100644
--- a/drivers/soc/renesas/rcar-rst.c
+++ b/drivers/soc/renesas/rcar-rst.c
@@ -13,8 +13,18 @@
 #include <linux/of_address.h>
 #include <linux/soc/renesas/rcar-rst.h>
 
+#define WDTRSTCR_RESET		0xA55A0002
+#define WDTRSTCR		0x0054
+
+static int rcar_rst_enable_wdt_reset(void __iomem *base)
+{
+	iowrite32(WDTRSTCR_RESET, base + WDTRSTCR);
+	return 0;
+}
+
 struct rst_config {
-	unsigned int modemr;	/* Mode Monitoring Register Offset */
+	unsigned int modemr;		/* Mode Monitoring Register Offset */
+	int (*configure)(void *base);	/* Platform specific configuration */
 };
 
 static const struct rst_config rcar_rst_gen1 __initconst = {
@@ -23,6 +33,11 @@ static const struct rst_config rcar_rst_gen1 __initconst = {
 
 static const struct rst_config rcar_rst_gen2 __initconst = {
 	.modemr = 0x60,
+	.configure = rcar_rst_enable_wdt_reset,
+};
+
+static const struct rst_config rcar_rst_gen3 __initconst = {
+	.modemr = 0x60,
 };
 
 static const struct of_device_id rcar_rst_matches[] __initconst = {
@@ -38,12 +53,12 @@ static const struct of_device_id rcar_rst_matches[] __initconst = {
 	{ .compatible = "renesas,r8a7792-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a7793-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a7794-rst", .data = &rcar_rst_gen2 },
-	/* R-Car Gen3 is handled like R-Car Gen2 */
-	{ .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77980-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen2 },
+	/* R-Car Gen3 */
+	{ .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77980-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen3 },
 	{ /* sentinel */ }
 };
 
@@ -72,6 +87,14 @@ static int __init rcar_rst_init(void)
 	rcar_rst_base = base;
 	cfg = match->data;
 	saved_mode = ioread32(base + cfg->modemr);
+	if (cfg->configure) {
+		error = cfg->configure(base);
+		if (error) {
+			pr_warn("%pOF: Cannot run SoC specific configuration\n",
+				np);
+			goto out_put;
+		}
+	}
 
 	pr_debug("%pOF: MODE = 0x%08x\n", np, saved_mode);
 
-- 
2.7.4


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

* [PATCH v6 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
@ 2018-02-13 13:02         ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-13 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

This patch allows for platform specific quirks as some of the SoC need
further customization for the watchdog to work properly, like for R-Car
Gen2 and for RZ/G.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
---
v5->v6:
* rebased on top of renesas-devel-20180213-v4.16-rc1

 drivers/soc/renesas/rcar-rst.c | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/drivers/soc/renesas/rcar-rst.c b/drivers/soc/renesas/rcar-rst.c
index e2340eb..3413666 100644
--- a/drivers/soc/renesas/rcar-rst.c
+++ b/drivers/soc/renesas/rcar-rst.c
@@ -13,8 +13,18 @@
 #include <linux/of_address.h>
 #include <linux/soc/renesas/rcar-rst.h>
 
+#define WDTRSTCR_RESET		0xA55A0002
+#define WDTRSTCR		0x0054
+
+static int rcar_rst_enable_wdt_reset(void __iomem *base)
+{
+	iowrite32(WDTRSTCR_RESET, base + WDTRSTCR);
+	return 0;
+}
+
 struct rst_config {
-	unsigned int modemr;	/* Mode Monitoring Register Offset */
+	unsigned int modemr;		/* Mode Monitoring Register Offset */
+	int (*configure)(void *base);	/* Platform specific configuration */
 };
 
 static const struct rst_config rcar_rst_gen1 __initconst = {
@@ -23,6 +33,11 @@ static const struct rst_config rcar_rst_gen1 __initconst = {
 
 static const struct rst_config rcar_rst_gen2 __initconst = {
 	.modemr = 0x60,
+	.configure = rcar_rst_enable_wdt_reset,
+};
+
+static const struct rst_config rcar_rst_gen3 __initconst = {
+	.modemr = 0x60,
 };
 
 static const struct of_device_id rcar_rst_matches[] __initconst = {
@@ -38,12 +53,12 @@ static const struct of_device_id rcar_rst_matches[] __initconst = {
 	{ .compatible = "renesas,r8a7792-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a7793-rst", .data = &rcar_rst_gen2 },
 	{ .compatible = "renesas,r8a7794-rst", .data = &rcar_rst_gen2 },
-	/* R-Car Gen3 is handled like R-Car Gen2 */
-	{ .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77980-rst", .data = &rcar_rst_gen2 },
-	{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen2 },
+	/* R-Car Gen3 */
+	{ .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77980-rst", .data = &rcar_rst_gen3 },
+	{ .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen3 },
 	{ /* sentinel */ }
 };
 
@@ -72,6 +87,14 @@ static int __init rcar_rst_init(void)
 	rcar_rst_base = base;
 	cfg = match->data;
 	saved_mode = ioread32(base + cfg->modemr);
+	if (cfg->configure) {
+		error = cfg->configure(base);
+		if (error) {
+			pr_warn("%pOF: Cannot run SoC specific configuration\n",
+				np);
+			goto out_put;
+		}
+	}
 
 	pr_debug("%pOF: MODE = 0x%08x\n", np, saved_mode);
 
-- 
2.7.4

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

* RE: [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
  2018-02-12 17:44   ` Fabrizio Castro
  (?)
  (?)
@ 2018-02-13 13:08       ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-13 13:08 UTC (permalink / raw)
  To: Simon Horman, Geert Uytterhoeven
  Cc: Guenter Roeck, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram, Fabrizio Castro, Philipp Zabel,
	Rob Herring, Mark Rutland, Wim Van Sebroeck, Russell King

Hello Simon,

what do you think about enabling the watchdog in multi_v7_defconfig as a module?

Thanks,
Fab

> Subject: [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>
> R-Car Gen2 and RZ/G1 platforms come with a watchdog IP, therefore enable
> its driver by default.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram-kTT6dE0pTRj3fQ9qLvQP4Q@public.gmane.orgs.com>
> Reviewed-by: Wolfram Sang <wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/@public.gmane.org>
> ---
> v4->v5:
> * no change
>
>  arch/arm/configs/shmobile_defconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
> index 578434c..d5cdad8 100644
> --- a/arch/arm/configs/shmobile_defconfig
> +++ b/arch/arm/configs/shmobile_defconfig
> @@ -132,6 +132,7 @@ CONFIG_CPU_THERMAL=y
>  CONFIG_RCAR_THERMAL=y
>  CONFIG_WATCHDOG=y
>  CONFIG_DA9063_WATCHDOG=y
> +CONFIG_RENESAS_WDT=y
>  CONFIG_MFD_AS3711=y
>  CONFIG_MFD_DA9063=y
>  CONFIG_REGULATOR_FIXED_VOLTAGE=y
> --
> 2.7.4




Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* RE: [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
@ 2018-02-13 13:08       ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-13 13:08 UTC (permalink / raw)
  To: Simon Horman, Geert Uytterhoeven
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram, Fabrizio Castro, Philipp Zabel,
	Rob Herring, Mark Rutland, Wim Van Sebroeck, Russell King,
	Catalin Marinas, Will Deacon, Michael Turquette, Stephen Boyd,
	Magnus Damm, Wolfram Sang

Hello Simon,

what do you think about enabling the watchdog in multi_v7_defconfig as a module?

Thanks,
Fab

> Subject: [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>
> R-Car Gen2 and RZ/G1 platforms come with a watchdog IP, therefore enable
> its driver by default.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> v4->v5:
> * no change
>
>  arch/arm/configs/shmobile_defconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
> index 578434c..d5cdad8 100644
> --- a/arch/arm/configs/shmobile_defconfig
> +++ b/arch/arm/configs/shmobile_defconfig
> @@ -132,6 +132,7 @@ CONFIG_CPU_THERMAL=y
>  CONFIG_RCAR_THERMAL=y
>  CONFIG_WATCHDOG=y
>  CONFIG_DA9063_WATCHDOG=y
> +CONFIG_RENESAS_WDT=y
>  CONFIG_MFD_AS3711=y
>  CONFIG_MFD_DA9063=y
>  CONFIG_REGULATOR_FIXED_VOLTAGE=y
> --
> 2.7.4




Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* RE: [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
@ 2018-02-13 13:08       ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-13 13:08 UTC (permalink / raw)
  To: Simon Horman, Geert Uytterhoeven
  Cc: Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram, Fabrizio Castro, Philipp Zabel,
	Rob Herring, Mark Rutland, Wim Van Sebroeck, Russell King,
	Catalin Marinas, Will Deacon, Michael Turquette, Stephen Boyd,
	Magnus Damm, Wolfram Sang

Hello Simon,

what do you think about enabling the watchdog in multi_v7_defconfig as a mo=
dule?

Thanks,
Fab

> Subject: [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GE=
N
>
> R-Car Gen2 and RZ/G1 platforms come with a watchdog IP, therefore enable
> its driver by default.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesa=
s.com>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> v4->v5:
> * no change
>
>  arch/arm/configs/shmobile_defconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmob=
ile_defconfig
> index 578434c..d5cdad8 100644
> --- a/arch/arm/configs/shmobile_defconfig
> +++ b/arch/arm/configs/shmobile_defconfig
> @@ -132,6 +132,7 @@ CONFIG_CPU_THERMAL=3Dy
>  CONFIG_RCAR_THERMAL=3Dy
>  CONFIG_WATCHDOG=3Dy
>  CONFIG_DA9063_WATCHDOG=3Dy
> +CONFIG_RENESAS_WDT=3Dy
>  CONFIG_MFD_AS3711=3Dy
>  CONFIG_MFD_DA9063=3Dy
>  CONFIG_REGULATOR_FIXED_VOLTAGE=3Dy
> --
> 2.7.4




Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, B=
uckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered=
 No. 04586709.

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

* [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
@ 2018-02-13 13:08       ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-13 13:08 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Simon,

what do you think about enabling the watchdog in multi_v7_defconfig as a module?

Thanks,
Fab

> Subject: [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>
> R-Car Gen2 and RZ/G1 platforms come with a watchdog IP, therefore enable
> its driver by default.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> v4->v5:
> * no change
>
>  arch/arm/configs/shmobile_defconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
> index 578434c..d5cdad8 100644
> --- a/arch/arm/configs/shmobile_defconfig
> +++ b/arch/arm/configs/shmobile_defconfig
> @@ -132,6 +132,7 @@ CONFIG_CPU_THERMAL=y
>  CONFIG_RCAR_THERMAL=y
>  CONFIG_WATCHDOG=y
>  CONFIG_DA9063_WATCHDOG=y
> +CONFIG_RENESAS_WDT=y
>  CONFIG_MFD_AS3711=y
>  CONFIG_MFD_DA9063=y
>  CONFIG_REGULATOR_FIXED_VOLTAGE=y
> --
> 2.7.4




Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* Re: [PATCH v6 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
  2018-02-13 13:02         ` Fabrizio Castro
  (?)
@ 2018-02-15 16:20           ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-15 16:20 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das, Ramesh

On Tue, Feb 13, 2018 at 01:02:44PM +0000, Fabrizio Castro wrote:
> This patch allows for platform specific quirks as some of the SoC need
> further customization for the watchdog to work properly, like for R-Car
> Gen2 and for RZ/G.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> ---
> v5->v6:
> * rebased on top of renesas-devel-20180213-v4.16-rc1

Thanks, applied.

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

* Re: [PATCH v6 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
@ 2018-02-15 16:20           ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-15 16:20 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram

On Tue, Feb 13, 2018 at 01:02:44PM +0000, Fabrizio Castro wrote:
> This patch allows for platform specific quirks as some of the SoC need
> further customization for the watchdog to work properly, like for R-Car
> Gen2 and for RZ/G.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> ---
> v5->v6:
> * rebased on top of renesas-devel-20180213-v4.16-rc1

Thanks, applied.

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

* [PATCH v6 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
@ 2018-02-15 16:20           ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-15 16:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 13, 2018 at 01:02:44PM +0000, Fabrizio Castro wrote:
> This patch allows for platform specific quirks as some of the SoC need
> further customization for the watchdog to work properly, like for R-Car
> Gen2 and for RZ/G.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> ---
> v5->v6:
> * rebased on top of renesas-devel-20180213-v4.16-rc1

Thanks, applied.

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

* Re: [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
  2018-02-13 13:08       ` Fabrizio Castro
  (?)
@ 2018-02-15 16:20           ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-15 16:20 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Geert Uytterhoeven, Guenter Roeck,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram, Philipp Zabel, Rob Herring,
	Mark Rutland, Wim Van Sebroeck, Russell King, Catalin

On Tue, Feb 13, 2018 at 01:08:19PM +0000, Fabrizio Castro wrote:
> Hello Simon,
> 
> what do you think about enabling the watchdog in multi_v7_defconfig as a module?

I think its a good idea.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
@ 2018-02-15 16:20           ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-15 16:20 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Geert Uytterhoeven, Guenter Roeck, devicetree, linux-watchdog,
	linux-renesas-soc, linux-arm-kernel, linux-clk, Chris Paterson,
	Biju Das, Ramesh Shanmugasundaram, Philipp Zabel, Rob Herring,
	Mark Rutland, Wim Van Sebroeck, Russell King, Catalin Marinas,
	Will Deacon, Michael Turquette, Stephen Boyd, Magnus Damm,
	Wolfram Sang

On Tue, Feb 13, 2018 at 01:08:19PM +0000, Fabrizio Castro wrote:
> Hello Simon,
> 
> what do you think about enabling the watchdog in multi_v7_defconfig as a module?

I think its a good idea.

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

* [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
@ 2018-02-15 16:20           ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-15 16:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 13, 2018 at 01:08:19PM +0000, Fabrizio Castro wrote:
> Hello Simon,
> 
> what do you think about enabling the watchdog in multi_v7_defconfig as a module?

I think its a good idea.

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
  2018-02-12 17:44 ` Fabrizio Castro
  (?)
@ 2018-02-20 12:51   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-20 12:51 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Simon Horman, linux-arm-kernel, Stephen Boyd, Linux-Renesas,
	Rob Herring, Philipp

On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> this series has been around for some time as RFC, and it has collected
> useful comments from the community along the way.
> The solution proposed by this patch set works for most R-Car Gen2 and
> RZ/G1 devices, but not all of them. We now know that for some R-Car
> Gen2 early revisions there is no proper software fix. Anyway, no
> product has been built around early revisions, but development boards
> mounting early revisions (basically prototypes) are still out there.
> As a result, this series isn't enabling the internal watchdog on R-Car
> Gen2 boards, developers may enable it in board specific device trees
> if needed.
> This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> and Koelsch boards.
>
> The problem
> ===========
> To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> the non-boot CPUs they are redirected to the reset vector installed by
> Linux in ICRAM1, and eventually they continue the execution to RAM,
> where the SMP bring-up code will take care of the rest.
> The content of the [S]BAR registers survives a watchdog triggered reset,
> and as such after the watchdog fires the boot core will try and execute
> the SMP bring-up code instead of jumping to the bootrom code.
>
> The fix
> =======
> The main strategy for the solution is to let the reset vector decide
> if it needs to jump to shmobile_boot_fn or to the bootrom code.
> In a watchdog triggered reset scenario, since the [S]BAR registers keep
> their values, the boot CPU will jump into the newly designed reset
> vector, the assembly routine will eventually test WOVF (a bit in register
> RWTCSRA that indicates if the watchdog counter has overflown, the value
> of this bit gets retained in this scenario), and jump to the bootrom code
> which will in turn load up the bootloader, etc.
> When bringing up SMP or using CPU hotplug, the reset vector will jump
> to shmobile_boot_fn instead.
>
> Thank you All for your help.
>
> Best regards,
>
> Fabrizio Castro (26):
>   ARM: shmobile: Add watchdog support
>   ARM: dts: r8a7743: Adjust SMP routine size
>   ARM: dts: r8a7745: Adjust SMP routine size
>   ARM: dts: r8a7790: Adjust SMP routine size
>   ARM: dts: r8a7791: Adjust SMP routine size
>   ARM: dts: r8a7792: Adjust SMP routine size
>   ARM: dts: r8a7793: Adjust SMP routine size
>   ARM: dts: r8a7794: Adjust SMP routine size
>   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>   ARM: shmobile: rcar-gen2: Add watchdog support
>   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>   watchdog: renesas_wdt: Add R-Car Gen2 support
>   watchdog: renesas_wdt: Add restart handler
>   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>   clk: renesas: r8a7743: Add rwdt clock
>   clk: renesas: r8a7745: Add rwdt clock
>   clk: renesas: r8a7790: Add rwdt clock
>   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>   clk: renesas: r8a7794: Add rwdt clock
>   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>
>  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>  arch/arm/configs/shmobile_defconfig                |  1 +
>  arch/arm/mach-shmobile/common.h                    |  6 +++
>  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--

Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
a hard dependency for:
  (1) The new reset vector in arch/arm/mach-shmobile/
  (2) The watchdog driver.

Note that the watchdog driver itself (2) has a hard dependency on the
new reset vector (1).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-20 12:51   ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-20 12:51 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, linux-arm-kernel,
	linux-clk, Chris Paterson, Biju Das, Ramesh Shanmugasundaram

On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> this series has been around for some time as RFC, and it has collected
> useful comments from the community along the way.
> The solution proposed by this patch set works for most R-Car Gen2 and
> RZ/G1 devices, but not all of them. We now know that for some R-Car
> Gen2 early revisions there is no proper software fix. Anyway, no
> product has been built around early revisions, but development boards
> mounting early revisions (basically prototypes) are still out there.
> As a result, this series isn't enabling the internal watchdog on R-Car
> Gen2 boards, developers may enable it in board specific device trees
> if needed.
> This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> and Koelsch boards.
>
> The problem
> ===========
> To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> the non-boot CPUs they are redirected to the reset vector installed by
> Linux in ICRAM1, and eventually they continue the execution to RAM,
> where the SMP bring-up code will take care of the rest.
> The content of the [S]BAR registers survives a watchdog triggered reset,
> and as such after the watchdog fires the boot core will try and execute
> the SMP bring-up code instead of jumping to the bootrom code.
>
> The fix
> =======
> The main strategy for the solution is to let the reset vector decide
> if it needs to jump to shmobile_boot_fn or to the bootrom code.
> In a watchdog triggered reset scenario, since the [S]BAR registers keep
> their values, the boot CPU will jump into the newly designed reset
> vector, the assembly routine will eventually test WOVF (a bit in register
> RWTCSRA that indicates if the watchdog counter has overflown, the value
> of this bit gets retained in this scenario), and jump to the bootrom code
> which will in turn load up the bootloader, etc.
> When bringing up SMP or using CPU hotplug, the reset vector will jump
> to shmobile_boot_fn instead.
>
> Thank you All for your help.
>
> Best regards,
>
> Fabrizio Castro (26):
>   ARM: shmobile: Add watchdog support
>   ARM: dts: r8a7743: Adjust SMP routine size
>   ARM: dts: r8a7745: Adjust SMP routine size
>   ARM: dts: r8a7790: Adjust SMP routine size
>   ARM: dts: r8a7791: Adjust SMP routine size
>   ARM: dts: r8a7792: Adjust SMP routine size
>   ARM: dts: r8a7793: Adjust SMP routine size
>   ARM: dts: r8a7794: Adjust SMP routine size
>   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>   ARM: shmobile: rcar-gen2: Add watchdog support
>   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>   watchdog: renesas_wdt: Add R-Car Gen2 support
>   watchdog: renesas_wdt: Add restart handler
>   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>   clk: renesas: r8a7743: Add rwdt clock
>   clk: renesas: r8a7745: Add rwdt clock
>   clk: renesas: r8a7790: Add rwdt clock
>   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>   clk: renesas: r8a7794: Add rwdt clock
>   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>
>  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>  arch/arm/configs/shmobile_defconfig                |  1 +
>  arch/arm/mach-shmobile/common.h                    |  6 +++
>  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--

Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
a hard dependency for:
  (1) The new reset vector in arch/arm/mach-shmobile/
  (2) The watchdog driver.

Note that the watchdog driver itself (2) has a hard dependency on the
new reset vector (1).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-20 12:51   ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-20 12:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> this series has been around for some time as RFC, and it has collected
> useful comments from the community along the way.
> The solution proposed by this patch set works for most R-Car Gen2 and
> RZ/G1 devices, but not all of them. We now know that for some R-Car
> Gen2 early revisions there is no proper software fix. Anyway, no
> product has been built around early revisions, but development boards
> mounting early revisions (basically prototypes) are still out there.
> As a result, this series isn't enabling the internal watchdog on R-Car
> Gen2 boards, developers may enable it in board specific device trees
> if needed.
> This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> and Koelsch boards.
>
> The problem
> ===========
> To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> the non-boot CPUs they are redirected to the reset vector installed by
> Linux in ICRAM1, and eventually they continue the execution to RAM,
> where the SMP bring-up code will take care of the rest.
> The content of the [S]BAR registers survives a watchdog triggered reset,
> and as such after the watchdog fires the boot core will try and execute
> the SMP bring-up code instead of jumping to the bootrom code.
>
> The fix
> =======
> The main strategy for the solution is to let the reset vector decide
> if it needs to jump to shmobile_boot_fn or to the bootrom code.
> In a watchdog triggered reset scenario, since the [S]BAR registers keep
> their values, the boot CPU will jump into the newly designed reset
> vector, the assembly routine will eventually test WOVF (a bit in register
> RWTCSRA that indicates if the watchdog counter has overflown, the value
> of this bit gets retained in this scenario), and jump to the bootrom code
> which will in turn load up the bootloader, etc.
> When bringing up SMP or using CPU hotplug, the reset vector will jump
> to shmobile_boot_fn instead.
>
> Thank you All for your help.
>
> Best regards,
>
> Fabrizio Castro (26):
>   ARM: shmobile: Add watchdog support
>   ARM: dts: r8a7743: Adjust SMP routine size
>   ARM: dts: r8a7745: Adjust SMP routine size
>   ARM: dts: r8a7790: Adjust SMP routine size
>   ARM: dts: r8a7791: Adjust SMP routine size
>   ARM: dts: r8a7792: Adjust SMP routine size
>   ARM: dts: r8a7793: Adjust SMP routine size
>   ARM: dts: r8a7794: Adjust SMP routine size
>   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>   ARM: shmobile: rcar-gen2: Add watchdog support
>   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>   watchdog: renesas_wdt: Add R-Car Gen2 support
>   watchdog: renesas_wdt: Add restart handler
>   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>   clk: renesas: r8a7743: Add rwdt clock
>   clk: renesas: r8a7745: Add rwdt clock
>   clk: renesas: r8a7790: Add rwdt clock
>   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>   clk: renesas: r8a7794: Add rwdt clock
>   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>
>  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>  arch/arm/configs/shmobile_defconfig                |  1 +
>  arch/arm/mach-shmobile/common.h                    |  6 +++
>  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--

Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
a hard dependency for:
  (1) The new reset vector in arch/arm/mach-shmobile/
  (2) The watchdog driver.

Note that the watchdog driver itself (2) has a hard dependency on the
new reset vector (1).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH] watchdog: renesas_wdt: Blacklist early R-Car Gen2 SoCs
  2018-02-12 17:44     ` Fabrizio Castro
                       ` (2 preceding siblings ...)
  (?)
@ 2018-02-21 15:43     ` Geert Uytterhoeven
  2018-02-21 16:22       ` Simon Horman
  2018-02-28 17:48       ` Fabrizio Castro
  -1 siblings, 2 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-21 15:43 UTC (permalink / raw)
  To: Fabrizio Castro, Wim Van Sebroeck, Guenter Roeck
  Cc: Philipp Zabel, Chris Paterson, Biju Das, Ramesh Shanmugasundaram,
	Simon Horman, Magnus Damm, Wolfram Sang, linux-watchdog,
	linux-renesas-soc, Geert Uytterhoeven

On early revisions of some R-Car Gen2 SoCs, and depending on SMP
configuration, the system may fail to restart on watchdog time-out, and
lock up instead.

Specifically:
  - On R-Car H2 ES1.0 and M2-W ES1.0, watchdog restart fails unless
    only the first CPU core is in use (using e.g. the "maxcpus=1" kernel
    commandline option).
  - On R-Car V2H ES1.1, watchdog restart fails unless SMP is disabled
    completely (using CONFIG_SMP=n during build configuration, or using
    the "nosmp" or "maxcpus=0" kernel commandline options).

Prevent using the watchdog in impacted cases by blacklisting the
affected SoCs, using the minimum known working revisions (ES2.0 on R-Car
H2, and ES3.0 on M2-W), and taking the actual SMP software configuration
into account.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
To be folded into Fabrizio Castro's "watchdog: renesas_wdt: Add R-Car
Gen2 support".

Note that I cannot use IS_ENABLED(CONFIG_SMP), as setup_max_cpus does
not exist for CONFIG_SMP=n.

Any reports on R-Car M2-W ES2.0 and V2H ES2.0+ are welcomed!

As the failure is due to an integration issue, and the watchdog itself
is working fine, an alternative solution would be to move the check to
the code that installs the reset trigger ("soc: renesas: rcar-rst:
Enable watchdog as reset trigger for Gen2").
However, doing so would mean that:
  1. The user could enable and seemingly use the watchdog, but watchdog
     timeout would not restart the system,
  2. The same check should be done before installing the new reset
     vector ("ARM: shmobile: rcar-gen2: Add watchdog support"), too,
     else onlining CPU0 would fail once the watchdog has timed out.
---
 drivers/watchdog/renesas_wdt.c | 43 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
index 0f88614797c36022..4c8e8d2600a922a5 100644
--- a/drivers/watchdog/renesas_wdt.c
+++ b/drivers/watchdog/renesas_wdt.c
@@ -16,6 +16,8 @@
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
+#include <linux/smp.h>
+#include <linux/sys_soc.h>
 #include <linux/watchdog.h>
 
 #define RWTCNT		0
@@ -131,6 +133,44 @@ static const struct watchdog_ops rwdt_ops = {
 	.restart = rwdt_restart,
 };
 
+#if defined(CONFIG_ARCH_RCAR_GEN2) && defined(CONFIG_SMP)
+/*
+ * Watchdog-reset integration is broken on early revisions of R-Car Gen2 SoCs
+ */
+static const struct soc_device_attribute rwdt_quirks_match[] = {
+	{
+		.soc_id = "r8a7790",
+		.revision = "ES1.*",
+		.data = (void *)1,	/* needs single CPU */
+	}, {
+		.soc_id = "r8a7791",
+		.revision = "ES[12].*",
+		.data = (void *)1,	/* needs single CPU */
+	}, {
+		.soc_id = "r8a7792",
+		.revision = "*",
+		.data = (void *)0,	/* needs SMP disabled */
+	},
+	{ /* sentinel */ }
+};
+
+static bool rwdt_blacklisted(struct device *dev)
+{
+	const struct soc_device_attribute *attr;
+
+	attr = soc_device_match(rwdt_quirks_match);
+	if (attr && setup_max_cpus > (uintptr_t)attr->data) {
+		dev_info(dev, "Watchdog blacklisted on %s %s\n", attr->soc_id,
+			 attr->revision);
+		return true;
+	}
+
+	return false;
+}
+#else /* !CONFIG_ARCH_RCAR_GEN2 || !CONFIG_SMP */
+static inline bool rwdt_blacklisted(struct device *dev) { return false; }
+#endif /* !CONFIG_ARCH_RCAR_GEN2 || !CONFIG_SMP */
+
 static int rwdt_probe(struct platform_device *pdev)
 {
 	struct rwdt_priv *priv;
@@ -139,6 +179,9 @@ static int rwdt_probe(struct platform_device *pdev)
 	unsigned long clks_per_sec;
 	int ret, i;
 
+	if (rwdt_blacklisted(&pdev->dev))
+		return -ENODEV;
+
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
-- 
2.7.4

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
  2018-02-20 12:51   ` Geert Uytterhoeven
  (?)
@ 2018-02-21 16:13     ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-21 16:13 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	Fabrizio Castro,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Rob Herring, linux-arm-kernel, Stephen Boyd, Linux-Renesas

On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > this series has been around for some time as RFC, and it has collected
> > useful comments from the community along the way.
> > The solution proposed by this patch set works for most R-Car Gen2 and
> > RZ/G1 devices, but not all of them. We now know that for some R-Car
> > Gen2 early revisions there is no proper software fix. Anyway, no
> > product has been built around early revisions, but development boards
> > mounting early revisions (basically prototypes) are still out there.
> > As a result, this series isn't enabling the internal watchdog on R-Car
> > Gen2 boards, developers may enable it in board specific device trees
> > if needed.
> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> > and Koelsch boards.
> >
> > The problem
> > ===========
> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> > the non-boot CPUs they are redirected to the reset vector installed by
> > Linux in ICRAM1, and eventually they continue the execution to RAM,
> > where the SMP bring-up code will take care of the rest.
> > The content of the [S]BAR registers survives a watchdog triggered reset,
> > and as such after the watchdog fires the boot core will try and execute
> > the SMP bring-up code instead of jumping to the bootrom code.
> >
> > The fix
> > =======
> > The main strategy for the solution is to let the reset vector decide
> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
> > their values, the boot CPU will jump into the newly designed reset
> > vector, the assembly routine will eventually test WOVF (a bit in register
> > RWTCSRA that indicates if the watchdog counter has overflown, the value
> > of this bit gets retained in this scenario), and jump to the bootrom code
> > which will in turn load up the bootloader, etc.
> > When bringing up SMP or using CPU hotplug, the reset vector will jump
> > to shmobile_boot_fn instead.
> >
> > Thank you All for your help.
> >
> > Best regards,
> >
> > Fabrizio Castro (26):
> >   ARM: shmobile: Add watchdog support
> >   ARM: dts: r8a7743: Adjust SMP routine size
> >   ARM: dts: r8a7745: Adjust SMP routine size
> >   ARM: dts: r8a7790: Adjust SMP routine size
> >   ARM: dts: r8a7791: Adjust SMP routine size
> >   ARM: dts: r8a7792: Adjust SMP routine size
> >   ARM: dts: r8a7793: Adjust SMP routine size
> >   ARM: dts: r8a7794: Adjust SMP routine size
> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
> >   ARM: shmobile: rcar-gen2: Add watchdog support
> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
> >   watchdog: renesas_wdt: Add R-Car Gen2 support
> >   watchdog: renesas_wdt: Add restart handler
> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
> >   clk: renesas: r8a7743: Add rwdt clock
> >   clk: renesas: r8a7745: Add rwdt clock
> >   clk: renesas: r8a7790: Add rwdt clock
> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
> >   clk: renesas: r8a7794: Add rwdt clock
> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >
> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
> >  arch/arm/configs/shmobile_defconfig                |  1 +
> >  arch/arm/mach-shmobile/common.h                    |  6 +++
> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
> 
> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
> a hard dependency for:
>   (1) The new reset vector in arch/arm/mach-shmobile/
>   (2) The watchdog driver.
> 
> Note that the watchdog driver itself (2) has a hard dependency on the
> new reset vector (1).

Thanks, I have marked the watchdog driver patch as Deferred.
Please resubmit or otherwise ping me once they dependencies
are in an rc release.

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-21 16:13     ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-21 16:13 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Fabrizio Castro, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, linux-arm-kernel,
	linux-clk, Chris Paterson, Biju Das, Ramesh Shanmugasundaram

On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > this series has been around for some time as RFC, and it has collected
> > useful comments from the community along the way.
> > The solution proposed by this patch set works for most R-Car Gen2 and
> > RZ/G1 devices, but not all of them. We now know that for some R-Car
> > Gen2 early revisions there is no proper software fix. Anyway, no
> > product has been built around early revisions, but development boards
> > mounting early revisions (basically prototypes) are still out there.
> > As a result, this series isn't enabling the internal watchdog on R-Car
> > Gen2 boards, developers may enable it in board specific device trees
> > if needed.
> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> > and Koelsch boards.
> >
> > The problem
> > ===========
> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> > the non-boot CPUs they are redirected to the reset vector installed by
> > Linux in ICRAM1, and eventually they continue the execution to RAM,
> > where the SMP bring-up code will take care of the rest.
> > The content of the [S]BAR registers survives a watchdog triggered reset,
> > and as such after the watchdog fires the boot core will try and execute
> > the SMP bring-up code instead of jumping to the bootrom code.
> >
> > The fix
> > =======
> > The main strategy for the solution is to let the reset vector decide
> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
> > their values, the boot CPU will jump into the newly designed reset
> > vector, the assembly routine will eventually test WOVF (a bit in register
> > RWTCSRA that indicates if the watchdog counter has overflown, the value
> > of this bit gets retained in this scenario), and jump to the bootrom code
> > which will in turn load up the bootloader, etc.
> > When bringing up SMP or using CPU hotplug, the reset vector will jump
> > to shmobile_boot_fn instead.
> >
> > Thank you All for your help.
> >
> > Best regards,
> >
> > Fabrizio Castro (26):
> >   ARM: shmobile: Add watchdog support
> >   ARM: dts: r8a7743: Adjust SMP routine size
> >   ARM: dts: r8a7745: Adjust SMP routine size
> >   ARM: dts: r8a7790: Adjust SMP routine size
> >   ARM: dts: r8a7791: Adjust SMP routine size
> >   ARM: dts: r8a7792: Adjust SMP routine size
> >   ARM: dts: r8a7793: Adjust SMP routine size
> >   ARM: dts: r8a7794: Adjust SMP routine size
> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
> >   ARM: shmobile: rcar-gen2: Add watchdog support
> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
> >   watchdog: renesas_wdt: Add R-Car Gen2 support
> >   watchdog: renesas_wdt: Add restart handler
> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
> >   clk: renesas: r8a7743: Add rwdt clock
> >   clk: renesas: r8a7745: Add rwdt clock
> >   clk: renesas: r8a7790: Add rwdt clock
> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
> >   clk: renesas: r8a7794: Add rwdt clock
> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >
> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
> >  arch/arm/configs/shmobile_defconfig                |  1 +
> >  arch/arm/mach-shmobile/common.h                    |  6 +++
> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
> 
> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
> a hard dependency for:
>   (1) The new reset vector in arch/arm/mach-shmobile/
>   (2) The watchdog driver.
> 
> Note that the watchdog driver itself (2) has a hard dependency on the
> new reset vector (1).

Thanks, I have marked the watchdog driver patch as Deferred.
Please resubmit or otherwise ping me once they dependencies
are in an rc release.

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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-21 16:13     ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-21 16:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > this series has been around for some time as RFC, and it has collected
> > useful comments from the community along the way.
> > The solution proposed by this patch set works for most R-Car Gen2 and
> > RZ/G1 devices, but not all of them. We now know that for some R-Car
> > Gen2 early revisions there is no proper software fix. Anyway, no
> > product has been built around early revisions, but development boards
> > mounting early revisions (basically prototypes) are still out there.
> > As a result, this series isn't enabling the internal watchdog on R-Car
> > Gen2 boards, developers may enable it in board specific device trees
> > if needed.
> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> > and Koelsch boards.
> >
> > The problem
> > ===========
> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> > the non-boot CPUs they are redirected to the reset vector installed by
> > Linux in ICRAM1, and eventually they continue the execution to RAM,
> > where the SMP bring-up code will take care of the rest.
> > The content of the [S]BAR registers survives a watchdog triggered reset,
> > and as such after the watchdog fires the boot core will try and execute
> > the SMP bring-up code instead of jumping to the bootrom code.
> >
> > The fix
> > =======
> > The main strategy for the solution is to let the reset vector decide
> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
> > their values, the boot CPU will jump into the newly designed reset
> > vector, the assembly routine will eventually test WOVF (a bit in register
> > RWTCSRA that indicates if the watchdog counter has overflown, the value
> > of this bit gets retained in this scenario), and jump to the bootrom code
> > which will in turn load up the bootloader, etc.
> > When bringing up SMP or using CPU hotplug, the reset vector will jump
> > to shmobile_boot_fn instead.
> >
> > Thank you All for your help.
> >
> > Best regards,
> >
> > Fabrizio Castro (26):
> >   ARM: shmobile: Add watchdog support
> >   ARM: dts: r8a7743: Adjust SMP routine size
> >   ARM: dts: r8a7745: Adjust SMP routine size
> >   ARM: dts: r8a7790: Adjust SMP routine size
> >   ARM: dts: r8a7791: Adjust SMP routine size
> >   ARM: dts: r8a7792: Adjust SMP routine size
> >   ARM: dts: r8a7793: Adjust SMP routine size
> >   ARM: dts: r8a7794: Adjust SMP routine size
> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
> >   ARM: shmobile: rcar-gen2: Add watchdog support
> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
> >   watchdog: renesas_wdt: Add R-Car Gen2 support
> >   watchdog: renesas_wdt: Add restart handler
> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
> >   clk: renesas: r8a7743: Add rwdt clock
> >   clk: renesas: r8a7745: Add rwdt clock
> >   clk: renesas: r8a7790: Add rwdt clock
> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
> >   clk: renesas: r8a7794: Add rwdt clock
> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >
> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
> >  arch/arm/configs/shmobile_defconfig                |  1 +
> >  arch/arm/mach-shmobile/common.h                    |  6 +++
> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
> 
> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
> a hard dependency for:
>   (1) The new reset vector in arch/arm/mach-shmobile/
>   (2) The watchdog driver.
> 
> Note that the watchdog driver itself (2) has a hard dependency on the
> new reset vector (1).

Thanks, I have marked the watchdog driver patch as Deferred.
Please resubmit or otherwise ping me once they dependencies
are in an rc release.

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

* Re: [PATCH] watchdog: renesas_wdt: Blacklist early R-Car Gen2 SoCs
  2018-02-21 15:43     ` [PATCH] watchdog: renesas_wdt: Blacklist early R-Car Gen2 SoCs Geert Uytterhoeven
@ 2018-02-21 16:22       ` Simon Horman
  2018-02-28 17:48       ` Fabrizio Castro
  1 sibling, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-21 16:22 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Fabrizio Castro, Wim Van Sebroeck, Guenter Roeck, Philipp Zabel,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram, Magnus Damm,
	Wolfram Sang, linux-watchdog, linux-renesas-soc

On Wed, Feb 21, 2018 at 04:43:04PM +0100, Geert Uytterhoeven wrote:
> On early revisions of some R-Car Gen2 SoCs, and depending on SMP
> configuration, the system may fail to restart on watchdog time-out, and
> lock up instead.
> 
> Specifically:
>   - On R-Car H2 ES1.0 and M2-W ES1.0, watchdog restart fails unless
>     only the first CPU core is in use (using e.g. the "maxcpus=1" kernel
>     commandline option).
>   - On R-Car V2H ES1.1, watchdog restart fails unless SMP is disabled
>     completely (using CONFIG_SMP=n during build configuration, or using
>     the "nosmp" or "maxcpus=0" kernel commandline options).
> 
> Prevent using the watchdog in impacted cases by blacklisting the
> affected SoCs, using the minimum known working revisions (ES2.0 on R-Car
> H2, and ES3.0 on M2-W), and taking the actual SMP software configuration
> into account.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> To be folded into Fabrizio Castro's "watchdog: renesas_wdt: Add R-Car
> Gen2 support".
> 
> Note that I cannot use IS_ENABLED(CONFIG_SMP), as setup_max_cpus does
> not exist for CONFIG_SMP=n.

Thanks, I was going to ask about that.

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


> Any reports on R-Car M2-W ES2.0 and V2H ES2.0+ are welcomed!
> 
> As the failure is due to an integration issue, and the watchdog itself
> is working fine, an alternative solution would be to move the check to
> the code that installs the reset trigger ("soc: renesas: rcar-rst:
> Enable watchdog as reset trigger for Gen2").
> However, doing so would mean that:
>   1. The user could enable and seemingly use the watchdog, but watchdog
>      timeout would not restart the system,
>   2. The same check should be done before installing the new reset
>      vector ("ARM: shmobile: rcar-gen2: Add watchdog support"), too,
>      else onlining CPU0 would fail once the watchdog has timed out.
> ---
>  drivers/watchdog/renesas_wdt.c | 43 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 43 insertions(+)
> 
> diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
> index 0f88614797c36022..4c8e8d2600a922a5 100644
> --- a/drivers/watchdog/renesas_wdt.c
> +++ b/drivers/watchdog/renesas_wdt.c
> @@ -16,6 +16,8 @@
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
> +#include <linux/smp.h>
> +#include <linux/sys_soc.h>
>  #include <linux/watchdog.h>
>  
>  #define RWTCNT		0
> @@ -131,6 +133,44 @@ static const struct watchdog_ops rwdt_ops = {
>  	.restart = rwdt_restart,
>  };
>  
> +#if defined(CONFIG_ARCH_RCAR_GEN2) && defined(CONFIG_SMP)
> +/*
> + * Watchdog-reset integration is broken on early revisions of R-Car Gen2 SoCs
> + */
> +static const struct soc_device_attribute rwdt_quirks_match[] = {
> +	{
> +		.soc_id = "r8a7790",
> +		.revision = "ES1.*",
> +		.data = (void *)1,	/* needs single CPU */
> +	}, {
> +		.soc_id = "r8a7791",
> +		.revision = "ES[12].*",
> +		.data = (void *)1,	/* needs single CPU */
> +	}, {
> +		.soc_id = "r8a7792",
> +		.revision = "*",
> +		.data = (void *)0,	/* needs SMP disabled */
> +	},
> +	{ /* sentinel */ }
> +};
> +
> +static bool rwdt_blacklisted(struct device *dev)
> +{
> +	const struct soc_device_attribute *attr;
> +
> +	attr = soc_device_match(rwdt_quirks_match);
> +	if (attr && setup_max_cpus > (uintptr_t)attr->data) {
> +		dev_info(dev, "Watchdog blacklisted on %s %s\n", attr->soc_id,
> +			 attr->revision);
> +		return true;
> +	}
> +
> +	return false;
> +}
> +#else /* !CONFIG_ARCH_RCAR_GEN2 || !CONFIG_SMP */
> +static inline bool rwdt_blacklisted(struct device *dev) { return false; }
> +#endif /* !CONFIG_ARCH_RCAR_GEN2 || !CONFIG_SMP */
> +
>  static int rwdt_probe(struct platform_device *pdev)
>  {
>  	struct rwdt_priv *priv;
> @@ -139,6 +179,9 @@ static int rwdt_probe(struct platform_device *pdev)
>  	unsigned long clks_per_sec;
>  	int ret, i;
>  
> +	if (rwdt_blacklisted(&pdev->dev))
> +		return -ENODEV;
> +
>  	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
>  	if (!priv)
>  		return -ENOMEM;
> -- 
> 2.7.4
> 

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
  2018-02-21 16:13     ` Simon Horman
  (?)
@ 2018-02-21 16:30       ` Geert Uytterhoeven
  -1 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-21 16:30 UTC (permalink / raw)
  To: Simon Horman
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	Fabrizio Castro,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Rob Herring, linux-arm-kernel, Stephen Boyd, Linux-Renesas

Hi Simon,

On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
> On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
>> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
>> <fabrizio.castro@bp.renesas.com> wrote:
>> > this series has been around for some time as RFC, and it has collected
>> > useful comments from the community along the way.
>> > The solution proposed by this patch set works for most R-Car Gen2 and
>> > RZ/G1 devices, but not all of them. We now know that for some R-Car
>> > Gen2 early revisions there is no proper software fix. Anyway, no
>> > product has been built around early revisions, but development boards
>> > mounting early revisions (basically prototypes) are still out there.
>> > As a result, this series isn't enabling the internal watchdog on R-Car
>> > Gen2 boards, developers may enable it in board specific device trees
>> > if needed.
>> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
>> > and Koelsch boards.
>> >
>> > The problem
>> > ===========
>> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
>> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
>> > the non-boot CPUs they are redirected to the reset vector installed by
>> > Linux in ICRAM1, and eventually they continue the execution to RAM,
>> > where the SMP bring-up code will take care of the rest.
>> > The content of the [S]BAR registers survives a watchdog triggered reset,
>> > and as such after the watchdog fires the boot core will try and execute
>> > the SMP bring-up code instead of jumping to the bootrom code.
>> >
>> > The fix
>> > =======
>> > The main strategy for the solution is to let the reset vector decide
>> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
>> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
>> > their values, the boot CPU will jump into the newly designed reset
>> > vector, the assembly routine will eventually test WOVF (a bit in register
>> > RWTCSRA that indicates if the watchdog counter has overflown, the value
>> > of this bit gets retained in this scenario), and jump to the bootrom code
>> > which will in turn load up the bootloader, etc.
>> > When bringing up SMP or using CPU hotplug, the reset vector will jump
>> > to shmobile_boot_fn instead.
>> >
>> > Thank you All for your help.
>> >
>> > Best regards,
>> >
>> > Fabrizio Castro (26):
>> >   ARM: shmobile: Add watchdog support
>> >   ARM: dts: r8a7743: Adjust SMP routine size
>> >   ARM: dts: r8a7745: Adjust SMP routine size
>> >   ARM: dts: r8a7790: Adjust SMP routine size
>> >   ARM: dts: r8a7791: Adjust SMP routine size
>> >   ARM: dts: r8a7792: Adjust SMP routine size
>> >   ARM: dts: r8a7793: Adjust SMP routine size
>> >   ARM: dts: r8a7794: Adjust SMP routine size
>> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>> >   ARM: shmobile: rcar-gen2: Add watchdog support
>> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>> >   watchdog: renesas_wdt: Add R-Car Gen2 support
>> >   watchdog: renesas_wdt: Add restart handler
>> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>> >   clk: renesas: r8a7743: Add rwdt clock
>> >   clk: renesas: r8a7745: Add rwdt clock
>> >   clk: renesas: r8a7790: Add rwdt clock
>> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>> >   clk: renesas: r8a7794: Add rwdt clock
>> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>> >
>> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>> >  arch/arm/configs/shmobile_defconfig                |  1 +
>> >  arch/arm/mach-shmobile/common.h                    |  6 +++
>> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
>>
>> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
>> a hard dependency for:
>>   (1) The new reset vector in arch/arm/mach-shmobile/
>>   (2) The watchdog driver.
>>
>> Note that the watchdog driver itself (2) has a hard dependency on the
>> new reset vector (1).
>
> Thanks, I have marked the watchdog driver patch as Deferred.
> Please resubmit or otherwise ping me once they dependencies
> are in an rc release.

I gave the dependencies a bit more thought.

I think we can gain once release cycle if you would postpone the DTS patches
(both SMP routine size adjustments and RWDT device node additions) to v4.18.
Then all other parts can be upstreamed in parallel in v4.17, as nothing
will be activated before the DTS parts are in.

Does this look sane?
Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-21 16:30       ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-21 16:30 UTC (permalink / raw)
  To: Simon Horman
  Cc: Fabrizio Castro, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, linux-arm-kernel,
	linux-clk, Chris Paterson, Biju Das, Ramesh Shanmugasundaram

Hi Simon,

On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
> On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
>> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
>> <fabrizio.castro@bp.renesas.com> wrote:
>> > this series has been around for some time as RFC, and it has collected
>> > useful comments from the community along the way.
>> > The solution proposed by this patch set works for most R-Car Gen2 and
>> > RZ/G1 devices, but not all of them. We now know that for some R-Car
>> > Gen2 early revisions there is no proper software fix. Anyway, no
>> > product has been built around early revisions, but development boards
>> > mounting early revisions (basically prototypes) are still out there.
>> > As a result, this series isn't enabling the internal watchdog on R-Car
>> > Gen2 boards, developers may enable it in board specific device trees
>> > if needed.
>> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
>> > and Koelsch boards.
>> >
>> > The problem
>> > ===========
>> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
>> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
>> > the non-boot CPUs they are redirected to the reset vector installed by
>> > Linux in ICRAM1, and eventually they continue the execution to RAM,
>> > where the SMP bring-up code will take care of the rest.
>> > The content of the [S]BAR registers survives a watchdog triggered reset,
>> > and as such after the watchdog fires the boot core will try and execute
>> > the SMP bring-up code instead of jumping to the bootrom code.
>> >
>> > The fix
>> > =======
>> > The main strategy for the solution is to let the reset vector decide
>> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
>> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
>> > their values, the boot CPU will jump into the newly designed reset
>> > vector, the assembly routine will eventually test WOVF (a bit in register
>> > RWTCSRA that indicates if the watchdog counter has overflown, the value
>> > of this bit gets retained in this scenario), and jump to the bootrom code
>> > which will in turn load up the bootloader, etc.
>> > When bringing up SMP or using CPU hotplug, the reset vector will jump
>> > to shmobile_boot_fn instead.
>> >
>> > Thank you All for your help.
>> >
>> > Best regards,
>> >
>> > Fabrizio Castro (26):
>> >   ARM: shmobile: Add watchdog support
>> >   ARM: dts: r8a7743: Adjust SMP routine size
>> >   ARM: dts: r8a7745: Adjust SMP routine size
>> >   ARM: dts: r8a7790: Adjust SMP routine size
>> >   ARM: dts: r8a7791: Adjust SMP routine size
>> >   ARM: dts: r8a7792: Adjust SMP routine size
>> >   ARM: dts: r8a7793: Adjust SMP routine size
>> >   ARM: dts: r8a7794: Adjust SMP routine size
>> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>> >   ARM: shmobile: rcar-gen2: Add watchdog support
>> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>> >   watchdog: renesas_wdt: Add R-Car Gen2 support
>> >   watchdog: renesas_wdt: Add restart handler
>> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>> >   clk: renesas: r8a7743: Add rwdt clock
>> >   clk: renesas: r8a7745: Add rwdt clock
>> >   clk: renesas: r8a7790: Add rwdt clock
>> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>> >   clk: renesas: r8a7794: Add rwdt clock
>> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>> >
>> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>> >  arch/arm/configs/shmobile_defconfig                |  1 +
>> >  arch/arm/mach-shmobile/common.h                    |  6 +++
>> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
>>
>> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
>> a hard dependency for:
>>   (1) The new reset vector in arch/arm/mach-shmobile/
>>   (2) The watchdog driver.
>>
>> Note that the watchdog driver itself (2) has a hard dependency on the
>> new reset vector (1).
>
> Thanks, I have marked the watchdog driver patch as Deferred.
> Please resubmit or otherwise ping me once they dependencies
> are in an rc release.

I gave the dependencies a bit more thought.

I think we can gain once release cycle if you would postpone the DTS patches
(both SMP routine size adjustments and RWDT device node additions) to v4.18.
Then all other parts can be upstreamed in parallel in v4.17, as nothing
will be activated before the DTS parts are in.

Does this look sane?
Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-21 16:30       ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-21 16:30 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
> On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
>> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
>> <fabrizio.castro@bp.renesas.com> wrote:
>> > this series has been around for some time as RFC, and it has collected
>> > useful comments from the community along the way.
>> > The solution proposed by this patch set works for most R-Car Gen2 and
>> > RZ/G1 devices, but not all of them. We now know that for some R-Car
>> > Gen2 early revisions there is no proper software fix. Anyway, no
>> > product has been built around early revisions, but development boards
>> > mounting early revisions (basically prototypes) are still out there.
>> > As a result, this series isn't enabling the internal watchdog on R-Car
>> > Gen2 boards, developers may enable it in board specific device trees
>> > if needed.
>> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
>> > and Koelsch boards.
>> >
>> > The problem
>> > ===========
>> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
>> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
>> > the non-boot CPUs they are redirected to the reset vector installed by
>> > Linux in ICRAM1, and eventually they continue the execution to RAM,
>> > where the SMP bring-up code will take care of the rest.
>> > The content of the [S]BAR registers survives a watchdog triggered reset,
>> > and as such after the watchdog fires the boot core will try and execute
>> > the SMP bring-up code instead of jumping to the bootrom code.
>> >
>> > The fix
>> > =======
>> > The main strategy for the solution is to let the reset vector decide
>> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
>> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
>> > their values, the boot CPU will jump into the newly designed reset
>> > vector, the assembly routine will eventually test WOVF (a bit in register
>> > RWTCSRA that indicates if the watchdog counter has overflown, the value
>> > of this bit gets retained in this scenario), and jump to the bootrom code
>> > which will in turn load up the bootloader, etc.
>> > When bringing up SMP or using CPU hotplug, the reset vector will jump
>> > to shmobile_boot_fn instead.
>> >
>> > Thank you All for your help.
>> >
>> > Best regards,
>> >
>> > Fabrizio Castro (26):
>> >   ARM: shmobile: Add watchdog support
>> >   ARM: dts: r8a7743: Adjust SMP routine size
>> >   ARM: dts: r8a7745: Adjust SMP routine size
>> >   ARM: dts: r8a7790: Adjust SMP routine size
>> >   ARM: dts: r8a7791: Adjust SMP routine size
>> >   ARM: dts: r8a7792: Adjust SMP routine size
>> >   ARM: dts: r8a7793: Adjust SMP routine size
>> >   ARM: dts: r8a7794: Adjust SMP routine size
>> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>> >   ARM: shmobile: rcar-gen2: Add watchdog support
>> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>> >   watchdog: renesas_wdt: Add R-Car Gen2 support
>> >   watchdog: renesas_wdt: Add restart handler
>> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>> >   clk: renesas: r8a7743: Add rwdt clock
>> >   clk: renesas: r8a7745: Add rwdt clock
>> >   clk: renesas: r8a7790: Add rwdt clock
>> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>> >   clk: renesas: r8a7794: Add rwdt clock
>> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>> >
>> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>> >  arch/arm/configs/shmobile_defconfig                |  1 +
>> >  arch/arm/mach-shmobile/common.h                    |  6 +++
>> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
>>
>> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
>> a hard dependency for:
>>   (1) The new reset vector in arch/arm/mach-shmobile/
>>   (2) The watchdog driver.
>>
>> Note that the watchdog driver itself (2) has a hard dependency on the
>> new reset vector (1).
>
> Thanks, I have marked the watchdog driver patch as Deferred.
> Please resubmit or otherwise ping me once they dependencies
> are in an rc release.

I gave the dependencies a bit more thought.

I think we can gain once release cycle if you would postpone the DTS patches
(both SMP routine size adjustments and RWDT device node additions) to v4.18.
Then all other parts can be upstreamed in parallel in v4.17, as nothing
will be activated before the DTS parts are in.

Does this look sane?
Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
  2018-02-21 16:30       ` Geert Uytterhoeven
  (?)
@ 2018-02-21 18:32         ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-21 18:32 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	Fabrizio Castro,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Rob Herring, linux-arm-kernel, Stephen Boyd, Linux-Renesas

On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> >> <fabrizio.castro@bp.renesas.com> wrote:
> >> > this series has been around for some time as RFC, and it has collected
> >> > useful comments from the community along the way.
> >> > The solution proposed by this patch set works for most R-Car Gen2 and
> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
> >> > Gen2 early revisions there is no proper software fix. Anyway, no
> >> > product has been built around early revisions, but development boards
> >> > mounting early revisions (basically prototypes) are still out there.
> >> > As a result, this series isn't enabling the internal watchdog on R-Car
> >> > Gen2 boards, developers may enable it in board specific device trees
> >> > if needed.
> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> >> > and Koelsch boards.
> >> >
> >> > The problem
> >> > ===========
> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> >> > the non-boot CPUs they are redirected to the reset vector installed by
> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
> >> > where the SMP bring-up code will take care of the rest.
> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
> >> > and as such after the watchdog fires the boot core will try and execute
> >> > the SMP bring-up code instead of jumping to the bootrom code.
> >> >
> >> > The fix
> >> > =======
> >> > The main strategy for the solution is to let the reset vector decide
> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
> >> > their values, the boot CPU will jump into the newly designed reset
> >> > vector, the assembly routine will eventually test WOVF (a bit in register
> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
> >> > of this bit gets retained in this scenario), and jump to the bootrom code
> >> > which will in turn load up the bootloader, etc.
> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
> >> > to shmobile_boot_fn instead.
> >> >
> >> > Thank you All for your help.
> >> >
> >> > Best regards,
> >> >
> >> > Fabrizio Castro (26):
> >> >   ARM: shmobile: Add watchdog support
> >> >   ARM: dts: r8a7743: Adjust SMP routine size
> >> >   ARM: dts: r8a7745: Adjust SMP routine size
> >> >   ARM: dts: r8a7790: Adjust SMP routine size
> >> >   ARM: dts: r8a7791: Adjust SMP routine size
> >> >   ARM: dts: r8a7792: Adjust SMP routine size
> >> >   ARM: dts: r8a7793: Adjust SMP routine size
> >> >   ARM: dts: r8a7794: Adjust SMP routine size
> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
> >> >   watchdog: renesas_wdt: Add restart handler
> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
> >> >   clk: renesas: r8a7743: Add rwdt clock
> >> >   clk: renesas: r8a7745: Add rwdt clock
> >> >   clk: renesas: r8a7790: Add rwdt clock
> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
> >> >   clk: renesas: r8a7794: Add rwdt clock
> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >> >
> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
> >>
> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
> >> a hard dependency for:
> >>   (1) The new reset vector in arch/arm/mach-shmobile/
> >>   (2) The watchdog driver.
> >>
> >> Note that the watchdog driver itself (2) has a hard dependency on the
> >> new reset vector (1).
> >
> > Thanks, I have marked the watchdog driver patch as Deferred.
> > Please resubmit or otherwise ping me once they dependencies
> > are in an rc release.
> 
> I gave the dependencies a bit more thought.
> 
> I think we can gain once release cycle if you would postpone the DTS patches
> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
> Then all other parts can be upstreamed in parallel in v4.17, as nothing
> will be activated before the DTS parts are in.
> 
> Does this look sane?

What about new DTS on old kernels of a specific vintage?

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-21 18:32         ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-21 18:32 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Fabrizio Castro, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, linux-arm-kernel,
	linux-clk, Chris Paterson, Biju Das, Ramesh Shanmugasundaram

On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> >> <fabrizio.castro@bp.renesas.com> wrote:
> >> > this series has been around for some time as RFC, and it has collected
> >> > useful comments from the community along the way.
> >> > The solution proposed by this patch set works for most R-Car Gen2 and
> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
> >> > Gen2 early revisions there is no proper software fix. Anyway, no
> >> > product has been built around early revisions, but development boards
> >> > mounting early revisions (basically prototypes) are still out there.
> >> > As a result, this series isn't enabling the internal watchdog on R-Car
> >> > Gen2 boards, developers may enable it in board specific device trees
> >> > if needed.
> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> >> > and Koelsch boards.
> >> >
> >> > The problem
> >> > ===========
> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> >> > the non-boot CPUs they are redirected to the reset vector installed by
> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
> >> > where the SMP bring-up code will take care of the rest.
> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
> >> > and as such after the watchdog fires the boot core will try and execute
> >> > the SMP bring-up code instead of jumping to the bootrom code.
> >> >
> >> > The fix
> >> > =======
> >> > The main strategy for the solution is to let the reset vector decide
> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
> >> > their values, the boot CPU will jump into the newly designed reset
> >> > vector, the assembly routine will eventually test WOVF (a bit in register
> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
> >> > of this bit gets retained in this scenario), and jump to the bootrom code
> >> > which will in turn load up the bootloader, etc.
> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
> >> > to shmobile_boot_fn instead.
> >> >
> >> > Thank you All for your help.
> >> >
> >> > Best regards,
> >> >
> >> > Fabrizio Castro (26):
> >> >   ARM: shmobile: Add watchdog support
> >> >   ARM: dts: r8a7743: Adjust SMP routine size
> >> >   ARM: dts: r8a7745: Adjust SMP routine size
> >> >   ARM: dts: r8a7790: Adjust SMP routine size
> >> >   ARM: dts: r8a7791: Adjust SMP routine size
> >> >   ARM: dts: r8a7792: Adjust SMP routine size
> >> >   ARM: dts: r8a7793: Adjust SMP routine size
> >> >   ARM: dts: r8a7794: Adjust SMP routine size
> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
> >> >   watchdog: renesas_wdt: Add restart handler
> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
> >> >   clk: renesas: r8a7743: Add rwdt clock
> >> >   clk: renesas: r8a7745: Add rwdt clock
> >> >   clk: renesas: r8a7790: Add rwdt clock
> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
> >> >   clk: renesas: r8a7794: Add rwdt clock
> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >> >
> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
> >>
> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
> >> a hard dependency for:
> >>   (1) The new reset vector in arch/arm/mach-shmobile/
> >>   (2) The watchdog driver.
> >>
> >> Note that the watchdog driver itself (2) has a hard dependency on the
> >> new reset vector (1).
> >
> > Thanks, I have marked the watchdog driver patch as Deferred.
> > Please resubmit or otherwise ping me once they dependencies
> > are in an rc release.
> 
> I gave the dependencies a bit more thought.
> 
> I think we can gain once release cycle if you would postpone the DTS patches
> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
> Then all other parts can be upstreamed in parallel in v4.17, as nothing
> will be activated before the DTS parts are in.
> 
> Does this look sane?

What about new DTS on old kernels of a specific vintage?

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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-21 18:32         ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-21 18:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> >> <fabrizio.castro@bp.renesas.com> wrote:
> >> > this series has been around for some time as RFC, and it has collected
> >> > useful comments from the community along the way.
> >> > The solution proposed by this patch set works for most R-Car Gen2 and
> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
> >> > Gen2 early revisions there is no proper software fix. Anyway, no
> >> > product has been built around early revisions, but development boards
> >> > mounting early revisions (basically prototypes) are still out there.
> >> > As a result, this series isn't enabling the internal watchdog on R-Car
> >> > Gen2 boards, developers may enable it in board specific device trees
> >> > if needed.
> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> >> > and Koelsch boards.
> >> >
> >> > The problem
> >> > ===========
> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> >> > the non-boot CPUs they are redirected to the reset vector installed by
> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
> >> > where the SMP bring-up code will take care of the rest.
> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
> >> > and as such after the watchdog fires the boot core will try and execute
> >> > the SMP bring-up code instead of jumping to the bootrom code.
> >> >
> >> > The fix
> >> > =======
> >> > The main strategy for the solution is to let the reset vector decide
> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
> >> > their values, the boot CPU will jump into the newly designed reset
> >> > vector, the assembly routine will eventually test WOVF (a bit in register
> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
> >> > of this bit gets retained in this scenario), and jump to the bootrom code
> >> > which will in turn load up the bootloader, etc.
> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
> >> > to shmobile_boot_fn instead.
> >> >
> >> > Thank you All for your help.
> >> >
> >> > Best regards,
> >> >
> >> > Fabrizio Castro (26):
> >> >   ARM: shmobile: Add watchdog support
> >> >   ARM: dts: r8a7743: Adjust SMP routine size
> >> >   ARM: dts: r8a7745: Adjust SMP routine size
> >> >   ARM: dts: r8a7790: Adjust SMP routine size
> >> >   ARM: dts: r8a7791: Adjust SMP routine size
> >> >   ARM: dts: r8a7792: Adjust SMP routine size
> >> >   ARM: dts: r8a7793: Adjust SMP routine size
> >> >   ARM: dts: r8a7794: Adjust SMP routine size
> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
> >> >   watchdog: renesas_wdt: Add restart handler
> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
> >> >   clk: renesas: r8a7743: Add rwdt clock
> >> >   clk: renesas: r8a7745: Add rwdt clock
> >> >   clk: renesas: r8a7790: Add rwdt clock
> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
> >> >   clk: renesas: r8a7794: Add rwdt clock
> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >> >
> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
> >>
> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
> >> a hard dependency for:
> >>   (1) The new reset vector in arch/arm/mach-shmobile/
> >>   (2) The watchdog driver.
> >>
> >> Note that the watchdog driver itself (2) has a hard dependency on the
> >> new reset vector (1).
> >
> > Thanks, I have marked the watchdog driver patch as Deferred.
> > Please resubmit or otherwise ping me once they dependencies
> > are in an rc release.
> 
> I gave the dependencies a bit more thought.
> 
> I think we can gain once release cycle if you would postpone the DTS patches
> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
> Then all other parts can be upstreamed in parallel in v4.17, as nothing
> will be activated before the DTS parts are in.
> 
> Does this look sane?

What about new DTS on old kernels of a specific vintage?

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
  2018-02-21 18:32         ` Simon Horman
  (?)
@ 2018-02-22  8:38           ` Geert Uytterhoeven
  -1 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-22  8:38 UTC (permalink / raw)
  To: Simon Horman
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	Fabrizio Castro,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Rob Herring, linux-arm-kernel, Stephen Boyd, Linux-Renesas

Hi Simon,

On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
> On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
>> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
>> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
>> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
>> >> <fabrizio.castro@bp.renesas.com> wrote:
>> >> > this series has been around for some time as RFC, and it has collected
>> >> > useful comments from the community along the way.
>> >> > The solution proposed by this patch set works for most R-Car Gen2 and
>> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
>> >> > Gen2 early revisions there is no proper software fix. Anyway, no
>> >> > product has been built around early revisions, but development boards
>> >> > mounting early revisions (basically prototypes) are still out there.
>> >> > As a result, this series isn't enabling the internal watchdog on R-Car
>> >> > Gen2 boards, developers may enable it in board specific device trees
>> >> > if needed.
>> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
>> >> > and Koelsch boards.
>> >> >
>> >> > The problem
>> >> > ===========
>> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
>> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
>> >> > the non-boot CPUs they are redirected to the reset vector installed by
>> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
>> >> > where the SMP bring-up code will take care of the rest.
>> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
>> >> > and as such after the watchdog fires the boot core will try and execute
>> >> > the SMP bring-up code instead of jumping to the bootrom code.
>> >> >
>> >> > The fix
>> >> > =======
>> >> > The main strategy for the solution is to let the reset vector decide
>> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
>> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
>> >> > their values, the boot CPU will jump into the newly designed reset
>> >> > vector, the assembly routine will eventually test WOVF (a bit in register
>> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
>> >> > of this bit gets retained in this scenario), and jump to the bootrom code
>> >> > which will in turn load up the bootloader, etc.
>> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
>> >> > to shmobile_boot_fn instead.
>> >> >
>> >> > Thank you All for your help.
>> >> >
>> >> > Best regards,
>> >> >
>> >> > Fabrizio Castro (26):
>> >> >   ARM: shmobile: Add watchdog support
>> >> >   ARM: dts: r8a7743: Adjust SMP routine size
>> >> >   ARM: dts: r8a7745: Adjust SMP routine size
>> >> >   ARM: dts: r8a7790: Adjust SMP routine size
>> >> >   ARM: dts: r8a7791: Adjust SMP routine size
>> >> >   ARM: dts: r8a7792: Adjust SMP routine size
>> >> >   ARM: dts: r8a7793: Adjust SMP routine size
>> >> >   ARM: dts: r8a7794: Adjust SMP routine size
>> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
>> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
>> >> >   watchdog: renesas_wdt: Add restart handler
>> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>> >> >   clk: renesas: r8a7743: Add rwdt clock
>> >> >   clk: renesas: r8a7745: Add rwdt clock
>> >> >   clk: renesas: r8a7790: Add rwdt clock
>> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>> >> >   clk: renesas: r8a7794: Add rwdt clock
>> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>> >> >
>> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
>> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
>> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
>> >>
>> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
>> >> a hard dependency for:
>> >>   (1) The new reset vector in arch/arm/mach-shmobile/
>> >>   (2) The watchdog driver.
>> >>
>> >> Note that the watchdog driver itself (2) has a hard dependency on the
>> >> new reset vector (1).
>> >
>> > Thanks, I have marked the watchdog driver patch as Deferred.
>> > Please resubmit or otherwise ping me once they dependencies
>> > are in an rc release.
>>
>> I gave the dependencies a bit more thought.
>>
>> I think we can gain once release cycle if you would postpone the DTS patches
>> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
>> Then all other parts can be upstreamed in parallel in v4.17, as nothing
>> will be activated before the DTS parts are in.
>>
>> Does this look sane?
>
> What about new DTS on old kernels of a specific vintage?

New DTS would work fine on v4.16 and older, which don't have any of the
other patches from this series.
New DTS would work fine on v4.17, assumed all other patches from this
series get into v4.17.

The only issue would be a new DTS on a kernel that has some but not all
other patches from this series.

If we want to fast-track everything into v4.17, we need a stable branch, to be
pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
renesas-dts).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-22  8:38           ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-22  8:38 UTC (permalink / raw)
  To: Simon Horman
  Cc: Fabrizio Castro, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, linux-arm-kernel,
	linux-clk, Chris Paterson, Biju Das, Ramesh Shanmugasundaram

Hi Simon,

On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
> On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
>> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
>> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
>> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
>> >> <fabrizio.castro@bp.renesas.com> wrote:
>> >> > this series has been around for some time as RFC, and it has collected
>> >> > useful comments from the community along the way.
>> >> > The solution proposed by this patch set works for most R-Car Gen2 and
>> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
>> >> > Gen2 early revisions there is no proper software fix. Anyway, no
>> >> > product has been built around early revisions, but development boards
>> >> > mounting early revisions (basically prototypes) are still out there.
>> >> > As a result, this series isn't enabling the internal watchdog on R-Car
>> >> > Gen2 boards, developers may enable it in board specific device trees
>> >> > if needed.
>> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
>> >> > and Koelsch boards.
>> >> >
>> >> > The problem
>> >> > ===========
>> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
>> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
>> >> > the non-boot CPUs they are redirected to the reset vector installed by
>> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
>> >> > where the SMP bring-up code will take care of the rest.
>> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
>> >> > and as such after the watchdog fires the boot core will try and execute
>> >> > the SMP bring-up code instead of jumping to the bootrom code.
>> >> >
>> >> > The fix
>> >> > =======
>> >> > The main strategy for the solution is to let the reset vector decide
>> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
>> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
>> >> > their values, the boot CPU will jump into the newly designed reset
>> >> > vector, the assembly routine will eventually test WOVF (a bit in register
>> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
>> >> > of this bit gets retained in this scenario), and jump to the bootrom code
>> >> > which will in turn load up the bootloader, etc.
>> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
>> >> > to shmobile_boot_fn instead.
>> >> >
>> >> > Thank you All for your help.
>> >> >
>> >> > Best regards,
>> >> >
>> >> > Fabrizio Castro (26):
>> >> >   ARM: shmobile: Add watchdog support
>> >> >   ARM: dts: r8a7743: Adjust SMP routine size
>> >> >   ARM: dts: r8a7745: Adjust SMP routine size
>> >> >   ARM: dts: r8a7790: Adjust SMP routine size
>> >> >   ARM: dts: r8a7791: Adjust SMP routine size
>> >> >   ARM: dts: r8a7792: Adjust SMP routine size
>> >> >   ARM: dts: r8a7793: Adjust SMP routine size
>> >> >   ARM: dts: r8a7794: Adjust SMP routine size
>> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
>> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
>> >> >   watchdog: renesas_wdt: Add restart handler
>> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>> >> >   clk: renesas: r8a7743: Add rwdt clock
>> >> >   clk: renesas: r8a7745: Add rwdt clock
>> >> >   clk: renesas: r8a7790: Add rwdt clock
>> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>> >> >   clk: renesas: r8a7794: Add rwdt clock
>> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>> >> >
>> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
>> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
>> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
>> >>
>> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
>> >> a hard dependency for:
>> >>   (1) The new reset vector in arch/arm/mach-shmobile/
>> >>   (2) The watchdog driver.
>> >>
>> >> Note that the watchdog driver itself (2) has a hard dependency on the
>> >> new reset vector (1).
>> >
>> > Thanks, I have marked the watchdog driver patch as Deferred.
>> > Please resubmit or otherwise ping me once they dependencies
>> > are in an rc release.
>>
>> I gave the dependencies a bit more thought.
>>
>> I think we can gain once release cycle if you would postpone the DTS patches
>> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
>> Then all other parts can be upstreamed in parallel in v4.17, as nothing
>> will be activated before the DTS parts are in.
>>
>> Does this look sane?
>
> What about new DTS on old kernels of a specific vintage?

New DTS would work fine on v4.16 and older, which don't have any of the
other patches from this series.
New DTS would work fine on v4.17, assumed all other patches from this
series get into v4.17.

The only issue would be a new DTS on a kernel that has some but not all
other patches from this series.

If we want to fast-track everything into v4.17, we need a stable branch, to be
pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
renesas-dts).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-22  8:38           ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-22  8:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
> On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
>> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
>> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
>> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
>> >> <fabrizio.castro@bp.renesas.com> wrote:
>> >> > this series has been around for some time as RFC, and it has collected
>> >> > useful comments from the community along the way.
>> >> > The solution proposed by this patch set works for most R-Car Gen2 and
>> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
>> >> > Gen2 early revisions there is no proper software fix. Anyway, no
>> >> > product has been built around early revisions, but development boards
>> >> > mounting early revisions (basically prototypes) are still out there.
>> >> > As a result, this series isn't enabling the internal watchdog on R-Car
>> >> > Gen2 boards, developers may enable it in board specific device trees
>> >> > if needed.
>> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
>> >> > and Koelsch boards.
>> >> >
>> >> > The problem
>> >> > ===========
>> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
>> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
>> >> > the non-boot CPUs they are redirected to the reset vector installed by
>> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
>> >> > where the SMP bring-up code will take care of the rest.
>> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
>> >> > and as such after the watchdog fires the boot core will try and execute
>> >> > the SMP bring-up code instead of jumping to the bootrom code.
>> >> >
>> >> > The fix
>> >> > =======
>> >> > The main strategy for the solution is to let the reset vector decide
>> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
>> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
>> >> > their values, the boot CPU will jump into the newly designed reset
>> >> > vector, the assembly routine will eventually test WOVF (a bit in register
>> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
>> >> > of this bit gets retained in this scenario), and jump to the bootrom code
>> >> > which will in turn load up the bootloader, etc.
>> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
>> >> > to shmobile_boot_fn instead.
>> >> >
>> >> > Thank you All for your help.
>> >> >
>> >> > Best regards,
>> >> >
>> >> > Fabrizio Castro (26):
>> >> >   ARM: shmobile: Add watchdog support
>> >> >   ARM: dts: r8a7743: Adjust SMP routine size
>> >> >   ARM: dts: r8a7745: Adjust SMP routine size
>> >> >   ARM: dts: r8a7790: Adjust SMP routine size
>> >> >   ARM: dts: r8a7791: Adjust SMP routine size
>> >> >   ARM: dts: r8a7792: Adjust SMP routine size
>> >> >   ARM: dts: r8a7793: Adjust SMP routine size
>> >> >   ARM: dts: r8a7794: Adjust SMP routine size
>> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
>> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
>> >> >   watchdog: renesas_wdt: Add restart handler
>> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>> >> >   clk: renesas: r8a7743: Add rwdt clock
>> >> >   clk: renesas: r8a7745: Add rwdt clock
>> >> >   clk: renesas: r8a7790: Add rwdt clock
>> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>> >> >   clk: renesas: r8a7794: Add rwdt clock
>> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>> >> >
>> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
>> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
>> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
>> >>
>> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
>> >> a hard dependency for:
>> >>   (1) The new reset vector in arch/arm/mach-shmobile/
>> >>   (2) The watchdog driver.
>> >>
>> >> Note that the watchdog driver itself (2) has a hard dependency on the
>> >> new reset vector (1).
>> >
>> > Thanks, I have marked the watchdog driver patch as Deferred.
>> > Please resubmit or otherwise ping me once they dependencies
>> > are in an rc release.
>>
>> I gave the dependencies a bit more thought.
>>
>> I think we can gain once release cycle if you would postpone the DTS patches
>> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
>> Then all other parts can be upstreamed in parallel in v4.17, as nothing
>> will be activated before the DTS parts are in.
>>
>> Does this look sane?
>
> What about new DTS on old kernels of a specific vintage?

New DTS would work fine on v4.16 and older, which don't have any of the
other patches from this series.
New DTS would work fine on v4.17, assumed all other patches from this
series get into v4.17.

The only issue would be a new DTS on a kernel that has some but not all
other patches from this series.

If we want to fast-track everything into v4.17, we need a stable branch, to be
pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
renesas-dts).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
  2018-02-22  8:38           ` Geert Uytterhoeven
  (?)
@ 2018-02-23  8:14             ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-23  8:14 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	Fabrizio Castro,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Rob Herring, linux-arm-kernel, Stephen Boyd, Linux-Renesas

On Thu, Feb 22, 2018 at 09:38:39AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
> >> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
> >> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
> >> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> >> >> <fabrizio.castro@bp.renesas.com> wrote:
> >> >> > this series has been around for some time as RFC, and it has collected
> >> >> > useful comments from the community along the way.
> >> >> > The solution proposed by this patch set works for most R-Car Gen2 and
> >> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
> >> >> > Gen2 early revisions there is no proper software fix. Anyway, no
> >> >> > product has been built around early revisions, but development boards
> >> >> > mounting early revisions (basically prototypes) are still out there.
> >> >> > As a result, this series isn't enabling the internal watchdog on R-Car
> >> >> > Gen2 boards, developers may enable it in board specific device trees
> >> >> > if needed.
> >> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> >> >> > and Koelsch boards.
> >> >> >
> >> >> > The problem
> >> >> > ===========
> >> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> >> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> >> >> > the non-boot CPUs they are redirected to the reset vector installed by
> >> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
> >> >> > where the SMP bring-up code will take care of the rest.
> >> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
> >> >> > and as such after the watchdog fires the boot core will try and execute
> >> >> > the SMP bring-up code instead of jumping to the bootrom code.
> >> >> >
> >> >> > The fix
> >> >> > =======
> >> >> > The main strategy for the solution is to let the reset vector decide
> >> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
> >> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
> >> >> > their values, the boot CPU will jump into the newly designed reset
> >> >> > vector, the assembly routine will eventually test WOVF (a bit in register
> >> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
> >> >> > of this bit gets retained in this scenario), and jump to the bootrom code
> >> >> > which will in turn load up the bootloader, etc.
> >> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
> >> >> > to shmobile_boot_fn instead.
> >> >> >
> >> >> > Thank you All for your help.
> >> >> >
> >> >> > Best regards,
> >> >> >
> >> >> > Fabrizio Castro (26):
> >> >> >   ARM: shmobile: Add watchdog support
> >> >> >   ARM: dts: r8a7743: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7745: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7790: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7791: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7792: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7793: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7794: Adjust SMP routine size
> >> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
> >> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
> >> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
> >> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
> >> >> >   watchdog: renesas_wdt: Add restart handler
> >> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
> >> >> >   clk: renesas: r8a7743: Add rwdt clock
> >> >> >   clk: renesas: r8a7745: Add rwdt clock
> >> >> >   clk: renesas: r8a7790: Add rwdt clock
> >> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
> >> >> >   clk: renesas: r8a7794: Add rwdt clock
> >> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> >> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >> >> >
> >> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
> >> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
> >> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
> >> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
> >> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
> >> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
> >> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
> >> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
> >> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
> >> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
> >> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
> >> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
> >> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
> >> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
> >> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
> >> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
> >> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
> >> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
> >> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
> >> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
> >> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
> >> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
> >> >>
> >> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
> >> >> a hard dependency for:
> >> >>   (1) The new reset vector in arch/arm/mach-shmobile/
> >> >>   (2) The watchdog driver.
> >> >>
> >> >> Note that the watchdog driver itself (2) has a hard dependency on the
> >> >> new reset vector (1).
> >> >
> >> > Thanks, I have marked the watchdog driver patch as Deferred.
> >> > Please resubmit or otherwise ping me once they dependencies
> >> > are in an rc release.
> >>
> >> I gave the dependencies a bit more thought.
> >>
> >> I think we can gain once release cycle if you would postpone the DTS patches
> >> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
> >> Then all other parts can be upstreamed in parallel in v4.17, as nothing
> >> will be activated before the DTS parts are in.
> >>
> >> Does this look sane?
> >
> > What about new DTS on old kernels of a specific vintage?
> 
> New DTS would work fine on v4.16 and older, which don't have any of the
> other patches from this series.
> New DTS would work fine on v4.17, assumed all other patches from this
> series get into v4.17.
> 
> The only issue would be a new DTS on a kernel that has some but not all
> other patches from this series.

Thanks for the analysis. I think this is the key point. What is the risk of
that happening?

> If we want to fast-track everything into v4.17, we need a stable branch, to be
> pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
> renesas-dts).

It seems that watchdog is the only item on that list that neither you nor I
sign off on. So I conclude that if the watchdog patch goes in early enough
in the cycle then we ought to be in good shape.

None the less, is it worth the risk?

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-23  8:14             ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-23  8:14 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Fabrizio Castro, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, linux-arm-kernel,
	linux-clk, Chris Paterson, Biju Das, Ramesh Shanmugasundaram

On Thu, Feb 22, 2018 at 09:38:39AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
> >> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
> >> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
> >> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> >> >> <fabrizio.castro@bp.renesas.com> wrote:
> >> >> > this series has been around for some time as RFC, and it has collected
> >> >> > useful comments from the community along the way.
> >> >> > The solution proposed by this patch set works for most R-Car Gen2 and
> >> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
> >> >> > Gen2 early revisions there is no proper software fix. Anyway, no
> >> >> > product has been built around early revisions, but development boards
> >> >> > mounting early revisions (basically prototypes) are still out there.
> >> >> > As a result, this series isn't enabling the internal watchdog on R-Car
> >> >> > Gen2 boards, developers may enable it in board specific device trees
> >> >> > if needed.
> >> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> >> >> > and Koelsch boards.
> >> >> >
> >> >> > The problem
> >> >> > ===========
> >> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> >> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> >> >> > the non-boot CPUs they are redirected to the reset vector installed by
> >> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
> >> >> > where the SMP bring-up code will take care of the rest.
> >> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
> >> >> > and as such after the watchdog fires the boot core will try and execute
> >> >> > the SMP bring-up code instead of jumping to the bootrom code.
> >> >> >
> >> >> > The fix
> >> >> > =======
> >> >> > The main strategy for the solution is to let the reset vector decide
> >> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
> >> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
> >> >> > their values, the boot CPU will jump into the newly designed reset
> >> >> > vector, the assembly routine will eventually test WOVF (a bit in register
> >> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
> >> >> > of this bit gets retained in this scenario), and jump to the bootrom code
> >> >> > which will in turn load up the bootloader, etc.
> >> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
> >> >> > to shmobile_boot_fn instead.
> >> >> >
> >> >> > Thank you All for your help.
> >> >> >
> >> >> > Best regards,
> >> >> >
> >> >> > Fabrizio Castro (26):
> >> >> >   ARM: shmobile: Add watchdog support
> >> >> >   ARM: dts: r8a7743: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7745: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7790: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7791: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7792: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7793: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7794: Adjust SMP routine size
> >> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
> >> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
> >> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
> >> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
> >> >> >   watchdog: renesas_wdt: Add restart handler
> >> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
> >> >> >   clk: renesas: r8a7743: Add rwdt clock
> >> >> >   clk: renesas: r8a7745: Add rwdt clock
> >> >> >   clk: renesas: r8a7790: Add rwdt clock
> >> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
> >> >> >   clk: renesas: r8a7794: Add rwdt clock
> >> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> >> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >> >> >
> >> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
> >> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
> >> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
> >> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
> >> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
> >> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
> >> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
> >> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
> >> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
> >> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
> >> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
> >> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
> >> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
> >> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
> >> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
> >> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
> >> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
> >> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
> >> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
> >> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
> >> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
> >> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
> >> >>
> >> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
> >> >> a hard dependency for:
> >> >>   (1) The new reset vector in arch/arm/mach-shmobile/
> >> >>   (2) The watchdog driver.
> >> >>
> >> >> Note that the watchdog driver itself (2) has a hard dependency on the
> >> >> new reset vector (1).
> >> >
> >> > Thanks, I have marked the watchdog driver patch as Deferred.
> >> > Please resubmit or otherwise ping me once they dependencies
> >> > are in an rc release.
> >>
> >> I gave the dependencies a bit more thought.
> >>
> >> I think we can gain once release cycle if you would postpone the DTS patches
> >> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
> >> Then all other parts can be upstreamed in parallel in v4.17, as nothing
> >> will be activated before the DTS parts are in.
> >>
> >> Does this look sane?
> >
> > What about new DTS on old kernels of a specific vintage?
> 
> New DTS would work fine on v4.16 and older, which don't have any of the
> other patches from this series.
> New DTS would work fine on v4.17, assumed all other patches from this
> series get into v4.17.
> 
> The only issue would be a new DTS on a kernel that has some but not all
> other patches from this series.

Thanks for the analysis. I think this is the key point. What is the risk of
that happening?

> If we want to fast-track everything into v4.17, we need a stable branch, to be
> pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
> renesas-dts).

It seems that watchdog is the only item on that list that neither you nor I
sign off on. So I conclude that if the watchdog patch goes in early enough
in the cycle then we ought to be in good shape.

None the less, is it worth the risk?

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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-02-23  8:14             ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-02-23  8:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 22, 2018 at 09:38:39AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
> >> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
> >> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
> >> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> >> >> <fabrizio.castro@bp.renesas.com> wrote:
> >> >> > this series has been around for some time as RFC, and it has collected
> >> >> > useful comments from the community along the way.
> >> >> > The solution proposed by this patch set works for most R-Car Gen2 and
> >> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
> >> >> > Gen2 early revisions there is no proper software fix. Anyway, no
> >> >> > product has been built around early revisions, but development boards
> >> >> > mounting early revisions (basically prototypes) are still out there.
> >> >> > As a result, this series isn't enabling the internal watchdog on R-Car
> >> >> > Gen2 boards, developers may enable it in board specific device trees
> >> >> > if needed.
> >> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> >> >> > and Koelsch boards.
> >> >> >
> >> >> > The problem
> >> >> > ===========
> >> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> >> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> >> >> > the non-boot CPUs they are redirected to the reset vector installed by
> >> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
> >> >> > where the SMP bring-up code will take care of the rest.
> >> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
> >> >> > and as such after the watchdog fires the boot core will try and execute
> >> >> > the SMP bring-up code instead of jumping to the bootrom code.
> >> >> >
> >> >> > The fix
> >> >> > =======
> >> >> > The main strategy for the solution is to let the reset vector decide
> >> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
> >> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
> >> >> > their values, the boot CPU will jump into the newly designed reset
> >> >> > vector, the assembly routine will eventually test WOVF (a bit in register
> >> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
> >> >> > of this bit gets retained in this scenario), and jump to the bootrom code
> >> >> > which will in turn load up the bootloader, etc.
> >> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
> >> >> > to shmobile_boot_fn instead.
> >> >> >
> >> >> > Thank you All for your help.
> >> >> >
> >> >> > Best regards,
> >> >> >
> >> >> > Fabrizio Castro (26):
> >> >> >   ARM: shmobile: Add watchdog support
> >> >> >   ARM: dts: r8a7743: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7745: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7790: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7791: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7792: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7793: Adjust SMP routine size
> >> >> >   ARM: dts: r8a7794: Adjust SMP routine size
> >> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
> >> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
> >> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
> >> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
> >> >> >   watchdog: renesas_wdt: Add restart handler
> >> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
> >> >> >   clk: renesas: r8a7743: Add rwdt clock
> >> >> >   clk: renesas: r8a7745: Add rwdt clock
> >> >> >   clk: renesas: r8a7790: Add rwdt clock
> >> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
> >> >> >   clk: renesas: r8a7794: Add rwdt clock
> >> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> >> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> >> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >> >> >
> >> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
> >> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
> >> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
> >> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
> >> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
> >> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
> >> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
> >> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
> >> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
> >> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
> >> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
> >> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
> >> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
> >> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
> >> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
> >> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
> >> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
> >> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
> >> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
> >> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
> >> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
> >> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
> >> >>
> >> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
> >> >> a hard dependency for:
> >> >>   (1) The new reset vector in arch/arm/mach-shmobile/
> >> >>   (2) The watchdog driver.
> >> >>
> >> >> Note that the watchdog driver itself (2) has a hard dependency on the
> >> >> new reset vector (1).
> >> >
> >> > Thanks, I have marked the watchdog driver patch as Deferred.
> >> > Please resubmit or otherwise ping me once they dependencies
> >> > are in an rc release.
> >>
> >> I gave the dependencies a bit more thought.
> >>
> >> I think we can gain once release cycle if you would postpone the DTS patches
> >> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
> >> Then all other parts can be upstreamed in parallel in v4.17, as nothing
> >> will be activated before the DTS parts are in.
> >>
> >> Does this look sane?
> >
> > What about new DTS on old kernels of a specific vintage?
> 
> New DTS would work fine on v4.16 and older, which don't have any of the
> other patches from this series.
> New DTS would work fine on v4.17, assumed all other patches from this
> series get into v4.17.
> 
> The only issue would be a new DTS on a kernel that has some but not all
> other patches from this series.

Thanks for the analysis. I think this is the key point. What is the risk of
that happening?

> If we want to fast-track everything into v4.17, we need a stable branch, to be
> pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
> renesas-dts).

It seems that watchdog is the only item on that list that neither you nor I
sign off on. So I conclude that if the watchdog patch goes in early enough
in the cycle then we ought to be in good shape.

None the less, is it worth the risk?

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

* Re: [PATCH v5 01/26] ARM: shmobile: Add watchdog support
  2018-02-12 17:44   ` Fabrizio Castro
  (?)
@ 2018-02-28 12:57     ` Geert Uytterhoeven
  -1 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-28 12:57 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Simon Horman, Linux ARM, Stephen Boyd, Linux-Renesas,
	Rob Herring

Hi Fabrizio,

On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> The value contained in the SBAR registers is not initialized by a WDT
> triggered reset, which means that after a WDT triggered reset we jump
> to the SMP bring up routine, preventing the system from executing the
> bootrom code.
>
> The purpose of this patch is to jump to the bootrom code in case of a
> WDT triggered reset, and keep the SMP functionality untouched.
> In order to tell if the code had been called due to the WDT overflowing
> we are testing WOVF from register RWTCSRA.
>
> The new function shmobile_boot_vector_gen2 isn't replacing
> shmobile_boot_vector for backward compatibility reasons. The kernel
> will install the best option (either shmobile_boot_vector or
> shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> according to the amount of memory available.
>
> Since shmobile_boot_vector has become bigger, "reg" property of nodes
> compatible with "renesas,smp-sram" now need to be set to a value
> greater or equal to "<0 0x60>".
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

> --- a/arch/arm/mach-shmobile/common.h
> +++ b/arch/arm/mach-shmobile/common.h
> @@ -7,6 +7,12 @@ extern void shmobile_init_delay(void);
>  extern void shmobile_boot_vector(void);
>  extern unsigned long shmobile_boot_fn;
>  extern unsigned long shmobile_boot_size;
> +#ifdef CONFIG_ARCH_RCAR_GEN2

I think this #ifdef can be removed.

> +extern void shmobile_boot_vector_gen2(void);
> +extern unsigned long shmobile_boot_fn_gen2;
> +extern unsigned long shmobile_boot_cpu_gen2;
> +extern unsigned long shmobile_boot_size_gen2;
> +#endif /* CONFIG_ARCH_RCAR_GEN2 */
>  extern void shmobile_smp_boot(void);
>  extern void shmobile_smp_sleep(void);
>  extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,

Apart from that:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v5 01/26] ARM: shmobile: Add watchdog support
@ 2018-02-28 12:57     ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-28 12:57 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

Hi Fabrizio,

On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> The value contained in the SBAR registers is not initialized by a WDT
> triggered reset, which means that after a WDT triggered reset we jump
> to the SMP bring up routine, preventing the system from executing the
> bootrom code.
>
> The purpose of this patch is to jump to the bootrom code in case of a
> WDT triggered reset, and keep the SMP functionality untouched.
> In order to tell if the code had been called due to the WDT overflowing
> we are testing WOVF from register RWTCSRA.
>
> The new function shmobile_boot_vector_gen2 isn't replacing
> shmobile_boot_vector for backward compatibility reasons. The kernel
> will install the best option (either shmobile_boot_vector or
> shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> according to the amount of memory available.
>
> Since shmobile_boot_vector has become bigger, "reg" property of nodes
> compatible with "renesas,smp-sram" now need to be set to a value
> greater or equal to "<0 0x60>".
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

> --- a/arch/arm/mach-shmobile/common.h
> +++ b/arch/arm/mach-shmobile/common.h
> @@ -7,6 +7,12 @@ extern void shmobile_init_delay(void);
>  extern void shmobile_boot_vector(void);
>  extern unsigned long shmobile_boot_fn;
>  extern unsigned long shmobile_boot_size;
> +#ifdef CONFIG_ARCH_RCAR_GEN2

I think this #ifdef can be removed.

> +extern void shmobile_boot_vector_gen2(void);
> +extern unsigned long shmobile_boot_fn_gen2;
> +extern unsigned long shmobile_boot_cpu_gen2;
> +extern unsigned long shmobile_boot_size_gen2;
> +#endif /* CONFIG_ARCH_RCAR_GEN2 */
>  extern void shmobile_smp_boot(void);
>  extern void shmobile_smp_sleep(void);
>  extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,

Apart from that:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH v5 01/26] ARM: shmobile: Add watchdog support
@ 2018-02-28 12:57     ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-28 12:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Fabrizio,

On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> The value contained in the SBAR registers is not initialized by a WDT
> triggered reset, which means that after a WDT triggered reset we jump
> to the SMP bring up routine, preventing the system from executing the
> bootrom code.
>
> The purpose of this patch is to jump to the bootrom code in case of a
> WDT triggered reset, and keep the SMP functionality untouched.
> In order to tell if the code had been called due to the WDT overflowing
> we are testing WOVF from register RWTCSRA.
>
> The new function shmobile_boot_vector_gen2 isn't replacing
> shmobile_boot_vector for backward compatibility reasons. The kernel
> will install the best option (either shmobile_boot_vector or
> shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> according to the amount of memory available.
>
> Since shmobile_boot_vector has become bigger, "reg" property of nodes
> compatible with "renesas,smp-sram" now need to be set to a value
> greater or equal to "<0 0x60>".
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

> --- a/arch/arm/mach-shmobile/common.h
> +++ b/arch/arm/mach-shmobile/common.h
> @@ -7,6 +7,12 @@ extern void shmobile_init_delay(void);
>  extern void shmobile_boot_vector(void);
>  extern unsigned long shmobile_boot_fn;
>  extern unsigned long shmobile_boot_size;
> +#ifdef CONFIG_ARCH_RCAR_GEN2

I think this #ifdef can be removed.

> +extern void shmobile_boot_vector_gen2(void);
> +extern unsigned long shmobile_boot_fn_gen2;
> +extern unsigned long shmobile_boot_cpu_gen2;
> +extern unsigned long shmobile_boot_size_gen2;
> +#endif /* CONFIG_ARCH_RCAR_GEN2 */
>  extern void shmobile_smp_boot(void);
>  extern void shmobile_smp_sleep(void);
>  extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,

Apart from that:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* RE: [PATCH v5 01/26] ARM: shmobile: Add watchdog support
  2018-02-28 12:57     ` Geert Uytterhoeven
  (?)
  (?)
@ 2018-02-28 17:37       ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-28 17:37 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Simon Horman, Linux ARM, Stephen Boyd, Linux-Renesas,
	Rob Herring

Hi Geert,

thank you for your feedback!

> Subject: Re: [PATCH v5 01/26] ARM: shmobile: Add watchdog support
>
> Hi Fabrizio,
>
> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> > boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> > The value contained in the SBAR registers is not initialized by a WDT
> > triggered reset, which means that after a WDT triggered reset we jump
> > to the SMP bring up routine, preventing the system from executing the
> > bootrom code.
> >
> > The purpose of this patch is to jump to the bootrom code in case of a
> > WDT triggered reset, and keep the SMP functionality untouched.
> > In order to tell if the code had been called due to the WDT overflowing
> > we are testing WOVF from register RWTCSRA.
> >
> > The new function shmobile_boot_vector_gen2 isn't replacing
> > shmobile_boot_vector for backward compatibility reasons. The kernel
> > will install the best option (either shmobile_boot_vector or
> > shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> > according to the amount of memory available.
> >
> > Since shmobile_boot_vector has become bigger, "reg" property of nodes
> > compatible with "renesas,smp-sram" now need to be set to a value
> > greater or equal to "<0 0x60>".
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
>
> > --- a/arch/arm/mach-shmobile/common.h
> > +++ b/arch/arm/mach-shmobile/common.h
> > @@ -7,6 +7,12 @@ extern void shmobile_init_delay(void);
> >  extern void shmobile_boot_vector(void);
> >  extern unsigned long shmobile_boot_fn;
> >  extern unsigned long shmobile_boot_size;
> > +#ifdef CONFIG_ARCH_RCAR_GEN2
>
> I think this #ifdef can be removed.

I'll send a new version of this patch without ifdefs.

Thanks,
Fab

>
> > +extern void shmobile_boot_vector_gen2(void);
> > +extern unsigned long shmobile_boot_fn_gen2;
> > +extern unsigned long shmobile_boot_cpu_gen2;
> > +extern unsigned long shmobile_boot_size_gen2;
> > +#endif /* CONFIG_ARCH_RCAR_GEN2 */
> >  extern void shmobile_smp_boot(void);
> >  extern void shmobile_smp_sleep(void);
> >  extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
>
> Apart from that:
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* RE: [PATCH v5 01/26] ARM: shmobile: Add watchdog support
@ 2018-02-28 17:37       ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-28 17:37 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

Hi Geert,

thank you for your feedback!

> Subject: Re: [PATCH v5 01/26] ARM: shmobile: Add watchdog support
>
> Hi Fabrizio,
>
> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> > boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> > The value contained in the SBAR registers is not initialized by a WDT
> > triggered reset, which means that after a WDT triggered reset we jump
> > to the SMP bring up routine, preventing the system from executing the
> > bootrom code.
> >
> > The purpose of this patch is to jump to the bootrom code in case of a
> > WDT triggered reset, and keep the SMP functionality untouched.
> > In order to tell if the code had been called due to the WDT overflowing
> > we are testing WOVF from register RWTCSRA.
> >
> > The new function shmobile_boot_vector_gen2 isn't replacing
> > shmobile_boot_vector for backward compatibility reasons. The kernel
> > will install the best option (either shmobile_boot_vector or
> > shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> > according to the amount of memory available.
> >
> > Since shmobile_boot_vector has become bigger, "reg" property of nodes
> > compatible with "renesas,smp-sram" now need to be set to a value
> > greater or equal to "<0 0x60>".
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
>
> > --- a/arch/arm/mach-shmobile/common.h
> > +++ b/arch/arm/mach-shmobile/common.h
> > @@ -7,6 +7,12 @@ extern void shmobile_init_delay(void);
> >  extern void shmobile_boot_vector(void);
> >  extern unsigned long shmobile_boot_fn;
> >  extern unsigned long shmobile_boot_size;
> > +#ifdef CONFIG_ARCH_RCAR_GEN2
>
> I think this #ifdef can be removed.

I'll send a new version of this patch without ifdefs.

Thanks,
Fab

>
> > +extern void shmobile_boot_vector_gen2(void);
> > +extern unsigned long shmobile_boot_fn_gen2;
> > +extern unsigned long shmobile_boot_cpu_gen2;
> > +extern unsigned long shmobile_boot_size_gen2;
> > +#endif /* CONFIG_ARCH_RCAR_GEN2 */
> >  extern void shmobile_smp_boot(void);
> >  extern void shmobile_smp_sleep(void);
> >  extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
>
> Apart from that:
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* RE: [PATCH v5 01/26] ARM: shmobile: Add watchdog support
@ 2018-02-28 17:37       ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-28 17:37 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

SGkgR2VlcnQsDQoNCnRoYW5rIHlvdSBmb3IgeW91ciBmZWVkYmFjayENCg0KPiBTdWJqZWN0OiBS
ZTogW1BBVENIIHY1IDAxLzI2XSBBUk06IHNobW9iaWxlOiBBZGQgd2F0Y2hkb2cgc3VwcG9ydA0K
Pg0KPiBIaSBGYWJyaXppbywNCj4NCj4gT24gTW9uLCBGZWIgMTIsIDIwMTggYXQgNjo0NCBQTSwg
RmFicml6aW8gQ2FzdHJvDQo+IDxmYWJyaXppby5jYXN0cm9AYnAucmVuZXNhcy5jb20+IHdyb3Rl
Og0KPiA+IE9uIFItQ2FyIEdlbjIgYW5kIFJaL0cxIHBsYXRmb3Jtcywgd2UgdXNlIHRoZSBTQkFS
IHJlZ2lzdGVycyB0byBtYWtlIG5vbg0KPiA+IGJvb3QgQ1BVcyBydW4gYSByb3V0aW5lIGRlc2ln
bmVkIHRvIGJyaW5nIHVwIFNNUCBhbmQgZGVhbCB3aXRoIGhvdCBwbHVnLg0KPiA+IFRoZSB2YWx1
ZSBjb250YWluZWQgaW4gdGhlIFNCQVIgcmVnaXN0ZXJzIGlzIG5vdCBpbml0aWFsaXplZCBieSBh
IFdEVA0KPiA+IHRyaWdnZXJlZCByZXNldCwgd2hpY2ggbWVhbnMgdGhhdCBhZnRlciBhIFdEVCB0
cmlnZ2VyZWQgcmVzZXQgd2UganVtcA0KPiA+IHRvIHRoZSBTTVAgYnJpbmcgdXAgcm91dGluZSwg
cHJldmVudGluZyB0aGUgc3lzdGVtIGZyb20gZXhlY3V0aW5nIHRoZQ0KPiA+IGJvb3Ryb20gY29k
ZS4NCj4gPg0KPiA+IFRoZSBwdXJwb3NlIG9mIHRoaXMgcGF0Y2ggaXMgdG8ganVtcCB0byB0aGUg
Ym9vdHJvbSBjb2RlIGluIGNhc2Ugb2YgYQ0KPiA+IFdEVCB0cmlnZ2VyZWQgcmVzZXQsIGFuZCBr
ZWVwIHRoZSBTTVAgZnVuY3Rpb25hbGl0eSB1bnRvdWNoZWQuDQo+ID4gSW4gb3JkZXIgdG8gdGVs
bCBpZiB0aGUgY29kZSBoYWQgYmVlbiBjYWxsZWQgZHVlIHRvIHRoZSBXRFQgb3ZlcmZsb3dpbmcN
Cj4gPiB3ZSBhcmUgdGVzdGluZyBXT1ZGIGZyb20gcmVnaXN0ZXIgUldUQ1NSQS4NCj4gPg0KPiA+
IFRoZSBuZXcgZnVuY3Rpb24gc2htb2JpbGVfYm9vdF92ZWN0b3JfZ2VuMiBpc24ndCByZXBsYWNp
bmcNCj4gPiBzaG1vYmlsZV9ib290X3ZlY3RvciBmb3IgYmFja3dhcmQgY29tcGF0aWJpbGl0eSBy
ZWFzb25zLiBUaGUga2VybmVsDQo+ID4gd2lsbCBpbnN0YWxsIHRoZSBiZXN0IG9wdGlvbiAoZWl0
aGVyIHNobW9iaWxlX2Jvb3RfdmVjdG9yIG9yDQo+ID4gc2htb2JpbGVfYm9vdF92ZWN0b3JfZ2Vu
MikgdG8gSUNSQU0xIGFmdGVyIHBhcnNpbmcgdGhlIGRldmljZSB0cmVlLA0KPiA+IGFjY29yZGlu
ZyB0byB0aGUgYW1vdW50IG9mIG1lbW9yeSBhdmFpbGFibGUuDQo+ID4NCj4gPiBTaW5jZSBzaG1v
YmlsZV9ib290X3ZlY3RvciBoYXMgYmVjb21lIGJpZ2dlciwgInJlZyIgcHJvcGVydHkgb2Ygbm9k
ZXMNCj4gPiBjb21wYXRpYmxlIHdpdGggInJlbmVzYXMsc21wLXNyYW0iIG5vdyBuZWVkIHRvIGJl
IHNldCB0byBhIHZhbHVlDQo+ID4gZ3JlYXRlciBvciBlcXVhbCB0byAiPDAgMHg2MD4iLg0KPiA+
DQo+ID4gU2lnbmVkLW9mZi1ieTogRmFicml6aW8gQ2FzdHJvIDxmYWJyaXppby5jYXN0cm9AYnAu
cmVuZXNhcy5jb20+DQo+ID4gU2lnbmVkLW9mZi1ieTogUmFtZXNoIFNoYW5tdWdhc3VuZGFyYW0g
PHJhbWVzaC5zaGFubXVnYXN1bmRhcmFtQGJwLnJlbmVzYXMuY29tPg0KPg0KPiA+IC0tLSBhL2Fy
Y2gvYXJtL21hY2gtc2htb2JpbGUvY29tbW9uLmgNCj4gPiArKysgYi9hcmNoL2FybS9tYWNoLXNo
bW9iaWxlL2NvbW1vbi5oDQo+ID4gQEAgLTcsNiArNywxMiBAQCBleHRlcm4gdm9pZCBzaG1vYmls
ZV9pbml0X2RlbGF5KHZvaWQpOw0KPiA+ICBleHRlcm4gdm9pZCBzaG1vYmlsZV9ib290X3ZlY3Rv
cih2b2lkKTsNCj4gPiAgZXh0ZXJuIHVuc2lnbmVkIGxvbmcgc2htb2JpbGVfYm9vdF9mbjsNCj4g
PiAgZXh0ZXJuIHVuc2lnbmVkIGxvbmcgc2htb2JpbGVfYm9vdF9zaXplOw0KPiA+ICsjaWZkZWYg
Q09ORklHX0FSQ0hfUkNBUl9HRU4yDQo+DQo+IEkgdGhpbmsgdGhpcyAjaWZkZWYgY2FuIGJlIHJl
bW92ZWQuDQoNCkknbGwgc2VuZCBhIG5ldyB2ZXJzaW9uIG9mIHRoaXMgcGF0Y2ggd2l0aG91dCBp
ZmRlZnMuDQoNClRoYW5rcywNCkZhYg0KDQo+DQo+ID4gK2V4dGVybiB2b2lkIHNobW9iaWxlX2Jv
b3RfdmVjdG9yX2dlbjIodm9pZCk7DQo+ID4gK2V4dGVybiB1bnNpZ25lZCBsb25nIHNobW9iaWxl
X2Jvb3RfZm5fZ2VuMjsNCj4gPiArZXh0ZXJuIHVuc2lnbmVkIGxvbmcgc2htb2JpbGVfYm9vdF9j
cHVfZ2VuMjsNCj4gPiArZXh0ZXJuIHVuc2lnbmVkIGxvbmcgc2htb2JpbGVfYm9vdF9zaXplX2dl
bjI7DQo+ID4gKyNlbmRpZiAvKiBDT05GSUdfQVJDSF9SQ0FSX0dFTjIgKi8NCj4gPiAgZXh0ZXJu
IHZvaWQgc2htb2JpbGVfc21wX2Jvb3Qodm9pZCk7DQo+ID4gIGV4dGVybiB2b2lkIHNobW9iaWxl
X3NtcF9zbGVlcCh2b2lkKTsNCj4gPiAgZXh0ZXJuIHZvaWQgc2htb2JpbGVfc21wX2hvb2sodW5z
aWduZWQgaW50IGNwdSwgdW5zaWduZWQgbG9uZyBmbiwNCj4NCj4gQXBhcnQgZnJvbSB0aGF0Og0K
PiBSZXZpZXdlZC1ieTogR2VlcnQgVXl0dGVyaG9ldmVuIDxnZWVydCtyZW5lc2FzQGdsaWRlci5i
ZT4NCj4NCj4gR3J7b2V0amUsZWV0aW5nfXMsDQo+DQo+ICAgICAgICAgICAgICAgICAgICAgICAg
IEdlZXJ0DQo+DQo+IC0tDQo+IEdlZXJ0IFV5dHRlcmhvZXZlbiAtLSBUaGVyZSdzIGxvdHMgb2Yg
TGludXggYmV5b25kIGlhMzIgLS0gZ2VlcnRAbGludXgtbTY4ay5vcmcNCj4NCj4gSW4gcGVyc29u
YWwgY29udmVyc2F0aW9ucyB3aXRoIHRlY2huaWNhbCBwZW9wbGUsIEkgY2FsbCBteXNlbGYgYSBo
YWNrZXIuIEJ1dA0KPiB3aGVuIEknbSB0YWxraW5nIHRvIGpvdXJuYWxpc3RzIEkganVzdCBzYXkg
InByb2dyYW1tZXIiIG9yIHNvbWV0aGluZyBsaWtlIHRoYXQuDQo+ICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgLS0gTGludXMgVG9ydmFsZHMNCg0KDQoNClJlbmVzYXMgRWxlY3Ryb25p
Y3MgRXVyb3BlIEx0ZCwgRHVrZXMgTWVhZG93LCBNaWxsYm9hcmQgUm9hZCwgQm91cm5lIEVuZCwg
QnVja2luZ2hhbXNoaXJlLCBTTDggNUZILCBVSy4gUmVnaXN0ZXJlZCBpbiBFbmdsYW5kICYgV2Fs
ZXMgdW5kZXIgUmVnaXN0ZXJlZCBOby4gMDQ1ODY3MDkuDQo=

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

* [PATCH v5 01/26] ARM: shmobile: Add watchdog support
@ 2018-02-28 17:37       ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-28 17:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Geert,

thank you for your feedback!

> Subject: Re: [PATCH v5 01/26] ARM: shmobile: Add watchdog support
>
> Hi Fabrizio,
>
> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> > boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> > The value contained in the SBAR registers is not initialized by a WDT
> > triggered reset, which means that after a WDT triggered reset we jump
> > to the SMP bring up routine, preventing the system from executing the
> > bootrom code.
> >
> > The purpose of this patch is to jump to the bootrom code in case of a
> > WDT triggered reset, and keep the SMP functionality untouched.
> > In order to tell if the code had been called due to the WDT overflowing
> > we are testing WOVF from register RWTCSRA.
> >
> > The new function shmobile_boot_vector_gen2 isn't replacing
> > shmobile_boot_vector for backward compatibility reasons. The kernel
> > will install the best option (either shmobile_boot_vector or
> > shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> > according to the amount of memory available.
> >
> > Since shmobile_boot_vector has become bigger, "reg" property of nodes
> > compatible with "renesas,smp-sram" now need to be set to a value
> > greater or equal to "<0 0x60>".
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
>
> > --- a/arch/arm/mach-shmobile/common.h
> > +++ b/arch/arm/mach-shmobile/common.h
> > @@ -7,6 +7,12 @@ extern void shmobile_init_delay(void);
> >  extern void shmobile_boot_vector(void);
> >  extern unsigned long shmobile_boot_fn;
> >  extern unsigned long shmobile_boot_size;
> > +#ifdef CONFIG_ARCH_RCAR_GEN2
>
> I think this #ifdef can be removed.

I'll send a new version of this patch without ifdefs.

Thanks,
Fab

>
> > +extern void shmobile_boot_vector_gen2(void);
> > +extern unsigned long shmobile_boot_fn_gen2;
> > +extern unsigned long shmobile_boot_cpu_gen2;
> > +extern unsigned long shmobile_boot_size_gen2;
> > +#endif /* CONFIG_ARCH_RCAR_GEN2 */
> >  extern void shmobile_smp_boot(void);
> >  extern void shmobile_smp_sleep(void);
> >  extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
>
> Apart from that:
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* [PATCH v6 01/26] ARM: shmobile: Add watchdog support
  2018-02-28 12:57     ` Geert Uytterhoeven
  (?)
@ 2018-02-28 17:40       ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-28 17:40 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Rutland, Catalin Marinas, Michael Turquette, Will Deacon,
	Wolfram Sang, Wim Van Sebroeck, linux-clk, Magnus Damm,
	Russell King, Guenter Roeck, Fabrizio Castro, devicetree,
	Chris Paterson, linux-watchdog, Biju Das, Simon Horman,
	linux-arm-kernel, Stephen Boyd, linux-renesas-soc, Rob Herring,
	Philipp Zabel, Ramesh Shanmugasundaram

On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
boot CPUs run a routine designed to bring up SMP and deal with hot plug.
The value contained in the SBAR registers is not initialized by a WDT
triggered reset, which means that after a WDT triggered reset we jump
to the SMP bring up routine, preventing the system from executing the
bootrom code.

The purpose of this patch is to jump to the bootrom code in case of a
WDT triggered reset, and keep the SMP functionality untouched.
In order to tell if the code had been called due to the WDT overflowing
we are testing WOVF from register RWTCSRA.

The new function shmobile_boot_vector_gen2 isn't replacing
shmobile_boot_vector for backward compatibility reasons. The kernel
will install the best option (either shmobile_boot_vector or
shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
according to the amount of memory available.

Since shmobile_boot_vector has become bigger, "reg" property of nodes
compatible with "renesas,smp-sram" now need to be set to a value
greater or equal to "<0 0x60>".

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v5->v6:
* taken ifdefs out as per Geert's suggestion.

 arch/arm/mach-shmobile/common.h  |  4 +++
 arch/arm/mach-shmobile/headsmp.S | 53 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index a8fa4f7..43c1ac69 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -7,6 +7,10 @@ extern void shmobile_init_delay(void);
 extern void shmobile_boot_vector(void);
 extern unsigned long shmobile_boot_fn;
 extern unsigned long shmobile_boot_size;
+extern void shmobile_boot_vector_gen2(void);
+extern unsigned long shmobile_boot_fn_gen2;
+extern unsigned long shmobile_boot_cpu_gen2;
+extern unsigned long shmobile_boot_size_gen2;
 extern void shmobile_smp_boot(void);
 extern void shmobile_smp_sleep(void);
 extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 32e0bf6..2ece67c 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -16,6 +16,11 @@
 #include <asm/assembler.h>
 #include <asm/memory.h>
 
+#define SCTLR_MMU	0x01
+#define BOOTROM_ADDRESS	0xE6340000
+#define RWTCSRA_ADDRESS 0xE6020004
+#define RWTCSRA_WOVF	0x10
+
 /*
  * Reset vector for secondary CPUs.
  * This will be mapped at address 0 by SBAR register.
@@ -38,6 +43,54 @@ shmobile_boot_size:
 	.long	. - shmobile_boot_vector
 
 /*
+ * Reset vector for R-Car Gen2 and RZ/G1 secondary CPUs.
+ * This will be mapped at address 0 by SBAR register.
+ */
+ENTRY(shmobile_boot_vector_gen2)
+	mrc	p15, 0, r0, c0, c0, 5		@ r0 = MPIDR
+	ldr	r1, shmobile_boot_cpu_gen2
+	cmp	r0, r1
+	bne	shmobile_smp_continue_gen2
+
+	mrc	p15, 0, r1, c1, c0, 0		@ r1 = SCTLR
+	and	r0, r1, #SCTLR_MMU
+	cmp	r0, #SCTLR_MMU
+	beq	shmobile_smp_continue_gen2
+
+	ldr	r0, rwtcsra
+	mov	r1, #0
+	ldrb	r1, [r0]
+	and	r0, r1, #RWTCSRA_WOVF
+	cmp	r0, #RWTCSRA_WOVF
+	bne	shmobile_smp_continue_gen2
+
+	ldr	r0, bootrom
+	bx	r0
+
+shmobile_smp_continue_gen2:
+	ldr     r1, shmobile_boot_fn_gen2
+	bx	r1
+
+ENDPROC(shmobile_boot_vector_gen2)
+
+	.align	4
+rwtcsra:
+	.word	RWTCSRA_ADDRESS
+bootrom:
+	.word	BOOTROM_ADDRESS
+	.globl	shmobile_boot_cpu_gen2
+shmobile_boot_cpu_gen2:
+	.word	0x00000000
+
+	.align	2
+	.globl	shmobile_boot_fn_gen2
+shmobile_boot_fn_gen2:
+	.space	4
+	.globl	shmobile_boot_size_gen2
+shmobile_boot_size_gen2:
+	.long	. - shmobile_boot_vector_gen2
+
+/*
  * Per-CPU SMP boot function/argument selection code based on MPIDR
  */
 
-- 
2.7.4

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

* [PATCH v6 01/26] ARM: shmobile: Add watchdog support
@ 2018-02-28 17:40       ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-28 17:40 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Simon Horman, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Fabrizio Castro, Ramesh Shanmugasundaram

On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
boot CPUs run a routine designed to bring up SMP and deal with hot plug.
The value contained in the SBAR registers is not initialized by a WDT
triggered reset, which means that after a WDT triggered reset we jump
to the SMP bring up routine, preventing the system from executing the
bootrom code.

The purpose of this patch is to jump to the bootrom code in case of a
WDT triggered reset, and keep the SMP functionality untouched.
In order to tell if the code had been called due to the WDT overflowing
we are testing WOVF from register RWTCSRA.

The new function shmobile_boot_vector_gen2 isn't replacing
shmobile_boot_vector for backward compatibility reasons. The kernel
will install the best option (either shmobile_boot_vector or
shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
according to the amount of memory available.

Since shmobile_boot_vector has become bigger, "reg" property of nodes
compatible with "renesas,smp-sram" now need to be set to a value
greater or equal to "<0 0x60>".

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v5->v6:
* taken ifdefs out as per Geert's suggestion.

 arch/arm/mach-shmobile/common.h  |  4 +++
 arch/arm/mach-shmobile/headsmp.S | 53 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index a8fa4f7..43c1ac69 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -7,6 +7,10 @@ extern void shmobile_init_delay(void);
 extern void shmobile_boot_vector(void);
 extern unsigned long shmobile_boot_fn;
 extern unsigned long shmobile_boot_size;
+extern void shmobile_boot_vector_gen2(void);
+extern unsigned long shmobile_boot_fn_gen2;
+extern unsigned long shmobile_boot_cpu_gen2;
+extern unsigned long shmobile_boot_size_gen2;
 extern void shmobile_smp_boot(void);
 extern void shmobile_smp_sleep(void);
 extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 32e0bf6..2ece67c 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -16,6 +16,11 @@
 #include <asm/assembler.h>
 #include <asm/memory.h>
 
+#define SCTLR_MMU	0x01
+#define BOOTROM_ADDRESS	0xE6340000
+#define RWTCSRA_ADDRESS 0xE6020004
+#define RWTCSRA_WOVF	0x10
+
 /*
  * Reset vector for secondary CPUs.
  * This will be mapped at address 0 by SBAR register.
@@ -38,6 +43,54 @@ shmobile_boot_size:
 	.long	. - shmobile_boot_vector
 
 /*
+ * Reset vector for R-Car Gen2 and RZ/G1 secondary CPUs.
+ * This will be mapped at address 0 by SBAR register.
+ */
+ENTRY(shmobile_boot_vector_gen2)
+	mrc	p15, 0, r0, c0, c0, 5		@ r0 = MPIDR
+	ldr	r1, shmobile_boot_cpu_gen2
+	cmp	r0, r1
+	bne	shmobile_smp_continue_gen2
+
+	mrc	p15, 0, r1, c1, c0, 0		@ r1 = SCTLR
+	and	r0, r1, #SCTLR_MMU
+	cmp	r0, #SCTLR_MMU
+	beq	shmobile_smp_continue_gen2
+
+	ldr	r0, rwtcsra
+	mov	r1, #0
+	ldrb	r1, [r0]
+	and	r0, r1, #RWTCSRA_WOVF
+	cmp	r0, #RWTCSRA_WOVF
+	bne	shmobile_smp_continue_gen2
+
+	ldr	r0, bootrom
+	bx	r0
+
+shmobile_smp_continue_gen2:
+	ldr     r1, shmobile_boot_fn_gen2
+	bx	r1
+
+ENDPROC(shmobile_boot_vector_gen2)
+
+	.align	4
+rwtcsra:
+	.word	RWTCSRA_ADDRESS
+bootrom:
+	.word	BOOTROM_ADDRESS
+	.globl	shmobile_boot_cpu_gen2
+shmobile_boot_cpu_gen2:
+	.word	0x00000000
+
+	.align	2
+	.globl	shmobile_boot_fn_gen2
+shmobile_boot_fn_gen2:
+	.space	4
+	.globl	shmobile_boot_size_gen2
+shmobile_boot_size_gen2:
+	.long	. - shmobile_boot_vector_gen2
+
+/*
  * Per-CPU SMP boot function/argument selection code based on MPIDR
  */
 
-- 
2.7.4


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

* [PATCH v6 01/26] ARM: shmobile: Add watchdog support
@ 2018-02-28 17:40       ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-28 17:40 UTC (permalink / raw)
  To: linux-arm-kernel

On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
boot CPUs run a routine designed to bring up SMP and deal with hot plug.
The value contained in the SBAR registers is not initialized by a WDT
triggered reset, which means that after a WDT triggered reset we jump
to the SMP bring up routine, preventing the system from executing the
bootrom code.

The purpose of this patch is to jump to the bootrom code in case of a
WDT triggered reset, and keep the SMP functionality untouched.
In order to tell if the code had been called due to the WDT overflowing
we are testing WOVF from register RWTCSRA.

The new function shmobile_boot_vector_gen2 isn't replacing
shmobile_boot_vector for backward compatibility reasons. The kernel
will install the best option (either shmobile_boot_vector or
shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
according to the amount of memory available.

Since shmobile_boot_vector has become bigger, "reg" property of nodes
compatible with "renesas,smp-sram" now need to be set to a value
greater or equal to "<0 0x60>".

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v5->v6:
* taken ifdefs out as per Geert's suggestion.

 arch/arm/mach-shmobile/common.h  |  4 +++
 arch/arm/mach-shmobile/headsmp.S | 53 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index a8fa4f7..43c1ac69 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -7,6 +7,10 @@ extern void shmobile_init_delay(void);
 extern void shmobile_boot_vector(void);
 extern unsigned long shmobile_boot_fn;
 extern unsigned long shmobile_boot_size;
+extern void shmobile_boot_vector_gen2(void);
+extern unsigned long shmobile_boot_fn_gen2;
+extern unsigned long shmobile_boot_cpu_gen2;
+extern unsigned long shmobile_boot_size_gen2;
 extern void shmobile_smp_boot(void);
 extern void shmobile_smp_sleep(void);
 extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 32e0bf6..2ece67c 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -16,6 +16,11 @@
 #include <asm/assembler.h>
 #include <asm/memory.h>
 
+#define SCTLR_MMU	0x01
+#define BOOTROM_ADDRESS	0xE6340000
+#define RWTCSRA_ADDRESS 0xE6020004
+#define RWTCSRA_WOVF	0x10
+
 /*
  * Reset vector for secondary CPUs.
  * This will be mapped at address 0 by SBAR register.
@@ -38,6 +43,54 @@ shmobile_boot_size:
 	.long	. - shmobile_boot_vector
 
 /*
+ * Reset vector for R-Car Gen2 and RZ/G1 secondary CPUs.
+ * This will be mapped at address 0 by SBAR register.
+ */
+ENTRY(shmobile_boot_vector_gen2)
+	mrc	p15, 0, r0, c0, c0, 5		@ r0 = MPIDR
+	ldr	r1, shmobile_boot_cpu_gen2
+	cmp	r0, r1
+	bne	shmobile_smp_continue_gen2
+
+	mrc	p15, 0, r1, c1, c0, 0		@ r1 = SCTLR
+	and	r0, r1, #SCTLR_MMU
+	cmp	r0, #SCTLR_MMU
+	beq	shmobile_smp_continue_gen2
+
+	ldr	r0, rwtcsra
+	mov	r1, #0
+	ldrb	r1, [r0]
+	and	r0, r1, #RWTCSRA_WOVF
+	cmp	r0, #RWTCSRA_WOVF
+	bne	shmobile_smp_continue_gen2
+
+	ldr	r0, bootrom
+	bx	r0
+
+shmobile_smp_continue_gen2:
+	ldr     r1, shmobile_boot_fn_gen2
+	bx	r1
+
+ENDPROC(shmobile_boot_vector_gen2)
+
+	.align	4
+rwtcsra:
+	.word	RWTCSRA_ADDRESS
+bootrom:
+	.word	BOOTROM_ADDRESS
+	.globl	shmobile_boot_cpu_gen2
+shmobile_boot_cpu_gen2:
+	.word	0x00000000
+
+	.align	2
+	.globl	shmobile_boot_fn_gen2
+shmobile_boot_fn_gen2:
+	.space	4
+	.globl	shmobile_boot_size_gen2
+shmobile_boot_size_gen2:
+	.long	. - shmobile_boot_vector_gen2
+
+/*
  * Per-CPU SMP boot function/argument selection code based on MPIDR
  */
 
-- 
2.7.4

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

* RE: [PATCH] watchdog: renesas_wdt: Blacklist early R-Car Gen2 SoCs
  2018-02-21 15:43     ` [PATCH] watchdog: renesas_wdt: Blacklist early R-Car Gen2 SoCs Geert Uytterhoeven
  2018-02-21 16:22       ` Simon Horman
@ 2018-02-28 17:48       ` Fabrizio Castro
  1 sibling, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-02-28 17:48 UTC (permalink / raw)
  To: Geert Uytterhoeven, Wim Van Sebroeck, Guenter Roeck
  Cc: Philipp Zabel, Chris Paterson, Biju Das, Ramesh Shanmugasundaram,
	Simon Horman, Magnus Damm, Wolfram Sang, linux-watchdog,
	linux-renesas-soc

> Subject: [PATCH] watchdog: renesas_wdt: Blacklist early R-Car Gen2 SoCs
>
> On early revisions of some R-Car Gen2 SoCs, and depending on SMP
> configuration, the system may fail to restart on watchdog time-out, and
> lock up instead.
>
> Specifically:
>   - On R-Car H2 ES1.0 and M2-W ES1.0, watchdog restart fails unless
>     only the first CPU core is in use (using e.g. the "maxcpus=1" kernel
>     commandline option).
>   - On R-Car V2H ES1.1, watchdog restart fails unless SMP is disabled
>     completely (using CONFIG_SMP=n during build configuration, or using
>     the "nosmp" or "maxcpus=0" kernel commandline options).
>
> Prevent using the watchdog in impacted cases by blacklisting the
> affected SoCs, using the minimum known working revisions (ES2.0 on R-Car
> H2, and ES3.0 on M2-W), and taking the actual SMP software configuration
> into account.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Acked-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>

> ---
> To be folded into Fabrizio Castro's "watchdog: renesas_wdt: Add R-Car
> Gen2 support".
>
> Note that I cannot use IS_ENABLED(CONFIG_SMP), as setup_max_cpus does
> not exist for CONFIG_SMP=n.
>
> Any reports on R-Car M2-W ES2.0 and V2H ES2.0+ are welcomed!
>
> As the failure is due to an integration issue, and the watchdog itself
> is working fine, an alternative solution would be to move the check to
> the code that installs the reset trigger ("soc: renesas: rcar-rst:
> Enable watchdog as reset trigger for Gen2").
> However, doing so would mean that:
>   1. The user could enable and seemingly use the watchdog, but watchdog
>      timeout would not restart the system,
>   2. The same check should be done before installing the new reset
>      vector ("ARM: shmobile: rcar-gen2: Add watchdog support"), too,
>      else onlining CPU0 would fail once the watchdog has timed out.
> ---
>  drivers/watchdog/renesas_wdt.c | 43 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 43 insertions(+)
>
> diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
> index 0f88614797c36022..4c8e8d2600a922a5 100644
> --- a/drivers/watchdog/renesas_wdt.c
> +++ b/drivers/watchdog/renesas_wdt.c
> @@ -16,6 +16,8 @@
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
> +#include <linux/smp.h>
> +#include <linux/sys_soc.h>
>  #include <linux/watchdog.h>
>
>  #define RWTCNT0
> @@ -131,6 +133,44 @@ static const struct watchdog_ops rwdt_ops = {
>  .restart = rwdt_restart,
>  };
>
> +#if defined(CONFIG_ARCH_RCAR_GEN2) && defined(CONFIG_SMP)
> +/*
> + * Watchdog-reset integration is broken on early revisions of R-Car Gen2 SoCs
> + */
> +static const struct soc_device_attribute rwdt_quirks_match[] = {
> +{
> +.soc_id = "r8a7790",
> +.revision = "ES1.*",
> +.data = (void *)1,/* needs single CPU */
> +}, {
> +.soc_id = "r8a7791",
> +.revision = "ES[12].*",
> +.data = (void *)1,/* needs single CPU */
> +}, {
> +.soc_id = "r8a7792",
> +.revision = "*",
> +.data = (void *)0,/* needs SMP disabled */
> +},
> +{ /* sentinel */ }
> +};
> +
> +static bool rwdt_blacklisted(struct device *dev)
> +{
> +const struct soc_device_attribute *attr;
> +
> +attr = soc_device_match(rwdt_quirks_match);
> +if (attr && setup_max_cpus > (uintptr_t)attr->data) {
> +dev_info(dev, "Watchdog blacklisted on %s %s\n", attr->soc_id,
> + attr->revision);
> +return true;
> +}
> +
> +return false;
> +}
> +#else /* !CONFIG_ARCH_RCAR_GEN2 || !CONFIG_SMP */
> +static inline bool rwdt_blacklisted(struct device *dev) { return false; }
> +#endif /* !CONFIG_ARCH_RCAR_GEN2 || !CONFIG_SMP */
> +
>  static int rwdt_probe(struct platform_device *pdev)
>  {
>  struct rwdt_priv *priv;
> @@ -139,6 +179,9 @@ static int rwdt_probe(struct platform_device *pdev)
>  unsigned long clks_per_sec;
>  int ret, i;
>
> +if (rwdt_blacklisted(&pdev->dev))
> +return -ENODEV;
> +
>  priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
>  if (!priv)
>  return -ENOMEM;
> --
> 2.7.4




Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* Re: [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
  2018-02-12 17:44     ` Fabrizio Castro
  (?)
@ 2018-02-28 19:24       ` Geert Uytterhoeven
  -1 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-28 19:24 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Simon Horman, Linux ARM, Stephen Boyd, Linux-Renesas,
	Rob Herring

Hi Fabrizio,

On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> Due to commits:
> * "ARM: shmobile: Add watchdog support",
> * "ARM: shmobile: rcar-gen2: Add watchdog support", and
> * "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
> we now have everything we needed for the watchdog to work on Gen2 and
> RZ/G1.
>
> This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
> Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
> always ON, when suspending to RAM we need to explicitly disable the
> counting by clearing TME from RWTCSRA.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

Thanks for your patch!

I verified this works on R-Car Gen2, so
Reviewed-and-Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>

Still, more comments below...

> --- a/drivers/watchdog/renesas_wdt.c
> +++ b/drivers/watchdog/renesas_wdt.c
> @@ -203,13 +203,29 @@ static int rwdt_remove(struct platform_device *pdev)
>         return 0;
>  }
>
> -/*
> - * This driver does also fit for R-Car Gen2 (r8a779[0-4]) WDT. However, for SMP
> - * to work there, one also needs a RESET (RST) driver which does not exist yet
> - * due to HW issues. This needs to be solved before adding compatibles here.
> - */
> +static int __maybe_unused rwdt_suspend(struct device *dev)
> +{
> +       struct rwdt_priv *priv = dev_get_drvdata(dev);
> +
> +       if (watchdog_active(&priv->wdev))
> +               rwdt_write(priv, priv->cks, RWTCSRA);
> +       return 0;
> +}
> +
> +static int __maybe_unused rwdt_resume(struct device *dev)
> +{
> +       struct rwdt_priv *priv = dev_get_drvdata(dev);
> +
> +       if (watchdog_active(&priv->wdev))
> +               rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);

Writing to this register is not sufficient on R-Car Gen3, where PSCI
suspend powers down the whole SoC.  Hence all WDT register content is lost,
causing the watchdog timeout never to trigger.
Note that this issue is pre-existing, and not caused by your patch.

This can be fixed by replacing the RWTCSRA register writes in the
suspend/resume handlers by calls to rwdt_stop() resp. rwdt_start(), like is
done in the BSP in commit e406980763f18f38 ("watchdog: renesas-wdt: Support
the suspend/resume"). Note that this would cause a small change in behavior
on R-Car Gen2, where the timeout would be reset on resume, instead of
continuing where stopped before. I don't think that hurts, though.

Since I was always a bit uncomfortable with this patch doing two things at
once (1. suspend/resume, 2. "renesas,rcar-gen2-wdt" matching), I think it
would be better to take the patch from the BSP first, and add support for
"renesas,rcar-gen2-wdt" in a subsequent patch.

Does the above make sense?
Do you agree?

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
@ 2018-02-28 19:24       ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-28 19:24 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

Hi Fabrizio,

On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> Due to commits:
> * "ARM: shmobile: Add watchdog support",
> * "ARM: shmobile: rcar-gen2: Add watchdog support", and
> * "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
> we now have everything we needed for the watchdog to work on Gen2 and
> RZ/G1.
>
> This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
> Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
> always ON, when suspending to RAM we need to explicitly disable the
> counting by clearing TME from RWTCSRA.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

Thanks for your patch!

I verified this works on R-Car Gen2, so
Reviewed-and-Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>

Still, more comments below...

> --- a/drivers/watchdog/renesas_wdt.c
> +++ b/drivers/watchdog/renesas_wdt.c
> @@ -203,13 +203,29 @@ static int rwdt_remove(struct platform_device *pdev)
>         return 0;
>  }
>
> -/*
> - * This driver does also fit for R-Car Gen2 (r8a779[0-4]) WDT. However, for SMP
> - * to work there, one also needs a RESET (RST) driver which does not exist yet
> - * due to HW issues. This needs to be solved before adding compatibles here.
> - */
> +static int __maybe_unused rwdt_suspend(struct device *dev)
> +{
> +       struct rwdt_priv *priv = dev_get_drvdata(dev);
> +
> +       if (watchdog_active(&priv->wdev))
> +               rwdt_write(priv, priv->cks, RWTCSRA);
> +       return 0;
> +}
> +
> +static int __maybe_unused rwdt_resume(struct device *dev)
> +{
> +       struct rwdt_priv *priv = dev_get_drvdata(dev);
> +
> +       if (watchdog_active(&priv->wdev))
> +               rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);

Writing to this register is not sufficient on R-Car Gen3, where PSCI
suspend powers down the whole SoC.  Hence all WDT register content is lost,
causing the watchdog timeout never to trigger.
Note that this issue is pre-existing, and not caused by your patch.

This can be fixed by replacing the RWTCSRA register writes in the
suspend/resume handlers by calls to rwdt_stop() resp. rwdt_start(), like is
done in the BSP in commit e406980763f18f38 ("watchdog: renesas-wdt: Support
the suspend/resume"). Note that this would cause a small change in behavior
on R-Car Gen2, where the timeout would be reset on resume, instead of
continuing where stopped before. I don't think that hurts, though.

Since I was always a bit uncomfortable with this patch doing two things at
once (1. suspend/resume, 2. "renesas,rcar-gen2-wdt" matching), I think it
would be better to take the patch from the BSP first, and add support for
"renesas,rcar-gen2-wdt" in a subsequent patch.

Does the above make sense?
Do you agree?

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
@ 2018-02-28 19:24       ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-02-28 19:24 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Fabrizio,

On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> Due to commits:
> * "ARM: shmobile: Add watchdog support",
> * "ARM: shmobile: rcar-gen2: Add watchdog support", and
> * "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
> we now have everything we needed for the watchdog to work on Gen2 and
> RZ/G1.
>
> This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
> Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
> always ON, when suspending to RAM we need to explicitly disable the
> counting by clearing TME from RWTCSRA.
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

Thanks for your patch!

I verified this works on R-Car Gen2, so
Reviewed-and-Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>

Still, more comments below...

> --- a/drivers/watchdog/renesas_wdt.c
> +++ b/drivers/watchdog/renesas_wdt.c
> @@ -203,13 +203,29 @@ static int rwdt_remove(struct platform_device *pdev)
>         return 0;
>  }
>
> -/*
> - * This driver does also fit for R-Car Gen2 (r8a779[0-4]) WDT. However, for SMP
> - * to work there, one also needs a RESET (RST) driver which does not exist yet
> - * due to HW issues. This needs to be solved before adding compatibles here.
> - */
> +static int __maybe_unused rwdt_suspend(struct device *dev)
> +{
> +       struct rwdt_priv *priv = dev_get_drvdata(dev);
> +
> +       if (watchdog_active(&priv->wdev))
> +               rwdt_write(priv, priv->cks, RWTCSRA);
> +       return 0;
> +}
> +
> +static int __maybe_unused rwdt_resume(struct device *dev)
> +{
> +       struct rwdt_priv *priv = dev_get_drvdata(dev);
> +
> +       if (watchdog_active(&priv->wdev))
> +               rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);

Writing to this register is not sufficient on R-Car Gen3, where PSCI
suspend powers down the whole SoC.  Hence all WDT register content is lost,
causing the watchdog timeout never to trigger.
Note that this issue is pre-existing, and not caused by your patch.

This can be fixed by replacing the RWTCSRA register writes in the
suspend/resume handlers by calls to rwdt_stop() resp. rwdt_start(), like is
done in the BSP in commit e406980763f18f38 ("watchdog: renesas-wdt: Support
the suspend/resume"). Note that this would cause a small change in behavior
on R-Car Gen2, where the timeout would be reset on resume, instead of
continuing where stopped before. I don't think that hurts, though.

Since I was always a bit uncomfortable with this patch doing two things at
once (1. suspend/resume, 2. "renesas,rcar-gen2-wdt" matching), I think it
would be better to take the patch from the BSP first, and add support for
"renesas,rcar-gen2-wdt" in a subsequent patch.

Does the above make sense?
Do you agree?

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v6 01/26] ARM: shmobile: Add watchdog support
  2018-02-28 17:40       ` Fabrizio Castro
  (?)
@ 2018-03-01  9:44         ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-03-01  9:44 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Mark Rutland, devicetree, Chris Paterson, Magnus Damm,
	linux-watchdog, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Russell King, linux-clk,
	linux-renesas-soc, Wolfram Sang, Wim Van Sebroeck, Rob Herring,
	linux-arm-kernel, Philipp Zabel, Biju Das, Stephen Boyd,
	Guenter Roeck, Ramesh Shanmugasundaram

On Wed, Feb 28, 2018 at 05:40:22PM +0000, Fabrizio Castro wrote:
> On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> The value contained in the SBAR registers is not initialized by a WDT
> triggered reset, which means that after a WDT triggered reset we jump
> to the SMP bring up routine, preventing the system from executing the
> bootrom code.
> 
> The purpose of this patch is to jump to the bootrom code in case of a
> WDT triggered reset, and keep the SMP functionality untouched.
> In order to tell if the code had been called due to the WDT overflowing
> we are testing WOVF from register RWTCSRA.
> 
> The new function shmobile_boot_vector_gen2 isn't replacing
> shmobile_boot_vector for backward compatibility reasons. The kernel
> will install the best option (either shmobile_boot_vector or
> shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> according to the amount of memory available.
> 
> Since shmobile_boot_vector has become bigger, "reg" property of nodes
> compatible with "renesas,smp-sram" now need to be set to a value
> greater or equal to "<0 0x60>".
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

Thanks, I have marked this as deferred as I would like dependencies to
be merged first.

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

* Re: [PATCH v6 01/26] ARM: shmobile: Add watchdog support
@ 2018-03-01  9:44         ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-03-01  9:44 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Geert Uytterhoeven, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram

On Wed, Feb 28, 2018 at 05:40:22PM +0000, Fabrizio Castro wrote:
> On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> The value contained in the SBAR registers is not initialized by a WDT
> triggered reset, which means that after a WDT triggered reset we jump
> to the SMP bring up routine, preventing the system from executing the
> bootrom code.
> 
> The purpose of this patch is to jump to the bootrom code in case of a
> WDT triggered reset, and keep the SMP functionality untouched.
> In order to tell if the code had been called due to the WDT overflowing
> we are testing WOVF from register RWTCSRA.
> 
> The new function shmobile_boot_vector_gen2 isn't replacing
> shmobile_boot_vector for backward compatibility reasons. The kernel
> will install the best option (either shmobile_boot_vector or
> shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> according to the amount of memory available.
> 
> Since shmobile_boot_vector has become bigger, "reg" property of nodes
> compatible with "renesas,smp-sram" now need to be set to a value
> greater or equal to "<0 0x60>".
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

Thanks, I have marked this as deferred as I would like dependencies to
be merged first.

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

* [PATCH v6 01/26] ARM: shmobile: Add watchdog support
@ 2018-03-01  9:44         ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-03-01  9:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Feb 28, 2018 at 05:40:22PM +0000, Fabrizio Castro wrote:
> On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> The value contained in the SBAR registers is not initialized by a WDT
> triggered reset, which means that after a WDT triggered reset we jump
> to the SMP bring up routine, preventing the system from executing the
> bootrom code.
> 
> The purpose of this patch is to jump to the bootrom code in case of a
> WDT triggered reset, and keep the SMP functionality untouched.
> In order to tell if the code had been called due to the WDT overflowing
> we are testing WOVF from register RWTCSRA.
> 
> The new function shmobile_boot_vector_gen2 isn't replacing
> shmobile_boot_vector for backward compatibility reasons. The kernel
> will install the best option (either shmobile_boot_vector or
> shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> according to the amount of memory available.
> 
> Since shmobile_boot_vector has become bigger, "reg" property of nodes
> compatible with "renesas,smp-sram" now need to be set to a value
> greater or equal to "<0 0x60>".
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>

Thanks, I have marked this as deferred as I would like dependencies to
be merged first.

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
  2018-02-23  8:14             ` Simon Horman
  (?)
@ 2018-03-01 10:20               ` Geert Uytterhoeven
  -1 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-03-01 10:20 UTC (permalink / raw)
  To: Simon Horman
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	Fabrizio Castro,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Rob Herring, Linux ARM, Stephen Boyd, Linux-Renesas

Hi Simon,

On Fri, Feb 23, 2018 at 9:14 AM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Feb 22, 2018 at 09:38:39AM +0100, Geert Uytterhoeven wrote:
>> On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
>> > On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
>> >> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
>> >> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
>> >> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
>> >> >> <fabrizio.castro@bp.renesas.com> wrote:
>> >> >> > this series has been around for some time as RFC, and it has collected
>> >> >> > useful comments from the community along the way.
>> >> >> > The solution proposed by this patch set works for most R-Car Gen2 and
>> >> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
>> >> >> > Gen2 early revisions there is no proper software fix. Anyway, no
>> >> >> > product has been built around early revisions, but development boards
>> >> >> > mounting early revisions (basically prototypes) are still out there.
>> >> >> > As a result, this series isn't enabling the internal watchdog on R-Car
>> >> >> > Gen2 boards, developers may enable it in board specific device trees
>> >> >> > if needed.
>> >> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
>> >> >> > and Koelsch boards.
>> >> >> >
>> >> >> > The problem
>> >> >> > ===========
>> >> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
>> >> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
>> >> >> > the non-boot CPUs they are redirected to the reset vector installed by
>> >> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
>> >> >> > where the SMP bring-up code will take care of the rest.
>> >> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
>> >> >> > and as such after the watchdog fires the boot core will try and execute
>> >> >> > the SMP bring-up code instead of jumping to the bootrom code.
>> >> >> >
>> >> >> > The fix
>> >> >> > =======
>> >> >> > The main strategy for the solution is to let the reset vector decide
>> >> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
>> >> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
>> >> >> > their values, the boot CPU will jump into the newly designed reset
>> >> >> > vector, the assembly routine will eventually test WOVF (a bit in register
>> >> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
>> >> >> > of this bit gets retained in this scenario), and jump to the bootrom code
>> >> >> > which will in turn load up the bootloader, etc.
>> >> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
>> >> >> > to shmobile_boot_fn instead.
>> >> >> >
>> >> >> > Thank you All for your help.
>> >> >> >
>> >> >> > Best regards,
>> >> >> >
>> >> >> > Fabrizio Castro (26):
>> >> >> >   ARM: shmobile: Add watchdog support
>> >> >> >   ARM: dts: r8a7743: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7745: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7790: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7791: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7792: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7793: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7794: Adjust SMP routine size
>> >> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>> >> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
>> >> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>> >> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
>> >> >> >   watchdog: renesas_wdt: Add restart handler
>> >> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>> >> >> >   clk: renesas: r8a7743: Add rwdt clock
>> >> >> >   clk: renesas: r8a7745: Add rwdt clock
>> >> >> >   clk: renesas: r8a7790: Add rwdt clock
>> >> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>> >> >> >   clk: renesas: r8a7794: Add rwdt clock
>> >> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>> >> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>> >> >> >
>> >> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>> >> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>> >> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>> >> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>> >> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>> >> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
>> >> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
>> >> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>> >> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>> >> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>> >> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>> >> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>> >> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>> >> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>> >> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>> >> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>> >> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
>> >> >>
>> >> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
>> >> >> a hard dependency for:
>> >> >>   (1) The new reset vector in arch/arm/mach-shmobile/
>> >> >>   (2) The watchdog driver.
>> >> >>
>> >> >> Note that the watchdog driver itself (2) has a hard dependency on the
>> >> >> new reset vector (1).
>> >> >
>> >> > Thanks, I have marked the watchdog driver patch as Deferred.
>> >> > Please resubmit or otherwise ping me once they dependencies
>> >> > are in an rc release.
>> >>
>> >> I gave the dependencies a bit more thought.
>> >>
>> >> I think we can gain once release cycle if you would postpone the DTS patches
>> >> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
>> >> Then all other parts can be upstreamed in parallel in v4.17, as nothing
>> >> will be activated before the DTS parts are in.
>> >>
>> >> Does this look sane?
>> >
>> > What about new DTS on old kernels of a specific vintage?
>>
>> New DTS would work fine on v4.16 and older, which don't have any of the
>> other patches from this series.
>> New DTS would work fine on v4.17, assumed all other patches from this
>> series get into v4.17.
>>
>> The only issue would be a new DTS on a kernel that has some but not all
>> other patches from this series.
>
> Thanks for the analysis. I think this is the key point. What is the risk of
> that happening?

I think the risk is fairly low.
You control when the DTS changes go in, and also when they are backported
to LTSI.

>> If we want to fast-track everything into v4.17, we need a stable branch, to be
>> pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
>> renesas-dts).
>
> It seems that watchdog is the only item on that list that neither you nor I
> sign off on. So I conclude that if the watchdog patch goes in early enough
> in the cycle then we ought to be in good shape.
>
> None the less, is it worth the risk?

Do we want the functionality early, or can we wait until v4.19?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-03-01 10:20               ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-03-01 10:20 UTC (permalink / raw)
  To: Simon Horman
  Cc: Fabrizio Castro, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

Hi Simon,

On Fri, Feb 23, 2018 at 9:14 AM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Feb 22, 2018 at 09:38:39AM +0100, Geert Uytterhoeven wrote:
>> On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
>> > On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
>> >> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
>> >> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
>> >> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
>> >> >> <fabrizio.castro@bp.renesas.com> wrote:
>> >> >> > this series has been around for some time as RFC, and it has collected
>> >> >> > useful comments from the community along the way.
>> >> >> > The solution proposed by this patch set works for most R-Car Gen2 and
>> >> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
>> >> >> > Gen2 early revisions there is no proper software fix. Anyway, no
>> >> >> > product has been built around early revisions, but development boards
>> >> >> > mounting early revisions (basically prototypes) are still out there.
>> >> >> > As a result, this series isn't enabling the internal watchdog on R-Car
>> >> >> > Gen2 boards, developers may enable it in board specific device trees
>> >> >> > if needed.
>> >> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
>> >> >> > and Koelsch boards.
>> >> >> >
>> >> >> > The problem
>> >> >> > ===========
>> >> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
>> >> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
>> >> >> > the non-boot CPUs they are redirected to the reset vector installed by
>> >> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
>> >> >> > where the SMP bring-up code will take care of the rest.
>> >> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
>> >> >> > and as such after the watchdog fires the boot core will try and execute
>> >> >> > the SMP bring-up code instead of jumping to the bootrom code.
>> >> >> >
>> >> >> > The fix
>> >> >> > =======
>> >> >> > The main strategy for the solution is to let the reset vector decide
>> >> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
>> >> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
>> >> >> > their values, the boot CPU will jump into the newly designed reset
>> >> >> > vector, the assembly routine will eventually test WOVF (a bit in register
>> >> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
>> >> >> > of this bit gets retained in this scenario), and jump to the bootrom code
>> >> >> > which will in turn load up the bootloader, etc.
>> >> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
>> >> >> > to shmobile_boot_fn instead.
>> >> >> >
>> >> >> > Thank you All for your help.
>> >> >> >
>> >> >> > Best regards,
>> >> >> >
>> >> >> > Fabrizio Castro (26):
>> >> >> >   ARM: shmobile: Add watchdog support
>> >> >> >   ARM: dts: r8a7743: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7745: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7790: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7791: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7792: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7793: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7794: Adjust SMP routine size
>> >> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>> >> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
>> >> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>> >> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
>> >> >> >   watchdog: renesas_wdt: Add restart handler
>> >> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>> >> >> >   clk: renesas: r8a7743: Add rwdt clock
>> >> >> >   clk: renesas: r8a7745: Add rwdt clock
>> >> >> >   clk: renesas: r8a7790: Add rwdt clock
>> >> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>> >> >> >   clk: renesas: r8a7794: Add rwdt clock
>> >> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>> >> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>> >> >> >
>> >> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>> >> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>> >> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>> >> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>> >> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>> >> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
>> >> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
>> >> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>> >> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>> >> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>> >> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>> >> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>> >> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>> >> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>> >> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>> >> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>> >> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
>> >> >>
>> >> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
>> >> >> a hard dependency for:
>> >> >>   (1) The new reset vector in arch/arm/mach-shmobile/
>> >> >>   (2) The watchdog driver.
>> >> >>
>> >> >> Note that the watchdog driver itself (2) has a hard dependency on the
>> >> >> new reset vector (1).
>> >> >
>> >> > Thanks, I have marked the watchdog driver patch as Deferred.
>> >> > Please resubmit or otherwise ping me once they dependencies
>> >> > are in an rc release.
>> >>
>> >> I gave the dependencies a bit more thought.
>> >>
>> >> I think we can gain once release cycle if you would postpone the DTS patches
>> >> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
>> >> Then all other parts can be upstreamed in parallel in v4.17, as nothing
>> >> will be activated before the DTS parts are in.
>> >>
>> >> Does this look sane?
>> >
>> > What about new DTS on old kernels of a specific vintage?
>>
>> New DTS would work fine on v4.16 and older, which don't have any of the
>> other patches from this series.
>> New DTS would work fine on v4.17, assumed all other patches from this
>> series get into v4.17.
>>
>> The only issue would be a new DTS on a kernel that has some but not all
>> other patches from this series.
>
> Thanks for the analysis. I think this is the key point. What is the risk of
> that happening?

I think the risk is fairly low.
You control when the DTS changes go in, and also when they are backported
to LTSI.

>> If we want to fast-track everything into v4.17, we need a stable branch, to be
>> pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
>> renesas-dts).
>
> It seems that watchdog is the only item on that list that neither you nor I
> sign off on. So I conclude that if the watchdog patch goes in early enough
> in the cycle then we ought to be in good shape.
>
> None the less, is it worth the risk?

Do we want the functionality early, or can we wait until v4.19?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-03-01 10:20               ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-03-01 10:20 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Fri, Feb 23, 2018 at 9:14 AM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Feb 22, 2018 at 09:38:39AM +0100, Geert Uytterhoeven wrote:
>> On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
>> > On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
>> >> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
>> >> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
>> >> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
>> >> >> <fabrizio.castro@bp.renesas.com> wrote:
>> >> >> > this series has been around for some time as RFC, and it has collected
>> >> >> > useful comments from the community along the way.
>> >> >> > The solution proposed by this patch set works for most R-Car Gen2 and
>> >> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
>> >> >> > Gen2 early revisions there is no proper software fix. Anyway, no
>> >> >> > product has been built around early revisions, but development boards
>> >> >> > mounting early revisions (basically prototypes) are still out there.
>> >> >> > As a result, this series isn't enabling the internal watchdog on R-Car
>> >> >> > Gen2 boards, developers may enable it in board specific device trees
>> >> >> > if needed.
>> >> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
>> >> >> > and Koelsch boards.
>> >> >> >
>> >> >> > The problem
>> >> >> > ===========
>> >> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
>> >> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
>> >> >> > the non-boot CPUs they are redirected to the reset vector installed by
>> >> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
>> >> >> > where the SMP bring-up code will take care of the rest.
>> >> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
>> >> >> > and as such after the watchdog fires the boot core will try and execute
>> >> >> > the SMP bring-up code instead of jumping to the bootrom code.
>> >> >> >
>> >> >> > The fix
>> >> >> > =======
>> >> >> > The main strategy for the solution is to let the reset vector decide
>> >> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
>> >> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
>> >> >> > their values, the boot CPU will jump into the newly designed reset
>> >> >> > vector, the assembly routine will eventually test WOVF (a bit in register
>> >> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
>> >> >> > of this bit gets retained in this scenario), and jump to the bootrom code
>> >> >> > which will in turn load up the bootloader, etc.
>> >> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
>> >> >> > to shmobile_boot_fn instead.
>> >> >> >
>> >> >> > Thank you All for your help.
>> >> >> >
>> >> >> > Best regards,
>> >> >> >
>> >> >> > Fabrizio Castro (26):
>> >> >> >   ARM: shmobile: Add watchdog support
>> >> >> >   ARM: dts: r8a7743: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7745: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7790: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7791: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7792: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7793: Adjust SMP routine size
>> >> >> >   ARM: dts: r8a7794: Adjust SMP routine size
>> >> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>> >> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
>> >> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>> >> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
>> >> >> >   watchdog: renesas_wdt: Add restart handler
>> >> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>> >> >> >   clk: renesas: r8a7743: Add rwdt clock
>> >> >> >   clk: renesas: r8a7745: Add rwdt clock
>> >> >> >   clk: renesas: r8a7790: Add rwdt clock
>> >> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>> >> >> >   clk: renesas: r8a7794: Add rwdt clock
>> >> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>> >> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>> >> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>> >> >> >
>> >> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>> >> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>> >> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>> >> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>> >> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>> >> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>> >> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
>> >> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
>> >> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>> >> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>> >> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>> >> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>> >> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>> >> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>> >> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>> >> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>> >> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>> >> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
>> >> >>
>> >> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
>> >> >> a hard dependency for:
>> >> >>   (1) The new reset vector in arch/arm/mach-shmobile/
>> >> >>   (2) The watchdog driver.
>> >> >>
>> >> >> Note that the watchdog driver itself (2) has a hard dependency on the
>> >> >> new reset vector (1).
>> >> >
>> >> > Thanks, I have marked the watchdog driver patch as Deferred.
>> >> > Please resubmit or otherwise ping me once they dependencies
>> >> > are in an rc release.
>> >>
>> >> I gave the dependencies a bit more thought.
>> >>
>> >> I think we can gain once release cycle if you would postpone the DTS patches
>> >> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
>> >> Then all other parts can be upstreamed in parallel in v4.17, as nothing
>> >> will be activated before the DTS parts are in.
>> >>
>> >> Does this look sane?
>> >
>> > What about new DTS on old kernels of a specific vintage?
>>
>> New DTS would work fine on v4.16 and older, which don't have any of the
>> other patches from this series.
>> New DTS would work fine on v4.17, assumed all other patches from this
>> series get into v4.17.
>>
>> The only issue would be a new DTS on a kernel that has some but not all
>> other patches from this series.
>
> Thanks for the analysis. I think this is the key point. What is the risk of
> that happening?

I think the risk is fairly low.
You control when the DTS changes go in, and also when they are backported
to LTSI.

>> If we want to fast-track everything into v4.17, we need a stable branch, to be
>> pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
>> renesas-dts).
>
> It seems that watchdog is the only item on that list that neither you nor I
> sign off on. So I conclude that if the watchdog patch goes in early enough
> in the cycle then we ought to be in good shape.
>
> None the less, is it worth the risk?

Do we want the functionality early, or can we wait until v4.19?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* RE: [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
  2018-02-28 19:24       ` Geert Uytterhoeven
  (?)
  (?)
@ 2018-03-01 15:34         ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-03-01 15:34 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Simon Horman, Linux ARM, Stephen Boyd, Linux-Renesas,
	Rob Herring

Hi Geert,

thank you for your feedback!

> Subject: Re: [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
>
> Hi Fabrizio,
>
> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > Due to commits:
> > * "ARM: shmobile: Add watchdog support",
> > * "ARM: shmobile: rcar-gen2: Add watchdog support", and
> > * "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
> > we now have everything we needed for the watchdog to work on Gen2 and
> > RZ/G1.
> >
> > This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
> > Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
> > always ON, when suspending to RAM we need to explicitly disable the
> > counting by clearing TME from RWTCSRA.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
>
> Thanks for your patch!
>
> I verified this works on R-Car Gen2, so
> Reviewed-and-Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Still, more comments below...
>
> > --- a/drivers/watchdog/renesas_wdt.c
> > +++ b/drivers/watchdog/renesas_wdt.c
> > @@ -203,13 +203,29 @@ static int rwdt_remove(struct platform_device *pdev)
> >         return 0;
> >  }
> >
> > -/*
> > - * This driver does also fit for R-Car Gen2 (r8a779[0-4]) WDT. However, for SMP
> > - * to work there, one also needs a RESET (RST) driver which does not exist yet
> > - * due to HW issues. This needs to be solved before adding compatibles here.
> > - */
> > +static int __maybe_unused rwdt_suspend(struct device *dev)
> > +{
> > +       struct rwdt_priv *priv = dev_get_drvdata(dev);
> > +
> > +       if (watchdog_active(&priv->wdev))
> > +               rwdt_write(priv, priv->cks, RWTCSRA);
> > +       return 0;
> > +}
> > +
> > +static int __maybe_unused rwdt_resume(struct device *dev)
> > +{
> > +       struct rwdt_priv *priv = dev_get_drvdata(dev);
> > +
> > +       if (watchdog_active(&priv->wdev))
> > +               rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);
>
> Writing to this register is not sufficient on R-Car Gen3, where PSCI
> suspend powers down the whole SoC.  Hence all WDT register content is lost,
> causing the watchdog timeout never to trigger.
> Note that this issue is pre-existing, and not caused by your patch.
>
> This can be fixed by replacing the RWTCSRA register writes in the
> suspend/resume handlers by calls to rwdt_stop() resp. rwdt_start(), like is
> done in the BSP in commit e406980763f18f38 ("watchdog: renesas-wdt: Support
> the suspend/resume"). Note that this would cause a small change in behavior
> on R-Car Gen2, where the timeout would be reset on resume, instead of
> continuing where stopped before. I don't think that hurts, though.

I see, well I believe we can make both of us happy by addressing Gen3
problems and preserving the original behaviour  from Gen2.

I am going to send a new series to address this shortly.

>
> Since I was always a bit uncomfortable with this patch doing two things at
> once (1. suspend/resume, 2. "renesas,rcar-gen2-wdt" matching), I think it
> would be better to take the patch from the BSP first, and add support for
> "renesas,rcar-gen2-wdt" in a subsequent patch.

I agree, I'll split the patch and submit suspend/resume first, Gen2 compatibility
next.

Thanks,
Fab

>
> Does the above make sense?
> Do you agree?
>
> Thanks!
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* RE: [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
@ 2018-03-01 15:34         ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-03-01 15:34 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

Hi Geert,

thank you for your feedback!

> Subject: Re: [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
>
> Hi Fabrizio,
>
> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > Due to commits:
> > * "ARM: shmobile: Add watchdog support",
> > * "ARM: shmobile: rcar-gen2: Add watchdog support", and
> > * "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
> > we now have everything we needed for the watchdog to work on Gen2 and
> > RZ/G1.
> >
> > This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
> > Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
> > always ON, when suspending to RAM we need to explicitly disable the
> > counting by clearing TME from RWTCSRA.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
>
> Thanks for your patch!
>
> I verified this works on R-Car Gen2, so
> Reviewed-and-Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Still, more comments below...
>
> > --- a/drivers/watchdog/renesas_wdt.c
> > +++ b/drivers/watchdog/renesas_wdt.c
> > @@ -203,13 +203,29 @@ static int rwdt_remove(struct platform_device *pdev)
> >         return 0;
> >  }
> >
> > -/*
> > - * This driver does also fit for R-Car Gen2 (r8a779[0-4]) WDT. However, for SMP
> > - * to work there, one also needs a RESET (RST) driver which does not exist yet
> > - * due to HW issues. This needs to be solved before adding compatibles here.
> > - */
> > +static int __maybe_unused rwdt_suspend(struct device *dev)
> > +{
> > +       struct rwdt_priv *priv = dev_get_drvdata(dev);
> > +
> > +       if (watchdog_active(&priv->wdev))
> > +               rwdt_write(priv, priv->cks, RWTCSRA);
> > +       return 0;
> > +}
> > +
> > +static int __maybe_unused rwdt_resume(struct device *dev)
> > +{
> > +       struct rwdt_priv *priv = dev_get_drvdata(dev);
> > +
> > +       if (watchdog_active(&priv->wdev))
> > +               rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);
>
> Writing to this register is not sufficient on R-Car Gen3, where PSCI
> suspend powers down the whole SoC.  Hence all WDT register content is lost,
> causing the watchdog timeout never to trigger.
> Note that this issue is pre-existing, and not caused by your patch.
>
> This can be fixed by replacing the RWTCSRA register writes in the
> suspend/resume handlers by calls to rwdt_stop() resp. rwdt_start(), like is
> done in the BSP in commit e406980763f18f38 ("watchdog: renesas-wdt: Support
> the suspend/resume"). Note that this would cause a small change in behavior
> on R-Car Gen2, where the timeout would be reset on resume, instead of
> continuing where stopped before. I don't think that hurts, though.

I see, well I believe we can make both of us happy by addressing Gen3
problems and preserving the original behaviour  from Gen2.

I am going to send a new series to address this shortly.

>
> Since I was always a bit uncomfortable with this patch doing two things at
> once (1. suspend/resume, 2. "renesas,rcar-gen2-wdt" matching), I think it
> would be better to take the patch from the BSP first, and add support for
> "renesas,rcar-gen2-wdt" in a subsequent patch.

I agree, I'll split the patch and submit suspend/resume first, Gen2 compatibility
next.

Thanks,
Fab

>
> Does the above make sense?
> Do you agree?
>
> Thanks!
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* RE: [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
@ 2018-03-01 15:34         ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-03-01 15:34 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Simon Horman, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

SGkgR2VlcnQsDQoNCnRoYW5rIHlvdSBmb3IgeW91ciBmZWVkYmFjayENCg0KPiBTdWJqZWN0OiBS
ZTogW1BBVENIIHY1IDEyLzI2XSB3YXRjaGRvZzogcmVuZXNhc193ZHQ6IEFkZCBSLUNhciBHZW4y
IHN1cHBvcnQNCj4NCj4gSGkgRmFicml6aW8sDQo+DQo+IE9uIE1vbiwgRmViIDEyLCAyMDE4IGF0
IDY6NDQgUE0sIEZhYnJpemlvIENhc3Rybw0KPiA8ZmFicml6aW8uY2FzdHJvQGJwLnJlbmVzYXMu
Y29tPiB3cm90ZToNCj4gPiBEdWUgdG8gY29tbWl0czoNCj4gPiAqICJBUk06IHNobW9iaWxlOiBB
ZGQgd2F0Y2hkb2cgc3VwcG9ydCIsDQo+ID4gKiAiQVJNOiBzaG1vYmlsZTogcmNhci1nZW4yOiBB
ZGQgd2F0Y2hkb2cgc3VwcG9ydCIsIGFuZA0KPiA+ICogInNvYzogcmVuZXNhczogcmNhci1yc3Q6
IEVuYWJsZSB3YXRjaGRvZyBhcyByZXNldCB0cmlnZ2VyIGZvciBHZW4yIiwNCj4gPiB3ZSBub3cg
aGF2ZSBldmVyeXRoaW5nIHdlIG5lZWRlZCBmb3IgdGhlIHdhdGNoZG9nIHRvIHdvcmsgb24gR2Vu
MiBhbmQNCj4gPiBSWi9HMS4NCj4gPg0KPiA+IFRoaXMgY29tbWl0IGFkZHMgInJlbmVzYXMscmNh
ci1nZW4yLXdkdCIgYXMgY29tcGF0aWJsZSBzdHJpbmcgZm9yIFItQ2FyDQo+ID4gR2VuMiBhbmQg
UlovRzEsIGFuZCBzaW5jZSBvbiB0aG9zZSBwbGF0Zm9ybXMgdGhlIHJ3ZHQgY2xvY2sgbmVlZHMg
dG8gYmUNCj4gPiBhbHdheXMgT04sIHdoZW4gc3VzcGVuZGluZyB0byBSQU0gd2UgbmVlZCB0byBl
eHBsaWNpdGx5IGRpc2FibGUgdGhlDQo+ID4gY291bnRpbmcgYnkgY2xlYXJpbmcgVE1FIGZyb20g
UldUQ1NSQS4NCj4gPg0KPiA+IFNpZ25lZC1vZmYtYnk6IEZhYnJpemlvIENhc3RybyA8ZmFicml6
aW8uY2FzdHJvQGJwLnJlbmVzYXMuY29tPg0KPiA+IFNpZ25lZC1vZmYtYnk6IFJhbWVzaCBTaGFu
bXVnYXN1bmRhcmFtIDxyYW1lc2guc2hhbm11Z2FzdW5kYXJhbUBicC5yZW5lc2FzLmNvbT4NCj4N
Cj4gVGhhbmtzIGZvciB5b3VyIHBhdGNoIQ0KPg0KPiBJIHZlcmlmaWVkIHRoaXMgd29ya3Mgb24g
Ui1DYXIgR2VuMiwgc28NCj4gUmV2aWV3ZWQtYW5kLVRlc3RlZC1ieTogR2VlcnQgVXl0dGVyaG9l
dmVuIDxnZWVydCtyZW5lc2FzQGdsaWRlci5iZT4NCj4NCj4gU3RpbGwsIG1vcmUgY29tbWVudHMg
YmVsb3cuLi4NCj4NCj4gPiAtLS0gYS9kcml2ZXJzL3dhdGNoZG9nL3JlbmVzYXNfd2R0LmMNCj4g
PiArKysgYi9kcml2ZXJzL3dhdGNoZG9nL3JlbmVzYXNfd2R0LmMNCj4gPiBAQCAtMjAzLDEzICsy
MDMsMjkgQEAgc3RhdGljIGludCByd2R0X3JlbW92ZShzdHJ1Y3QgcGxhdGZvcm1fZGV2aWNlICpw
ZGV2KQ0KPiA+ICAgICAgICAgcmV0dXJuIDA7DQo+ID4gIH0NCj4gPg0KPiA+IC0vKg0KPiA+IC0g
KiBUaGlzIGRyaXZlciBkb2VzIGFsc28gZml0IGZvciBSLUNhciBHZW4yIChyOGE3NzlbMC00XSkg
V0RULiBIb3dldmVyLCBmb3IgU01QDQo+ID4gLSAqIHRvIHdvcmsgdGhlcmUsIG9uZSBhbHNvIG5l
ZWRzIGEgUkVTRVQgKFJTVCkgZHJpdmVyIHdoaWNoIGRvZXMgbm90IGV4aXN0IHlldA0KPiA+IC0g
KiBkdWUgdG8gSFcgaXNzdWVzLiBUaGlzIG5lZWRzIHRvIGJlIHNvbHZlZCBiZWZvcmUgYWRkaW5n
IGNvbXBhdGlibGVzIGhlcmUuDQo+ID4gLSAqLw0KPiA+ICtzdGF0aWMgaW50IF9fbWF5YmVfdW51
c2VkIHJ3ZHRfc3VzcGVuZChzdHJ1Y3QgZGV2aWNlICpkZXYpDQo+ID4gK3sNCj4gPiArICAgICAg
IHN0cnVjdCByd2R0X3ByaXYgKnByaXYgPSBkZXZfZ2V0X2RydmRhdGEoZGV2KTsNCj4gPiArDQo+
ID4gKyAgICAgICBpZiAod2F0Y2hkb2dfYWN0aXZlKCZwcml2LT53ZGV2KSkNCj4gPiArICAgICAg
ICAgICAgICAgcndkdF93cml0ZShwcml2LCBwcml2LT5ja3MsIFJXVENTUkEpOw0KPiA+ICsgICAg
ICAgcmV0dXJuIDA7DQo+ID4gK30NCj4gPiArDQo+ID4gK3N0YXRpYyBpbnQgX19tYXliZV91bnVz
ZWQgcndkdF9yZXN1bWUoc3RydWN0IGRldmljZSAqZGV2KQ0KPiA+ICt7DQo+ID4gKyAgICAgICBz
dHJ1Y3QgcndkdF9wcml2ICpwcml2ID0gZGV2X2dldF9kcnZkYXRhKGRldik7DQo+ID4gKw0KPiA+
ICsgICAgICAgaWYgKHdhdGNoZG9nX2FjdGl2ZSgmcHJpdi0+d2RldikpDQo+ID4gKyAgICAgICAg
ICAgICAgIHJ3ZHRfd3JpdGUocHJpdiwgcHJpdi0+Y2tzIHwgUldUQ1NSQV9UTUUsIFJXVENTUkEp
Ow0KPg0KPiBXcml0aW5nIHRvIHRoaXMgcmVnaXN0ZXIgaXMgbm90IHN1ZmZpY2llbnQgb24gUi1D
YXIgR2VuMywgd2hlcmUgUFNDSQ0KPiBzdXNwZW5kIHBvd2VycyBkb3duIHRoZSB3aG9sZSBTb0Mu
ICBIZW5jZSBhbGwgV0RUIHJlZ2lzdGVyIGNvbnRlbnQgaXMgbG9zdCwNCj4gY2F1c2luZyB0aGUg
d2F0Y2hkb2cgdGltZW91dCBuZXZlciB0byB0cmlnZ2VyLg0KPiBOb3RlIHRoYXQgdGhpcyBpc3N1
ZSBpcyBwcmUtZXhpc3RpbmcsIGFuZCBub3QgY2F1c2VkIGJ5IHlvdXIgcGF0Y2guDQo+DQo+IFRo
aXMgY2FuIGJlIGZpeGVkIGJ5IHJlcGxhY2luZyB0aGUgUldUQ1NSQSByZWdpc3RlciB3cml0ZXMg
aW4gdGhlDQo+IHN1c3BlbmQvcmVzdW1lIGhhbmRsZXJzIGJ5IGNhbGxzIHRvIHJ3ZHRfc3RvcCgp
IHJlc3AuIHJ3ZHRfc3RhcnQoKSwgbGlrZSBpcw0KPiBkb25lIGluIHRoZSBCU1AgaW4gY29tbWl0
IGU0MDY5ODA3NjNmMThmMzggKCJ3YXRjaGRvZzogcmVuZXNhcy13ZHQ6IFN1cHBvcnQNCj4gdGhl
IHN1c3BlbmQvcmVzdW1lIikuIE5vdGUgdGhhdCB0aGlzIHdvdWxkIGNhdXNlIGEgc21hbGwgY2hh
bmdlIGluIGJlaGF2aW9yDQo+IG9uIFItQ2FyIEdlbjIsIHdoZXJlIHRoZSB0aW1lb3V0IHdvdWxk
IGJlIHJlc2V0IG9uIHJlc3VtZSwgaW5zdGVhZCBvZg0KPiBjb250aW51aW5nIHdoZXJlIHN0b3Bw
ZWQgYmVmb3JlLiBJIGRvbid0IHRoaW5rIHRoYXQgaHVydHMsIHRob3VnaC4NCg0KSSBzZWUsIHdl
bGwgSSBiZWxpZXZlIHdlIGNhbiBtYWtlIGJvdGggb2YgdXMgaGFwcHkgYnkgYWRkcmVzc2luZyBH
ZW4zDQpwcm9ibGVtcyBhbmQgcHJlc2VydmluZyB0aGUgb3JpZ2luYWwgYmVoYXZpb3VyICBmcm9t
IEdlbjIuDQoNCkkgYW0gZ29pbmcgdG8gc2VuZCBhIG5ldyBzZXJpZXMgdG8gYWRkcmVzcyB0aGlz
IHNob3J0bHkuDQoNCj4NCj4gU2luY2UgSSB3YXMgYWx3YXlzIGEgYml0IHVuY29tZm9ydGFibGUg
d2l0aCB0aGlzIHBhdGNoIGRvaW5nIHR3byB0aGluZ3MgYXQNCj4gb25jZSAoMS4gc3VzcGVuZC9y
ZXN1bWUsIDIuICJyZW5lc2FzLHJjYXItZ2VuMi13ZHQiIG1hdGNoaW5nKSwgSSB0aGluayBpdA0K
PiB3b3VsZCBiZSBiZXR0ZXIgdG8gdGFrZSB0aGUgcGF0Y2ggZnJvbSB0aGUgQlNQIGZpcnN0LCBh
bmQgYWRkIHN1cHBvcnQgZm9yDQo+ICJyZW5lc2FzLHJjYXItZ2VuMi13ZHQiIGluIGEgc3Vic2Vx
dWVudCBwYXRjaC4NCg0KSSBhZ3JlZSwgSSdsbCBzcGxpdCB0aGUgcGF0Y2ggYW5kIHN1Ym1pdCBz
dXNwZW5kL3Jlc3VtZSBmaXJzdCwgR2VuMiBjb21wYXRpYmlsaXR5DQpuZXh0Lg0KDQpUaGFua3Ms
DQpGYWINCg0KPg0KPiBEb2VzIHRoZSBhYm92ZSBtYWtlIHNlbnNlPw0KPiBEbyB5b3UgYWdyZWU/
DQo+DQo+IFRoYW5rcyENCj4NCj4gR3J7b2V0amUsZWV0aW5nfXMsDQo+DQo+ICAgICAgICAgICAg
ICAgICAgICAgICAgIEdlZXJ0DQo+DQo+IC0tDQo+IEdlZXJ0IFV5dHRlcmhvZXZlbiAtLSBUaGVy
ZSdzIGxvdHMgb2YgTGludXggYmV5b25kIGlhMzIgLS0gZ2VlcnRAbGludXgtbTY4ay5vcmcNCj4N
Cj4gSW4gcGVyc29uYWwgY29udmVyc2F0aW9ucyB3aXRoIHRlY2huaWNhbCBwZW9wbGUsIEkgY2Fs
bCBteXNlbGYgYSBoYWNrZXIuIEJ1dA0KPiB3aGVuIEknbSB0YWxraW5nIHRvIGpvdXJuYWxpc3Rz
IEkganVzdCBzYXkgInByb2dyYW1tZXIiIG9yIHNvbWV0aGluZyBsaWtlIHRoYXQuDQo+ICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgLS0gTGludXMgVG9ydmFsZHMNCg0KDQoNClJlbmVz
YXMgRWxlY3Ryb25pY3MgRXVyb3BlIEx0ZCwgRHVrZXMgTWVhZG93LCBNaWxsYm9hcmQgUm9hZCwg
Qm91cm5lIEVuZCwgQnVja2luZ2hhbXNoaXJlLCBTTDggNUZILCBVSy4gUmVnaXN0ZXJlZCBpbiBF
bmdsYW5kICYgV2FsZXMgdW5kZXIgUmVnaXN0ZXJlZCBOby4gMDQ1ODY3MDkuDQo=

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

* [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
@ 2018-03-01 15:34         ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-03-01 15:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Geert,

thank you for your feedback!

> Subject: Re: [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support
>
> Hi Fabrizio,
>
> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > Due to commits:
> > * "ARM: shmobile: Add watchdog support",
> > * "ARM: shmobile: rcar-gen2: Add watchdog support", and
> > * "soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2",
> > we now have everything we needed for the watchdog to work on Gen2 and
> > RZ/G1.
> >
> > This commit adds "renesas,rcar-gen2-wdt" as compatible string for R-Car
> > Gen2 and RZ/G1, and since on those platforms the rwdt clock needs to be
> > always ON, when suspending to RAM we need to explicitly disable the
> > counting by clearing TME from RWTCSRA.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
>
> Thanks for your patch!
>
> I verified this works on R-Car Gen2, so
> Reviewed-and-Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Still, more comments below...
>
> > --- a/drivers/watchdog/renesas_wdt.c
> > +++ b/drivers/watchdog/renesas_wdt.c
> > @@ -203,13 +203,29 @@ static int rwdt_remove(struct platform_device *pdev)
> >         return 0;
> >  }
> >
> > -/*
> > - * This driver does also fit for R-Car Gen2 (r8a779[0-4]) WDT. However, for SMP
> > - * to work there, one also needs a RESET (RST) driver which does not exist yet
> > - * due to HW issues. This needs to be solved before adding compatibles here.
> > - */
> > +static int __maybe_unused rwdt_suspend(struct device *dev)
> > +{
> > +       struct rwdt_priv *priv = dev_get_drvdata(dev);
> > +
> > +       if (watchdog_active(&priv->wdev))
> > +               rwdt_write(priv, priv->cks, RWTCSRA);
> > +       return 0;
> > +}
> > +
> > +static int __maybe_unused rwdt_resume(struct device *dev)
> > +{
> > +       struct rwdt_priv *priv = dev_get_drvdata(dev);
> > +
> > +       if (watchdog_active(&priv->wdev))
> > +               rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);
>
> Writing to this register is not sufficient on R-Car Gen3, where PSCI
> suspend powers down the whole SoC.  Hence all WDT register content is lost,
> causing the watchdog timeout never to trigger.
> Note that this issue is pre-existing, and not caused by your patch.
>
> This can be fixed by replacing the RWTCSRA register writes in the
> suspend/resume handlers by calls to rwdt_stop() resp. rwdt_start(), like is
> done in the BSP in commit e406980763f18f38 ("watchdog: renesas-wdt: Support
> the suspend/resume"). Note that this would cause a small change in behavior
> on R-Car Gen2, where the timeout would be reset on resume, instead of
> continuing where stopped before. I don't think that hurts, though.

I see, well I believe we can make both of us happy by addressing Gen3
problems and preserving the original behaviour  from Gen2.

I am going to send a new series to address this shortly.

>
> Since I was always a bit uncomfortable with this patch doing two things at
> once (1. suspend/resume, 2. "renesas,rcar-gen2-wdt" matching), I think it
> would be better to take the patch from the BSP first, and add support for
> "renesas,rcar-gen2-wdt" in a subsequent patch.

I agree, I'll split the patch and submit suspend/resume first, Gen2 compatibility
next.

Thanks,
Fab

>
> Does the above make sense?
> Do you agree?
>
> Thanks!
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* Re: [PATCH v6 01/26] ARM: shmobile: Add watchdog support
  2018-02-28 17:40       ` Fabrizio Castro
  (?)
@ 2018-03-13 13:43         ` Geert Uytterhoeven
  -1 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-03-13 13:43 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Simon Horman, Linux ARM, Stephen Boyd, Linux-Renesas,
	Rob Herring

Hi Fabrizio,

On Wed, Feb 28, 2018 at 6:40 PM, Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> The value contained in the SBAR registers is not initialized by a WDT
> triggered reset, which means that after a WDT triggered reset we jump
> to the SMP bring up routine, preventing the system from executing the
> bootrom code.
>
> The purpose of this patch is to jump to the bootrom code in case of a
> WDT triggered reset, and keep the SMP functionality untouched.
> In order to tell if the code had been called due to the WDT overflowing
> we are testing WOVF from register RWTCSRA.
>
> The new function shmobile_boot_vector_gen2 isn't replacing
> shmobile_boot_vector for backward compatibility reasons. The kernel
> will install the best option (either shmobile_boot_vector or
> shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> according to the amount of memory available.
>
> Since shmobile_boot_vector has become bigger, "reg" property of nodes
> compatible with "renesas,smp-sram" now need to be set to a value
> greater or equal to "<0 0x60>".
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v5->v6:
> * taken ifdefs out as per Geert's suggestion.

My intention was to remove the #ifdefs from the header file only, not
from arch/arm/mach-shmobile/headsmp.S, as the latter is used for
other SoC families, too.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v6 01/26] ARM: shmobile: Add watchdog support
@ 2018-03-13 13:43         ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-03-13 13:43 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Geert Uytterhoeven, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Simon Horman,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

Hi Fabrizio,

On Wed, Feb 28, 2018 at 6:40 PM, Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> The value contained in the SBAR registers is not initialized by a WDT
> triggered reset, which means that after a WDT triggered reset we jump
> to the SMP bring up routine, preventing the system from executing the
> bootrom code.
>
> The purpose of this patch is to jump to the bootrom code in case of a
> WDT triggered reset, and keep the SMP functionality untouched.
> In order to tell if the code had been called due to the WDT overflowing
> we are testing WOVF from register RWTCSRA.
>
> The new function shmobile_boot_vector_gen2 isn't replacing
> shmobile_boot_vector for backward compatibility reasons. The kernel
> will install the best option (either shmobile_boot_vector or
> shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> according to the amount of memory available.
>
> Since shmobile_boot_vector has become bigger, "reg" property of nodes
> compatible with "renesas,smp-sram" now need to be set to a value
> greater or equal to "<0 0x60>".
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v5->v6:
> * taken ifdefs out as per Geert's suggestion.

My intention was to remove the #ifdefs from the header file only, not
from arch/arm/mach-shmobile/headsmp.S, as the latter is used for
other SoC families, too.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH v6 01/26] ARM: shmobile: Add watchdog support
@ 2018-03-13 13:43         ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-03-13 13:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Fabrizio,

On Wed, Feb 28, 2018 at 6:40 PM, Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> The value contained in the SBAR registers is not initialized by a WDT
> triggered reset, which means that after a WDT triggered reset we jump
> to the SMP bring up routine, preventing the system from executing the
> bootrom code.
>
> The purpose of this patch is to jump to the bootrom code in case of a
> WDT triggered reset, and keep the SMP functionality untouched.
> In order to tell if the code had been called due to the WDT overflowing
> we are testing WOVF from register RWTCSRA.
>
> The new function shmobile_boot_vector_gen2 isn't replacing
> shmobile_boot_vector for backward compatibility reasons. The kernel
> will install the best option (either shmobile_boot_vector or
> shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> according to the amount of memory available.
>
> Since shmobile_boot_vector has become bigger, "reg" property of nodes
> compatible with "renesas,smp-sram" now need to be set to a value
> greater or equal to "<0 0x60>".
>
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v5->v6:
> * taken ifdefs out as per Geert's suggestion.

My intention was to remove the #ifdefs from the header file only, not
from arch/arm/mach-shmobile/headsmp.S, as the latter is used for
other SoC families, too.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
  2018-03-01 10:20               ` Geert Uytterhoeven
  (?)
@ 2018-03-13 20:05                 ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-03-13 20:05 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	Fabrizio Castro,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Rob Herring, Linux ARM, Stephen Boyd, Linux-Renesas

On Thu, Mar 01, 2018 at 11:20:11AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Fri, Feb 23, 2018 at 9:14 AM, Simon Horman <horms@verge.net.au> wrote:
> > On Thu, Feb 22, 2018 at 09:38:39AM +0100, Geert Uytterhoeven wrote:
> >> On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
> >> > On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
> >> >> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
> >> >> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
> >> >> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> >> >> >> <fabrizio.castro@bp.renesas.com> wrote:
> >> >> >> > this series has been around for some time as RFC, and it has collected
> >> >> >> > useful comments from the community along the way.
> >> >> >> > The solution proposed by this patch set works for most R-Car Gen2 and
> >> >> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
> >> >> >> > Gen2 early revisions there is no proper software fix. Anyway, no
> >> >> >> > product has been built around early revisions, but development boards
> >> >> >> > mounting early revisions (basically prototypes) are still out there.
> >> >> >> > As a result, this series isn't enabling the internal watchdog on R-Car
> >> >> >> > Gen2 boards, developers may enable it in board specific device trees
> >> >> >> > if needed.
> >> >> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> >> >> >> > and Koelsch boards.
> >> >> >> >
> >> >> >> > The problem
> >> >> >> > ===========
> >> >> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> >> >> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> >> >> >> > the non-boot CPUs they are redirected to the reset vector installed by
> >> >> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
> >> >> >> > where the SMP bring-up code will take care of the rest.
> >> >> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
> >> >> >> > and as such after the watchdog fires the boot core will try and execute
> >> >> >> > the SMP bring-up code instead of jumping to the bootrom code.
> >> >> >> >
> >> >> >> > The fix
> >> >> >> > =======
> >> >> >> > The main strategy for the solution is to let the reset vector decide
> >> >> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
> >> >> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
> >> >> >> > their values, the boot CPU will jump into the newly designed reset
> >> >> >> > vector, the assembly routine will eventually test WOVF (a bit in register
> >> >> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
> >> >> >> > of this bit gets retained in this scenario), and jump to the bootrom code
> >> >> >> > which will in turn load up the bootloader, etc.
> >> >> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
> >> >> >> > to shmobile_boot_fn instead.
> >> >> >> >
> >> >> >> > Thank you All for your help.
> >> >> >> >
> >> >> >> > Best regards,
> >> >> >> >
> >> >> >> > Fabrizio Castro (26):
> >> >> >> >   ARM: shmobile: Add watchdog support
> >> >> >> >   ARM: dts: r8a7743: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7745: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7790: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7791: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7792: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7793: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7794: Adjust SMP routine size
> >> >> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
> >> >> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
> >> >> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
> >> >> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
> >> >> >> >   watchdog: renesas_wdt: Add restart handler
> >> >> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
> >> >> >> >   clk: renesas: r8a7743: Add rwdt clock
> >> >> >> >   clk: renesas: r8a7745: Add rwdt clock
> >> >> >> >   clk: renesas: r8a7790: Add rwdt clock
> >> >> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
> >> >> >> >   clk: renesas: r8a7794: Add rwdt clock
> >> >> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> >> >> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >> >> >> >
> >> >> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
> >> >> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
> >> >> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
> >> >> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
> >> >> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
> >> >> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
> >> >> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
> >> >> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
> >> >> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
> >> >> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
> >> >> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
> >> >> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
> >> >> >>
> >> >> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
> >> >> >> a hard dependency for:
> >> >> >>   (1) The new reset vector in arch/arm/mach-shmobile/
> >> >> >>   (2) The watchdog driver.
> >> >> >>
> >> >> >> Note that the watchdog driver itself (2) has a hard dependency on the
> >> >> >> new reset vector (1).
> >> >> >
> >> >> > Thanks, I have marked the watchdog driver patch as Deferred.
> >> >> > Please resubmit or otherwise ping me once they dependencies
> >> >> > are in an rc release.
> >> >>
> >> >> I gave the dependencies a bit more thought.
> >> >>
> >> >> I think we can gain once release cycle if you would postpone the DTS patches
> >> >> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
> >> >> Then all other parts can be upstreamed in parallel in v4.17, as nothing
> >> >> will be activated before the DTS parts are in.
> >> >>
> >> >> Does this look sane?
> >> >
> >> > What about new DTS on old kernels of a specific vintage?
> >>
> >> New DTS would work fine on v4.16 and older, which don't have any of the
> >> other patches from this series.
> >> New DTS would work fine on v4.17, assumed all other patches from this
> >> series get into v4.17.
> >>
> >> The only issue would be a new DTS on a kernel that has some but not all
> >> other patches from this series.
> >
> > Thanks for the analysis. I think this is the key point. What is the risk of
> > that happening?
> 
> I think the risk is fairly low.
> You control when the DTS changes go in, and also when they are backported
> to LTSI.
> 
> >> If we want to fast-track everything into v4.17, we need a stable branch, to be
> >> pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
> >> renesas-dts).
> >
> > It seems that watchdog is the only item on that list that neither you nor I
> > sign off on. So I conclude that if the watchdog patch goes in early enough
> > in the cycle then we ought to be in good shape.
> >
> > None the less, is it worth the risk?
> 
> Do we want the functionality early, or can we wait until v4.19?

I understand that the watchdog driver has been accepted and that as things
currently stand if it is enabled in the build it will be enabled in DT and
a crash will result. From my POV that is a regression so I have decided
to adopt the alternate plan proposed by Geert above: in short drop DT
patches (to avoid enabling broken driver) and enqueue mach-shmobile
patches (which don't make things any worse.

Patch-by-patch things are as follows.

Dropped from "[PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1":

979d28f29742 ARM: dts: r8a7743: Adjust SMP routine size
0b205f679f5d ARM: dts: r8a7745: Adjust SMP routine size
2ad21a1d78b3 ARM: dts: r8a7790: Adjust SMP routine size
82c978459c77 ARM: dts: r8a7791: Adjust SMP routine size
d303698e6ff3 ARM: dts: r8a7792: Adjust SMP routine size
d8b8b9a1e295 ARM: dts: r8a7793: Adjust SMP routine size
70b3ab369773 ARM: dts: r8a7794: Adjust SMP routine size

ebf26cf1b1de ARM: dts: r8a7743: Add watchdog support to SoC dtsi
5a4566ab3777 ARM: dts: r8a7745: Add watchdog support to SoC dtsi
acd58e2bb1e5 ARM: dts: r8a7790: Add watchdog support to SoC dtsi
e3f89168e72f ARM: dts: r8a7791: Add watchdog support to SoC dtsi
e76a6a69a1fc ARM: dts: r8a7794: Add watchdog support to SoC dtsi
242cc1ab7f7c ARM: dts: iwg20m: Add watchdog support to SoM dtsi
748ed07f6c7c ARM: dts: iwg22m: Add watchdog support to SoM dtsi


Dropped from "[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog support":

c257202482e2 ARM: dts: r8a7792: Add RWDT node
01ec04dec8eb ARM: dts: r8a7793: Add RWDT node
8e6ebe4f2f94 ARM: dts: lager: Enable watchdog support
f223ad0198f6 ARM: dts: koelsch: Enable watchdog support
1d14d2bb700d ARM: dts: porter: Enable watchdog support
bf71652fc955 ARM: dts: blanche: Enable watchdog support
13a0b10aeea4 ARM: dts: wheat: Enable watchdog support
4e247bf110b8 ARM: dts: gose: Enable watchdog support
2dcbd24bbf5e ARM: dts: alt: Enable watchdog support
7f6844c900b4 ARM: dts: silk: Enable watchdog support

And applied:

[v5] ARM: shmobile: rcar-gen2: Add watchdog support
[v5] ARM: shmobile: Add watchdog support

In the case of the last patch above I removed the #ifdef from the header file.

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-03-13 20:05                 ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-03-13 20:05 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Fabrizio Castro, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

On Thu, Mar 01, 2018 at 11:20:11AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Fri, Feb 23, 2018 at 9:14 AM, Simon Horman <horms@verge.net.au> wrote:
> > On Thu, Feb 22, 2018 at 09:38:39AM +0100, Geert Uytterhoeven wrote:
> >> On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
> >> > On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
> >> >> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
> >> >> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
> >> >> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> >> >> >> <fabrizio.castro@bp.renesas.com> wrote:
> >> >> >> > this series has been around for some time as RFC, and it has collected
> >> >> >> > useful comments from the community along the way.
> >> >> >> > The solution proposed by this patch set works for most R-Car Gen2 and
> >> >> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
> >> >> >> > Gen2 early revisions there is no proper software fix. Anyway, no
> >> >> >> > product has been built around early revisions, but development boards
> >> >> >> > mounting early revisions (basically prototypes) are still out there.
> >> >> >> > As a result, this series isn't enabling the internal watchdog on R-Car
> >> >> >> > Gen2 boards, developers may enable it in board specific device trees
> >> >> >> > if needed.
> >> >> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> >> >> >> > and Koelsch boards.
> >> >> >> >
> >> >> >> > The problem
> >> >> >> > ===========
> >> >> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> >> >> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> >> >> >> > the non-boot CPUs they are redirected to the reset vector installed by
> >> >> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
> >> >> >> > where the SMP bring-up code will take care of the rest.
> >> >> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
> >> >> >> > and as such after the watchdog fires the boot core will try and execute
> >> >> >> > the SMP bring-up code instead of jumping to the bootrom code.
> >> >> >> >
> >> >> >> > The fix
> >> >> >> > =======
> >> >> >> > The main strategy for the solution is to let the reset vector decide
> >> >> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
> >> >> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
> >> >> >> > their values, the boot CPU will jump into the newly designed reset
> >> >> >> > vector, the assembly routine will eventually test WOVF (a bit in register
> >> >> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
> >> >> >> > of this bit gets retained in this scenario), and jump to the bootrom code
> >> >> >> > which will in turn load up the bootloader, etc.
> >> >> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
> >> >> >> > to shmobile_boot_fn instead.
> >> >> >> >
> >> >> >> > Thank you All for your help.
> >> >> >> >
> >> >> >> > Best regards,
> >> >> >> >
> >> >> >> > Fabrizio Castro (26):
> >> >> >> >   ARM: shmobile: Add watchdog support
> >> >> >> >   ARM: dts: r8a7743: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7745: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7790: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7791: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7792: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7793: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7794: Adjust SMP routine size
> >> >> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
> >> >> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
> >> >> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
> >> >> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
> >> >> >> >   watchdog: renesas_wdt: Add restart handler
> >> >> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
> >> >> >> >   clk: renesas: r8a7743: Add rwdt clock
> >> >> >> >   clk: renesas: r8a7745: Add rwdt clock
> >> >> >> >   clk: renesas: r8a7790: Add rwdt clock
> >> >> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
> >> >> >> >   clk: renesas: r8a7794: Add rwdt clock
> >> >> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> >> >> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >> >> >> >
> >> >> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
> >> >> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
> >> >> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
> >> >> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
> >> >> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
> >> >> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
> >> >> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
> >> >> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
> >> >> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
> >> >> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
> >> >> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
> >> >> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
> >> >> >>
> >> >> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
> >> >> >> a hard dependency for:
> >> >> >>   (1) The new reset vector in arch/arm/mach-shmobile/
> >> >> >>   (2) The watchdog driver.
> >> >> >>
> >> >> >> Note that the watchdog driver itself (2) has a hard dependency on the
> >> >> >> new reset vector (1).
> >> >> >
> >> >> > Thanks, I have marked the watchdog driver patch as Deferred.
> >> >> > Please resubmit or otherwise ping me once they dependencies
> >> >> > are in an rc release.
> >> >>
> >> >> I gave the dependencies a bit more thought.
> >> >>
> >> >> I think we can gain once release cycle if you would postpone the DTS patches
> >> >> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
> >> >> Then all other parts can be upstreamed in parallel in v4.17, as nothing
> >> >> will be activated before the DTS parts are in.
> >> >>
> >> >> Does this look sane?
> >> >
> >> > What about new DTS on old kernels of a specific vintage?
> >>
> >> New DTS would work fine on v4.16 and older, which don't have any of the
> >> other patches from this series.
> >> New DTS would work fine on v4.17, assumed all other patches from this
> >> series get into v4.17.
> >>
> >> The only issue would be a new DTS on a kernel that has some but not all
> >> other patches from this series.
> >
> > Thanks for the analysis. I think this is the key point. What is the risk of
> > that happening?
> 
> I think the risk is fairly low.
> You control when the DTS changes go in, and also when they are backported
> to LTSI.
> 
> >> If we want to fast-track everything into v4.17, we need a stable branch, to be
> >> pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
> >> renesas-dts).
> >
> > It seems that watchdog is the only item on that list that neither you nor I
> > sign off on. So I conclude that if the watchdog patch goes in early enough
> > in the cycle then we ought to be in good shape.
> >
> > None the less, is it worth the risk?
> 
> Do we want the functionality early, or can we wait until v4.19?

I understand that the watchdog driver has been accepted and that as things
currently stand if it is enabled in the build it will be enabled in DT and
a crash will result. From my POV that is a regression so I have decided
to adopt the alternate plan proposed by Geert above: in short drop DT
patches (to avoid enabling broken driver) and enqueue mach-shmobile
patches (which don't make things any worse.

Patch-by-patch things are as follows.

Dropped from "[PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1":

979d28f29742 ARM: dts: r8a7743: Adjust SMP routine size
0b205f679f5d ARM: dts: r8a7745: Adjust SMP routine size
2ad21a1d78b3 ARM: dts: r8a7790: Adjust SMP routine size
82c978459c77 ARM: dts: r8a7791: Adjust SMP routine size
d303698e6ff3 ARM: dts: r8a7792: Adjust SMP routine size
d8b8b9a1e295 ARM: dts: r8a7793: Adjust SMP routine size
70b3ab369773 ARM: dts: r8a7794: Adjust SMP routine size

ebf26cf1b1de ARM: dts: r8a7743: Add watchdog support to SoC dtsi
5a4566ab3777 ARM: dts: r8a7745: Add watchdog support to SoC dtsi
acd58e2bb1e5 ARM: dts: r8a7790: Add watchdog support to SoC dtsi
e3f89168e72f ARM: dts: r8a7791: Add watchdog support to SoC dtsi
e76a6a69a1fc ARM: dts: r8a7794: Add watchdog support to SoC dtsi
242cc1ab7f7c ARM: dts: iwg20m: Add watchdog support to SoM dtsi
748ed07f6c7c ARM: dts: iwg22m: Add watchdog support to SoM dtsi


Dropped from "[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog support":

c257202482e2 ARM: dts: r8a7792: Add RWDT node
01ec04dec8eb ARM: dts: r8a7793: Add RWDT node
8e6ebe4f2f94 ARM: dts: lager: Enable watchdog support
f223ad0198f6 ARM: dts: koelsch: Enable watchdog support
1d14d2bb700d ARM: dts: porter: Enable watchdog support
bf71652fc955 ARM: dts: blanche: Enable watchdog support
13a0b10aeea4 ARM: dts: wheat: Enable watchdog support
4e247bf110b8 ARM: dts: gose: Enable watchdog support
2dcbd24bbf5e ARM: dts: alt: Enable watchdog support
7f6844c900b4 ARM: dts: silk: Enable watchdog support

And applied:

[v5] ARM: shmobile: rcar-gen2: Add watchdog support
[v5] ARM: shmobile: Add watchdog support

In the case of the last patch above I removed the #ifdef from the header file.


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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-03-13 20:05                 ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-03-13 20:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 01, 2018 at 11:20:11AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Fri, Feb 23, 2018 at 9:14 AM, Simon Horman <horms@verge.net.au> wrote:
> > On Thu, Feb 22, 2018 at 09:38:39AM +0100, Geert Uytterhoeven wrote:
> >> On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
> >> > On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
> >> >> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
> >> >> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
> >> >> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
> >> >> >> <fabrizio.castro@bp.renesas.com> wrote:
> >> >> >> > this series has been around for some time as RFC, and it has collected
> >> >> >> > useful comments from the community along the way.
> >> >> >> > The solution proposed by this patch set works for most R-Car Gen2 and
> >> >> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
> >> >> >> > Gen2 early revisions there is no proper software fix. Anyway, no
> >> >> >> > product has been built around early revisions, but development boards
> >> >> >> > mounting early revisions (basically prototypes) are still out there.
> >> >> >> > As a result, this series isn't enabling the internal watchdog on R-Car
> >> >> >> > Gen2 boards, developers may enable it in board specific device trees
> >> >> >> > if needed.
> >> >> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
> >> >> >> > and Koelsch boards.
> >> >> >> >
> >> >> >> > The problem
> >> >> >> > ===========
> >> >> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
> >> >> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
> >> >> >> > the non-boot CPUs they are redirected to the reset vector installed by
> >> >> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
> >> >> >> > where the SMP bring-up code will take care of the rest.
> >> >> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
> >> >> >> > and as such after the watchdog fires the boot core will try and execute
> >> >> >> > the SMP bring-up code instead of jumping to the bootrom code.
> >> >> >> >
> >> >> >> > The fix
> >> >> >> > =======
> >> >> >> > The main strategy for the solution is to let the reset vector decide
> >> >> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
> >> >> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
> >> >> >> > their values, the boot CPU will jump into the newly designed reset
> >> >> >> > vector, the assembly routine will eventually test WOVF (a bit in register
> >> >> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
> >> >> >> > of this bit gets retained in this scenario), and jump to the bootrom code
> >> >> >> > which will in turn load up the bootloader, etc.
> >> >> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
> >> >> >> > to shmobile_boot_fn instead.
> >> >> >> >
> >> >> >> > Thank you All for your help.
> >> >> >> >
> >> >> >> > Best regards,
> >> >> >> >
> >> >> >> > Fabrizio Castro (26):
> >> >> >> >   ARM: shmobile: Add watchdog support
> >> >> >> >   ARM: dts: r8a7743: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7745: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7790: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7791: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7792: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7793: Adjust SMP routine size
> >> >> >> >   ARM: dts: r8a7794: Adjust SMP routine size
> >> >> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
> >> >> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
> >> >> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
> >> >> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
> >> >> >> >   watchdog: renesas_wdt: Add restart handler
> >> >> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
> >> >> >> >   clk: renesas: r8a7743: Add rwdt clock
> >> >> >> >   clk: renesas: r8a7745: Add rwdt clock
> >> >> >> >   clk: renesas: r8a7790: Add rwdt clock
> >> >> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
> >> >> >> >   clk: renesas: r8a7794: Add rwdt clock
> >> >> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> >> >> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> >> >> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >> >> >> >
> >> >> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
> >> >> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
> >> >> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
> >> >> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
> >> >> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
> >> >> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
> >> >> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
> >> >> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
> >> >> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
> >> >> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
> >> >> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
> >> >> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
> >> >> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
> >> >> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
> >> >> >>
> >> >> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
> >> >> >> a hard dependency for:
> >> >> >>   (1) The new reset vector in arch/arm/mach-shmobile/
> >> >> >>   (2) The watchdog driver.
> >> >> >>
> >> >> >> Note that the watchdog driver itself (2) has a hard dependency on the
> >> >> >> new reset vector (1).
> >> >> >
> >> >> > Thanks, I have marked the watchdog driver patch as Deferred.
> >> >> > Please resubmit or otherwise ping me once they dependencies
> >> >> > are in an rc release.
> >> >>
> >> >> I gave the dependencies a bit more thought.
> >> >>
> >> >> I think we can gain once release cycle if you would postpone the DTS patches
> >> >> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
> >> >> Then all other parts can be upstreamed in parallel in v4.17, as nothing
> >> >> will be activated before the DTS parts are in.
> >> >>
> >> >> Does this look sane?
> >> >
> >> > What about new DTS on old kernels of a specific vintage?
> >>
> >> New DTS would work fine on v4.16 and older, which don't have any of the
> >> other patches from this series.
> >> New DTS would work fine on v4.17, assumed all other patches from this
> >> series get into v4.17.
> >>
> >> The only issue would be a new DTS on a kernel that has some but not all
> >> other patches from this series.
> >
> > Thanks for the analysis. I think this is the key point. What is the risk of
> > that happening?
> 
> I think the risk is fairly low.
> You control when the DTS changes go in, and also when they are backported
> to LTSI.
> 
> >> If we want to fast-track everything into v4.17, we need a stable branch, to be
> >> pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
> >> renesas-dts).
> >
> > It seems that watchdog is the only item on that list that neither you nor I
> > sign off on. So I conclude that if the watchdog patch goes in early enough
> > in the cycle then we ought to be in good shape.
> >
> > None the less, is it worth the risk?
> 
> Do we want the functionality early, or can we wait until v4.19?

I understand that the watchdog driver has been accepted and that as things
currently stand if it is enabled in the build it will be enabled in DT and
a crash will result. From my POV that is a regression so I have decided
to adopt the alternate plan proposed by Geert above: in short drop DT
patches (to avoid enabling broken driver) and enqueue mach-shmobile
patches (which don't make things any worse.

Patch-by-patch things are as follows.

Dropped from "[PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1":

979d28f29742 ARM: dts: r8a7743: Adjust SMP routine size
0b205f679f5d ARM: dts: r8a7745: Adjust SMP routine size
2ad21a1d78b3 ARM: dts: r8a7790: Adjust SMP routine size
82c978459c77 ARM: dts: r8a7791: Adjust SMP routine size
d303698e6ff3 ARM: dts: r8a7792: Adjust SMP routine size
d8b8b9a1e295 ARM: dts: r8a7793: Adjust SMP routine size
70b3ab369773 ARM: dts: r8a7794: Adjust SMP routine size

ebf26cf1b1de ARM: dts: r8a7743: Add watchdog support to SoC dtsi
5a4566ab3777 ARM: dts: r8a7745: Add watchdog support to SoC dtsi
acd58e2bb1e5 ARM: dts: r8a7790: Add watchdog support to SoC dtsi
e3f89168e72f ARM: dts: r8a7791: Add watchdog support to SoC dtsi
e76a6a69a1fc ARM: dts: r8a7794: Add watchdog support to SoC dtsi
242cc1ab7f7c ARM: dts: iwg20m: Add watchdog support to SoM dtsi
748ed07f6c7c ARM: dts: iwg22m: Add watchdog support to SoM dtsi


Dropped from "[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog support":

c257202482e2 ARM: dts: r8a7792: Add RWDT node
01ec04dec8eb ARM: dts: r8a7793: Add RWDT node
8e6ebe4f2f94 ARM: dts: lager: Enable watchdog support
f223ad0198f6 ARM: dts: koelsch: Enable watchdog support
1d14d2bb700d ARM: dts: porter: Enable watchdog support
bf71652fc955 ARM: dts: blanche: Enable watchdog support
13a0b10aeea4 ARM: dts: wheat: Enable watchdog support
4e247bf110b8 ARM: dts: gose: Enable watchdog support
2dcbd24bbf5e ARM: dts: alt: Enable watchdog support
7f6844c900b4 ARM: dts: silk: Enable watchdog support

And applied:

[v5] ARM: shmobile: rcar-gen2: Add watchdog support
[v5] ARM: shmobile: Add watchdog support

In the case of the last patch above I removed the #ifdef from the header file.

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
  2018-03-13 20:05                 ` Simon Horman
  (?)
  (?)
@ 2018-03-14  8:17                   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-03-14  8:17 UTC (permalink / raw)
  To: Simon Horman
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	Fabrizio Castro,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Rob Herring, Linux ARM, Stephen Boyd, Linux-Renesas

Hi Simon,

On Tue, Mar 13, 2018 at 9:05 PM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Mar 01, 2018 at 11:20:11AM +0100, Geert Uytterhoeven wrote:
>> On Fri, Feb 23, 2018 at 9:14 AM, Simon Horman <horms@verge.net.au> wrote:
>> > On Thu, Feb 22, 2018 at 09:38:39AM +0100, Geert Uytterhoeven wrote:
>> >> On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
>> >> > On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
>> >> >> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
>> >> >> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
>> >> >> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
>> >> >> >> <fabrizio.castro@bp.renesas.com> wrote:
>> >> >> >> > this series has been around for some time as RFC, and it has collected
>> >> >> >> > useful comments from the community along the way.
>> >> >> >> > The solution proposed by this patch set works for most R-Car Gen2 and
>> >> >> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
>> >> >> >> > Gen2 early revisions there is no proper software fix. Anyway, no
>> >> >> >> > product has been built around early revisions, but development boards
>> >> >> >> > mounting early revisions (basically prototypes) are still out there.
>> >> >> >> > As a result, this series isn't enabling the internal watchdog on R-Car
>> >> >> >> > Gen2 boards, developers may enable it in board specific device trees
>> >> >> >> > if needed.
>> >> >> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
>> >> >> >> > and Koelsch boards.
>> >> >> >> >
>> >> >> >> > The problem
>> >> >> >> > ===========
>> >> >> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
>> >> >> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
>> >> >> >> > the non-boot CPUs they are redirected to the reset vector installed by
>> >> >> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
>> >> >> >> > where the SMP bring-up code will take care of the rest.
>> >> >> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
>> >> >> >> > and as such after the watchdog fires the boot core will try and execute
>> >> >> >> > the SMP bring-up code instead of jumping to the bootrom code.
>> >> >> >> >
>> >> >> >> > The fix
>> >> >> >> > =======
>> >> >> >> > The main strategy for the solution is to let the reset vector decide
>> >> >> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
>> >> >> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
>> >> >> >> > their values, the boot CPU will jump into the newly designed reset
>> >> >> >> > vector, the assembly routine will eventually test WOVF (a bit in register
>> >> >> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
>> >> >> >> > of this bit gets retained in this scenario), and jump to the bootrom code
>> >> >> >> > which will in turn load up the bootloader, etc.
>> >> >> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
>> >> >> >> > to shmobile_boot_fn instead.
>> >> >> >> >
>> >> >> >> > Thank you All for your help.
>> >> >> >> >
>> >> >> >> > Best regards,
>> >> >> >> >
>> >> >> >> > Fabrizio Castro (26):
>> >> >> >> >   ARM: shmobile: Add watchdog support
>> >> >> >> >   ARM: dts: r8a7743: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7745: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7790: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7791: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7792: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7793: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7794: Adjust SMP routine size
>> >> >> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>> >> >> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
>> >> >> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>> >> >> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
>> >> >> >> >   watchdog: renesas_wdt: Add restart handler
>> >> >> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>> >> >> >> >   clk: renesas: r8a7743: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7745: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7790: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7794: Add rwdt clock
>> >> >> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>> >> >> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>> >> >> >> >
>> >> >> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>> >> >> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>> >> >> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>> >> >> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>> >> >> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>> >> >> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
>> >> >> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
>> >> >> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>> >> >> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>> >> >> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>> >> >> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>> >> >> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
>> >> >> >>
>> >> >> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
>> >> >> >> a hard dependency for:
>> >> >> >>   (1) The new reset vector in arch/arm/mach-shmobile/
>> >> >> >>   (2) The watchdog driver.
>> >> >> >>
>> >> >> >> Note that the watchdog driver itself (2) has a hard dependency on the
>> >> >> >> new reset vector (1).
>> >> >> >
>> >> >> > Thanks, I have marked the watchdog driver patch as Deferred.
>> >> >> > Please resubmit or otherwise ping me once they dependencies
>> >> >> > are in an rc release.
>> >> >>
>> >> >> I gave the dependencies a bit more thought.
>> >> >>
>> >> >> I think we can gain once release cycle if you would postpone the DTS patches
>> >> >> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
>> >> >> Then all other parts can be upstreamed in parallel in v4.17, as nothing
>> >> >> will be activated before the DTS parts are in.
>> >> >>
>> >> >> Does this look sane?
>> >> >
>> >> > What about new DTS on old kernels of a specific vintage?
>> >>
>> >> New DTS would work fine on v4.16 and older, which don't have any of the
>> >> other patches from this series.
>> >> New DTS would work fine on v4.17, assumed all other patches from this
>> >> series get into v4.17.
>> >>
>> >> The only issue would be a new DTS on a kernel that has some but not all
>> >> other patches from this series.
>> >
>> > Thanks for the analysis. I think this is the key point. What is the risk of
>> > that happening?
>>
>> I think the risk is fairly low.
>> You control when the DTS changes go in, and also when they are backported
>> to LTSI.
>>
>> >> If we want to fast-track everything into v4.17, we need a stable branch, to be
>> >> pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
>> >> renesas-dts).
>> >
>> > It seems that watchdog is the only item on that list that neither you nor I
>> > sign off on. So I conclude that if the watchdog patch goes in early enough
>> > in the cycle then we ought to be in good shape.
>> >
>> > None the less, is it worth the risk?
>>
>> Do we want the functionality early, or can we wait until v4.19?
>
> I understand that the watchdog driver has been accepted and that as things
> currently stand if it is enabled in the build it will be enabled in DT and
> a crash will result. From my POV that is a regression so I have decided
> to adopt the alternate plan proposed by Geert above: in short drop DT
> patches (to avoid enabling broken driver) and enqueue mach-shmobile
> patches (which don't make things any worse.
>
> Patch-by-patch things are as follows.
>
> Dropped from "[PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1":
>
> 979d28f29742 ARM: dts: r8a7743: Adjust SMP routine size
> 0b205f679f5d ARM: dts: r8a7745: Adjust SMP routine size
> 2ad21a1d78b3 ARM: dts: r8a7790: Adjust SMP routine size
> 82c978459c77 ARM: dts: r8a7791: Adjust SMP routine size
> d303698e6ff3 ARM: dts: r8a7792: Adjust SMP routine size
> d8b8b9a1e295 ARM: dts: r8a7793: Adjust SMP routine size
> 70b3ab369773 ARM: dts: r8a7794: Adjust SMP routine size
>
> ebf26cf1b1de ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> 5a4566ab3777 ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> acd58e2bb1e5 ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> e3f89168e72f ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> e76a6a69a1fc ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> 242cc1ab7f7c ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> 748ed07f6c7c ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>
>
> Dropped from "[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog support":
>
> c257202482e2 ARM: dts: r8a7792: Add RWDT node
> 01ec04dec8eb ARM: dts: r8a7793: Add RWDT node
> 8e6ebe4f2f94 ARM: dts: lager: Enable watchdog support
> f223ad0198f6 ARM: dts: koelsch: Enable watchdog support
> 1d14d2bb700d ARM: dts: porter: Enable watchdog support
> bf71652fc955 ARM: dts: blanche: Enable watchdog support
> 13a0b10aeea4 ARM: dts: wheat: Enable watchdog support
> 4e247bf110b8 ARM: dts: gose: Enable watchdog support
> 2dcbd24bbf5e ARM: dts: alt: Enable watchdog support
> 7f6844c900b4 ARM: dts: silk: Enable watchdog support
>
> And applied:
>
> [v5] ARM: shmobile: rcar-gen2: Add watchdog support
> [v5] ARM: shmobile: Add watchdog support
>
> In the case of the last patch above I removed the #ifdef from the header file.

Thank you, sounds good to me.

BTW, who will take "dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support"?
Günter, Wim: will you take this through the watchdog tree, too?

Thanks again!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-03-14  8:17                   ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-03-14  8:17 UTC (permalink / raw)
  To: Simon Horman
  Cc: Fabrizio Castro, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

Hi Simon,

On Tue, Mar 13, 2018 at 9:05 PM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Mar 01, 2018 at 11:20:11AM +0100, Geert Uytterhoeven wrote:
>> On Fri, Feb 23, 2018 at 9:14 AM, Simon Horman <horms@verge.net.au> wrote:
>> > On Thu, Feb 22, 2018 at 09:38:39AM +0100, Geert Uytterhoeven wrote:
>> >> On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
>> >> > On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
>> >> >> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
>> >> >> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
>> >> >> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
>> >> >> >> <fabrizio.castro@bp.renesas.com> wrote:
>> >> >> >> > this series has been around for some time as RFC, and it has collected
>> >> >> >> > useful comments from the community along the way.
>> >> >> >> > The solution proposed by this patch set works for most R-Car Gen2 and
>> >> >> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
>> >> >> >> > Gen2 early revisions there is no proper software fix. Anyway, no
>> >> >> >> > product has been built around early revisions, but development boards
>> >> >> >> > mounting early revisions (basically prototypes) are still out there.
>> >> >> >> > As a result, this series isn't enabling the internal watchdog on R-Car
>> >> >> >> > Gen2 boards, developers may enable it in board specific device trees
>> >> >> >> > if needed.
>> >> >> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
>> >> >> >> > and Koelsch boards.
>> >> >> >> >
>> >> >> >> > The problem
>> >> >> >> > ===========
>> >> >> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
>> >> >> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
>> >> >> >> > the non-boot CPUs they are redirected to the reset vector installed by
>> >> >> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
>> >> >> >> > where the SMP bring-up code will take care of the rest.
>> >> >> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
>> >> >> >> > and as such after the watchdog fires the boot core will try and execute
>> >> >> >> > the SMP bring-up code instead of jumping to the bootrom code.
>> >> >> >> >
>> >> >> >> > The fix
>> >> >> >> > =======
>> >> >> >> > The main strategy for the solution is to let the reset vector decide
>> >> >> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
>> >> >> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
>> >> >> >> > their values, the boot CPU will jump into the newly designed reset
>> >> >> >> > vector, the assembly routine will eventually test WOVF (a bit in register
>> >> >> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
>> >> >> >> > of this bit gets retained in this scenario), and jump to the bootrom code
>> >> >> >> > which will in turn load up the bootloader, etc.
>> >> >> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
>> >> >> >> > to shmobile_boot_fn instead.
>> >> >> >> >
>> >> >> >> > Thank you All for your help.
>> >> >> >> >
>> >> >> >> > Best regards,
>> >> >> >> >
>> >> >> >> > Fabrizio Castro (26):
>> >> >> >> >   ARM: shmobile: Add watchdog support
>> >> >> >> >   ARM: dts: r8a7743: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7745: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7790: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7791: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7792: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7793: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7794: Adjust SMP routine size
>> >> >> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>> >> >> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
>> >> >> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>> >> >> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
>> >> >> >> >   watchdog: renesas_wdt: Add restart handler
>> >> >> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>> >> >> >> >   clk: renesas: r8a7743: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7745: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7790: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7794: Add rwdt clock
>> >> >> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>> >> >> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>> >> >> >> >
>> >> >> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>> >> >> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>> >> >> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>> >> >> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>> >> >> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>> >> >> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
>> >> >> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
>> >> >> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>> >> >> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>> >> >> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>> >> >> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>> >> >> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
>> >> >> >>
>> >> >> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
>> >> >> >> a hard dependency for:
>> >> >> >>   (1) The new reset vector in arch/arm/mach-shmobile/
>> >> >> >>   (2) The watchdog driver.
>> >> >> >>
>> >> >> >> Note that the watchdog driver itself (2) has a hard dependency on the
>> >> >> >> new reset vector (1).
>> >> >> >
>> >> >> > Thanks, I have marked the watchdog driver patch as Deferred.
>> >> >> > Please resubmit or otherwise ping me once they dependencies
>> >> >> > are in an rc release.
>> >> >>
>> >> >> I gave the dependencies a bit more thought.
>> >> >>
>> >> >> I think we can gain once release cycle if you would postpone the DTS patches
>> >> >> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
>> >> >> Then all other parts can be upstreamed in parallel in v4.17, as nothing
>> >> >> will be activated before the DTS parts are in.
>> >> >>
>> >> >> Does this look sane?
>> >> >
>> >> > What about new DTS on old kernels of a specific vintage?
>> >>
>> >> New DTS would work fine on v4.16 and older, which don't have any of the
>> >> other patches from this series.
>> >> New DTS would work fine on v4.17, assumed all other patches from this
>> >> series get into v4.17.
>> >>
>> >> The only issue would be a new DTS on a kernel that has some but not all
>> >> other patches from this series.
>> >
>> > Thanks for the analysis. I think this is the key point. What is the risk of
>> > that happening?
>>
>> I think the risk is fairly low.
>> You control when the DTS changes go in, and also when they are backported
>> to LTSI.
>>
>> >> If we want to fast-track everything into v4.17, we need a stable branch, to be
>> >> pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
>> >> renesas-dts).
>> >
>> > It seems that watchdog is the only item on that list that neither you nor I
>> > sign off on. So I conclude that if the watchdog patch goes in early enough
>> > in the cycle then we ought to be in good shape.
>> >
>> > None the less, is it worth the risk?
>>
>> Do we want the functionality early, or can we wait until v4.19?
>
> I understand that the watchdog driver has been accepted and that as things
> currently stand if it is enabled in the build it will be enabled in DT and
> a crash will result. From my POV that is a regression so I have decided
> to adopt the alternate plan proposed by Geert above: in short drop DT
> patches (to avoid enabling broken driver) and enqueue mach-shmobile
> patches (which don't make things any worse.
>
> Patch-by-patch things are as follows.
>
> Dropped from "[PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1":
>
> 979d28f29742 ARM: dts: r8a7743: Adjust SMP routine size
> 0b205f679f5d ARM: dts: r8a7745: Adjust SMP routine size
> 2ad21a1d78b3 ARM: dts: r8a7790: Adjust SMP routine size
> 82c978459c77 ARM: dts: r8a7791: Adjust SMP routine size
> d303698e6ff3 ARM: dts: r8a7792: Adjust SMP routine size
> d8b8b9a1e295 ARM: dts: r8a7793: Adjust SMP routine size
> 70b3ab369773 ARM: dts: r8a7794: Adjust SMP routine size
>
> ebf26cf1b1de ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> 5a4566ab3777 ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> acd58e2bb1e5 ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> e3f89168e72f ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> e76a6a69a1fc ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> 242cc1ab7f7c ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> 748ed07f6c7c ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>
>
> Dropped from "[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog support":
>
> c257202482e2 ARM: dts: r8a7792: Add RWDT node
> 01ec04dec8eb ARM: dts: r8a7793: Add RWDT node
> 8e6ebe4f2f94 ARM: dts: lager: Enable watchdog support
> f223ad0198f6 ARM: dts: koelsch: Enable watchdog support
> 1d14d2bb700d ARM: dts: porter: Enable watchdog support
> bf71652fc955 ARM: dts: blanche: Enable watchdog support
> 13a0b10aeea4 ARM: dts: wheat: Enable watchdog support
> 4e247bf110b8 ARM: dts: gose: Enable watchdog support
> 2dcbd24bbf5e ARM: dts: alt: Enable watchdog support
> 7f6844c900b4 ARM: dts: silk: Enable watchdog support
>
> And applied:
>
> [v5] ARM: shmobile: rcar-gen2: Add watchdog support
> [v5] ARM: shmobile: Add watchdog support
>
> In the case of the last patch above I removed the #ifdef from the header file.

Thank you, sounds good to me.

BTW, who will take "dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support"?
Günter, Wim: will you take this through the watchdog tree, too?

Thanks again!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-03-14  8:17                   ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-03-14  8:17 UTC (permalink / raw)
  To: Simon Horman
  Cc: Fabrizio Castro, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

Hi Simon,

On Tue, Mar 13, 2018 at 9:05 PM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Mar 01, 2018 at 11:20:11AM +0100, Geert Uytterhoeven wrote:
>> On Fri, Feb 23, 2018 at 9:14 AM, Simon Horman <horms@verge.net.au> wrote=
:
>> > On Thu, Feb 22, 2018 at 09:38:39AM +0100, Geert Uytterhoeven wrote:
>> >> On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wr=
ote:
>> >> > On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
>> >> >> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au>=
 wrote:
>> >> >> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wro=
te:
>> >> >> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
>> >> >> >> <fabrizio.castro@bp.renesas.com> wrote:
>> >> >> >> > this series has been around for some time as RFC, and it has =
collected
>> >> >> >> > useful comments from the community along the way.
>> >> >> >> > The solution proposed by this patch set works for most R-Car =
Gen2 and
>> >> >> >> > RZ/G1 devices, but not all of them. We now know that for some=
 R-Car
>> >> >> >> > Gen2 early revisions there is no proper software fix. Anyway,=
 no
>> >> >> >> > product has been built around early revisions, but developmen=
t boards
>> >> >> >> > mounting early revisions (basically prototypes) are still out=
 there.
>> >> >> >> > As a result, this series isn't enabling the internal watchdog=
 on R-Car
>> >> >> >> > Gen2 boards, developers may enable it in board specific devic=
e trees
>> >> >> >> > if needed.
>> >> >> >> > This series has been tested by me on the iwg20d, iwg22d, Lage=
r, Alt,
>> >> >> >> > and Koelsch boards.
>> >> >> >> >
>> >> >> >> > The problem
>> >> >> >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> >> >> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset =
vector
>> >> >> >> > to ICRAM1 and we program the [S]BAR registers so that when we=
 turn ON
>> >> >> >> > the non-boot CPUs they are redirected to the reset vector ins=
talled by
>> >> >> >> > Linux in ICRAM1, and eventually they continue the execution t=
o RAM,
>> >> >> >> > where the SMP bring-up code will take care of the rest.
>> >> >> >> > The content of the [S]BAR registers survives a watchdog trigg=
ered reset,
>> >> >> >> > and as such after the watchdog fires the boot core will try a=
nd execute
>> >> >> >> > the SMP bring-up code instead of jumping to the bootrom code.
>> >> >> >> >
>> >> >> >> > The fix
>> >> >> >> > =3D=3D=3D=3D=3D=3D=3D
>> >> >> >> > The main strategy for the solution is to let the reset vector=
 decide
>> >> >> >> > if it needs to jump to shmobile_boot_fn or to the bootrom cod=
e.
>> >> >> >> > In a watchdog triggered reset scenario, since the [S]BAR regi=
sters keep
>> >> >> >> > their values, the boot CPU will jump into the newly designed =
reset
>> >> >> >> > vector, the assembly routine will eventually test WOVF (a bit=
 in register
>> >> >> >> > RWTCSRA that indicates if the watchdog counter has overflown,=
 the value
>> >> >> >> > of this bit gets retained in this scenario), and jump to the =
bootrom code
>> >> >> >> > which will in turn load up the bootloader, etc.
>> >> >> >> > When bringing up SMP or using CPU hotplug, the reset vector w=
ill jump
>> >> >> >> > to shmobile_boot_fn instead.
>> >> >> >> >
>> >> >> >> > Thank you All for your help.
>> >> >> >> >
>> >> >> >> > Best regards,
>> >> >> >> >
>> >> >> >> > Fabrizio Castro (26):
>> >> >> >> >   ARM: shmobile: Add watchdog support
>> >> >> >> >   ARM: dts: r8a7743: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7745: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7790: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7791: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7792: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7793: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7794: Adjust SMP routine size
>> >> >> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger fo=
r Gen2
>> >> >> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
>> >> >> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>> >> >> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
>> >> >> >> >   watchdog: renesas_wdt: Add restart handler
>> >> >> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>> >> >> >> >   clk: renesas: r8a7743: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7745: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7790: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7794: Add rwdt clock
>> >> >> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>> >> >> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>> >> >> >> >
>> >> >> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++=
++--
>> >> >> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>> >> >> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++=
-
>> >> >> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>> >> >> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++=
-
>> >> >> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++=
-
>> >> >> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++=
-
>> >> >> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>> >> >> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>> >> >> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++=
-
>> >> >> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
>> >> >> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
>> >> >> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++=
++++++++++++++++++
>> >> >> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>> >> >> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++=
--
>> >> >> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 ++++=
+++++++---
>> >> >> >> >  drivers/watchdog/renesas_wdt.c                     | 39 ++++=
+++++++++--
>> >> >> >>
>> >> >> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17,=
 as they are
>> >> >> >> a hard dependency for:
>> >> >> >>   (1) The new reset vector in arch/arm/mach-shmobile/
>> >> >> >>   (2) The watchdog driver.
>> >> >> >>
>> >> >> >> Note that the watchdog driver itself (2) has a hard dependency =
on the
>> >> >> >> new reset vector (1).
>> >> >> >
>> >> >> > Thanks, I have marked the watchdog driver patch as Deferred.
>> >> >> > Please resubmit or otherwise ping me once they dependencies
>> >> >> > are in an rc release.
>> >> >>
>> >> >> I gave the dependencies a bit more thought.
>> >> >>
>> >> >> I think we can gain once release cycle if you would postpone the D=
TS patches
>> >> >> (both SMP routine size adjustments and RWDT device node additions)=
 to v4.18.
>> >> >> Then all other parts can be upstreamed in parallel in v4.17, as no=
thing
>> >> >> will be activated before the DTS parts are in.
>> >> >>
>> >> >> Does this look sane?
>> >> >
>> >> > What about new DTS on old kernels of a specific vintage?
>> >>
>> >> New DTS would work fine on v4.16 and older, which don't have any of t=
he
>> >> other patches from this series.
>> >> New DTS would work fine on v4.17, assumed all other patches from this
>> >> series get into v4.17.
>> >>
>> >> The only issue would be a new DTS on a kernel that has some but not a=
ll
>> >> other patches from this series.
>> >
>> > Thanks for the analysis. I think this is the key point. What is the ri=
sk of
>> > that happening?
>>
>> I think the risk is fairly low.
>> You control when the DTS changes go in, and also when they are backporte=
d
>> to LTSI.
>>
>> >> If we want to fast-track everything into v4.17, we need a stable bran=
ch, to be
>> >> pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watc=
hdog,
>> >> renesas-dts).
>> >
>> > It seems that watchdog is the only item on that list that neither you =
nor I
>> > sign off on. So I conclude that if the watchdog patch goes in early en=
ough
>> > in the cycle then we ought to be in good shape.
>> >
>> > None the less, is it worth the risk?
>>
>> Do we want the functionality early, or can we wait until v4.19?
>
> I understand that the watchdog driver has been accepted and that as thing=
s
> currently stand if it is enabled in the build it will be enabled in DT an=
d
> a crash will result. From my POV that is a regression so I have decided
> to adopt the alternate plan proposed by Geert above: in short drop DT
> patches (to avoid enabling broken driver) and enqueue mach-shmobile
> patches (which don't make things any worse.
>
> Patch-by-patch things are as follows.
>
> Dropped from "[PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/=
G1":
>
> 979d28f29742 ARM: dts: r8a7743: Adjust SMP routine size
> 0b205f679f5d ARM: dts: r8a7745: Adjust SMP routine size
> 2ad21a1d78b3 ARM: dts: r8a7790: Adjust SMP routine size
> 82c978459c77 ARM: dts: r8a7791: Adjust SMP routine size
> d303698e6ff3 ARM: dts: r8a7792: Adjust SMP routine size
> d8b8b9a1e295 ARM: dts: r8a7793: Adjust SMP routine size
> 70b3ab369773 ARM: dts: r8a7794: Adjust SMP routine size
>
> ebf26cf1b1de ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> 5a4566ab3777 ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> acd58e2bb1e5 ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> e3f89168e72f ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> e76a6a69a1fc ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> 242cc1ab7f7c ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> 748ed07f6c7c ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>
>
> Dropped from "[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog supp=
ort":
>
> c257202482e2 ARM: dts: r8a7792: Add RWDT node
> 01ec04dec8eb ARM: dts: r8a7793: Add RWDT node
> 8e6ebe4f2f94 ARM: dts: lager: Enable watchdog support
> f223ad0198f6 ARM: dts: koelsch: Enable watchdog support
> 1d14d2bb700d ARM: dts: porter: Enable watchdog support
> bf71652fc955 ARM: dts: blanche: Enable watchdog support
> 13a0b10aeea4 ARM: dts: wheat: Enable watchdog support
> 4e247bf110b8 ARM: dts: gose: Enable watchdog support
> 2dcbd24bbf5e ARM: dts: alt: Enable watchdog support
> 7f6844c900b4 ARM: dts: silk: Enable watchdog support
>
> And applied:
>
> [v5] ARM: shmobile: rcar-gen2: Add watchdog support
> [v5] ARM: shmobile: Add watchdog support
>
> In the case of the last patch above I removed the #ifdef from the header =
file.

Thank you, sounds good to me.

BTW, who will take "dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 supp=
ort"?
G=C3=BCnter, Wim: will you take this through the watchdog tree, too?

Thanks again!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k=
.org

In personal conversations with technical people, I call myself a hacker. Bu=
t
when I'm talking to journalists I just say "programmer" or something like t=
hat.
                                -- Linus Torvalds

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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-03-14  8:17                   ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-03-14  8:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Tue, Mar 13, 2018 at 9:05 PM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Mar 01, 2018 at 11:20:11AM +0100, Geert Uytterhoeven wrote:
>> On Fri, Feb 23, 2018 at 9:14 AM, Simon Horman <horms@verge.net.au> wrote:
>> > On Thu, Feb 22, 2018 at 09:38:39AM +0100, Geert Uytterhoeven wrote:
>> >> On Wed, Feb 21, 2018 at 7:32 PM, Simon Horman <horms@verge.net.au> wrote:
>> >> > On Wed, Feb 21, 2018 at 05:30:12PM +0100, Geert Uytterhoeven wrote:
>> >> >> On Wed, Feb 21, 2018 at 5:13 PM, Simon Horman <horms@verge.net.au> wrote:
>> >> >> > On Tue, Feb 20, 2018 at 01:51:28PM +0100, Geert Uytterhoeven wrote:
>> >> >> >> On Mon, Feb 12, 2018 at 6:44 PM, Fabrizio Castro
>> >> >> >> <fabrizio.castro@bp.renesas.com> wrote:
>> >> >> >> > this series has been around for some time as RFC, and it has collected
>> >> >> >> > useful comments from the community along the way.
>> >> >> >> > The solution proposed by this patch set works for most R-Car Gen2 and
>> >> >> >> > RZ/G1 devices, but not all of them. We now know that for some R-Car
>> >> >> >> > Gen2 early revisions there is no proper software fix. Anyway, no
>> >> >> >> > product has been built around early revisions, but development boards
>> >> >> >> > mounting early revisions (basically prototypes) are still out there.
>> >> >> >> > As a result, this series isn't enabling the internal watchdog on R-Car
>> >> >> >> > Gen2 boards, developers may enable it in board specific device trees
>> >> >> >> > if needed.
>> >> >> >> > This series has been tested by me on the iwg20d, iwg22d, Lager, Alt,
>> >> >> >> > and Koelsch boards.
>> >> >> >> >
>> >> >> >> > The problem
>> >> >> >> > ===========
>> >> >> >> > To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector
>> >> >> >> > to ICRAM1 and we program the [S]BAR registers so that when we turn ON
>> >> >> >> > the non-boot CPUs they are redirected to the reset vector installed by
>> >> >> >> > Linux in ICRAM1, and eventually they continue the execution to RAM,
>> >> >> >> > where the SMP bring-up code will take care of the rest.
>> >> >> >> > The content of the [S]BAR registers survives a watchdog triggered reset,
>> >> >> >> > and as such after the watchdog fires the boot core will try and execute
>> >> >> >> > the SMP bring-up code instead of jumping to the bootrom code.
>> >> >> >> >
>> >> >> >> > The fix
>> >> >> >> > =======
>> >> >> >> > The main strategy for the solution is to let the reset vector decide
>> >> >> >> > if it needs to jump to shmobile_boot_fn or to the bootrom code.
>> >> >> >> > In a watchdog triggered reset scenario, since the [S]BAR registers keep
>> >> >> >> > their values, the boot CPU will jump into the newly designed reset
>> >> >> >> > vector, the assembly routine will eventually test WOVF (a bit in register
>> >> >> >> > RWTCSRA that indicates if the watchdog counter has overflown, the value
>> >> >> >> > of this bit gets retained in this scenario), and jump to the bootrom code
>> >> >> >> > which will in turn load up the bootloader, etc.
>> >> >> >> > When bringing up SMP or using CPU hotplug, the reset vector will jump
>> >> >> >> > to shmobile_boot_fn instead.
>> >> >> >> >
>> >> >> >> > Thank you All for your help.
>> >> >> >> >
>> >> >> >> > Best regards,
>> >> >> >> >
>> >> >> >> > Fabrizio Castro (26):
>> >> >> >> >   ARM: shmobile: Add watchdog support
>> >> >> >> >   ARM: dts: r8a7743: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7745: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7790: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7791: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7792: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7793: Adjust SMP routine size
>> >> >> >> >   ARM: dts: r8a7794: Adjust SMP routine size
>> >> >> >> >   soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2
>> >> >> >> >   ARM: shmobile: rcar-gen2: Add watchdog support
>> >> >> >> >   dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
>> >> >> >> >   watchdog: renesas_wdt: Add R-Car Gen2 support
>> >> >> >> >   watchdog: renesas_wdt: Add restart handler
>> >> >> >> >   ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
>> >> >> >> >   clk: renesas: r8a7743: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7745: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7790: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7791/r8a7793: Add rwdt clock
>> >> >> >> >   clk: renesas: r8a7794: Add rwdt clock
>> >> >> >> >   ARM: dts: r8a7743: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7745: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7790: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7791: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: r8a7794: Add watchdog support to SoC dtsi
>> >> >> >> >   ARM: dts: iwg20m: Add watchdog support to SoM dtsi
>> >> >> >> >   ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>> >> >> >> >
>> >> >> >> >  .../devicetree/bindings/watchdog/renesas-wdt.txt   | 19 ++++++--
>> >> >> >> >  arch/arm/boot/dts/r8a7743-iwg20m.dtsi              |  5 ++
>> >> >> >> >  arch/arm/boot/dts/r8a7743.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/boot/dts/r8a7745-iwg22m.dtsi              |  5 ++
>> >> >> >> >  arch/arm/boot/dts/r8a7745.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/boot/dts/r8a7790.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/boot/dts/r8a7791.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/boot/dts/r8a7792.dtsi                     |  2 +-
>> >> >> >> >  arch/arm/boot/dts/r8a7793.dtsi                     |  2 +-
>> >> >> >> >  arch/arm/boot/dts/r8a7794.dtsi                     | 12 ++++-
>> >> >> >> >  arch/arm/configs/shmobile_defconfig                |  1 +
>> >> >> >> >  arch/arm/mach-shmobile/common.h                    |  6 +++
>> >> >> >> >  arch/arm/mach-shmobile/headsmp.S                   | 55 ++++++++++++++++++++++
>> >> >> >> >  arch/arm/mach-shmobile/platsmp-apmu.c              |  1 +
>> >> >> >> >  arch/arm/mach-shmobile/pm-rcar-gen2.c              | 15 ++++--
>> >> >> >> >  drivers/clk/renesas/r8a7743-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7745-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7790-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7791-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/clk/renesas/r8a7794-cpg-mssr.c             |  2 +
>> >> >> >> >  drivers/soc/renesas/rcar-rst.c                     | 35 +++++++++++---
>> >> >> >> >  drivers/watchdog/renesas_wdt.c                     | 39 +++++++++++++--
>> >> >> >>
>> >> >> >> Thanks, I've queued the clock patches in clk-renesas-for-v4.17, as they are
>> >> >> >> a hard dependency for:
>> >> >> >>   (1) The new reset vector in arch/arm/mach-shmobile/
>> >> >> >>   (2) The watchdog driver.
>> >> >> >>
>> >> >> >> Note that the watchdog driver itself (2) has a hard dependency on the
>> >> >> >> new reset vector (1).
>> >> >> >
>> >> >> > Thanks, I have marked the watchdog driver patch as Deferred.
>> >> >> > Please resubmit or otherwise ping me once they dependencies
>> >> >> > are in an rc release.
>> >> >>
>> >> >> I gave the dependencies a bit more thought.
>> >> >>
>> >> >> I think we can gain once release cycle if you would postpone the DTS patches
>> >> >> (both SMP routine size adjustments and RWDT device node additions) to v4.18.
>> >> >> Then all other parts can be upstreamed in parallel in v4.17, as nothing
>> >> >> will be activated before the DTS parts are in.
>> >> >>
>> >> >> Does this look sane?
>> >> >
>> >> > What about new DTS on old kernels of a specific vintage?
>> >>
>> >> New DTS would work fine on v4.16 and older, which don't have any of the
>> >> other patches from this series.
>> >> New DTS would work fine on v4.17, assumed all other patches from this
>> >> series get into v4.17.
>> >>
>> >> The only issue would be a new DTS on a kernel that has some but not all
>> >> other patches from this series.
>> >
>> > Thanks for the analysis. I think this is the key point. What is the risk of
>> > that happening?
>>
>> I think the risk is fairly low.
>> You control when the DTS changes go in, and also when they are backported
>> to LTSI.
>>
>> >> If we want to fast-track everything into v4.17, we need a stable branch, to be
>> >> pulled by all 5 actors (clk-renesas, mach-shmobile, soc-renesas, watchdog,
>> >> renesas-dts).
>> >
>> > It seems that watchdog is the only item on that list that neither you nor I
>> > sign off on. So I conclude that if the watchdog patch goes in early enough
>> > in the cycle then we ought to be in good shape.
>> >
>> > None the less, is it worth the risk?
>>
>> Do we want the functionality early, or can we wait until v4.19?
>
> I understand that the watchdog driver has been accepted and that as things
> currently stand if it is enabled in the build it will be enabled in DT and
> a crash will result. From my POV that is a regression so I have decided
> to adopt the alternate plan proposed by Geert above: in short drop DT
> patches (to avoid enabling broken driver) and enqueue mach-shmobile
> patches (which don't make things any worse.
>
> Patch-by-patch things are as follows.
>
> Dropped from "[PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1":
>
> 979d28f29742 ARM: dts: r8a7743: Adjust SMP routine size
> 0b205f679f5d ARM: dts: r8a7745: Adjust SMP routine size
> 2ad21a1d78b3 ARM: dts: r8a7790: Adjust SMP routine size
> 82c978459c77 ARM: dts: r8a7791: Adjust SMP routine size
> d303698e6ff3 ARM: dts: r8a7792: Adjust SMP routine size
> d8b8b9a1e295 ARM: dts: r8a7793: Adjust SMP routine size
> 70b3ab369773 ARM: dts: r8a7794: Adjust SMP routine size
>
> ebf26cf1b1de ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> 5a4566ab3777 ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> acd58e2bb1e5 ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> e3f89168e72f ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> e76a6a69a1fc ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> 242cc1ab7f7c ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> 748ed07f6c7c ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>
>
> Dropped from "[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog support":
>
> c257202482e2 ARM: dts: r8a7792: Add RWDT node
> 01ec04dec8eb ARM: dts: r8a7793: Add RWDT node
> 8e6ebe4f2f94 ARM: dts: lager: Enable watchdog support
> f223ad0198f6 ARM: dts: koelsch: Enable watchdog support
> 1d14d2bb700d ARM: dts: porter: Enable watchdog support
> bf71652fc955 ARM: dts: blanche: Enable watchdog support
> 13a0b10aeea4 ARM: dts: wheat: Enable watchdog support
> 4e247bf110b8 ARM: dts: gose: Enable watchdog support
> 2dcbd24bbf5e ARM: dts: alt: Enable watchdog support
> 7f6844c900b4 ARM: dts: silk: Enable watchdog support
>
> And applied:
>
> [v5] ARM: shmobile: rcar-gen2: Add watchdog support
> [v5] ARM: shmobile: Add watchdog support
>
> In the case of the last patch above I removed the #ifdef from the header file.

Thank you, sounds good to me.

BTW, who will take "dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support"?
G?nter, Wim: will you take this through the watchdog tree, too?

Thanks again!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* RE: [PATCH v6 01/26] ARM: shmobile: Add watchdog support
  2018-03-13 13:43         ` Geert Uytterhoeven
  (?)
  (?)
@ 2018-03-14 11:02           ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-03-14 11:02 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Simon Horman, Linux ARM, Stephen Boyd, Linux-Renesas,
	Rob Herring

Hi Geert,

> Subject: Re: [PATCH v6 01/26] ARM: shmobile: Add watchdog support
>
> Hi Fabrizio,
>
> On Wed, Feb 28, 2018 at 6:40 PM, Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> > boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> > The value contained in the SBAR registers is not initialized by a WDT
> > triggered reset, which means that after a WDT triggered reset we jump
> > to the SMP bring up routine, preventing the system from executing the
> > bootrom code.
> >
> > The purpose of this patch is to jump to the bootrom code in case of a
> > WDT triggered reset, and keep the SMP functionality untouched.
> > In order to tell if the code had been called due to the WDT overflowing
> > we are testing WOVF from register RWTCSRA.
> >
> > The new function shmobile_boot_vector_gen2 isn't replacing
> > shmobile_boot_vector for backward compatibility reasons. The kernel
> > will install the best option (either shmobile_boot_vector or
> > shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> > according to the amount of memory available.
> >
> > Since shmobile_boot_vector has become bigger, "reg" property of nodes
> > compatible with "renesas,smp-sram" now need to be set to a value
> > greater or equal to "<0 0x60>".
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > v5->v6:
> > * taken ifdefs out as per Geert's suggestion.
>
> My intention was to remove the #ifdefs from the header file only, not
> from arch/arm/mach-shmobile/headsmp.S, as the latter is used for
> other SoC families, too.

Ah ok, I'll send another version to restore the ifdef within headsmp.S then.

Thanks,
Fab

>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* RE: [PATCH v6 01/26] ARM: shmobile: Add watchdog support
@ 2018-03-14 11:02           ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-03-14 11:02 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Geert Uytterhoeven, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Simon Horman,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

Hi Geert,

> Subject: Re: [PATCH v6 01/26] ARM: shmobile: Add watchdog support
>
> Hi Fabrizio,
>
> On Wed, Feb 28, 2018 at 6:40 PM, Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> > boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> > The value contained in the SBAR registers is not initialized by a WDT
> > triggered reset, which means that after a WDT triggered reset we jump
> > to the SMP bring up routine, preventing the system from executing the
> > bootrom code.
> >
> > The purpose of this patch is to jump to the bootrom code in case of a
> > WDT triggered reset, and keep the SMP functionality untouched.
> > In order to tell if the code had been called due to the WDT overflowing
> > we are testing WOVF from register RWTCSRA.
> >
> > The new function shmobile_boot_vector_gen2 isn't replacing
> > shmobile_boot_vector for backward compatibility reasons. The kernel
> > will install the best option (either shmobile_boot_vector or
> > shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> > according to the amount of memory available.
> >
> > Since shmobile_boot_vector has become bigger, "reg" property of nodes
> > compatible with "renesas,smp-sram" now need to be set to a value
> > greater or equal to "<0 0x60>".
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > v5->v6:
> > * taken ifdefs out as per Geert's suggestion.
>
> My intention was to remove the #ifdefs from the header file only, not
> from arch/arm/mach-shmobile/headsmp.S, as the latter is used for
> other SoC families, too.

Ah ok, I'll send another version to restore the ifdef within headsmp.S then.

Thanks,
Fab

>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* RE: [PATCH v6 01/26] ARM: shmobile: Add watchdog support
@ 2018-03-14 11:02           ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-03-14 11:02 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Geert Uytterhoeven, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Simon Horman,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

SGkgR2VlcnQsDQoNCj4gU3ViamVjdDogUmU6IFtQQVRDSCB2NiAwMS8yNl0gQVJNOiBzaG1vYmls
ZTogQWRkIHdhdGNoZG9nIHN1cHBvcnQNCj4NCj4gSGkgRmFicml6aW8sDQo+DQo+IE9uIFdlZCwg
RmViIDI4LCAyMDE4IGF0IDY6NDAgUE0sIEZhYnJpemlvIENhc3Rybw0KPiA8ZmFicml6aW8uY2Fz
dHJvQGJwLnJlbmVzYXMuY29tPiB3cm90ZToNCj4gPiBPbiBSLUNhciBHZW4yIGFuZCBSWi9HMSBw
bGF0Zm9ybXMsIHdlIHVzZSB0aGUgU0JBUiByZWdpc3RlcnMgdG8gbWFrZSBub24NCj4gPiBib290
IENQVXMgcnVuIGEgcm91dGluZSBkZXNpZ25lZCB0byBicmluZyB1cCBTTVAgYW5kIGRlYWwgd2l0
aCBob3QgcGx1Zy4NCj4gPiBUaGUgdmFsdWUgY29udGFpbmVkIGluIHRoZSBTQkFSIHJlZ2lzdGVy
cyBpcyBub3QgaW5pdGlhbGl6ZWQgYnkgYSBXRFQNCj4gPiB0cmlnZ2VyZWQgcmVzZXQsIHdoaWNo
IG1lYW5zIHRoYXQgYWZ0ZXIgYSBXRFQgdHJpZ2dlcmVkIHJlc2V0IHdlIGp1bXANCj4gPiB0byB0
aGUgU01QIGJyaW5nIHVwIHJvdXRpbmUsIHByZXZlbnRpbmcgdGhlIHN5c3RlbSBmcm9tIGV4ZWN1
dGluZyB0aGUNCj4gPiBib290cm9tIGNvZGUuDQo+ID4NCj4gPiBUaGUgcHVycG9zZSBvZiB0aGlz
IHBhdGNoIGlzIHRvIGp1bXAgdG8gdGhlIGJvb3Ryb20gY29kZSBpbiBjYXNlIG9mIGENCj4gPiBX
RFQgdHJpZ2dlcmVkIHJlc2V0LCBhbmQga2VlcCB0aGUgU01QIGZ1bmN0aW9uYWxpdHkgdW50b3Vj
aGVkLg0KPiA+IEluIG9yZGVyIHRvIHRlbGwgaWYgdGhlIGNvZGUgaGFkIGJlZW4gY2FsbGVkIGR1
ZSB0byB0aGUgV0RUIG92ZXJmbG93aW5nDQo+ID4gd2UgYXJlIHRlc3RpbmcgV09WRiBmcm9tIHJl
Z2lzdGVyIFJXVENTUkEuDQo+ID4NCj4gPiBUaGUgbmV3IGZ1bmN0aW9uIHNobW9iaWxlX2Jvb3Rf
dmVjdG9yX2dlbjIgaXNuJ3QgcmVwbGFjaW5nDQo+ID4gc2htb2JpbGVfYm9vdF92ZWN0b3IgZm9y
IGJhY2t3YXJkIGNvbXBhdGliaWxpdHkgcmVhc29ucy4gVGhlIGtlcm5lbA0KPiA+IHdpbGwgaW5z
dGFsbCB0aGUgYmVzdCBvcHRpb24gKGVpdGhlciBzaG1vYmlsZV9ib290X3ZlY3RvciBvcg0KPiA+
IHNobW9iaWxlX2Jvb3RfdmVjdG9yX2dlbjIpIHRvIElDUkFNMSBhZnRlciBwYXJzaW5nIHRoZSBk
ZXZpY2UgdHJlZSwNCj4gPiBhY2NvcmRpbmcgdG8gdGhlIGFtb3VudCBvZiBtZW1vcnkgYXZhaWxh
YmxlLg0KPiA+DQo+ID4gU2luY2Ugc2htb2JpbGVfYm9vdF92ZWN0b3IgaGFzIGJlY29tZSBiaWdn
ZXIsICJyZWciIHByb3BlcnR5IG9mIG5vZGVzDQo+ID4gY29tcGF0aWJsZSB3aXRoICJyZW5lc2Fz
LHNtcC1zcmFtIiBub3cgbmVlZCB0byBiZSBzZXQgdG8gYSB2YWx1ZQ0KPiA+IGdyZWF0ZXIgb3Ig
ZXF1YWwgdG8gIjwwIDB4NjA+Ii4NCj4gPg0KPiA+IFNpZ25lZC1vZmYtYnk6IEZhYnJpemlvIENh
c3RybyA8ZmFicml6aW8uY2FzdHJvQGJwLnJlbmVzYXMuY29tPg0KPiA+IFNpZ25lZC1vZmYtYnk6
IFJhbWVzaCBTaGFubXVnYXN1bmRhcmFtIDxyYW1lc2guc2hhbm11Z2FzdW5kYXJhbUBicC5yZW5l
c2FzLmNvbT4NCj4gPiBSZXZpZXdlZC1ieTogR2VlcnQgVXl0dGVyaG9ldmVuIDxnZWVydCtyZW5l
c2FzQGdsaWRlci5iZT4NCj4gPiAtLS0NCj4gPiB2NS0+djY6DQo+ID4gKiB0YWtlbiBpZmRlZnMg
b3V0IGFzIHBlciBHZWVydCdzIHN1Z2dlc3Rpb24uDQo+DQo+IE15IGludGVudGlvbiB3YXMgdG8g
cmVtb3ZlIHRoZSAjaWZkZWZzIGZyb20gdGhlIGhlYWRlciBmaWxlIG9ubHksIG5vdA0KPiBmcm9t
IGFyY2gvYXJtL21hY2gtc2htb2JpbGUvaGVhZHNtcC5TLCBhcyB0aGUgbGF0dGVyIGlzIHVzZWQg
Zm9yDQo+IG90aGVyIFNvQyBmYW1pbGllcywgdG9vLg0KDQpBaCBvaywgSSdsbCBzZW5kIGFub3Ro
ZXIgdmVyc2lvbiB0byByZXN0b3JlIHRoZSBpZmRlZiB3aXRoaW4gaGVhZHNtcC5TIHRoZW4uDQoN
ClRoYW5rcywNCkZhYg0KDQo+DQo+IEdye29ldGplLGVldGluZ31zLA0KPg0KPiAgICAgICAgICAg
ICAgICAgICAgICAgICBHZWVydA0KPg0KPiAtLQ0KPiBHZWVydCBVeXR0ZXJob2V2ZW4gLS0gVGhl
cmUncyBsb3RzIG9mIExpbnV4IGJleW9uZCBpYTMyIC0tIGdlZXJ0QGxpbnV4LW02OGsub3JnDQo+
DQo+IEluIHBlcnNvbmFsIGNvbnZlcnNhdGlvbnMgd2l0aCB0ZWNobmljYWwgcGVvcGxlLCBJIGNh
bGwgbXlzZWxmIGEgaGFja2VyLiBCdXQNCj4gd2hlbiBJJ20gdGFsa2luZyB0byBqb3VybmFsaXN0
cyBJIGp1c3Qgc2F5ICJwcm9ncmFtbWVyIiBvciBzb21ldGhpbmcgbGlrZSB0aGF0Lg0KPiAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0tIExpbnVzIFRvcnZhbGRzDQoNCg0KDQpSZW5l
c2FzIEVsZWN0cm9uaWNzIEV1cm9wZSBMdGQsIER1a2VzIE1lYWRvdywgTWlsbGJvYXJkIFJvYWQs
IEJvdXJuZSBFbmQsIEJ1Y2tpbmdoYW1zaGlyZSwgU0w4IDVGSCwgVUsuIFJlZ2lzdGVyZWQgaW4g
RW5nbGFuZCAmIFdhbGVzIHVuZGVyIFJlZ2lzdGVyZWQgTm8uIDA0NTg2NzA5Lg0K

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

* [PATCH v6 01/26] ARM: shmobile: Add watchdog support
@ 2018-03-14 11:02           ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-03-14 11:02 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Geert,

> Subject: Re: [PATCH v6 01/26] ARM: shmobile: Add watchdog support
>
> Hi Fabrizio,
>
> On Wed, Feb 28, 2018 at 6:40 PM, Fabrizio Castro
> <fabrizio.castro@bp.renesas.com> wrote:
> > On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> > boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> > The value contained in the SBAR registers is not initialized by a WDT
> > triggered reset, which means that after a WDT triggered reset we jump
> > to the SMP bring up routine, preventing the system from executing the
> > bootrom code.
> >
> > The purpose of this patch is to jump to the bootrom code in case of a
> > WDT triggered reset, and keep the SMP functionality untouched.
> > In order to tell if the code had been called due to the WDT overflowing
> > we are testing WOVF from register RWTCSRA.
> >
> > The new function shmobile_boot_vector_gen2 isn't replacing
> > shmobile_boot_vector for backward compatibility reasons. The kernel
> > will install the best option (either shmobile_boot_vector or
> > shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> > according to the amount of memory available.
> >
> > Since shmobile_boot_vector has become bigger, "reg" property of nodes
> > compatible with "renesas,smp-sram" now need to be set to a value
> > greater or equal to "<0 0x60>".
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > v5->v6:
> > * taken ifdefs out as per Geert's suggestion.
>
> My intention was to remove the #ifdefs from the header file only, not
> from arch/arm/mach-shmobile/headsmp.S, as the latter is used for
> other SoC families, too.

Ah ok, I'll send another version to restore the ifdef within headsmp.S then.

Thanks,
Fab

>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* [PATCH v7] ARM: shmobile: Add watchdog support
  2018-03-13 13:43         ` Geert Uytterhoeven
@ 2018-03-14 11:13           ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-03-14 11:13 UTC (permalink / raw)
  To: Geert Uytterhoeven, Simon Horman, Russell King
  Cc: Fabrizio Castro, Magnus Damm, linux-arm-kernel,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram

On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
boot CPUs run a routine designed to bring up SMP and deal with hot plug.
The value contained in the SBAR registers is not initialized by a WDT
triggered reset, which means that after a WDT triggered reset we jump
to the SMP bring up routine, preventing the system from executing the
bootrom code.

The purpose of this patch is to jump to the bootrom code in case of a
WDT triggered reset, and keep the SMP functionality untouched.
In order to tell if the code had been called due to the WDT overflowing
we are testing WOVF from register RWTCSRA.

The new function shmobile_boot_vector_gen2 isn't replacing
shmobile_boot_vector for backward compatibility reasons. The kernel
will install the best option (either shmobile_boot_vector or
shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
according to the amount of memory available.

Since shmobile_boot_vector has become bigger, "reg" property of nodes
compatible with "renesas,smp-sram" now need to be set to a value
greater or equal to "<0 0x60>".

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v6->v7:
* restored ifdef within arch/arm/mach-shmobile/headsmp.S

 arch/arm/mach-shmobile/common.h  |  4 +++
 arch/arm/mach-shmobile/headsmp.S | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index a8fa4f7..43c1ac69 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -7,6 +7,10 @@ extern void shmobile_init_delay(void);
 extern void shmobile_boot_vector(void);
 extern unsigned long shmobile_boot_fn;
 extern unsigned long shmobile_boot_size;
+extern void shmobile_boot_vector_gen2(void);
+extern unsigned long shmobile_boot_fn_gen2;
+extern unsigned long shmobile_boot_cpu_gen2;
+extern unsigned long shmobile_boot_size_gen2;
 extern void shmobile_smp_boot(void);
 extern void shmobile_smp_sleep(void);
 extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 32e0bf6..cef8e8c 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -16,6 +16,11 @@
 #include <asm/assembler.h>
 #include <asm/memory.h>
 
+#define SCTLR_MMU	0x01
+#define BOOTROM_ADDRESS	0xE6340000
+#define RWTCSRA_ADDRESS	0xE6020004
+#define RWTCSRA_WOVF	0x10
+
 /*
  * Reset vector for secondary CPUs.
  * This will be mapped at address 0 by SBAR register.
@@ -37,6 +42,56 @@ shmobile_boot_fn:
 shmobile_boot_size:
 	.long	. - shmobile_boot_vector
 
+#ifdef CONFIG_ARCH_RCAR_GEN2
+/*
+ * Reset vector for R-Car Gen2 and RZ/G1 secondary CPUs.
+ * This will be mapped at address 0 by SBAR register.
+ */
+ENTRY(shmobile_boot_vector_gen2)
+	mrc	p15, 0, r0, c0, c0, 5		@ r0 = MPIDR
+	ldr	r1, shmobile_boot_cpu_gen2
+	cmp	r0, r1
+	bne	shmobile_smp_continue_gen2
+
+	mrc	p15, 0, r1, c1, c0, 0		@ r1 = SCTLR
+	and	r0, r1, #SCTLR_MMU
+	cmp	r0, #SCTLR_MMU
+	beq	shmobile_smp_continue_gen2
+
+	ldr	r0, rwtcsra
+	mov	r1, #0
+	ldrb	r1, [r0]
+	and	r0, r1, #RWTCSRA_WOVF
+	cmp	r0, #RWTCSRA_WOVF
+	bne	shmobile_smp_continue_gen2
+
+	ldr	r0, bootrom
+	bx	r0
+
+shmobile_smp_continue_gen2:
+	ldr     r1, shmobile_boot_fn_gen2
+	bx	r1
+
+ENDPROC(shmobile_boot_vector_gen2)
+
+	.align	4
+rwtcsra:
+	.word	RWTCSRA_ADDRESS
+bootrom:
+	.word	BOOTROM_ADDRESS
+	.globl	shmobile_boot_cpu_gen2
+shmobile_boot_cpu_gen2:
+	.word	0x00000000
+
+	.align	2
+	.globl	shmobile_boot_fn_gen2
+shmobile_boot_fn_gen2:
+	.space	4
+	.globl	shmobile_boot_size_gen2
+shmobile_boot_size_gen2:
+	.long	. - shmobile_boot_vector_gen2
+#endif /* CONFIG_ARCH_RCAR_GEN2 */
+
 /*
  * Per-CPU SMP boot function/argument selection code based on MPIDR
  */
-- 
2.7.4

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

* [PATCH v7] ARM: shmobile: Add watchdog support
@ 2018-03-14 11:13           ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-03-14 11:13 UTC (permalink / raw)
  To: linux-arm-kernel

On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
boot CPUs run a routine designed to bring up SMP and deal with hot plug.
The value contained in the SBAR registers is not initialized by a WDT
triggered reset, which means that after a WDT triggered reset we jump
to the SMP bring up routine, preventing the system from executing the
bootrom code.

The purpose of this patch is to jump to the bootrom code in case of a
WDT triggered reset, and keep the SMP functionality untouched.
In order to tell if the code had been called due to the WDT overflowing
we are testing WOVF from register RWTCSRA.

The new function shmobile_boot_vector_gen2 isn't replacing
shmobile_boot_vector for backward compatibility reasons. The kernel
will install the best option (either shmobile_boot_vector or
shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
according to the amount of memory available.

Since shmobile_boot_vector has become bigger, "reg" property of nodes
compatible with "renesas,smp-sram" now need to be set to a value
greater or equal to "<0 0x60>".

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v6->v7:
* restored ifdef within arch/arm/mach-shmobile/headsmp.S

 arch/arm/mach-shmobile/common.h  |  4 +++
 arch/arm/mach-shmobile/headsmp.S | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index a8fa4f7..43c1ac69 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -7,6 +7,10 @@ extern void shmobile_init_delay(void);
 extern void shmobile_boot_vector(void);
 extern unsigned long shmobile_boot_fn;
 extern unsigned long shmobile_boot_size;
+extern void shmobile_boot_vector_gen2(void);
+extern unsigned long shmobile_boot_fn_gen2;
+extern unsigned long shmobile_boot_cpu_gen2;
+extern unsigned long shmobile_boot_size_gen2;
 extern void shmobile_smp_boot(void);
 extern void shmobile_smp_sleep(void);
 extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 32e0bf6..cef8e8c 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -16,6 +16,11 @@
 #include <asm/assembler.h>
 #include <asm/memory.h>
 
+#define SCTLR_MMU	0x01
+#define BOOTROM_ADDRESS	0xE6340000
+#define RWTCSRA_ADDRESS	0xE6020004
+#define RWTCSRA_WOVF	0x10
+
 /*
  * Reset vector for secondary CPUs.
  * This will be mapped at address 0 by SBAR register.
@@ -37,6 +42,56 @@ shmobile_boot_fn:
 shmobile_boot_size:
 	.long	. - shmobile_boot_vector
 
+#ifdef CONFIG_ARCH_RCAR_GEN2
+/*
+ * Reset vector for R-Car Gen2 and RZ/G1 secondary CPUs.
+ * This will be mapped at address 0 by SBAR register.
+ */
+ENTRY(shmobile_boot_vector_gen2)
+	mrc	p15, 0, r0, c0, c0, 5		@ r0 = MPIDR
+	ldr	r1, shmobile_boot_cpu_gen2
+	cmp	r0, r1
+	bne	shmobile_smp_continue_gen2
+
+	mrc	p15, 0, r1, c1, c0, 0		@ r1 = SCTLR
+	and	r0, r1, #SCTLR_MMU
+	cmp	r0, #SCTLR_MMU
+	beq	shmobile_smp_continue_gen2
+
+	ldr	r0, rwtcsra
+	mov	r1, #0
+	ldrb	r1, [r0]
+	and	r0, r1, #RWTCSRA_WOVF
+	cmp	r0, #RWTCSRA_WOVF
+	bne	shmobile_smp_continue_gen2
+
+	ldr	r0, bootrom
+	bx	r0
+
+shmobile_smp_continue_gen2:
+	ldr     r1, shmobile_boot_fn_gen2
+	bx	r1
+
+ENDPROC(shmobile_boot_vector_gen2)
+
+	.align	4
+rwtcsra:
+	.word	RWTCSRA_ADDRESS
+bootrom:
+	.word	BOOTROM_ADDRESS
+	.globl	shmobile_boot_cpu_gen2
+shmobile_boot_cpu_gen2:
+	.word	0x00000000
+
+	.align	2
+	.globl	shmobile_boot_fn_gen2
+shmobile_boot_fn_gen2:
+	.space	4
+	.globl	shmobile_boot_size_gen2
+shmobile_boot_size_gen2:
+	.long	. - shmobile_boot_vector_gen2
+#endif /* CONFIG_ARCH_RCAR_GEN2 */
+
 /*
  * Per-CPU SMP boot function/argument selection code based on MPIDR
  */
-- 
2.7.4

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

* Re: [PATCH v7] ARM: shmobile: Add watchdog support
  2018-03-14 11:13           ` Fabrizio Castro
@ 2018-03-14 12:43             ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-03-14 12:43 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Geert Uytterhoeven, Russell King, Magnus Damm, linux-arm-kernel,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram

On Wed, Mar 14, 2018 at 11:13:53AM +0000, Fabrizio Castro wrote:
> On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> The value contained in the SBAR registers is not initialized by a WDT
> triggered reset, which means that after a WDT triggered reset we jump
> to the SMP bring up routine, preventing the system from executing the
> bootrom code.
> 
> The purpose of this patch is to jump to the bootrom code in case of a
> WDT triggered reset, and keep the SMP functionality untouched.
> In order to tell if the code had been called due to the WDT overflowing
> we are testing WOVF from register RWTCSRA.
> 
> The new function shmobile_boot_vector_gen2 isn't replacing
> shmobile_boot_vector for backward compatibility reasons. The kernel
> will install the best option (either shmobile_boot_vector or
> shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> according to the amount of memory available.
> 
> Since shmobile_boot_vector has become bigger, "reg" property of nodes
> compatible with "renesas,smp-sram" now need to be set to a value
> greater or equal to "<0 0x60>".
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v6->v7:
> * restored ifdef within arch/arm/mach-shmobile/headsmp.S

Thanks. I believe that this is the same as the hand modified
version of v5 that I applied yesterday.

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

* [PATCH v7] ARM: shmobile: Add watchdog support
@ 2018-03-14 12:43             ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-03-14 12:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 14, 2018 at 11:13:53AM +0000, Fabrizio Castro wrote:
> On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> The value contained in the SBAR registers is not initialized by a WDT
> triggered reset, which means that after a WDT triggered reset we jump
> to the SMP bring up routine, preventing the system from executing the
> bootrom code.
> 
> The purpose of this patch is to jump to the bootrom code in case of a
> WDT triggered reset, and keep the SMP functionality untouched.
> In order to tell if the code had been called due to the WDT overflowing
> we are testing WOVF from register RWTCSRA.
> 
> The new function shmobile_boot_vector_gen2 isn't replacing
> shmobile_boot_vector for backward compatibility reasons. The kernel
> will install the best option (either shmobile_boot_vector or
> shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> according to the amount of memory available.
> 
> Since shmobile_boot_vector has become bigger, "reg" property of nodes
> compatible with "renesas,smp-sram" now need to be set to a value
> greater or equal to "<0 0x60>".
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v6->v7:
> * restored ifdef within arch/arm/mach-shmobile/headsmp.S

Thanks. I believe that this is the same as the hand modified
version of v5 that I applied yesterday.

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

* RE: [PATCH v7] ARM: shmobile: Add watchdog support
  2018-03-14 12:43             ` Simon Horman
@ 2018-03-14 13:26               ` Fabrizio Castro
  -1 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-03-14 13:26 UTC (permalink / raw)
  To: Simon Horman
  Cc: Geert Uytterhoeven, Russell King, Magnus Damm, linux-arm-kernel,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram

Hello Simon,

> Subject: Re: [PATCH v7] ARM: shmobile: Add watchdog support
>
> On Wed, Mar 14, 2018 at 11:13:53AM +0000, Fabrizio Castro wrote:
> > On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> > boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> > The value contained in the SBAR registers is not initialized by a WDT
> > triggered reset, which means that after a WDT triggered reset we jump
> > to the SMP bring up routine, preventing the system from executing the
> > bootrom code.
> >
> > The purpose of this patch is to jump to the bootrom code in case of a
> > WDT triggered reset, and keep the SMP functionality untouched.
> > In order to tell if the code had been called due to the WDT overflowing
> > we are testing WOVF from register RWTCSRA.
> >
> > The new function shmobile_boot_vector_gen2 isn't replacing
> > shmobile_boot_vector for backward compatibility reasons. The kernel
> > will install the best option (either shmobile_boot_vector or
> > shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> > according to the amount of memory available.
> >
> > Since shmobile_boot_vector has become bigger, "reg" property of nodes
> > compatible with "renesas,smp-sram" now need to be set to a value
> > greater or equal to "<0 0x60>".
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > v6->v7:
> > * restored ifdef within arch/arm/mach-shmobile/headsmp.S
>
> Thanks. I believe that this is the same as the hand modified
> version of v5 that I applied yesterday.

yes, I believe v5 modified and applied by you is the same as v7.
Thank you for taking the patch.

Fab



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* [PATCH v7] ARM: shmobile: Add watchdog support
@ 2018-03-14 13:26               ` Fabrizio Castro
  0 siblings, 0 replies; 177+ messages in thread
From: Fabrizio Castro @ 2018-03-14 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Simon,

> Subject: Re: [PATCH v7] ARM: shmobile: Add watchdog support
>
> On Wed, Mar 14, 2018 at 11:13:53AM +0000, Fabrizio Castro wrote:
> > On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> > boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> > The value contained in the SBAR registers is not initialized by a WDT
> > triggered reset, which means that after a WDT triggered reset we jump
> > to the SMP bring up routine, preventing the system from executing the
> > bootrom code.
> >
> > The purpose of this patch is to jump to the bootrom code in case of a
> > WDT triggered reset, and keep the SMP functionality untouched.
> > In order to tell if the code had been called due to the WDT overflowing
> > we are testing WOVF from register RWTCSRA.
> >
> > The new function shmobile_boot_vector_gen2 isn't replacing
> > shmobile_boot_vector for backward compatibility reasons. The kernel
> > will install the best option (either shmobile_boot_vector or
> > shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> > according to the amount of memory available.
> >
> > Since shmobile_boot_vector has become bigger, "reg" property of nodes
> > compatible with "renesas,smp-sram" now need to be set to a value
> > greater or equal to "<0 0x60>".
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > v6->v7:
> > * restored ifdef within arch/arm/mach-shmobile/headsmp.S
>
> Thanks. I believe that this is the same as the hand modified
> version of v5 that I applied yesterday.

yes, I believe v5 modified and applied by you is the same as v7.
Thank you for taking the patch.

Fab



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

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

* Re: [PATCH v7] ARM: shmobile: Add watchdog support
  2018-03-14 13:26               ` Fabrizio Castro
@ 2018-03-16 11:49                 ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-03-16 11:49 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Geert Uytterhoeven, Russell King, Magnus Damm, linux-arm-kernel,
	linux-renesas-soc, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram

On Wed, Mar 14, 2018 at 01:26:52PM +0000, Fabrizio Castro wrote:
> Hello Simon,
> 
> > Subject: Re: [PATCH v7] ARM: shmobile: Add watchdog support
> >
> > On Wed, Mar 14, 2018 at 11:13:53AM +0000, Fabrizio Castro wrote:
> > > On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> > > boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> > > The value contained in the SBAR registers is not initialized by a WDT
> > > triggered reset, which means that after a WDT triggered reset we jump
> > > to the SMP bring up routine, preventing the system from executing the
> > > bootrom code.
> > >
> > > The purpose of this patch is to jump to the bootrom code in case of a
> > > WDT triggered reset, and keep the SMP functionality untouched.
> > > In order to tell if the code had been called due to the WDT overflowing
> > > we are testing WOVF from register RWTCSRA.
> > >
> > > The new function shmobile_boot_vector_gen2 isn't replacing
> > > shmobile_boot_vector for backward compatibility reasons. The kernel
> > > will install the best option (either shmobile_boot_vector or
> > > shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> > > according to the amount of memory available.
> > >
> > > Since shmobile_boot_vector has become bigger, "reg" property of nodes
> > > compatible with "renesas,smp-sram" now need to be set to a value
> > > greater or equal to "<0 0x60>".
> > >
> > > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> > > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > ---
> > > v6->v7:
> > > * restored ifdef within arch/arm/mach-shmobile/headsmp.S
> >
> > Thanks. I believe that this is the same as the hand modified
> > version of v5 that I applied yesterday.
> 
> yes, I believe v5 modified and applied by you is the same as v7.
> Thank you for taking the patch.

Likewise, thanks for the patches and for confirming this one is correct.

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

* [PATCH v7] ARM: shmobile: Add watchdog support
@ 2018-03-16 11:49                 ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-03-16 11:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 14, 2018 at 01:26:52PM +0000, Fabrizio Castro wrote:
> Hello Simon,
> 
> > Subject: Re: [PATCH v7] ARM: shmobile: Add watchdog support
> >
> > On Wed, Mar 14, 2018 at 11:13:53AM +0000, Fabrizio Castro wrote:
> > > On R-Car Gen2 and RZ/G1 platforms, we use the SBAR registers to make non
> > > boot CPUs run a routine designed to bring up SMP and deal with hot plug.
> > > The value contained in the SBAR registers is not initialized by a WDT
> > > triggered reset, which means that after a WDT triggered reset we jump
> > > to the SMP bring up routine, preventing the system from executing the
> > > bootrom code.
> > >
> > > The purpose of this patch is to jump to the bootrom code in case of a
> > > WDT triggered reset, and keep the SMP functionality untouched.
> > > In order to tell if the code had been called due to the WDT overflowing
> > > we are testing WOVF from register RWTCSRA.
> > >
> > > The new function shmobile_boot_vector_gen2 isn't replacing
> > > shmobile_boot_vector for backward compatibility reasons. The kernel
> > > will install the best option (either shmobile_boot_vector or
> > > shmobile_boot_vector_gen2) to ICRAM1 after parsing the device tree,
> > > according to the amount of memory available.
> > >
> > > Since shmobile_boot_vector has become bigger, "reg" property of nodes
> > > compatible with "renesas,smp-sram" now need to be set to a value
> > > greater or equal to "<0 0x60>".
> > >
> > > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > > Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> > > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > > ---
> > > v6->v7:
> > > * restored ifdef within arch/arm/mach-shmobile/headsmp.S
> >
> > Thanks. I believe that this is the same as the hand modified
> > version of v5 that I applied yesterday.
> 
> yes, I believe v5 modified and applied by you is the same as v7.
> Thank you for taking the patch.

Likewise, thanks for the patches and for confirming this one is correct.

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
  2018-03-13 20:05                 ` Simon Horman
  (?)
@ 2018-04-18 13:37                   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-04-18 13:37 UTC (permalink / raw)
  To: Simon Horman
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	Fabrizio Castro,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Rob Herring, Linux ARM, Stephen Boyd, Linux-Renesas

Hi Simon,

On Tue, Mar 13, 2018 at 9:05 PM, Simon Horman <horms@verge.net.au> wrote:
> I understand that the watchdog driver has been accepted and that as things
> currently stand if it is enabled in the build it will be enabled in DT and
> a crash will result. From my POV that is a regression so I have decided
> to adopt the alternate plan proposed by Geert above: in short drop DT
> patches (to avoid enabling broken driver) and enqueue mach-shmobile
> patches (which don't make things any worse.
>
> Patch-by-patch things are as follows.
>
> Dropped from "[PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1":
>
> 979d28f29742 ARM: dts: r8a7743: Adjust SMP routine size
> 0b205f679f5d ARM: dts: r8a7745: Adjust SMP routine size
> 2ad21a1d78b3 ARM: dts: r8a7790: Adjust SMP routine size
> 82c978459c77 ARM: dts: r8a7791: Adjust SMP routine size
> d303698e6ff3 ARM: dts: r8a7792: Adjust SMP routine size
> d8b8b9a1e295 ARM: dts: r8a7793: Adjust SMP routine size
> 70b3ab369773 ARM: dts: r8a7794: Adjust SMP routine size
>
> ebf26cf1b1de ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> 5a4566ab3777 ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> acd58e2bb1e5 ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> e3f89168e72f ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> e76a6a69a1fc ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> 242cc1ab7f7c ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> 748ed07f6c7c ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>
>
> Dropped from "[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog support":
>
> c257202482e2 ARM: dts: r8a7792: Add RWDT node
> 01ec04dec8eb ARM: dts: r8a7793: Add RWDT node
> 8e6ebe4f2f94 ARM: dts: lager: Enable watchdog support
> f223ad0198f6 ARM: dts: koelsch: Enable watchdog support
> 1d14d2bb700d ARM: dts: porter: Enable watchdog support
> bf71652fc955 ARM: dts: blanche: Enable watchdog support
> 13a0b10aeea4 ARM: dts: wheat: Enable watchdog support
> 4e247bf110b8 ARM: dts: gose: Enable watchdog support
> 2dcbd24bbf5e ARM: dts: alt: Enable watchdog support
> 7f6844c900b4 ARM: dts: silk: Enable watchdog support
>
> And applied:
>
> [v5] ARM: shmobile: rcar-gen2: Add watchdog support
> [v5] ARM: shmobile: Add watchdog support
>
> In the case of the last patch above I removed the #ifdef from the header file.

I guess the time is ripe to apply the DTS patches again, in the following order:
  1. SMP routine size adjustments,
  2. Watchdog support additions to dtsi,
  3. Watchdog enablement for dts?

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-04-18 13:37                   ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-04-18 13:37 UTC (permalink / raw)
  To: Simon Horman
  Cc: Fabrizio Castro, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

Hi Simon,

On Tue, Mar 13, 2018 at 9:05 PM, Simon Horman <horms@verge.net.au> wrote:
> I understand that the watchdog driver has been accepted and that as things
> currently stand if it is enabled in the build it will be enabled in DT and
> a crash will result. From my POV that is a regression so I have decided
> to adopt the alternate plan proposed by Geert above: in short drop DT
> patches (to avoid enabling broken driver) and enqueue mach-shmobile
> patches (which don't make things any worse.
>
> Patch-by-patch things are as follows.
>
> Dropped from "[PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1":
>
> 979d28f29742 ARM: dts: r8a7743: Adjust SMP routine size
> 0b205f679f5d ARM: dts: r8a7745: Adjust SMP routine size
> 2ad21a1d78b3 ARM: dts: r8a7790: Adjust SMP routine size
> 82c978459c77 ARM: dts: r8a7791: Adjust SMP routine size
> d303698e6ff3 ARM: dts: r8a7792: Adjust SMP routine size
> d8b8b9a1e295 ARM: dts: r8a7793: Adjust SMP routine size
> 70b3ab369773 ARM: dts: r8a7794: Adjust SMP routine size
>
> ebf26cf1b1de ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> 5a4566ab3777 ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> acd58e2bb1e5 ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> e3f89168e72f ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> e76a6a69a1fc ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> 242cc1ab7f7c ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> 748ed07f6c7c ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>
>
> Dropped from "[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog support":
>
> c257202482e2 ARM: dts: r8a7792: Add RWDT node
> 01ec04dec8eb ARM: dts: r8a7793: Add RWDT node
> 8e6ebe4f2f94 ARM: dts: lager: Enable watchdog support
> f223ad0198f6 ARM: dts: koelsch: Enable watchdog support
> 1d14d2bb700d ARM: dts: porter: Enable watchdog support
> bf71652fc955 ARM: dts: blanche: Enable watchdog support
> 13a0b10aeea4 ARM: dts: wheat: Enable watchdog support
> 4e247bf110b8 ARM: dts: gose: Enable watchdog support
> 2dcbd24bbf5e ARM: dts: alt: Enable watchdog support
> 7f6844c900b4 ARM: dts: silk: Enable watchdog support
>
> And applied:
>
> [v5] ARM: shmobile: rcar-gen2: Add watchdog support
> [v5] ARM: shmobile: Add watchdog support
>
> In the case of the last patch above I removed the #ifdef from the header file.

I guess the time is ripe to apply the DTS patches again, in the following order:
  1. SMP routine size adjustments,
  2. Watchdog support additions to dtsi,
  3. Watchdog enablement for dts?

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-04-18 13:37                   ` Geert Uytterhoeven
  0 siblings, 0 replies; 177+ messages in thread
From: Geert Uytterhoeven @ 2018-04-18 13:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Tue, Mar 13, 2018 at 9:05 PM, Simon Horman <horms@verge.net.au> wrote:
> I understand that the watchdog driver has been accepted and that as things
> currently stand if it is enabled in the build it will be enabled in DT and
> a crash will result. From my POV that is a regression so I have decided
> to adopt the alternate plan proposed by Geert above: in short drop DT
> patches (to avoid enabling broken driver) and enqueue mach-shmobile
> patches (which don't make things any worse.
>
> Patch-by-patch things are as follows.
>
> Dropped from "[PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1":
>
> 979d28f29742 ARM: dts: r8a7743: Adjust SMP routine size
> 0b205f679f5d ARM: dts: r8a7745: Adjust SMP routine size
> 2ad21a1d78b3 ARM: dts: r8a7790: Adjust SMP routine size
> 82c978459c77 ARM: dts: r8a7791: Adjust SMP routine size
> d303698e6ff3 ARM: dts: r8a7792: Adjust SMP routine size
> d8b8b9a1e295 ARM: dts: r8a7793: Adjust SMP routine size
> 70b3ab369773 ARM: dts: r8a7794: Adjust SMP routine size
>
> ebf26cf1b1de ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> 5a4566ab3777 ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> acd58e2bb1e5 ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> e3f89168e72f ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> e76a6a69a1fc ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> 242cc1ab7f7c ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> 748ed07f6c7c ARM: dts: iwg22m: Add watchdog support to SoM dtsi
>
>
> Dropped from "[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog support":
>
> c257202482e2 ARM: dts: r8a7792: Add RWDT node
> 01ec04dec8eb ARM: dts: r8a7793: Add RWDT node
> 8e6ebe4f2f94 ARM: dts: lager: Enable watchdog support
> f223ad0198f6 ARM: dts: koelsch: Enable watchdog support
> 1d14d2bb700d ARM: dts: porter: Enable watchdog support
> bf71652fc955 ARM: dts: blanche: Enable watchdog support
> 13a0b10aeea4 ARM: dts: wheat: Enable watchdog support
> 4e247bf110b8 ARM: dts: gose: Enable watchdog support
> 2dcbd24bbf5e ARM: dts: alt: Enable watchdog support
> 7f6844c900b4 ARM: dts: silk: Enable watchdog support
>
> And applied:
>
> [v5] ARM: shmobile: rcar-gen2: Add watchdog support
> [v5] ARM: shmobile: Add watchdog support
>
> In the case of the last patch above I removed the #ifdef from the header file.

I guess the time is ripe to apply the DTS patches again, in the following order:
  1. SMP routine size adjustments,
  2. Watchdog support additions to dtsi,
  3. Watchdog enablement for dts?

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
  2018-04-18 13:37                   ` Geert Uytterhoeven
  (?)
@ 2018-04-24  9:09                     ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-04-24  9:09 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Rutland, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Wolfram Sang, Wim Van Sebroeck,
	linux-clk, Magnus Damm, Russell King, Guenter Roeck,
	Fabrizio Castro,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Chris Paterson, Linux Watchdog Mailing List, Biju Das,
	Rob Herring, Linux ARM, Stephen Boyd, Linux-Renesas

On Wed, Apr 18, 2018 at 03:37:29PM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Tue, Mar 13, 2018 at 9:05 PM, Simon Horman <horms@verge.net.au> wrote:
> > I understand that the watchdog driver has been accepted and that as things
> > currently stand if it is enabled in the build it will be enabled in DT and
> > a crash will result. From my POV that is a regression so I have decided
> > to adopt the alternate plan proposed by Geert above: in short drop DT
> > patches (to avoid enabling broken driver) and enqueue mach-shmobile
> > patches (which don't make things any worse.
> >
> > Patch-by-patch things are as follows.
> >
> > Dropped from "[PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1":
> >
> > 979d28f29742 ARM: dts: r8a7743: Adjust SMP routine size
> > 0b205f679f5d ARM: dts: r8a7745: Adjust SMP routine size
> > 2ad21a1d78b3 ARM: dts: r8a7790: Adjust SMP routine size
> > 82c978459c77 ARM: dts: r8a7791: Adjust SMP routine size
> > d303698e6ff3 ARM: dts: r8a7792: Adjust SMP routine size
> > d8b8b9a1e295 ARM: dts: r8a7793: Adjust SMP routine size
> > 70b3ab369773 ARM: dts: r8a7794: Adjust SMP routine size
> >
> > ebf26cf1b1de ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> > 5a4566ab3777 ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> > acd58e2bb1e5 ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> > e3f89168e72f ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> > e76a6a69a1fc ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> > 242cc1ab7f7c ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> > 748ed07f6c7c ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >
> >
> > Dropped from "[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog support":
> >
> > c257202482e2 ARM: dts: r8a7792: Add RWDT node
> > 01ec04dec8eb ARM: dts: r8a7793: Add RWDT node
> > 8e6ebe4f2f94 ARM: dts: lager: Enable watchdog support
> > f223ad0198f6 ARM: dts: koelsch: Enable watchdog support
> > 1d14d2bb700d ARM: dts: porter: Enable watchdog support
> > bf71652fc955 ARM: dts: blanche: Enable watchdog support
> > 13a0b10aeea4 ARM: dts: wheat: Enable watchdog support
> > 4e247bf110b8 ARM: dts: gose: Enable watchdog support
> > 2dcbd24bbf5e ARM: dts: alt: Enable watchdog support
> > 7f6844c900b4 ARM: dts: silk: Enable watchdog support
> >
> > And applied:
> >
> > [v5] ARM: shmobile: rcar-gen2: Add watchdog support
> > [v5] ARM: shmobile: Add watchdog support
> >
> > In the case of the last patch above I removed the #ifdef from the header file.
> 
> I guess the time is ripe to apply the DTS patches again, in the following order:
>   1. SMP routine size adjustments,
>   2. Watchdog support additions to dtsi,
>   3. Watchdog enablement for dts?
> 
> Thanks!

Thanks, I have tentatively reapplied all of the above.

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

* Re: [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-04-24  9:09                     ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-04-24  9:09 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Fabrizio Castro, Philipp Zabel, Rob Herring, Mark Rutland,
	Wim Van Sebroeck, Russell King, Catalin Marinas, Will Deacon,
	Michael Turquette, Stephen Boyd, Magnus Damm, Geert Uytterhoeven,
	Wolfram Sang, Guenter Roeck,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Linux Watchdog Mailing List, Linux-Renesas, Linux ARM, linux-clk,
	Chris Paterson, Biju Das, Ramesh Shanmugasundaram

On Wed, Apr 18, 2018 at 03:37:29PM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Tue, Mar 13, 2018 at 9:05 PM, Simon Horman <horms@verge.net.au> wrote:
> > I understand that the watchdog driver has been accepted and that as things
> > currently stand if it is enabled in the build it will be enabled in DT and
> > a crash will result. From my POV that is a regression so I have decided
> > to adopt the alternate plan proposed by Geert above: in short drop DT
> > patches (to avoid enabling broken driver) and enqueue mach-shmobile
> > patches (which don't make things any worse.
> >
> > Patch-by-patch things are as follows.
> >
> > Dropped from "[PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1":
> >
> > 979d28f29742 ARM: dts: r8a7743: Adjust SMP routine size
> > 0b205f679f5d ARM: dts: r8a7745: Adjust SMP routine size
> > 2ad21a1d78b3 ARM: dts: r8a7790: Adjust SMP routine size
> > 82c978459c77 ARM: dts: r8a7791: Adjust SMP routine size
> > d303698e6ff3 ARM: dts: r8a7792: Adjust SMP routine size
> > d8b8b9a1e295 ARM: dts: r8a7793: Adjust SMP routine size
> > 70b3ab369773 ARM: dts: r8a7794: Adjust SMP routine size
> >
> > ebf26cf1b1de ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> > 5a4566ab3777 ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> > acd58e2bb1e5 ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> > e3f89168e72f ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> > e76a6a69a1fc ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> > 242cc1ab7f7c ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> > 748ed07f6c7c ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >
> >
> > Dropped from "[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog support":
> >
> > c257202482e2 ARM: dts: r8a7792: Add RWDT node
> > 01ec04dec8eb ARM: dts: r8a7793: Add RWDT node
> > 8e6ebe4f2f94 ARM: dts: lager: Enable watchdog support
> > f223ad0198f6 ARM: dts: koelsch: Enable watchdog support
> > 1d14d2bb700d ARM: dts: porter: Enable watchdog support
> > bf71652fc955 ARM: dts: blanche: Enable watchdog support
> > 13a0b10aeea4 ARM: dts: wheat: Enable watchdog support
> > 4e247bf110b8 ARM: dts: gose: Enable watchdog support
> > 2dcbd24bbf5e ARM: dts: alt: Enable watchdog support
> > 7f6844c900b4 ARM: dts: silk: Enable watchdog support
> >
> > And applied:
> >
> > [v5] ARM: shmobile: rcar-gen2: Add watchdog support
> > [v5] ARM: shmobile: Add watchdog support
> >
> > In the case of the last patch above I removed the #ifdef from the header file.
> 
> I guess the time is ripe to apply the DTS patches again, in the following order:
>   1. SMP routine size adjustments,
>   2. Watchdog support additions to dtsi,
>   3. Watchdog enablement for dts?
> 
> Thanks!

Thanks, I have tentatively reapplied all of the above.

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

* [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-04-24  9:09                     ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-04-24  9:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 18, 2018 at 03:37:29PM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Tue, Mar 13, 2018 at 9:05 PM, Simon Horman <horms@verge.net.au> wrote:
> > I understand that the watchdog driver has been accepted and that as things
> > currently stand if it is enabled in the build it will be enabled in DT and
> > a crash will result. From my POV that is a regression so I have decided
> > to adopt the alternate plan proposed by Geert above: in short drop DT
> > patches (to avoid enabling broken driver) and enqueue mach-shmobile
> > patches (which don't make things any worse.
> >
> > Patch-by-patch things are as follows.
> >
> > Dropped from "[PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1":
> >
> > 979d28f29742 ARM: dts: r8a7743: Adjust SMP routine size
> > 0b205f679f5d ARM: dts: r8a7745: Adjust SMP routine size
> > 2ad21a1d78b3 ARM: dts: r8a7790: Adjust SMP routine size
> > 82c978459c77 ARM: dts: r8a7791: Adjust SMP routine size
> > d303698e6ff3 ARM: dts: r8a7792: Adjust SMP routine size
> > d8b8b9a1e295 ARM: dts: r8a7793: Adjust SMP routine size
> > 70b3ab369773 ARM: dts: r8a7794: Adjust SMP routine size
> >
> > ebf26cf1b1de ARM: dts: r8a7743: Add watchdog support to SoC dtsi
> > 5a4566ab3777 ARM: dts: r8a7745: Add watchdog support to SoC dtsi
> > acd58e2bb1e5 ARM: dts: r8a7790: Add watchdog support to SoC dtsi
> > e3f89168e72f ARM: dts: r8a7791: Add watchdog support to SoC dtsi
> > e76a6a69a1fc ARM: dts: r8a7794: Add watchdog support to SoC dtsi
> > 242cc1ab7f7c ARM: dts: iwg20m: Add watchdog support to SoM dtsi
> > 748ed07f6c7c ARM: dts: iwg22m: Add watchdog support to SoM dtsi
> >
> >
> > Dropped from "[PATCH/RFC 00/11] ARM: dts: rcar-gen2: Enable watchdog support":
> >
> > c257202482e2 ARM: dts: r8a7792: Add RWDT node
> > 01ec04dec8eb ARM: dts: r8a7793: Add RWDT node
> > 8e6ebe4f2f94 ARM: dts: lager: Enable watchdog support
> > f223ad0198f6 ARM: dts: koelsch: Enable watchdog support
> > 1d14d2bb700d ARM: dts: porter: Enable watchdog support
> > bf71652fc955 ARM: dts: blanche: Enable watchdog support
> > 13a0b10aeea4 ARM: dts: wheat: Enable watchdog support
> > 4e247bf110b8 ARM: dts: gose: Enable watchdog support
> > 2dcbd24bbf5e ARM: dts: alt: Enable watchdog support
> > 7f6844c900b4 ARM: dts: silk: Enable watchdog support
> >
> > And applied:
> >
> > [v5] ARM: shmobile: rcar-gen2: Add watchdog support
> > [v5] ARM: shmobile: Add watchdog support
> >
> > In the case of the last patch above I removed the #ifdef from the header file.
> 
> I guess the time is ripe to apply the DTS patches again, in the following order:
>   1. SMP routine size adjustments,
>   2. Watchdog support additions to dtsi,
>   3. Watchdog enablement for dts?
> 
> Thanks!

Thanks, I have tentatively reapplied all of the above.

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

* Re: [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
  2018-02-12 17:44   ` Fabrizio Castro
  (?)
@ 2018-05-02  9:38     ` Simon Horman
  -1 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-05-02  9:38 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Mark Rutland, devicetree, Chris Paterson, Magnus Damm,
	linux-watchdog, Geert Uytterhoeven, Catalin Marinas,
	Michael Turquette, Will Deacon, Russell King, linux-clk,
	linux-renesas-soc, Wolfram Sang, Wim Van Sebroeck, Rob Herring,
	linux-arm-kernel, Philipp Zabel, Biju Das, Stephen Boyd,
	Guenter Roeck, Ramesh Shanmugasundaram

On Mon, Feb 12, 2018 at 05:44:23PM +0000, Fabrizio Castro wrote:
> R-Car Gen2 and RZ/G1 platforms come with a watchdog IP, therefore enable
> its driver by default.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Thanks, applied.

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

* Re: [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
@ 2018-05-02  9:38     ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-05-02  9:38 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Philipp Zabel, Rob Herring, Mark Rutland, Wim Van Sebroeck,
	Russell King, Catalin Marinas, Will Deacon, Michael Turquette,
	Stephen Boyd, Magnus Damm, Geert Uytterhoeven, Wolfram Sang,
	Guenter Roeck, devicetree, linux-watchdog, linux-renesas-soc,
	linux-arm-kernel, linux-clk, Chris Paterson, Biju Das,
	Ramesh Shanmugasundaram

On Mon, Feb 12, 2018 at 05:44:23PM +0000, Fabrizio Castro wrote:
> R-Car Gen2 and RZ/G1 platforms come with a watchdog IP, therefore enable
> its driver by default.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Thanks, applied.

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

* [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN
@ 2018-05-02  9:38     ` Simon Horman
  0 siblings, 0 replies; 177+ messages in thread
From: Simon Horman @ 2018-05-02  9:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 12, 2018 at 05:44:23PM +0000, Fabrizio Castro wrote:
> R-Car Gen2 and RZ/G1 platforms come with a watchdog IP, therefore enable
> its driver by default.
> 
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Thanks, applied.

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

end of thread, other threads:[~2018-05-02  9:38 UTC | newest]

Thread overview: 177+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-12 17:44 [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1 Fabrizio Castro
2018-02-12 17:44 ` Fabrizio Castro
2018-02-12 17:44 ` Fabrizio Castro
2018-02-12 17:44 ` [PATCH v5 01/26] ARM: shmobile: Add watchdog support Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
2018-02-28 12:57   ` Geert Uytterhoeven
2018-02-28 12:57     ` Geert Uytterhoeven
2018-02-28 12:57     ` Geert Uytterhoeven
2018-02-28 17:37     ` Fabrizio Castro
2018-02-28 17:37       ` Fabrizio Castro
2018-02-28 17:37       ` Fabrizio Castro
2018-02-28 17:37       ` Fabrizio Castro
2018-02-28 17:40     ` [PATCH v6 " Fabrizio Castro
2018-02-28 17:40       ` Fabrizio Castro
2018-02-28 17:40       ` Fabrizio Castro
2018-03-01  9:44       ` Simon Horman
2018-03-01  9:44         ` Simon Horman
2018-03-01  9:44         ` Simon Horman
2018-03-13 13:43       ` Geert Uytterhoeven
2018-03-13 13:43         ` Geert Uytterhoeven
2018-03-13 13:43         ` Geert Uytterhoeven
2018-03-14 11:02         ` Fabrizio Castro
2018-03-14 11:02           ` Fabrizio Castro
2018-03-14 11:02           ` Fabrizio Castro
2018-03-14 11:02           ` Fabrizio Castro
2018-03-14 11:13         ` [PATCH v7] " Fabrizio Castro
2018-03-14 11:13           ` Fabrizio Castro
2018-03-14 12:43           ` Simon Horman
2018-03-14 12:43             ` Simon Horman
2018-03-14 13:26             ` Fabrizio Castro
2018-03-14 13:26               ` Fabrizio Castro
2018-03-16 11:49               ` Simon Horman
2018-03-16 11:49                 ` Simon Horman
2018-02-12 17:44 ` [PATCH v5 02/26] ARM: dts: r8a7743: Adjust SMP routine size Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
2018-02-12 17:44 ` [PATCH v5 03/26] ARM: dts: r8a7745: " Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
2018-02-12 17:44 ` [PATCH v5 04/26] ARM: dts: r8a7790: " Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
2018-02-12 17:44 ` [PATCH v5 07/26] ARM: dts: r8a7793: " Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
2018-02-12 17:44 ` [PATCH v5 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
     [not found]   ` <1518457475-4480-15-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-13 13:08     ` Fabrizio Castro
2018-02-13 13:08       ` Fabrizio Castro
2018-02-13 13:08       ` Fabrizio Castro
2018-02-13 13:08       ` Fabrizio Castro
     [not found]       ` <TY1PR06MB0895970E6725F954D1A97E4CC0F60-/PRLmSCtZ16EeHdvShrxA20DtJ1/0DrXvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-02-15 16:20         ` Simon Horman
2018-02-15 16:20           ` Simon Horman
2018-02-15 16:20           ` Simon Horman
2018-05-02  9:38   ` Simon Horman
2018-05-02  9:38     ` Simon Horman
2018-05-02  9:38     ` Simon Horman
2018-02-12 17:44 ` [PATCH v5 15/26] clk: renesas: r8a7743: Add rwdt clock Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
2018-02-12 17:44 ` [PATCH v5 16/26] clk: renesas: r8a7745: " Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
     [not found] ` <1518457475-4480-1-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-12 17:44   ` [PATCH v5 05/26] ARM: dts: r8a7791: Adjust SMP routine size Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44   ` [PATCH v5 06/26] ARM: dts: r8a7792: " Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44   ` [PATCH v5 08/26] ARM: dts: r8a7794: " Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44   ` [PATCH v5 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2 Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-13  8:19     ` Simon Horman
2018-02-13  8:19       ` Simon Horman
2018-02-13  8:19       ` Simon Horman
2018-02-13 12:57       ` Fabrizio Castro
2018-02-13 12:57         ` Fabrizio Castro
2018-02-13 12:57         ` Fabrizio Castro
2018-02-13 12:57         ` Fabrizio Castro
2018-02-13 13:02       ` [PATCH v6 " Fabrizio Castro
2018-02-13 13:02         ` Fabrizio Castro
2018-02-13 13:02         ` Fabrizio Castro
2018-02-15 16:20         ` Simon Horman
2018-02-15 16:20           ` Simon Horman
2018-02-15 16:20           ` Simon Horman
2018-02-12 17:44   ` [PATCH v5 10/26] ARM: shmobile: rcar-gen2: Add watchdog support Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
     [not found]     ` <1518457475-4480-11-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-13  8:21       ` Simon Horman
2018-02-13  8:21         ` Simon Horman
2018-02-13  8:21         ` Simon Horman
2018-02-12 17:44   ` [PATCH v5 11/26] dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44   ` [PATCH v5 12/26] watchdog: renesas_wdt: " Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
     [not found]     ` <1518457475-4480-13-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-02-12 19:24       ` Guenter Roeck
2018-02-12 19:24         ` Guenter Roeck
2018-02-12 19:24         ` Guenter Roeck
2018-02-12 20:58       ` Wolfram Sang
2018-02-12 20:58         ` Wolfram Sang
2018-02-12 20:58         ` Wolfram Sang
2018-02-21 15:43     ` [PATCH] watchdog: renesas_wdt: Blacklist early R-Car Gen2 SoCs Geert Uytterhoeven
2018-02-21 16:22       ` Simon Horman
2018-02-28 17:48       ` Fabrizio Castro
2018-02-28 19:24     ` [PATCH v5 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support Geert Uytterhoeven
2018-02-28 19:24       ` Geert Uytterhoeven
2018-02-28 19:24       ` Geert Uytterhoeven
2018-03-01 15:34       ` Fabrizio Castro
2018-03-01 15:34         ` Fabrizio Castro
2018-03-01 15:34         ` Fabrizio Castro
2018-03-01 15:34         ` Fabrizio Castro
2018-02-12 17:44   ` [PATCH v5 13/26] watchdog: renesas_wdt: Add restart handler Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 20:59     ` Wolfram Sang
2018-02-12 20:59       ` Wolfram Sang
2018-02-12 20:59       ` Wolfram Sang
2018-02-12 17:44   ` [PATCH v5 17/26] clk: renesas: r8a7790: Add rwdt clock Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44   ` [PATCH v5 18/26] clk: renesas: r8a7791/r8a7793: " Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44   ` [PATCH v5 22/26] ARM: dts: r8a7790: Add watchdog support to SoC dtsi Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44   ` [PATCH v5 25/26] ARM: dts: iwg20m: Add watchdog support to SoM dtsi Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44     ` Fabrizio Castro
2018-02-12 17:44 ` [PATCH v5 19/26] clk: renesas: r8a7794: Add rwdt clock Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
2018-02-12 17:44 ` [PATCH v5 20/26] ARM: dts: r8a7743: Add watchdog support to SoC dtsi Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
2018-02-12 17:44 ` [PATCH v5 21/26] ARM: dts: r8a7745: " Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
2018-02-12 17:44 ` [PATCH v5 23/26] ARM: dts: r8a7791: " Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
2018-02-12 17:44 ` [PATCH v5 24/26] ARM: dts: r8a7794: " Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
2018-02-12 17:44 ` [PATCH v5 26/26] ARM: dts: iwg22m: Add watchdog support to SoM dtsi Fabrizio Castro
2018-02-12 17:44   ` Fabrizio Castro
2018-02-13  8:05 ` [PATCH v5 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1 Simon Horman
2018-02-13  8:05   ` Simon Horman
2018-02-13  8:05   ` Simon Horman
2018-02-20 12:51 ` Geert Uytterhoeven
2018-02-20 12:51   ` Geert Uytterhoeven
2018-02-20 12:51   ` Geert Uytterhoeven
2018-02-21 16:13   ` Simon Horman
2018-02-21 16:13     ` Simon Horman
2018-02-21 16:13     ` Simon Horman
2018-02-21 16:30     ` Geert Uytterhoeven
2018-02-21 16:30       ` Geert Uytterhoeven
2018-02-21 16:30       ` Geert Uytterhoeven
2018-02-21 18:32       ` Simon Horman
2018-02-21 18:32         ` Simon Horman
2018-02-21 18:32         ` Simon Horman
2018-02-22  8:38         ` Geert Uytterhoeven
2018-02-22  8:38           ` Geert Uytterhoeven
2018-02-22  8:38           ` Geert Uytterhoeven
2018-02-23  8:14           ` Simon Horman
2018-02-23  8:14             ` Simon Horman
2018-02-23  8:14             ` Simon Horman
2018-03-01 10:20             ` Geert Uytterhoeven
2018-03-01 10:20               ` Geert Uytterhoeven
2018-03-01 10:20               ` Geert Uytterhoeven
2018-03-13 20:05               ` Simon Horman
2018-03-13 20:05                 ` Simon Horman
2018-03-13 20:05                 ` Simon Horman
2018-03-14  8:17                 ` Geert Uytterhoeven
2018-03-14  8:17                   ` Geert Uytterhoeven
2018-03-14  8:17                   ` Geert Uytterhoeven
2018-03-14  8:17                   ` Geert Uytterhoeven
2018-04-18 13:37                 ` Geert Uytterhoeven
2018-04-18 13:37                   ` Geert Uytterhoeven
2018-04-18 13:37                   ` Geert Uytterhoeven
2018-04-24  9:09                   ` Simon Horman
2018-04-24  9:09                     ` Simon Horman
2018-04-24  9:09                     ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.