aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mvebu/armada-370-xp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mvebu/armada-370-xp.c')
-rw-r--r--arch/arm/mach-mvebu/armada-370-xp.c57
1 files changed, 29 insertions, 28 deletions
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
index 1c48890bb72b..97cbb8021919 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/armada-370-xp.c
@@ -14,13 +14,13 @@
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/clk-provider.h>
18#include <linux/of_address.h>
17#include <linux/of_platform.h> 19#include <linux/of_platform.h>
18#include <linux/io.h> 20#include <linux/io.h>
19#include <linux/time-armada-370-xp.h> 21#include <linux/time-armada-370-xp.h>
20#include <linux/clk/mvebu.h>
21#include <linux/dma-mapping.h> 22#include <linux/dma-mapping.h>
22#include <linux/mbus.h> 23#include <linux/mbus.h>
23#include <linux/irqchip.h>
24#include <asm/hardware/cache-l2x0.h> 24#include <asm/hardware/cache-l2x0.h>
25#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
@@ -29,45 +29,49 @@
29#include "common.h" 29#include "common.h"
30#include "coherency.h" 30#include "coherency.h"
31 31
32static struct map_desc armada_370_xp_io_desc[] __initdata = { 32static void __init armada_370_xp_map_io(void)
33 {
34 .virtual = (unsigned long) ARMADA_370_XP_REGS_VIRT_BASE,
35 .pfn = __phys_to_pfn(ARMADA_370_XP_REGS_PHYS_BASE),
36 .length = ARMADA_370_XP_REGS_SIZE,
37 .type = MT_DEVICE,
38 },
39};
40
41void __init armada_370_xp_map_io(void)
42{ 33{
43 iotable_init(armada_370_xp_io_desc, ARRAY_SIZE(armada_370_xp_io_desc)); 34 debug_ll_io_init();
44} 35}
45 36
46void __init armada_370_xp_timer_and_clk_init(void) 37/*
47{ 38 * This initialization will be replaced by a DT-based
48 mvebu_clocks_init(); 39 * initialization once the mvebu-mbus driver gains DT support.
49 armada_370_xp_timer_init(); 40 */
50}
51 41
52void __init armada_370_xp_init_early(void) 42#define ARMADA_370_XP_MBUS_WINS_OFFS 0x20000
43#define ARMADA_370_XP_MBUS_WINS_SIZE 0x100
44#define ARMADA_370_XP_SDRAM_WINS_OFFS 0x20180
45#define ARMADA_370_XP_SDRAM_WINS_SIZE 0x20
46
47static void __init armada_370_xp_mbus_init(void)
53{ 48{
54 char *mbus_soc_name; 49 char *mbus_soc_name;
50 struct device_node *dn;
51 const __be32 mbus_wins_offs = cpu_to_be32(ARMADA_370_XP_MBUS_WINS_OFFS);
52 const __be32 sdram_wins_offs = cpu_to_be32(ARMADA_370_XP_SDRAM_WINS_OFFS);
55 53
56 /*
57 * This initialization will be replaced by a DT-based
58 * initialization once the mvebu-mbus driver gains DT support.
59 */
60 if (of_machine_is_compatible("marvell,armada370")) 54 if (of_machine_is_compatible("marvell,armada370"))
61 mbus_soc_name = "marvell,armada370-mbus"; 55 mbus_soc_name = "marvell,armada370-mbus";
62 else 56 else
63 mbus_soc_name = "marvell,armadaxp-mbus"; 57 mbus_soc_name = "marvell,armadaxp-mbus";
64 58
59 dn = of_find_node_by_name(NULL, "internal-regs");
60 BUG_ON(!dn);
61
65 mvebu_mbus_init(mbus_soc_name, 62 mvebu_mbus_init(mbus_soc_name,
66 ARMADA_370_XP_MBUS_WINS_BASE, 63 of_translate_address(dn, &mbus_wins_offs),
67 ARMADA_370_XP_MBUS_WINS_SIZE, 64 ARMADA_370_XP_MBUS_WINS_SIZE,
68 ARMADA_370_XP_SDRAM_WINS_BASE, 65 of_translate_address(dn, &sdram_wins_offs),
69 ARMADA_370_XP_SDRAM_WINS_SIZE); 66 ARMADA_370_XP_SDRAM_WINS_SIZE);
67}
70 68
69static void __init armada_370_xp_timer_and_clk_init(void)
70{
71 of_clk_init(NULL);
72 armada_370_xp_timer_init();
73 coherency_init();
74 armada_370_xp_mbus_init();
71#ifdef CONFIG_CACHE_L2X0 75#ifdef CONFIG_CACHE_L2X0
72 l2x0_of_init(0, ~0UL); 76 l2x0_of_init(0, ~0UL);
73#endif 77#endif
@@ -76,7 +80,6 @@ void __init armada_370_xp_init_early(void)
76static void __init armada_370_xp_dt_init(void) 80static void __init armada_370_xp_dt_init(void)
77{ 81{
78 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 82 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
79 coherency_init();
80} 83}
81 84
82static const char * const armada_370_xp_dt_compat[] = { 85static const char * const armada_370_xp_dt_compat[] = {
@@ -88,8 +91,6 @@ DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)")
88 .smp = smp_ops(armada_xp_smp_ops), 91 .smp = smp_ops(armada_xp_smp_ops),
89 .init_machine = armada_370_xp_dt_init, 92 .init_machine = armada_370_xp_dt_init,
90 .map_io = armada_370_xp_map_io, 93 .map_io = armada_370_xp_map_io,
91 .init_early = armada_370_xp_init_early,
92 .init_irq = irqchip_init,
93 .init_time = armada_370_xp_timer_and_clk_init, 94 .init_time = armada_370_xp_timer_and_clk_init,
94 .restart = mvebu_restart, 95 .restart = mvebu_restart,
95 .dt_compat = armada_370_xp_dt_compat, 96 .dt_compat = armada_370_xp_dt_compat,