@@ -86,7 +86,7 @@ struct smp_operations {
/*
* Setup the set of possible CPUs (via set_cpu_possible)
*/
- void (*smp_init_cpus)(void);
+ int (*smp_init_cpus)(void);
/*
* Initialize cpu_possible map, and enable coherency
*/
@@ -373,7 +373,7 @@ fail:
* which may be present or become present in the system.
*/
-static void __init exynos_smp_init_cpus(void)
+static int __init exynos_smp_init_cpus(void)
{
void __iomem *scu_base = scu_base_addr();
unsigned int i, ncores;
@@ -385,7 +385,7 @@ static void __init exynos_smp_init_cpus(void)
* CPU Nodes are passed thru DT and set_cpu_possible
* is set by "arm_dt_init_cpu_maps".
*/
- return;
+ return 0;
/* sanity check */
if (ncores > nr_cpu_ids) {
@@ -396,6 +396,8 @@ static void __init exynos_smp_init_cpus(void)
for (i = 0; i < ncores; i++)
set_cpu_possible(i, true);
+
+ return ncores;
}
static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)
@@ -57,7 +57,7 @@ static int imx_boot_secondary(unsigned int cpu, struct task_struct *idle)
* Initialise the CPU possible map early - this describes the CPUs
* which may be present or become present in the system.
*/
-static void __init imx_smp_init_cpus(void)
+static int __init imx_smp_init_cpus(void)
{
int i, ncores;
@@ -65,6 +65,8 @@ static void __init imx_smp_init_cpus(void)
for (i = ncores; i < NR_CPUS; i++)
set_cpu_possible(i, false);
+
+ return ncores;
}
void imx_smp_prepare(void)
@@ -175,7 +175,7 @@ static int omap4_boot_secondary(unsigned int cpu, struct task_struct *idle)
* Initialise the CPU possible map early - this describes the CPUs
* which may be present or become present in the system.
*/
-static void __init omap4_smp_init_cpus(void)
+static int __init omap4_smp_init_cpus(void)
{
unsigned int i = 0, ncores = 1, cpu_id;
@@ -202,6 +202,8 @@ static void __init omap4_smp_init_cpus(void)
for (i = 0; i < ncores; i++)
set_cpu_possible(i, true);
+
+ return ncores;
}
static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)
@@ -42,7 +42,7 @@ static void __iomem *scu_base_addr(void)
* Initialise the CPU possible map early - this describes the CPUs
* which may be present or become present in the system.
*/
-static void __init realview_smp_init_cpus(void)
+static int __init realview_smp_init_cpus(void)
{
void __iomem *scu_base = scu_base_addr();
unsigned int i, ncores;
@@ -58,6 +58,8 @@ static void __init realview_smp_init_cpus(void)
for (i = 0; i < ncores; i++)
set_cpu_possible(i, true);
+
+ return ncores;
}
static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
@@ -58,7 +58,7 @@ static int socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle)
* Initialise the CPU possible map early - this describes the CPUs
* which may be present or become present in the system.
*/
-static void __init socfpga_smp_init_cpus(void)
+static int __init socfpga_smp_init_cpus(void)
{
unsigned int i, ncores;
@@ -76,6 +76,8 @@ static void __init socfpga_smp_init_cpus(void)
for (i = 0; i < ncores; i++)
set_cpu_possible(i, true);
+
+ return ncores;
}
static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus)
@@ -93,7 +93,7 @@ static int spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle)
* Initialise the CPU possible map early - this describes the CPUs
* which may be present or become present in the system.
*/
-static void __init spear13xx_smp_init_cpus(void)
+static int __init spear13xx_smp_init_cpus(void)
{
unsigned int i, ncores = scu_get_core_count(scu_base);
@@ -105,6 +105,8 @@ static void __init spear13xx_smp_init_cpus(void)
for (i = 0; i < ncores; i++)
set_cpu_possible(i, true);
+
+ return ncores;
}
static void __init spear13xx_smp_prepare_cpus(unsigned int max_cpus)
@@ -133,7 +133,7 @@ static void __init wakeup_secondary(void)
* Initialise the CPU possible map early - this describes the CPUs
* which may be present or become present in the system.
*/
-static void __init ux500_smp_init_cpus(void)
+static int __init ux500_smp_init_cpus(void)
{
void __iomem *scu_base = scu_base_addr();
unsigned int i, ncores;
@@ -149,6 +149,8 @@ static void __init ux500_smp_init_cpus(void)
for (i = 0; i < ncores; i++)
set_cpu_possible(i, true);
+
+ return ncores;
}
static void __init ux500_smp_prepare_cpus(unsigned int max_cpus)
@@ -97,7 +97,7 @@ static int zynq_boot_secondary(unsigned int cpu,
* Initialise the CPU possible map early - this describes the CPUs
* which may be present or become present in the system.
*/
-static void __init zynq_smp_init_cpus(void)
+static int __init zynq_smp_init_cpus(void)
{
int i;
@@ -105,6 +105,8 @@ static void __init zynq_smp_init_cpus(void)
for (i = 0; i < ncores && i < CONFIG_NR_CPUS; i++)
set_cpu_possible(i, true);
+
+ return ncores;
}
static void __init zynq_smp_prepare_cpus(unsigned int max_cpus)
Return the number of cores the platform has. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- arch/arm/include/asm/smp.h | 2 +- arch/arm/mach-exynos/platsmp.c | 6 ++++-- arch/arm/mach-imx/platsmp.c | 4 +++- arch/arm/mach-omap2/omap-smp.c | 4 +++- arch/arm/mach-realview/platsmp.c | 4 +++- arch/arm/mach-socfpga/platsmp.c | 4 +++- arch/arm/mach-spear/platsmp.c | 4 +++- arch/arm/mach-ux500/platsmp.c | 4 +++- arch/arm/mach-zynq/platsmp.c | 4 +++- 9 files changed, 26 insertions(+), 10 deletions(-)