Commit 3e0a8f23 authored by Thomas Petazzoni's avatar Thomas Petazzoni Committed by Jason Cooper

arm: mvebu: move cache and mvebu-mbus initialization later

Current, the L2 cache and the mvebu-mbus drivers are initialized at
->init_early() time. However, at ->init_early() time, ioremap() only
works if a static I/O mapping has already been put in place. If it's
not the case, it tries to do a memory allocation with kmalloc() which
is not possible so early at this stage of the initialization.

Since we want to get rid of the static I/O mapping, we cannot
initialize the L2 cache driver and the mvebu-mbus driver so early. So,
we move their initialization to the ->init_time() level, which is
slightly later (so ioremap() works properly), but sufficiently early
to be before the call of the ->smp_prepare_cpus() hook, which creates
an address decoding window for the BootROM, which requires the
mvebu-mbus driver to be properly initialized.
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarJason Cooper <jason@lakedaemon.net>
parent 865e0527
...@@ -44,14 +44,11 @@ static void __init armada_370_xp_map_io(void) ...@@ -44,14 +44,11 @@ static void __init armada_370_xp_map_io(void)
static void __init armada_370_xp_timer_and_clk_init(void) static void __init armada_370_xp_timer_and_clk_init(void)
{ {
char *mbus_soc_name;
mvebu_clocks_init(); mvebu_clocks_init();
armada_370_xp_timer_init(); armada_370_xp_timer_init();
coherency_init(); coherency_init();
}
static void __init armada_370_xp_init_early(void)
{
char *mbus_soc_name;
/* /*
* This initialization will be replaced by a DT-based * This initialization will be replaced by a DT-based
...@@ -87,7 +84,6 @@ DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)") ...@@ -87,7 +84,6 @@ DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)")
.smp = smp_ops(armada_xp_smp_ops), .smp = smp_ops(armada_xp_smp_ops),
.init_machine = armada_370_xp_dt_init, .init_machine = armada_370_xp_dt_init,
.map_io = armada_370_xp_map_io, .map_io = armada_370_xp_map_io,
.init_early = armada_370_xp_init_early,
.init_time = armada_370_xp_timer_and_clk_init, .init_time = armada_370_xp_timer_and_clk_init,
.restart = mvebu_restart, .restart = mvebu_restart,
.dt_compat = armada_370_xp_dt_compat, .dt_compat = armada_370_xp_dt_compat,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment