[PATCH RESEND 2/3] ARM: Meson6: Add SMP support for Amlogic Meson6

Arnd Bergmann arnd at arndb.de
Mon Nov 24 07:20:45 PST 2014


On Friday 14 November 2014, Carlo Caione wrote:

> +static void __iomem *cpucfg_membase;
> +static void __iomem *scu_membase;

I don't think you need a global scu_membase variable, you use it only in
one function.

> +static DEFINE_SPINLOCK(cpu_lock);
> +
> +extern void meson_secondary_startup(void);

Better put the extern declaration into a header file.

> +static void __init meson6_smp_prepare_cpus(unsigned int max_cpus)
> +{
> +	struct device_node *node;
> +
> +	node = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
> +	if (!node) {
> +		pr_err("Missing Meson6 SCU node\n");
> +		return;
> +	}
> +
> +	scu_membase = of_iomap(node, 0);
> +	if (!scu_membase) {
> +		pr_err("Couln't map Meson6 SCU registers\n");
> +		return;
> +	}
> +
> +	node = of_find_compatible_node(NULL, NULL, "amlogic,meson6-cpuconfig");
> +	if (!node) {
> +		pr_err("Missing Meson6 CPU config node\n");
> +		return;
> +	}

I'm not sure about the "amlogic,meson6-cpuconfig" device node. Since this
is just an 8-byte register range, I suspect it's actually part of a larger
device, so you should better represent that instead. We can now have
early "syscon" devices (in linux-next I think), so you could instead make
this a device that is compatible with "syscon" and have the smp code
look that up and apply an appropriate offset. Do you have an idea of
which device this is part of?

	Arnd



More information about the linux-arm-kernel mailing list