devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v3 00/25] Fix watchdog on Renesas R-Car Gen2 and RZ/G1
@ 2018-01-30 20:22 Fabrizio Castro
  2018-01-30 20:22 ` [RFC v3 03/25] ARM: dts: r8a7745: Adjust SMP routine size Fabrizio Castro
                   ` (10 more replies)
  0 siblings, 11 replies; 42+ messages in thread
From: Fabrizio Castro @ 2018-01-30 20:22 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,

while trying to add watchdog support to RZ/G1M and RZ/G1E I discovered
that it couldn't work out of the box. R-Car Gen2 and RZ/G1 are very
similar from a design perspective, and therefore the same problem is
observable on R-Car Gen2 too.

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.

This series is a proposal for a fix to the aforementioned problem.
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.

v3 takes into account all the feedbacks recieved, and implements a
different logic in the reset vector in order to get rid of
shmobile_wdt_clock_status.

This work was rebased on top of tag renesas-devel-20180122-v4.15-rc9
from the below repository:
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git

What do you guys think about this?

Any volunteer for testing this work?

Comments welcome!

Best Regards,

Fabrizio Castro (25):
  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
  dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support
  watchdog: renesas_wdt: Add R-Car Gen2 support
  ARM: shmobile: rcar-gen2: Add watchdog support
  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   | 18 +++++--
 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              | 13 +++--
 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                     | 61 ++++++++++++++++++++--
 22 files changed, 248 insertions(+), 26 deletions(-)

-- 
2.7.4


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

end of thread, other threads:[~2018-01-31 15:37 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-30 20:22 [RFC v3 00/25] Fix watchdog on Renesas R-Car Gen2 and RZ/G1 Fabrizio Castro
2018-01-30 20:22 ` [RFC v3 03/25] ARM: dts: r8a7745: Adjust SMP routine size Fabrizio Castro
     [not found]   ` <1517343778-27902-4-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-01-31  8:42     ` Geert Uytterhoeven
2018-01-30 20:22 ` [RFC v3 06/25] ARM: dts: r8a7792: " Fabrizio Castro
2018-01-31  8:43   ` Geert Uytterhoeven
2018-01-30 20:22 ` [RFC v3 12/25] ARM: shmobile: rcar-gen2: Add watchdog support Fabrizio Castro
     [not found] ` <1517343778-27902-1-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-01-30 20:22   ` [RFC v3 01/25] ARM: shmobile: " Fabrizio Castro
2018-01-30 20:22   ` [RFC v3 02/25] ARM: dts: r8a7743: Adjust SMP routine size Fabrizio Castro
     [not found]     ` <1517343778-27902-3-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-01-31  8:42       ` Geert Uytterhoeven
2018-01-30 20:22   ` [RFC v3 04/25] ARM: dts: r8a7790: " Fabrizio Castro
     [not found]     ` <1517343778-27902-5-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-01-31  8:43       ` Geert Uytterhoeven
2018-01-30 20:22   ` [RFC v3 05/25] ARM: dts: r8a7791: " Fabrizio Castro
     [not found]     ` <1517343778-27902-6-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-01-31  8:43       ` Geert Uytterhoeven
2018-01-30 20:22   ` [RFC v3 07/25] ARM: dts: r8a7793: " Fabrizio Castro
     [not found]     ` <1517343778-27902-8-git-send-email-fabrizio.castro-kTT6dE0pTRh9uiUsa/gSgQ@public.gmane.org>
2018-01-31  8:43       ` Geert Uytterhoeven
2018-01-30 20:22   ` [RFC v3 08/25] ARM: dts: r8a7794: " Fabrizio Castro
2018-01-31  8:44     ` Geert Uytterhoeven
2018-01-30 20:22   ` [RFC v3 09/25] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2 Fabrizio Castro
2018-01-30 20:22   ` [RFC v3 10/25] dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support Fabrizio Castro
2018-01-31  8:46     ` Geert Uytterhoeven
     [not found]       ` <CAMuHMdXkHF9R0XfcG++s0RRup+Mdtam5p=FXw26z86wAOJhZfQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-31 10:27         ` Fabrizio Castro
2018-01-30 20:22   ` [RFC v3 11/25] watchdog: renesas_wdt: " Fabrizio Castro
2018-01-30 22:05     ` Guenter Roeck
     [not found]       ` <20180130220504.GA16709-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2018-01-31 10:47         ` Fabrizio Castro
     [not found]           ` <TY1PR06MB0895ECB2936323F9D281C1EFC0FB0-/PRLmSCtZ16EeHdvShrxA20DtJ1/0DrXvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-01-31 12:13             ` Geert Uytterhoeven
2018-01-31 13:58               ` Fabrizio Castro
2018-01-31 14:48               ` Guenter Roeck
2018-01-31 15:27                 ` Fabrizio Castro
     [not found]                 ` <007dd1e3-70fd-69ad-fd02-4719e958b41c-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2018-01-31 15:37                   ` Geert Uytterhoeven
2018-01-30 20:22   ` [RFC v3 13/25] ARM: shmobile: defconfig: Enable CONFIG_RENESAS_WDT Fabrizio Castro
2018-01-30 20:22   ` [RFC v3 14/25] clk: renesas: r8a7743: Add rwdt clock Fabrizio Castro
2018-01-30 20:22   ` [RFC v3 15/25] clk: renesas: r8a7745: " Fabrizio Castro
2018-01-30 20:22   ` [RFC v3 16/25] clk: renesas: r8a7790: " Fabrizio Castro
2018-01-30 20:22   ` [RFC v3 20/25] ARM: dts: r8a7745: Add watchdog support to SoC dtsi Fabrizio Castro
2018-01-30 20:22   ` [RFC v3 21/25] ARM: dts: r8a7790: " Fabrizio Castro
2018-01-30 20:22 ` [RFC v3 17/25] clk: renesas: r8a7791/r8a7793: Add rwdt clock Fabrizio Castro
2018-01-30 20:22 ` [RFC v3 18/25] clk: renesas: r8a7794: " Fabrizio Castro
2018-01-30 20:22 ` [RFC v3 19/25] ARM: dts: r8a7743: Add watchdog support to SoC dtsi Fabrizio Castro
2018-01-30 20:22 ` [RFC v3 22/25] ARM: dts: r8a7791: " Fabrizio Castro
2018-01-30 20:22 ` [RFC v3 23/25] ARM: dts: r8a7794: " Fabrizio Castro
2018-01-30 20:22 ` [RFC v3 24/25] ARM: dts: iwg20m: Add watchdog support to SoM dtsi Fabrizio Castro
2018-01-30 20:22 ` [RFC v3 25/25] ARM: dts: iwg22m: " Fabrizio Castro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).