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

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.