linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: fabrizio.castro@bp.renesas.com (Fabrizio Castro)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC v4 10/26] ARM: shmobile: rcar-gen2: Add watchdog support
Date: Wed, 31 Jan 2018 18:24:14 +0000	[thread overview]
Message-ID: <1517423070-24236-11-git-send-email-fabrizio.castro@bp.renesas.com> (raw)
In-Reply-To: <1517423070-24236-1-git-send-email-fabrizio.castro@bp.renesas.com>

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>
---
v3->4:
* no change

 arch/arm/mach-shmobile/platsmp-apmu.c |  1 +
 arch/arm/mach-shmobile/pm-rcar-gen2.c | 13 ++++++++++---
 2 files changed, 11 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..bfad202 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,15 @@ 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

  parent reply	other threads:[~2018-01-31 18:24 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 18:24 [RFC v4 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1 Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 01/26] ARM: shmobile: Add watchdog support Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 02/26] ARM: dts: r8a7743: Adjust SMP routine size Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 03/26] ARM: dts: r8a7745: " Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 04/26] ARM: dts: r8a7790: " Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 05/26] ARM: dts: r8a7791: " Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 06/26] ARM: dts: r8a7792: " Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 07/26] ARM: dts: r8a7793: " Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 08/26] ARM: dts: r8a7794: " Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 09/26] soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2 Fabrizio Castro
2018-01-31 18:24 ` Fabrizio Castro [this message]
2018-01-31 18:24 ` [RFC v4 11/26] dt-bindings: watchdog: renesas-wdt: Add R-Car Gen2 support Fabrizio Castro
2018-02-05  6:08   ` Rob Herring
2018-02-07 23:04   ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 12/26] watchdog: renesas_wdt: " Fabrizio Castro
2018-02-02  2:56   ` Guenter Roeck
2018-02-05 11:16     ` Fabrizio Castro
2018-02-07 22:53   ` Wolfram Sang
2018-02-12 10:31     ` Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 13/26] watchdog: renesas_wdt: Add restart handler Fabrizio Castro
2018-02-02  2:58   ` Guenter Roeck
2018-02-07 15:46   ` Geert Uytterhoeven
2018-02-07 15:55     ` Fabrizio Castro
2018-02-07 23:03   ` Wolfram Sang
2018-02-12 10:33     ` Fabrizio Castro
2018-02-12 10:54       ` Wolfram Sang
2018-02-12 11:38         ` Fabrizio Castro
2018-01-31 18:24 ` [RFC v4 14/26] ARM: shmobile: defconfig: Enable RENESAS_WDT_GEN Fabrizio Castro
2018-02-07 23:11   ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 15/26] clk: renesas: r8a7743: Add rwdt clock Fabrizio Castro
2018-02-07 23:12   ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 16/26] clk: renesas: r8a7745: " Fabrizio Castro
2018-02-07 23:16   ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 17/26] clk: renesas: r8a7790: " Fabrizio Castro
2018-02-07 23:17   ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 18/26] clk: renesas: r8a7791/r8a7793: " Fabrizio Castro
2018-02-07 23:17   ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 19/26] clk: renesas: r8a7794: " Fabrizio Castro
2018-02-07 23:17   ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 20/26] ARM: dts: r8a7743: Add watchdog support to SoC dtsi Fabrizio Castro
2018-02-07 23:20   ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 21/26] ARM: dts: r8a7745: " Fabrizio Castro
2018-02-07 23:20   ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 22/26] ARM: dts: r8a7790: " Fabrizio Castro
2018-02-07 23:20   ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 23/26] ARM: dts: r8a7791: " Fabrizio Castro
2018-02-07 23:20   ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 24/26] ARM: dts: r8a7794: " Fabrizio Castro
2018-02-07 23:20   ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 25/26] ARM: dts: iwg20m: Add watchdog support to SoM dtsi Fabrizio Castro
2018-02-07 23:21   ` Wolfram Sang
2018-01-31 18:24 ` [RFC v4 26/26] ARM: dts: iwg22m: " Fabrizio Castro
2018-02-07 23:21   ` Wolfram Sang
2018-02-06 15:44 ` [RFC v4 00/26] Fix watchdog on Renesas R-Car Gen2 and RZ/G1 Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1517423070-24236-11-git-send-email-fabrizio.castro@bp.renesas.com \
    --to=fabrizio.castro@bp.renesas.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).