* [PATCH 0/2] ARM: shmobile: r8a7791: Correct number of CPU cores
@ 2014-10-24 8:33 Simon Horman
2014-10-24 8:33 ` [PATCH 1/2] ARM: shmobile: Separate APMU resource data into CPU dependant part Simon Horman
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Simon Horman @ 2014-10-24 8:33 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
this short series separates AMPU resource data as it is not
common accross R-Car gen2 SoCs: only the r8a7790 (H1) has the resouces
described. It then corrects the resource data for the r8a7791,
the only other SoC currently present in mainline that uses this data.
Based on the renesas-next-20141024-v3.18-rc1 tag of my renesas tree.
Hisashi Nakamura (2):
ARM: shmobile: Separate APMU resource data into CPU dependant part
ARM: shmobile: r8a7791: Correct number of CPU cores
arch/arm/mach-shmobile/common.h | 5 -----
arch/arm/mach-shmobile/platsmp-apmu.c | 27 +++++++++------------------
arch/arm/mach-shmobile/platsmp-apmu.h | 32 ++++++++++++++++++++++++++++++++
arch/arm/mach-shmobile/smp-r8a7790.c | 16 +++++++++++++++-
arch/arm/mach-shmobile/smp-r8a7791.c | 12 +++++++++++-
5 files changed, 67 insertions(+), 25 deletions(-)
create mode 100644 arch/arm/mach-shmobile/platsmp-apmu.h
--
2.1.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ARM: shmobile: Separate APMU resource data into CPU dependant part
2014-10-24 8:33 [PATCH 0/2] ARM: shmobile: r8a7791: Correct number of CPU cores Simon Horman
@ 2014-10-24 8:33 ` Simon Horman
2014-10-24 8:33 ` [PATCH 2/2] ARM: shmobile: r8a7791: Correct number of CPU cores Simon Horman
2014-11-05 0:36 ` [PATCH 0/2] " Simon Horman
2 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2014-10-24 8:33 UTC (permalink / raw)
To: linux-arm-kernel
From: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
APMU resources are not common to all R-Car SoCs so don't share this data.
A subsequent patch will correct the CPU cores for the r8a7791.
Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/common.h | 5 -----
arch/arm/mach-shmobile/platsmp-apmu.c | 27 +++++++++------------------
arch/arm/mach-shmobile/platsmp-apmu.h | 32 ++++++++++++++++++++++++++++++++
arch/arm/mach-shmobile/smp-r8a7790.c | 16 +++++++++++++++-
arch/arm/mach-shmobile/smp-r8a7791.c | 16 +++++++++++++++-
5 files changed, 71 insertions(+), 25 deletions(-)
create mode 100644 arch/arm/mach-shmobile/platsmp-apmu.h
diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index 72087c7..309025e 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -19,11 +19,6 @@ extern void shmobile_boot_scu(void);
extern void shmobile_smp_scu_prepare_cpus(unsigned int max_cpus);
extern void shmobile_smp_scu_cpu_die(unsigned int cpu);
extern int shmobile_smp_scu_cpu_kill(unsigned int cpu);
-extern void shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus);
-extern int shmobile_smp_apmu_boot_secondary(unsigned int cpu,
- struct task_struct *idle);
-extern void shmobile_smp_apmu_cpu_die(unsigned int cpu);
-extern int shmobile_smp_apmu_cpu_kill(unsigned int cpu);
struct clk;
extern int shmobile_clk_init(void);
extern void shmobile_handle_irq_intc(struct pt_regs *);
diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
index 2c06810..f483b56 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -1,6 +1,7 @@
/*
* SMP support for SoCs with APMU
*
+ * Copyright (C) 2014 Renesas Electronics Corporation
* Copyright (C) 2013 Magnus Damm
*
* This program is free software; you can redistribute it and/or modify
@@ -22,6 +23,7 @@
#include <asm/smp_plat.h>
#include <asm/suspend.h>
#include "common.h"
+#include "platsmp-apmu.h"
static struct {
void __iomem *iomem;
@@ -83,28 +85,15 @@ static void apmu_init_cpu(struct resource *res, int cpu, int bit)
pr_debug("apmu ioremap %d %d %pr\n", cpu, bit, res);
}
-static struct {
- struct resource iomem;
- int cpus[4];
-} apmu_config[] = {
- {
- .iomem = DEFINE_RES_MEM(0xe6152000, 0x88),
- .cpus = { 0, 1, 2, 3 },
- },
- {
- .iomem = DEFINE_RES_MEM(0xe6151000, 0x88),
- .cpus = { 0x100, 0x101, 0x102, 0x103 },
- }
-};
-
-static void apmu_parse_cfg(void (*fn)(struct resource *res, int cpu, int bit))
+static void apmu_parse_cfg(void (*fn)(struct resource *res, int cpu, int bit),
+ struct rcar_apmu_config *apmu_config, int num)
{
u32 id;
int k;
int bit, index;
bool is_allowed;
- for (k = 0; k < ARRAY_SIZE(apmu_config); k++) {
+ for (k = 0; k < num; k++) {
/* only enable the cluster that includes the boot CPU */
is_allowed = false;
for (bit = 0; bit < ARRAY_SIZE(apmu_config[k].cpus); bit++) {
@@ -128,14 +117,16 @@ static void apmu_parse_cfg(void (*fn)(struct resource *res, int cpu, int bit))
}
}
-void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus)
+void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus,
+ struct rcar_apmu_config *apmu_config,
+ int num)
{
/* install boot code shared by all CPUs */
shmobile_boot_fn = virt_to_phys(shmobile_smp_boot);
shmobile_boot_arg = MPIDR_HWID_BITMASK;
/* perform per-cpu setup */
- apmu_parse_cfg(apmu_init_cpu);
+ apmu_parse_cfg(apmu_init_cpu, apmu_config, num);
}
#ifdef CONFIG_SMP
diff --git a/arch/arm/mach-shmobile/platsmp-apmu.h b/arch/arm/mach-shmobile/platsmp-apmu.h
new file mode 100644
index 0000000..76512c9
--- /dev/null
+++ b/arch/arm/mach-shmobile/platsmp-apmu.h
@@ -0,0 +1,32 @@
+/*
+ * rmobile apmu definition
+ *
+ * Copyright (C) 2014 Renesas Electronics Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef PLATSMP_APMU_H
+#define PLATSMP_APMU_H
+
+struct rcar_apmu_config {
+ struct resource iomem;
+ int cpus[4];
+};
+
+extern void shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus,
+ struct rcar_apmu_config *apmu_config,
+ int num);
+extern int shmobile_smp_apmu_boot_secondary(unsigned int cpu,
+ struct task_struct *idle);
+extern void shmobile_smp_apmu_cpu_die(unsigned int cpu);
+extern int shmobile_smp_apmu_cpu_kill(unsigned int cpu);
+
+#endif /* PLATSMP_APMU_H */
diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c
index 2311694..9c3da13 100644
--- a/arch/arm/mach-shmobile/smp-r8a7790.c
+++ b/arch/arm/mach-shmobile/smp-r8a7790.c
@@ -21,6 +21,7 @@
#include <asm/smp_plat.h>
#include "common.h"
+#include "platsmp-apmu.h"
#include "pm-rcar.h"
#include "r8a7790.h"
@@ -34,10 +35,23 @@ static struct rcar_sysc_ch r8a7790_ca7_scu = {
.isr_bit = 21, /* CA7-SCU */
};
+static struct rcar_apmu_config r8a7790_apmu_config[] = {
+ {
+ .iomem = DEFINE_RES_MEM(0xe6152000, 0x88),
+ .cpus = { 0, 1, 2, 3 },
+ },
+ {
+ .iomem = DEFINE_RES_MEM(0xe6151000, 0x88),
+ .cpus = { 0x100, 0x0101, 0x102, 0x103 },
+ }
+};
+
static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus)
{
/* let APMU code install data related to shmobile_boot_vector */
- shmobile_smp_apmu_prepare_cpus(max_cpus);
+ shmobile_smp_apmu_prepare_cpus(max_cpus,
+ r8a7790_apmu_config,
+ ARRAY_SIZE(r8a7790_apmu_config));
/* turn on power to SCU */
r8a7790_pm_init();
diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c
index f743386..96e392c 100644
--- a/arch/arm/mach-shmobile/smp-r8a7791.c
+++ b/arch/arm/mach-shmobile/smp-r8a7791.c
@@ -21,13 +21,27 @@
#include <asm/smp_plat.h>
#include "common.h"
+#include "platsmp-apmu.h"
#include "r8a7791.h"
#include "rcar-gen2.h"
+static struct rcar_apmu_config r8a7791_apmu_config[] = {
+ {
+ .iomem = DEFINE_RES_MEM(0xe6152000, 0x88),
+ .cpus = { 0, 1, 2, 3 },
+ },
+ {
+ .iomem = DEFINE_RES_MEM(0xe6151000, 0x88),
+ .cpus = { 0x100, 0x0101, 0x102, 0x103 },
+ }
+};
+
static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus)
{
/* let APMU code install data related to shmobile_boot_vector */
- shmobile_smp_apmu_prepare_cpus(max_cpus);
+ shmobile_smp_apmu_prepare_cpus(max_cpus,
+ r8a7791_apmu_config,
+ ARRAY_SIZE(r8a7791_apmu_config));
r8a7791_pm_init();
}
--
2.1.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ARM: shmobile: r8a7791: Correct number of CPU cores
2014-10-24 8:33 [PATCH 0/2] ARM: shmobile: r8a7791: Correct number of CPU cores Simon Horman
2014-10-24 8:33 ` [PATCH 1/2] ARM: shmobile: Separate APMU resource data into CPU dependant part Simon Horman
@ 2014-10-24 8:33 ` Simon Horman
2014-11-05 0:36 ` [PATCH 0/2] " Simon Horman
2 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2014-10-24 8:33 UTC (permalink / raw)
To: linux-arm-kernel
From: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
The r8a7791 only has 2 CPU CA15 cores, not 4 CA15 and 4 CA7 cores.
Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/smp-r8a7791.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c
index 96e392c..7e49e0a 100644
--- a/arch/arm/mach-shmobile/smp-r8a7791.c
+++ b/arch/arm/mach-shmobile/smp-r8a7791.c
@@ -28,11 +28,7 @@
static struct rcar_apmu_config r8a7791_apmu_config[] = {
{
.iomem = DEFINE_RES_MEM(0xe6152000, 0x88),
- .cpus = { 0, 1, 2, 3 },
- },
- {
- .iomem = DEFINE_RES_MEM(0xe6151000, 0x88),
- .cpus = { 0x100, 0x0101, 0x102, 0x103 },
+ .cpus = { 0, 1 },
}
};
--
2.1.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 0/2] ARM: shmobile: r8a7791: Correct number of CPU cores
2014-10-24 8:33 [PATCH 0/2] ARM: shmobile: r8a7791: Correct number of CPU cores Simon Horman
2014-10-24 8:33 ` [PATCH 1/2] ARM: shmobile: Separate APMU resource data into CPU dependant part Simon Horman
2014-10-24 8:33 ` [PATCH 2/2] ARM: shmobile: r8a7791: Correct number of CPU cores Simon Horman
@ 2014-11-05 0:36 ` Simon Horman
2014-11-05 1:23 ` Magnus Damm
2 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2014-11-05 0:36 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Oct 24, 2014 at 05:33:07PM +0900, Simon Horman wrote:
> Hi,
>
> this short series separates AMPU resource data as it is not
> common accross R-Car gen2 SoCs: only the r8a7790 (H1) has the resouces
> described. It then corrects the resource data for the r8a7791,
> the only other SoC currently present in mainline that uses this data.
>
> Based on the renesas-next-20141024-v3.18-rc1 tag of my renesas tree.
>
> Hisashi Nakamura (2):
> ARM: shmobile: Separate APMU resource data into CPU dependant part
> ARM: shmobile: r8a7791: Correct number of CPU cores
I have queued up this series.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 0/2] ARM: shmobile: r8a7791: Correct number of CPU cores
2014-11-05 0:36 ` [PATCH 0/2] " Simon Horman
@ 2014-11-05 1:23 ` Magnus Damm
2014-11-05 1:56 ` Simon Horman
0 siblings, 1 reply; 6+ messages in thread
From: Magnus Damm @ 2014-11-05 1:23 UTC (permalink / raw)
To: linux-arm-kernel
Hi Simon,
On Wed, Nov 5, 2014 at 9:36 AM, Simon Horman <horms@verge.net.au> wrote:
> On Fri, Oct 24, 2014 at 05:33:07PM +0900, Simon Horman wrote:
>> Hi,
>>
>> this short series separates AMPU resource data as it is not
>> common accross R-Car gen2 SoCs: only the r8a7790 (H1) has the resouces
>> described. It then corrects the resource data for the r8a7791,
>> the only other SoC currently present in mainline that uses this data.
>>
>> Based on the renesas-next-20141024-v3.18-rc1 tag of my renesas tree.
>>
>> Hisashi Nakamura (2):
>> ARM: shmobile: Separate APMU resource data into CPU dependant part
>> ARM: shmobile: r8a7791: Correct number of CPU cores
>
> I have queued up this series.
Thanks. I didn't say anything so I should probably be silent, but in
the future it would make sense to fold in the fix into the original
patch to void merging broken stuff.
Cheers,
/ magnus
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 0/2] ARM: shmobile: r8a7791: Correct number of CPU cores
2014-11-05 1:23 ` Magnus Damm
@ 2014-11-05 1:56 ` Simon Horman
0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2014-11-05 1:56 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Nov 05, 2014 at 10:23:34AM +0900, Magnus Damm wrote:
> Hi Simon,
>
> On Wed, Nov 5, 2014 at 9:36 AM, Simon Horman <horms@verge.net.au> wrote:
> > On Fri, Oct 24, 2014 at 05:33:07PM +0900, Simon Horman wrote:
> >> Hi,
> >>
> >> this short series separates AMPU resource data as it is not
> >> common accross R-Car gen2 SoCs: only the r8a7790 (H1) has the resouces
> >> described. It then corrects the resource data for the r8a7791,
> >> the only other SoC currently present in mainline that uses this data.
> >>
> >> Based on the renesas-next-20141024-v3.18-rc1 tag of my renesas tree.
> >>
> >> Hisashi Nakamura (2):
> >> ARM: shmobile: Separate APMU resource data into CPU dependant part
> >> ARM: shmobile: r8a7791: Correct number of CPU cores
> >
> > I have queued up this series.
>
> Thanks. I didn't say anything so I should probably be silent, but in
> the future it would make sense to fold in the fix into the original
> patch to void merging broken stuff.
I'm not quite sure what you are getting at in relation to this series,
but yes, in general I agree.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-11-05 1:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-24 8:33 [PATCH 0/2] ARM: shmobile: r8a7791: Correct number of CPU cores Simon Horman
2014-10-24 8:33 ` [PATCH 1/2] ARM: shmobile: Separate APMU resource data into CPU dependant part Simon Horman
2014-10-24 8:33 ` [PATCH 2/2] ARM: shmobile: r8a7791: Correct number of CPU cores Simon Horman
2014-11-05 0:36 ` [PATCH 0/2] " Simon Horman
2014-11-05 1:23 ` Magnus Damm
2014-11-05 1:56 ` Simon Horman
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).