Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1521298 > unrolled thread

[PATCH 00/16] Provide support of generic function for SCU enable

Started byPankaj Dubey <pankaj.dubey@samsung.com>
First post2016-11-14 06:00 +0100
Last post2016-11-14 06:10 +0100
Articles 19 on this page of 39 — 8 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/16] Provide support of generic function for SCU enable Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:00 +0100
    [PATCH 01/16] ARM: scu: Provide support for parsing SCU device node to  enable SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:00 +0100
      Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device  node to enable SCU Jisheng Zhang <jszhang@marvell.com> - 2016-11-14 07:20 +0100
        Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device  node to enable SCU Jisheng Zhang <jszhang@marvell.com> - 2016-11-14 08:10 +0100
          Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device  node to enable SCU "pankaj.dubey" <pankaj.dubey@samsung.com> - 2016-11-14 10:00 +0100
          Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device  node to enable SCU Jisheng Zhang <jszhang@marvell.com> - 2016-11-14 10:00 +0100
        Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device  node to enable SCU "pankaj.dubey" <pankaj.dubey@samsung.com> - 2016-11-14 09:40 +0100
          Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device node to enable SCU Arnd Bergmann <arnd@arndb.de> - 2016-11-14 13:10 +0100
            Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device  node to enable SCU Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-11-14 15:00 +0100
              Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device node to enable SCU Arnd Bergmann <arnd@arndb.de> - 2016-11-14 15:40 +0100
                Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device  node to enable SCU Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-11-14 16:00 +0100
                  Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device  node to enable SCU "pankaj.dubey" <pankaj.dubey@samsung.com> - 2016-11-17 05:30 +0100
                    Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device node to enable SCU Arnd Bergmann <arnd@arndb.de> - 2016-11-17 18:10 +0100
                      Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device  node to enable SCU "pankaj.dubey" <pankaj.dubey@samsung.com> - 2016-11-18 04:30 +0100
                        Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device node to enable SCU Arnd Bergmann <arnd@arndb.de> - 2016-11-18 13:20 +0100
                          Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device  node to enable SCU Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-11-18 13:50 +0100
                            Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device node to enable SCU Arnd Bergmann <arnd@arndb.de> - 2016-11-18 14:40 +0100
      Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device  node to enable SCU Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-11-14 14:50 +0100
        Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device  node to enable SCU "pankaj.dubey" <pankaj.dubey@samsung.com> - 2016-11-17 03:20 +0100
    [PATCH 09/16] ARM: BCM: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:10 +0100
      Re: [PATCH 09/16] ARM: BCM: use generic API for enabling SCU Florian Fainelli <f.fainelli@gmail.com> - 2016-11-14 07:20 +0100
    [PATCH 06/16] ARM: STi: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:10 +0100
    [PATCH 15/16] ARM: mvebu: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:10 +0100
    [PATCH 12/16] ARM: imx: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:10 +0100
      Re: [PATCH 12/16] ARM: imx: use generic API for enabling SCU Shawn Guo <shawnguo@kernel.org> - 2016-11-14 15:30 +0100
        Re: [PATCH 12/16] ARM: imx: use generic API for enabling SCU "pankaj.dubey" <pankaj.dubey@samsung.com> - 2016-11-17 05:30 +0100
    [PATCH 13/16] ARM: zynq: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:10 +0100
    [PATCH 08/16] ARM: vexpress: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:10 +0100
      Re: [PATCH 08/16] ARM: vexpress: use generic API for enabling SCU Sudeep Holla <sudeep.holla@arm.com> - 2016-11-16 15:40 +0100
        Re: [PATCH 08/16] ARM: vexpress: use generic API for enabling SCU "pankaj.dubey" <pankaj.dubey@samsung.com> - 2016-11-17 03:20 +0100
    [PATCH 05/16] ARM: socfpga: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:10 +0100
    [PATCH 03/16] ARM: berlin: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:10 +0100
      Re: [PATCH 03/16] ARM: berlin: use generic API for enabling SCU Jisheng Zhang <jszhang@marvell.com> - 2016-11-14 10:00 +0100
        Re: [PATCH 03/16] ARM: berlin: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 17:30 +0100
    [PATCH 10/16] ARM: tegra: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:10 +0100
    [PATCH 16/16] ARM: zx: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:10 +0100
    [PATCH 11/16] ARM: rockchip: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:10 +0100
    [PATCH 14/16] ARM: hisi: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:10 +0100
    [PATCH 07/16] ARM: ux500: use generic API for enabling SCU Pankaj Dubey <pankaj.dubey@samsung.com> - 2016-11-14 06:10 +0100

Page 2 of 2 — ← Prev page 1 [2]


#1521343 — Re: [PATCH 09/16] ARM: BCM: use generic API for enabling SCU

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2016-11-14 07:20 +0100
SubjectRe: [PATCH 09/16] ARM: BCM: use generic API for enabling SCU
Message-ID<sDiMx-3cC-7@gated-at.bofh.it>
In reply to#1521301
Le 13/11/2016 à 21:02, Pankaj Dubey a écrit :
> Now as we have of_scu_enable which takes care of mapping
> scu base from DT, lets use it.
> 
> CC: Florian Fainelli <f.fainelli@gmail.com>
> CC: Ray Jui <rjui@broadcom.com>
> CC: Scott Branden <sbranden@broadcom.com>
> CC: bcm-kernel-feedback-list@broadcom.com
> Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

Let me know if I need to pick this and submit via ARM SoC pull requests,
thanks!
-- 
Florian

[toc] | [prev] | [next] | [standalone]


#1521303 — [PATCH 06/16] ARM: STi: use generic API for enabling SCU

FromPankaj Dubey <pankaj.dubey@samsung.com>
Date2016-11-14 06:10 +0100
Subject[PATCH 06/16] ARM: STi: use generic API for enabling SCU
Message-ID<sDhGN-2pH-13@gated-at.bofh.it>
In reply to#1521298
Now as we have of_scu_enable which takes care of mapping
scu base from DT, lets use it.

