public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ARM: shmobile: Check MD21 at SMP boot in case of APMU
@ 2014-02-17  6:31 Magnus Damm
  2014-02-17  7:21 ` Simon Horman
  2014-02-17  8:53 ` Geert Uytterhoeven
  0 siblings, 2 replies; 5+ messages in thread
From: Magnus Damm @ 2014-02-17  6:31 UTC (permalink / raw)
  To: linux-arm-kernel

From: Magnus Damm <damm@opensource.se>

On R-Car Gen2 SoCs such as r8a7790 and r8a7791 the hardware boot
mode bit MD21 indicates if hardware debug mode is enabled or not.

In case hardware debug mode is enabled print a warning and refrain
from booting secondary CPU cores. Without this patch Koelsch boards
with SW8-4 set to OFF will hang at SMP boot.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 Written against renesas-devel-v3.14-rc2-20140213

 arch/arm/mach-shmobile/platsmp-apmu.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- 0001/arch/arm/mach-shmobile/platsmp-apmu.c
+++ work/arch/arm/mach-shmobile/platsmp-apmu.c	2014-02-17 15:11:15.000000000 +0900
@@ -17,6 +17,7 @@
 #include <asm/cp15.h>
 #include <asm/smp_plat.h>
 #include <mach/common.h>
+#include <mach/rcar-gen2.h>
 
 static struct {
 	void __iomem *iomem;
@@ -136,6 +137,12 @@ void __init shmobile_smp_apmu_prepare_cp
 
 int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
+	/* Refrain boot when hardware debug mode is enabled */
+	if (rcar_gen2_read_mode_pins() & BIT(21)) {
+		pr_warn("Unable to boot CPU%d when MD21 is set\n", cpu);
+		return -ENOTSUPP;
+	}
+
 	/* For this particular CPU register boot vector */
 	shmobile_smp_hook(cpu, virt_to_phys(shmobile_invalidate_start), 0);
 

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

end of thread, other threads:[~2014-02-17 11:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-17  6:31 [PATCH] ARM: shmobile: Check MD21 at SMP boot in case of APMU Magnus Damm
2014-02-17  7:21 ` Simon Horman
2014-02-17  7:35   ` Magnus Damm
2014-02-17  8:53 ` Geert Uytterhoeven
2014-02-17 11:14   ` Magnus Damm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox