ARM: mvebu: Simplify memory init order
The initialisation of the memory nodes on mvebu is a bit
compilcated:

pure_initcall(mvebu_memory_fixup_register)
	of_register_fixup(mvebu_memory_of_fixup, NULL)
core_initcall(kirkwood_init_soc)
	mvebu_set_memory()
core_initcall(of_arm_init)
	of_fix_tree()
		mvebu_memory_of_fixup()

First a mvebu common of_fixup function is registered, then the SoC
calls mvebu_set_memory which stores the memory base and size in global
variables. Afterwards the of_fixup is executed which fixes the memory
nodes according to the global variables.

Instead register a SoC specific fixup which directly calls mvebu_set_memory
with the memory base and size as arguments:

pure_initcall(kirkwood_register_soc_fixup);
	of_register_fixup(kirkwood_init_soc, NULL);
core_initcall(of_arm_init)
	of_fix_tree()
		kirkwood_init_soc()
			mvebu_set_memory(phys_base, phys_size);

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 561dfeb commit 295f0b23b505812768cbc2ff38bffa505fbda8d2
@Sascha Hauer Sascha Hauer authored on 17 Sep 2014
Showing 5 changed files
View
arch/arm/mach-mvebu/armada-370-xp.c
View
arch/arm/mach-mvebu/common.c
View
arch/arm/mach-mvebu/dove.c
View
arch/arm/mach-mvebu/include/mach/common.h
View
arch/arm/mach-mvebu/kirkwood.c