linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] ARM: mvebu: Let the device-tree determine smp_ops
@ 2014-11-06  4:49 Chris Packham
  2014-11-06 14:49 ` Andrew Lunn
  2014-11-06 14:58 ` Thomas Petazzoni
  0 siblings, 2 replies; 20+ messages in thread
From: Chris Packham @ 2014-11-06  4:49 UTC (permalink / raw)
  To: linux-arm-kernel

The machine specific SMP operations can be configured either via
setup_arch or via arm_dt_init_cpu_maps. For the ARMADA_370_XP_DT devices
both of these are called and setup_arch wins because it is called last.
This means that it is not possible to substitute a different set of SMP
operations via the device-tree.

All of the ARMADA_370_XP_DT compatible devices are either single core or
declare an enable-method in the dts (via one of armada-xp-mv78230.dtsi,
armada-xp-mv78260.dtsi or armada-xp-mv78460.dtsi). Remove the smp
assignment from board-v7.c so that the SMP operations set via the
device-tree aren't discarded.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
Hi,

(This is the first patch I've sent to the arm-lkml so beware of my newbie-ness)

I'm working on a new board that uses a integrated CPU that according to the
vendor is "based on the ARMADA-XP", more on that to come in the future
hopefully. For the most part things just work if I use a .dts based on the
mv78260.

One difference I've encountered is in the way the secondary CPU is initialised,
which requires me to supply a slightly different set of machine specific SMP
operations so I can bring up the 2nd core. It looks like I should be able to
supply a different /cpus/enable-method in the .dts and once I define the
corresponding set of operations it should be picked up. 

Which leads me to what I think could be a bug (or just a lack of clear
specification). The smp ops are set by both arm_dt_init_cpu_maps (from the
enable-method) and setup_arch (from mdesc). The latter always wins because it
is called last and doesn't check to see if smp_ops has already been set.

This is my attempt at fixing the problem by not setting mdesc.smp for the
ARMADA_370_XP_DT machines thus preventing setup_arch from overriding what has
been setup by arm_dt_init_cpu_maps.

Thanks,
Chris

 arch/arm/mach-mvebu/board-v7.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
index 6478626..894974b 100644
--- a/arch/arm/mach-mvebu/board-v7.c
+++ b/arch/arm/mach-mvebu/board-v7.c
@@ -206,7 +206,6 @@ static const char * const armada_370_xp_dt_compat[] = {
 DT_MACHINE_START(ARMADA_370_XP_DT, "Marvell Armada 370/XP (Device Tree)")
 	.l2c_aux_val	= 0,
 	.l2c_aux_mask	= ~0,
-	.smp		= smp_ops(armada_xp_smp_ops),
 	.init_machine	= mvebu_dt_init,
 	.init_irq       = mvebu_init_irq,
 	.restart	= mvebu_restart,
-- 
2.2.0.rc0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2014-11-18 23:37 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-06  4:49 [RFC PATCH] ARM: mvebu: Let the device-tree determine smp_ops Chris Packham
2014-11-06 14:49 ` Andrew Lunn
2014-11-06 19:49   ` Chris Packham
2014-11-06 20:03     ` Andrew Lunn
2014-11-06 14:58 ` Thomas Petazzoni
2014-11-06 15:21   ` Andrew Lunn
2014-11-06 15:33     ` Thomas Petazzoni
2014-11-06 19:56   ` Chris Packham
2014-11-06 20:16     ` Andrew Lunn
2014-11-07  2:33       ` [RFC PATCHv2] " Chris Packham
2014-11-16 22:40         ` [RFC PATCHv3] " Chris Packham
2014-11-17  8:45         ` [RFC PATCHv2] " Thomas Petazzoni
2014-11-17  8:56         ` Thomas Petazzoni
2014-11-17 20:46           ` Chris Packham
2014-11-17 23:34           ` Chris Packham
2014-11-18  0:31             ` Chris Packham
2014-11-18  8:21               ` Maxime Ripard
2014-11-18 19:43                 ` Chris Packham
2014-11-18 23:37                 ` [RFC PATCHv4] ARM: mvebu: use dt_fixup to provide fallback for enable-method Chris Packham
2014-11-18  8:16             ` [RFC PATCHv2] ARM: mvebu: Let the device-tree determine smp_ops Maxime Ripard

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).