CC: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/mach-sti/platsmp.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/arm/mach-sti/platsmp.c b/arch/arm/mach-sti/platsmp.c
index ea5a227..0bc7ff8 100644
--- a/arch/arm/mach-sti/platsmp.c
+++ b/arch/arm/mach-sti/platsmp.c
@@ -99,19 +99,12 @@ static int sti_boot_secondary(unsigned int cpu, struct task_struct *idle)
 static void __init sti_smp_prepare_cpus(unsigned int max_cpus)
 {
 	struct device_node *np;
-	void __iomem *scu_base;
 	u32 __iomem *cpu_strt_ptr;
 	u32 release_phys;
 	int cpu;
 	unsigned long entry_pa = virt_to_phys(sti_secondary_startup);
 
-	np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
-
-	if (np) {
-		scu_base = of_iomap(np, 0);
-		scu_enable(scu_base);
-		of_node_put(np);
-	}
+	of_scu_enable();
 
 	if (max_cpus <= 1)
 		return;
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1521305 — [PATCH 15/16] ARM: mvebu: use generic API for enabling SCU

FromPankaj Dubey <pankaj.dubey@samsung.com>
Date2016-11-14 06:10 +0100
Subject[PATCH 15/16] ARM: mvebu: use generic API for enabling SCU
Message-ID<sDhGN-2pH-7@gated-at.bofh.it>
In reply to#1521298
Now as we have of_scu_enable which takes care of mapping
scu base from DT, lets use it.

CC: Jason Cooper <jason@lakedaemon.net>
CC: Andrew Lunn <andrew@lunn.ch>
CC: Gregory Clement <gregory.clement@free-electrons.com>
CC: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/mach-mvebu/board-v7.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
index ccca951..d7014a3 100644
--- a/arch/arm/mach-mvebu/board-v7.c
+++ b/arch/arm/mach-mvebu/board-v7.c
@@ -41,13 +41,9 @@ static void __iomem *scu_base;
  */
 static void __init mvebu_scu_enable(void)
 {
-	struct device_node *np =
-		of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
-	if (np) {
-		scu_base = of_iomap(np, 0);
+	scu_base = of_scu_get_base();
+	if (!IS_ERR(scu_base))
 		scu_enable(scu_base);
-		of_node_put(np);
-	}
 }
 
 void __iomem *mvebu_get_scu_base(void)
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1521306 — [PATCH 12/16] ARM: imx: use generic API for enabling SCU

FromPankaj Dubey <pankaj.dubey@samsung.com>
Date2016-11-14 06:10 +0100
Subject[PATCH 12/16] ARM: imx: use generic API for enabling SCU
Message-ID<sDhGN-2pH-9@gated-at.bofh.it>
In reply to#1521298
Now as we have of_scu_enable which takes care of mapping
scu base from DT, lets use it.

At the same time this patch cleans up mach-imx platform files by
removing static mapping of SCU and dropping imx_scu_map_io function.

CC: Shawn Guo <shawnguo@kernel.org>
CC: Sascha Hauer <kernel@pengutronix.de>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/mach-imx/common.h     |  5 -----
 arch/arm/mach-imx/mach-imx6q.c |  8 +-------
 arch/arm/mach-imx/platsmp.c    | 32 +++++---------------------------
 arch/arm/mach-imx/pm-imx6.c    |  3 ++-
 4 files changed, 8 insertions(+), 40 deletions(-)

diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index c4436d9..9787d5f 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -87,11 +87,6 @@ u32 imx_get_cpu_arg(int cpu);
 void imx_set_cpu_arg(int cpu, u32 arg);
 #ifdef CONFIG_SMP
 void v7_secondary_startup(void);
-void imx_scu_map_io(void);
-void imx_smp_prepare(void);
-#else
-static inline void imx_scu_map_io(void) {}
-static inline void imx_smp_prepare(void) {}
 #endif
 void imx_src_init(void);
 void imx_gpc_pre_suspend(bool arm_power_off);
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 45801b2..1c6cc9f 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -383,12 +383,6 @@ static void __init imx6q_init_late(void)
 	}
 }
 
-static void __init imx6q_map_io(void)
-{
-	debug_ll_io_init();
-	imx_scu_map_io();
-}
-
 static void __init imx6q_init_irq(void)
 {
 	imx_gpc_check_dt();
@@ -410,7 +404,7 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad/DualLite (Device Tree)")
 	.l2c_aux_val 	= 0,
 	.l2c_aux_mask	= ~0,
 	.smp		= smp_ops(imx_smp_ops),
-	.map_io		= imx6q_map_io,
+	.map_io		= debug_ll_io_init,
 	.init_irq	= imx6q_init_irq,
 	.init_machine	= imx6q_init_machine,
 	.init_late      = imx6q_init_late,
diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c
index 711dbbd..c032369 100644
--- a/arch/arm/mach-imx/platsmp.c
+++ b/arch/arm/mach-imx/platsmp.c
@@ -26,26 +26,6 @@
 u32 g_diag_reg;
 static void __iomem *scu_base;
 
-static struct map_desc scu_io_desc __initdata = {
-	/* .virtual and .pfn are run-time assigned */
-	.length		= SZ_4K,
-	.type		= MT_DEVICE,
-};
-
-void __init imx_scu_map_io(void)
-{
-	unsigned long base;
-
-	/* Get SCU base */
-	asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base));
-
-	scu_io_desc.virtual = IMX_IO_P2V(base);
-	scu_io_desc.pfn = __phys_to_pfn(base);
-	iotable_init(&scu_io_desc, 1);
-
-	scu_base = IMX_IO_ADDRESS(base);
-}
-
 static int imx_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	imx_set_cpu_jump(cpu, v7_secondary_startup);
