diff mbox

[v2,04/10] arm: renesas: r8a7791: Obtain MD pin value using boot-mode-reg

Message ID 1462944578-1220-5-git-send-email-dirk.behme@de.bosch.com (mailing list archive)
State Superseded
Delegated to: Simon Horman
Headers show

Commit Message

Dirk Behme May 11, 2016, 5:29 a.m. UTC
From: Simon Horman <horms+renesas@verge.net.au>

Use new boot mode reg infrastructure to obtain the mode pin
value when initialising SMP for r8a7791 SoC.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
---
 arch/arm/mach-shmobile/smp-r8a7791.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c
index 2d6417a..00d794d 100644
--- a/arch/arm/mach-shmobile/smp-r8a7791.c
+++ b/arch/arm/mach-shmobile/smp-r8a7791.c
@@ -20,6 +20,8 @@ 
 
 #include <asm/smp_plat.h>
 
+#include <misc/boot-mode-reg.h>
+
 #include "common.h"
 #include "platsmp-apmu.h"
 #include "r8a7791.h"
@@ -45,8 +47,17 @@  static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus)
 static int r8a7791_smp_boot_secondary(unsigned int cpu,
 				      struct task_struct *idle)
 {
+	int err;
+	u32 mode;
+
+	err = boot_mode_reg_get(&mode);
+	if (err) {
+		pr_warn("Unable to retrieve boot mode register\n");
+		return err;
+	}
+
 	/* Error out when hardware debug mode is enabled */
-	if (rcar_gen2_read_mode_pins() & BIT(21)) {
+	if (mode & BIT(21)) {
 		pr_warn("Unable to boot CPU%u when MD21 is set\n", cpu);
 		return -ENOTSUPP;
 	}