@@ -61,20 +41,18 @@ static void __init imx_smp_init_cpus(void)
 {
 	int i, ncores;
 
-	ncores = scu_get_core_count(scu_base);
+	if (!IS_ERR(scu_base))
+		ncores = scu_get_core_count(scu_base);
 
 	for (i = ncores; i < NR_CPUS; i++)
 		set_cpu_possible(i, false);
 }
 
-void imx_smp_prepare(void)
-{
-	scu_enable(scu_base);
-}
-
 static void __init imx_smp_prepare_cpus(unsigned int max_cpus)
 {
-	imx_smp_prepare();
+	scu_base = of_scu_get_base();
+	if (!IS_ERR(scu_base))
+		scu_enable(scu_base);
 
 	/*
 	 * The diagnostic register holds the errata bits.  Mostly bootloader
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
index 1515e49..859aacb 100644
--- a/arch/arm/mach-imx/pm-imx6.c
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -26,6 +26,7 @@
 #include <asm/fncpy.h>
 #include <asm/proc-fns.h>
 #include <asm/suspend.h>
+#include <asm/smp_scu.h>
 #include <asm/tlb.h>
 
 #include "common.h"
@@ -393,7 +394,7 @@ static int imx6q_pm_enter(suspend_state_t state)
 		/* Zzz ... */
 		cpu_suspend(0, imx6q_suspend_finish);
 		if (cpu_is_imx6q() || cpu_is_imx6dl())
-			imx_smp_prepare();
+			of_scu_enable();
 		imx_anatop_post_resume();
 		imx_gpc_post_resume();
 		imx6_enable_rbc(false);
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1521695 — Re: [PATCH 12/16] ARM: imx: use generic API for enabling SCU

FromShawn Guo <shawnguo@kernel.org>
Date2016-11-14 15:30 +0100
SubjectRe: [PATCH 12/16] ARM: imx: use generic API for enabling SCU
Message-ID<sDqqJ-892-21@gated-at.bofh.it>
In reply to#1521306
On Mon, Nov 14, 2016 at 10:32:07AM +0530, Pankaj Dubey wrote:
> Now as we have of_scu_enable which takes care of mapping
> scu base from DT, lets use it.
> 
> At the same time this patch cleans up mach-imx platform files by
> removing static mapping of SCU and dropping imx_scu_map_io function.

I remember that the static mapping of SCU is necessary because SCU is
being accessed at very early boot stage where dynamic mapping hasn't
been set up.

> CC: Shawn Guo <shawnguo@kernel.org>
> CC: Sascha Hauer <kernel@pengutronix.de>
> Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
> ---
>  arch/arm/mach-imx/common.h     |  5 -----
>  arch/arm/mach-imx/mach-imx6q.c |  8 +-------
>  arch/arm/mach-imx/platsmp.c    | 32 +++++---------------------------
>  arch/arm/mach-imx/pm-imx6.c    |  3 ++-
>  4 files changed, 8 insertions(+), 40 deletions(-)

I tested it and saw that the booting of imx6q is broken like below.

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.0-rc5-00002-g3e5aac418b91 (r65073@dragon) (gcc version 4.9.3 20150413 (prerelease) (Linaro GCC 4.9-2015.04-1) ) #5 SMP Mon Nov 14 22:17:36 CST 2016
[    0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt:Machine model: Freescale i.MX6 Quad SABRE Smart Device Board
[    0.000000] earlycon: ec_imx21 at MMIO 0x02020000 (options '')
[    0.000000] bootconsole [ec_imx21] enabled
[    0.000000] cma: Reserved 16 MiB at 0x4f000000
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[    0.000000] pgd = c0004000
[    0.000000] [00000004] *pgd=00000000
[    0.000000] Internal error: Oops: 5 [#1] SMP ARM
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.9.0-rc5-00002-g3e5aac418b91 #5
[    0.000000] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[    0.000000] task: c0e086c0 task.stack: c0e00000
[    0.000000] PC is at scu_get_core_count+0xc/0x1c
[    0.000000] LR is at imx_smp_init_cpus+0x20/0x4c
[    0.000000] pc : [<c0d05438>]    lr : [<c0d0df2c>]    psr: 000000d3
[    0.000000] sp : c0e01f10  ip : c0e01f20  fp : c0e01f1c
[    0.000000] r10: c0bed850  r9 : c0e051c0  r8 : c0e75140
[    0.000000] r7 : c164c5f0  r6 : c0e09f08  r5 : c0d5d6fc  r4 : c0e08340
[    0.000000] r3 : c0e755f8  r2 : 00000000  r1 : c0120d3c  r0 : 00000000
[    0.000000] Flags: nzcv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment none
[    0.000000] Control: 10c5387d  Table: 1000404a  DAC: 00000051
[    0.000000] Process swapper (pid: 0, stack limit = 0xc0e00210)
[    0.000000] Stack: (0xc0e01f10 to 0xc0e02000)
[    0.000000] 1f00:                                     c0e01f34 c0e01f20 c0d0df2c c0d05438
[    0.000000] 1f20: c0e08340 c0d5d6fc c0e01f44 c0e01f38 c0d052b8 c0d0df18 c0e01fac c0e01f48
[    0.000000] 1f40: c0d0457c c0d052a4 ffffffff 10c5387d c0e050c0 1000406a 4fffffff efffeec0
[    0.000000] 1f60: c0e01f84 c0e01f70 c017b614 c017af04 c0bebc44 c0e01fa4 c0e01f9c c0e01f88
[    0.000000] 1f80: c01cf6dc c0e75294 c0e050d8 c0d5fa44 c0e050c0 1000406a 412fc09a 00000000
[    0.000000] 1fa0: c0e01ff4 c0e01fb0 c0d009b0 c0d03d24 00000000 00000000 00000000 00000000
[    0.000000] 1fc0: 00000000 c0d5fa48 00000000 c0e75294 c0e050d8 c0d5fa44 c0e0a070 1000406a
[    0.000000] 1fe0: 412fc09a 00000000 00000000 c0e01ff8 1000807c c0d0096c 00000000 00000000
[    0.000000] Backtrace: 
[    0.000000] [<c0d0542c>] (scu_get_core_count) from [<c0d0df2c>] (imx_smp_init_cpus+0x20/0x4c)
[    0.000000] [<c0d0df0c>] (imx_smp_init_cpus) from [<c0d052b8>] (smp_init_cpus+0x20/0x28)
[    0.000000]  r5:c0d5d6fc[    0.000000]  r4:c0e08340
[    0.000000] 
[    0.000000] [<c0d05298>] (smp_init_cpus) from [<c0d0457c>] (setup_arch+0x864/0xc50)
[    0.000000] [<c0d03d18>] (setup_arch) from [<c0d009b0>] (start_kernel+0x50/0x398)
[    0.000000]  r10:00000000[    0.000000]  r9:412fc09a
 r8:1000406a[    0.000000]  r7:c0e050c0
 r6:c0d5fa44[    0.000000]  r5:c0e050d8
[    0.000000]  r4:c0e75294[    0.000000] 
[    0.000000] [<c0d00960>] (start_kernel) from [<1000807c>] (0x1000807c)
[    0.000000]  r10:00000000[    0.000000]  r9:412fc09a
 r8:1000406a[    0.000000]  r7:c0e0a070
 r6:c0d5fa44[    0.000000]  r5:c0e050d8
[    0.000000]  r4:c0e75294[    0.000000] 
[    0.000000] Code: c0e75338 e1a0c00d e92dd800 e24cb004 (e5900004) 
[    0.000000] ---[ end trace 0000000000000000 ]---
[    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
[    0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task!

[toc] | [prev] | [next] | [standalone]


#1524082 — Re: [PATCH 12/16] ARM: imx: use generic API for enabling SCU

From"pankaj.dubey" <pankaj.dubey@samsung.com>
Date2016-11-17 05:30 +0100
SubjectRe: [PATCH 12/16] ARM: imx: use generic API for enabling SCU
Message-ID<sEmuJ-49B-9@gated-at.bofh.it>
In reply to#1521695
Hi Shawn,

On Monday 14 November 2016 07:56 PM, Shawn Guo wrote:
> On Mon, Nov 14, 2016 at 10:32:07AM +0530, Pankaj Dubey wrote:
>> Now as we have of_scu_enable which takes care of mapping
>> scu base from DT, lets use it.
>>
>> At the same time this patch cleans up mach-imx platform files by
>> removing static mapping of SCU and dropping imx_scu_map_io function.
> 
> I remember that the static mapping of SCU is necessary because SCU is
> being accessed at very early boot stage where dynamic mapping hasn't
> been set up.
> 
>> CC: Shawn Guo <shawnguo@kernel.org>
>> CC: Sascha Hauer <kernel@pengutronix.de>
>> Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
>> ---
>>  arch/arm/mach-imx/common.h     |  5 -----
>>  arch/arm/mach-imx/mach-imx6q.c |  8 +-------
>>  arch/arm/mach-imx/platsmp.c    | 32 +++++---------------------------
>>  arch/arm/mach-imx/pm-imx6.c    |  3 ++-
>>  4 files changed, 8 insertions(+), 40 deletions(-)
> 
> I tested it and saw that the booting of imx6q is broken like below.

Thanks for testing and letting me know about this.

Currently only two platforms (IMX and ZYNQ) are using SCU address at
very early stage of boot, for configuring possible cpus via
set_cpu_possible().. rest platforms are either using DT method or they
handle this in smp_prepare_cpus.

Since I am not sure if all boards based on IMX has been moved to DT
based boot, if it has moved to completely DT based then we do not need
this set_cpu_possible in smp_init_cpus, it will be taken care via
"arm_dt_init_cpu_maps" and this will avoid need of early mapping of SCU
base as well.

If not then, currently I can't see any other way to handle this and in
that case I will drop-out IMX platform's patch of using generic SCU APIs
in v2 version of series.

Thanks,
Pankaj Dubey

[toc] | [prev] | [next] | [standalone]


#1521307 — [PATCH 13/16] ARM: zynq: use generic API for enabling SCU

FromPankaj Dubey <pankaj.dubey@samsung.com>
Date2016-11-14 06:10 +0100
Subject[PATCH 13/16] ARM: zynq: use generic API for enabling SCU
Message-ID<sDhGN-2pH-17@gated-at.bofh.it>
In reply to#1521298
Now as we have of_scu_enable which takes care of mapping
scu base from DT, lets use it.

At the same time this patch cleans up mach-zynq platform files by
removing static mapping of SCU and dropping zynq_scu_map_io and zynq_map_io
functions.

CC: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/mach-zynq/common.c  | 32 +-------------------------------
 arch/arm/mach-zynq/common.h  |  2 --
 arch/arm/mach-zynq/platsmp.c |  2 ++
 3 files changed, 3 insertions(+), 33 deletions(-)

diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index d12002c..3986b2b 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -38,7 +38,6 @@
 #include <asm/mach-types.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
-#include <asm/smp_scu.h>
 #include <asm/system_info.h>
 #include <asm/hardware/cache-l2x0.h>
 
@@ -48,8 +47,6 @@
 #define ZYNQ_DEVCFG_PS_VERSION_SHIFT	28
 #define ZYNQ_DEVCFG_PS_VERSION_MASK	0xF
 
-void __iomem *zynq_scu_base;
-
 /**
  * zynq_memory_init - Initialize special memory
  *
@@ -153,33 +150,6 @@ static void __init zynq_timer_init(void)
 	clocksource_probe();
 }
 
-static struct map_desc zynq_cortex_a9_scu_map __initdata = {
-	.length	= SZ_256,
-	.type	= MT_DEVICE,
-};
-
-static void __init zynq_scu_map_io(void)
-{
-	unsigned long base;
-
-	base = scu_a9_get_base();
-	zynq_cortex_a9_scu_map.pfn = __phys_to_pfn(base);
-	/* Expected address is in vmalloc area that's why simple assign here */
-	zynq_cortex_a9_scu_map.virtual = base;
-	iotable_init(&zynq_cortex_a9_scu_map, 1);
-	zynq_scu_base = (void __iomem *)base;
-	BUG_ON(!zynq_scu_base);
-}
-
-/**
- * zynq_map_io - Create memory mappings needed for early I/O.
- */
-static void __init zynq_map_io(void)
-{
-	debug_ll_io_init();
-	zynq_scu_map_io();
-}
-
 static void __init zynq_irq_init(void)
 {
 	zynq_early_slcr_init();
@@ -196,7 +166,7 @@ DT_MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform")
 	.l2c_aux_val    = 0x00400000,
 	.l2c_aux_mask	= 0xffbfffff,
 	.smp		= smp_ops(zynq_smp_ops),
-	.map_io		= zynq_map_io,
+	.map_io		= debug_ll_io_init,
 	.init_irq	= zynq_irq_init,
 	.init_machine	= zynq_init_machine,
 	.init_late	= zynq_init_late,
diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h
index e771933..7c2f008 100644
--- a/arch/arm/mach-zynq/common.h
+++ b/arch/arm/mach-zynq/common.h
@@ -33,8 +33,6 @@ extern int zynq_cpun_start(u32 address, int cpu);
 extern const struct smp_operations zynq_smp_ops;
 #endif
 
-extern void __iomem *zynq_scu_base;
-
 void zynq_pm_late_init(void);
 
 static inline void zynq_core_pm_init(void)
diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
index 7cd9865..2d09119 100644
--- a/arch/arm/mach-zynq/platsmp.c
+++ b/arch/arm/mach-zynq/platsmp.c
@@ -33,6 +33,7 @@
  * be called from zynq_cpun_start() because it is not in __init section.
  */
 static int ncores;
+static void __iomem *zynq_scu_base;
 
 int zynq_cpun_start(u32 address, int cpu)
 {
@@ -108,6 +109,7 @@ static void __init zynq_smp_init_cpus(void)
 
 static void __init zynq_smp_prepare_cpus(unsigned int max_cpus)
 {
+	zynq_scu_base = of_scu_get_base();
 	scu_enable(zynq_scu_base);
 }
 
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1521308 — [PATCH 08/16] ARM: vexpress: use generic API for enabling SCU

FromPankaj Dubey <pankaj.dubey@samsung.com>
Date2016-11-14 06:10 +0100
Subject[PATCH 08/16] ARM: vexpress: use generic API for enabling SCU
Message-ID<sDhGO-2pH-19@gated-at.bofh.it>
In reply to#1521298
Now as we have of_scu_enable which takes care of mapping
scu base from DT, lets use it.

CC: Liviu Dudau <liviu.dudau@arm.com>
CC: Sudeep Holla <sudeep.holla@arm.com>
CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/mach-vexpress/platsmp.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c
index 8b8d072..17dee2b 100644
--- a/arch/arm/mach-vexpress/platsmp.c
+++ b/arch/arm/mach-vexpress/platsmp.c
@@ -41,20 +41,9 @@ bool __init vexpress_smp_init_ops(void)
 	return false;
 }
 
-static const struct of_device_id vexpress_smp_dt_scu_match[] __initconst = {
-	{ .compatible = "arm,cortex-a5-scu", },
-	{ .compatible = "arm,cortex-a9-scu", },
-	{}
-};
-
 static void __init vexpress_smp_dt_prepare_cpus(unsigned int max_cpus)
 {
-	struct device_node *scu = of_find_matching_node(NULL,
-			vexpress_smp_dt_scu_match);
-
-	if (scu)
-		scu_enable(of_iomap(scu, 0));
-
+	of_scu_enable();
 	/*
 	 * Write the address of secondary startup into the
 	 * system-wide flags register. The boot monitor waits
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1523525 — Re: [PATCH 08/16] ARM: vexpress: use generic API for enabling SCU

FromSudeep Holla <sudeep.holla@arm.com>
Date2016-11-16 15:40 +0100
SubjectRe: [PATCH 08/16] ARM: vexpress: use generic API for enabling SCU
Message-ID<sE9xw-48I-21@gated-at.bofh.it>
In reply to#1521308

On 14/11/16 05:02, Pankaj Dubey wrote:
> Now as we have of_scu_enable which takes care of mapping
> scu base from DT, lets use it.
>
> CC: Liviu Dudau <liviu.dudau@arm.com>
> CC: Sudeep Holla <sudeep.holla@arm.com>

I assume you will take this series through a single tree. Also I assume
you may make changes around a9 SCU. I will try to test if I can get my
setup back working. But if this patch is not changed, then

Acked-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

[toc] | [prev] | [next] | [standalone]


#1524029 — Re: [PATCH 08/16] ARM: vexpress: use generic API for enabling SCU

From"pankaj.dubey" <pankaj.dubey@samsung.com>
Date2016-11-17 03:20 +0100
SubjectRe: [PATCH 08/16] ARM: vexpress: use generic API for enabling SCU
Message-ID<sEksV-2Rd-11@gated-at.bofh.it>
In reply to#1523525
Hi Sudeep,

On Wednesday 16 November 2016 08:04 PM, Sudeep Holla wrote:
> 
> 
> On 14/11/16 05:02, Pankaj Dubey wrote:
>> Now as we have of_scu_enable which takes care of mapping
>> scu base from DT, lets use it.
>>
>> CC: Liviu Dudau <liviu.dudau@arm.com>
>> CC: Sudeep Holla <sudeep.holla@arm.com>
> 
> I assume you will take this series through a single tree. Also I assume
> you may make changes around a9 SCU. I will try to test if I can get my
> setup back working. But if this patch is not changed, then
> 
> Acked-by: Sudeep Holla <sudeep.holla@arm.com>

Thanks for review and Ack.

Yes, plan is to take this series through a single tree.
As there are few comments for other platforms and common scu file, I
will address them and submit v2 of this series soon. But I can see there
won't be any changes for vexpress platform patch in v2, so I will
include your Ack.

Thanks,
Pankaj Dubey

[toc] | [prev] | [next] | [standalone]


#1521309 — [PATCH 05/16] ARM: socfpga: use generic API for enabling SCU

FromPankaj Dubey <pankaj.dubey@samsung.com>
Date2016-11-14 06:10 +0100
Subject[PATCH 05/16] ARM: socfpga: use generic API for enabling SCU
Message-ID<sDhGO-2pH-21@gated-at.bofh.it>
In reply to#1521298
Now as we have of_scu_enable which takes care of mapping
scu base from DT, lets use it.

CC: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/mach-socfpga/platsmp.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c
index 0794574..d3f0a07 100644
--- a/arch/arm/mach-socfpga/platsmp.c
+++ b/arch/arm/mach-socfpga/platsmp.c
@@ -79,19 +79,10 @@ static int socfpga_a10_boot_secondary(unsigned int cpu, struct task_struct *idle
 
 static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus)
 {
-	struct device_node *np;
-	void __iomem *socfpga_scu_base_addr;
-
-	np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
-	if (!np) {
+	if (of_scu_enable()) {
 		pr_err("%s: missing scu\n", __func__);
 		return;
 	}
-
-	socfpga_scu_base_addr = of_iomap(np, 0);
-	if (!socfpga_scu_base_addr)
-		return;
-	scu_enable(socfpga_scu_base_addr);
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1521312 — [PATCH 03/16] ARM: berlin: use generic API for enabling SCU

FromPankaj Dubey <pankaj.dubey@samsung.com>
Date2016-11-14 06:10 +0100
Subject[PATCH 03/16] ARM: berlin: use generic API for enabling SCU
Message-ID<sDhGO-2pH-29@gated-at.bofh.it>
In reply to#1521298
Now as we have of_scu_enable which takes care of mapping
scu base from DT, lets use it.

CC: Jisheng Zhang <jszhang@marvell.com>
CC: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/mach-berlin/platsmp.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-berlin/platsmp.c b/arch/arm/mach-berlin/platsmp.c
index 93f9068..25a6ca5 100644
--- a/arch/arm/mach-berlin/platsmp.c
+++ b/arch/arm/mach-berlin/platsmp.c
@@ -60,26 +60,21 @@ static int berlin_boot_secondary(unsigned int cpu, struct task_struct *idle)
 static void __init berlin_smp_prepare_cpus(unsigned int max_cpus)
 {
 	struct device_node *np;
-	void __iomem *scu_base;
 	void __iomem *vectors_base;
 
-	np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
-	scu_base = of_iomap(np, 0);
-	of_node_put(np);
-	if (!scu_base)
-		return;
-
 	np = of_find_compatible_node(NULL, NULL, "marvell,berlin-cpu-ctrl");
 	cpu_ctrl = of_iomap(np, 0);
 	of_node_put(np);
 	if (!cpu_ctrl)
-		goto unmap_scu;
+		return;
 
 	vectors_base = ioremap(CONFIG_VECTORS_BASE, SZ_32K);
 	if (!vectors_base)
-		goto unmap_scu;
+		return;
+
+	if (of_scu_enable())
+		return;
 
-	scu_enable(scu_base);
 	flush_cache_all();
 
 	/*
@@ -95,8 +90,6 @@ static void __init berlin_smp_prepare_cpus(unsigned int max_cpus)
 	writel(virt_to_phys(secondary_startup), vectors_base + SW_RESET_ADDR);
 
 	iounmap(vectors_base);
-unmap_scu:
-	iounmap(scu_base);
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1521438 — Re: [PATCH 03/16] ARM: berlin: use generic API for enabling SCU

FromJisheng Zhang <jszhang@marvell.com>
Date2016-11-14 10:00 +0100
SubjectRe: [PATCH 03/16] ARM: berlin: use generic API for enabling SCU
Message-ID<sDlho-4FD-31@gated-at.bofh.it>
In reply to#1521312
Hi Pankaj,

On Mon, 14 Nov 2016 10:31:58 +0530 Pankaj Dubey wrote:

> Now as we have of_scu_enable which takes care of mapping
> scu base from DT, lets use it.
> 
> CC: Jisheng Zhang <jszhang@marvell.com>
> CC: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
> ---
>  arch/arm/mach-berlin/platsmp.c | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-berlin/platsmp.c b/arch/arm/mach-berlin/platsmp.c
> index 93f9068..25a6ca5 100644
> --- a/arch/arm/mach-berlin/platsmp.c
> +++ b/arch/arm/mach-berlin/platsmp.c
> @@ -60,26 +60,21 @@ static int berlin_boot_secondary(unsigned int cpu, struct task_struct *idle)
>  static void __init berlin_smp_prepare_cpus(unsigned int max_cpus)
>  {
>  	struct device_node *np;
> -	void __iomem *scu_base;
>  	void __iomem *vectors_base;
>  
> -	np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
> -	scu_base = of_iomap(np, 0);
> -	of_node_put(np);
> -	if (!scu_base)
> -		return;
> -
>  	np = of_find_compatible_node(NULL, NULL, "marvell,berlin-cpu-ctrl");
>  	cpu_ctrl = of_iomap(np, 0);
>  	of_node_put(np);
>  	if (!cpu_ctrl)
> -		goto unmap_scu;
> +		return;
>  
>  	vectors_base = ioremap(CONFIG_VECTORS_BASE, SZ_32K);
>  	if (!vectors_base)
> -		goto unmap_scu;
> +		return;
> +
> +	if (of_scu_enable())

In err code path, we need to unmap vectors_base before return

> +		return;
>  
> -	scu_enable(scu_base);
>  	flush_cache_all();
>  
>  	/*
> @@ -95,8 +90,6 @@ static void __init berlin_smp_prepare_cpus(unsigned int max_cpus)
>  	writel(virt_to_phys(secondary_startup), vectors_base + SW_RESET_ADDR);
>  
>  	iounmap(vectors_base);
> -unmap_scu:
> -	iounmap(scu_base);
>  }
>  
>  #ifdef CONFIG_HOTPLUG_CPU

[toc] | [prev] | [next] | [standalone]


#1521822 — Re: [PATCH 03/16] ARM: berlin: use generic API for enabling SCU

FromPankaj Dubey <pankaj.dubey@samsung.com>
Date2016-11-14 17:30 +0100
SubjectRe: [PATCH 03/16] ARM: berlin: use generic API for enabling SCU
Message-ID<sDsiR-Vh-11@gated-at.bofh.it>
In reply to#1521438
Hi Jisheng,

On 14 November 2016 at 14:21, Jisheng Zhang <jszhang@marvell.com> wrote:
> Hi Pankaj,
>
> On Mon, 14 Nov 2016 10:31:58 +0530 Pankaj Dubey wrote:
>
>> Now as we have of_scu_enable which takes care of mapping
>> scu base from DT, lets use it.
>>
>> CC: Jisheng Zhang <jszhang@marvell.com>
>> CC: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
>> Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
>> ---
>>  arch/arm/mach-berlin/platsmp.c | 17 +++++------------
>>  1 file changed, 5 insertions(+), 12 deletions(-)
>>
>> diff --git a/arch/arm/mach-berlin/platsmp.c b/arch/arm/mach-berlin/platsmp.c
>> index 93f9068..25a6ca5 100644
>> --- a/arch/arm/mach-berlin/platsmp.c
>> +++ b/arch/arm/mach-berlin/platsmp.c
>> @@ -60,26 +60,21 @@ static int berlin_boot_secondary(unsigned int cpu, struct task_struct *idle)
>>  static void __init berlin_smp_prepare_cpus(unsigned int max_cpus)
>>  {
>>       struct device_node *np;
>> -     void __iomem *scu_base;
>>       void __iomem *vectors_base;
>>
>> -     np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
>> -     scu_base = of_iomap(np, 0);
>> -     of_node_put(np);
>> -     if (!scu_base)
>> -             return;
>> -
>>       np = of_find_compatible_node(NULL, NULL, "marvell,berlin-cpu-ctrl");
>>       cpu_ctrl = of_iomap(np, 0);
>>       of_node_put(np);
>>       if (!cpu_ctrl)
>> -             goto unmap_scu;
>> +             return;
>>
>>       vectors_base = ioremap(CONFIG_VECTORS_BASE, SZ_32K);
>>       if (!vectors_base)
>> -             goto unmap_scu;
>> +             return;
>> +
>> +     if (of_scu_enable())
>
> In err code path, we need to unmap vectors_base before return
>

You are correct. I missed this, Will update in v2.

Thanks for review.

Pankaj Dubey

>> +             return;
>>
>> -     scu_enable(scu_base);
>>       flush_cache_all();
>>
>>       /*
>> @@ -95,8 +90,6 @@ static void __init berlin_smp_prepare_cpus(unsigned int max_cpus)
>>       writel(virt_to_phys(secondary_startup), vectors_base + SW_RESET_ADDR);
>>
>>       iounmap(vectors_base);
>> -unmap_scu:
>> -     iounmap(scu_base);
>>  }
>>
>>  #ifdef CONFIG_HOTPLUG_CPU
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

[toc] | [prev] | [next] | [standalone]


#1521313 — [PATCH 10/16] ARM: tegra: use generic API for enabling SCU

FromPankaj Dubey <pankaj.dubey@samsung.com>
Date2016-11-14 06:10 +0100
Subject[PATCH 10/16] ARM: tegra: use generic API for enabling SCU
Message-ID<sDhGO-2pH-31@gated-at.bofh.it>
In reply to#1521298
Now as we have of_scu_enable which takes care of mapping
scu base from DT, lets use it.

CC: Stephen Warren <swarren@wwwdotorg.org>
CC: linux-tegra@vger.kernel.org
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/mach-tegra/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c
index 75620ae..3467617 100644
--- a/arch/arm/mach-tegra/platsmp.c
+++ b/arch/arm/mach-tegra/platsmp.c
@@ -179,7 +179,7 @@ static void __init tegra_smp_prepare_cpus(unsigned int max_cpus)
 	cpumask_set_cpu(0, &tegra_cpu_init_mask);
 
 	if (scu_a9_has_base())
-		scu_enable(IO_ADDRESS(scu_a9_get_base()));
+		of_scu_enable();
 }
 
 const struct smp_operations tegra_smp_ops __initconst = {
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1521314 — [PATCH 16/16] ARM: zx: use generic API for enabling SCU

FromPankaj Dubey <pankaj.dubey@samsung.com>
Date2016-11-14 06:10 +0100
Subject[PATCH 16/16] ARM: zx: use generic API for enabling SCU
Message-ID<sDhGO-2pH-33@gated-at.bofh.it>
In reply to#1521298
Now as we have of_scu_enable which takes care of mapping
scu base from DT, lets use it.

CC: Jun Nie <jun.nie@linaro.org>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/mach-zx/platsmp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-zx/platsmp.c b/arch/arm/mach-zx/platsmp.c
index 0297f92..2788c34 100644
--- a/arch/arm/mach-zx/platsmp.c
+++ b/arch/arm/mach-zx/platsmp.c
@@ -44,13 +44,11 @@ static void __iomem *scu_base;
 void __init zx_smp_prepare_cpus(unsigned int max_cpus)
 {
 	struct device_node *np;
-	unsigned long base = 0;
 	void __iomem *aonsysctrl_base;
 	void __iomem *sys_iram;
 
-	base = scu_a9_get_base();
-	scu_base = ioremap(base, SZ_256);
-	if (!scu_base) {
+	scu_base = of_scu_get_base();
+	if (IS_ERR(scu_base)) {
 		pr_err("%s: failed to map scu\n", __func__);
 		return;
 	}
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1521315 — [PATCH 11/16] ARM: rockchip: use generic API for enabling SCU

FromPankaj Dubey <pankaj.dubey@samsung.com>
Date2016-11-14 06:10 +0100
Subject[PATCH 11/16] ARM: rockchip: use generic API for enabling SCU
Message-ID<sDhGO-2pH-27@gated-at.bofh.it>
In reply to#1521298
Now as we have of_scu_enable which takes care of mapping
scu base from DT, lets use it.

CC: Heiko Stuebner <heiko@sntech.de>
CC: linux-rockchip@lists.infradead.org
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/mach-rockchip/platsmp.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c
index 4d827a0..31169cf 100644
--- a/arch/arm/mach-rockchip/platsmp.c
+++ b/arch/arm/mach-rockchip/platsmp.c
@@ -282,21 +282,15 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
 	if (has_pmu && rockchip_smp_prepare_pmu())
 		return;
 
-	if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
+	if (scu_a9_has_base()) {
 		if (rockchip_smp_prepare_sram(node))
 			return;
 
 		/* enable the SCU power domain */
 		pmu_set_power_domain(PMU_PWRDN_SCU, true);
 
-		node = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
-		if (!node) {
-			pr_err("%s: missing scu\n", __func__);
-			return;
-		}
-
-		scu_base_addr = of_iomap(node, 0);
-		if (!scu_base_addr) {
+		scu_base_addr = of_scu_get_base();
+		if (IS_ERR(scu_base_addr)) {
 			pr_err("%s: could not map scu registers\n", __func__);
 			return;
 		}
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1521317 — [PATCH 14/16] ARM: hisi: use generic API for enabling SCU

FromPankaj Dubey <pankaj.dubey@samsung.com>
Date2016-11-14 06:10 +0100
Subject[PATCH 14/16] ARM: hisi: use generic API for enabling SCU
Message-ID<sDhGO-2pH-45@gated-at.bofh.it>
In reply to#1521298
Now as we have of_scu_enable which takes care of mapping
scu base from DT, lets use it.

CC: Wei Xu <xuwei5@hisilicon.com>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/mach-hisi/platsmp.c | 24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c
index e1d6764..425a291 100644
--- a/arch/arm/mach-hisi/platsmp.c
+++ b/arch/arm/mach-hisi/platsmp.c
@@ -39,29 +39,14 @@ int hi3xxx_get_cpu_jump(int cpu)
 	return readl_relaxed(ctrl_base + ((cpu - 1) << 2));
 }
 
-static void __init hisi_enable_scu_a9(void)
-{
-	unsigned long base = 0;
-	void __iomem *scu_base = NULL;
-
-	if (scu_a9_has_base()) {
-		base = scu_a9_get_base();
-		scu_base = ioremap(base, SZ_4K);
-		if (!scu_base) {
-			pr_err("ioremap(scu_base) failed\n");
-			return;
-		}
-		scu_enable(scu_base);
-		iounmap(scu_base);
-	}
-}
-
 static void __init hi3xxx_smp_prepare_cpus(unsigned int max_cpus)
 {
 	struct device_node *np = NULL;
 	u32 offset = 0;
 
-	hisi_enable_scu_a9();
+	if (scu_a9_has_base())
+		of_scu_enable();
+
 	if (!ctrl_base) {
 		np = of_find_compatible_node(NULL, NULL, "hisilicon,sysctrl");
 		if (!np) {
@@ -100,7 +85,8 @@ static const struct smp_operations hi3xxx_smp_ops __initconst = {
 
 static void __init hisi_common_smp_prepare_cpus(unsigned int max_cpus)
 {
-	hisi_enable_scu_a9();
+	if (scu_a9_has_base())
+		of_scu_enable();
 }
 
 static void hix5hd2_set_scu_boot_addr(phys_addr_t start_addr, phys_addr_t jump_addr)
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1521319 — [PATCH 07/16] ARM: ux500: use generic API for enabling SCU

FromPankaj Dubey <pankaj.dubey@samsung.com>
Date2016-11-14 06:10 +0100
Subject[PATCH 07/16] ARM: ux500: use generic API for enabling SCU
Message-ID<sDhGO-2pH-43@gated-at.bofh.it>
In reply to#1521298
Now as we have of_scu_enable which takes care of mapping
scu base from DT, lets use it.

CC: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
---
 arch/arm/mach-ux500/platsmp.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index 8f2f615..e1927ae 100644
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -66,28 +66,10 @@ static void wakeup_secondary(void)
 
 static void __init ux500_smp_prepare_cpus(unsigned int max_cpus)
 {
-	struct device_node *np;
-	static void __iomem *scu_base;
-	unsigned int ncores;
-	int i;
-
-	np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
-	if (!np) {
-		pr_err("No SCU base address\n");
-		return;
-	}
-	scu_base = of_iomap(np, 0);
-	of_node_put(np);
-	if (!scu_base) {
+	if (of_scu_enable()) {
 		pr_err("No SCU remap\n");
 		return;
 	}
-
-	scu_enable(scu_base);
-	ncores = scu_get_core_count(scu_base);
-	for (i = 0; i < ncores; i++)
-		set_cpu_possible(i, true);
-	iounmap(scu_base);
 }
 
 static int ux500_boot_secondary(unsigned int cpu, struct task_struct *idle)
-- 
2.7.4

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web