aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mvebu
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2013-08-16 02:10:31 -0400
committerOlof Johansson <olof@lixom.net>2013-08-16 02:10:31 -0400
commitf668adebf43556df9834f254479a44a20294dcf1 (patch)
tree1db70c6f513da3c4c2fdc0341ef0d8ffdffa07f5 /arch/arm/mach-mvebu
parentfac2e57742d9aa3dbe41860280352efda9d5566e (diff)
parenta0cec7867ffdf5d153d29b3a8243911ea8dfd366 (diff)
Merge tag 'drivers-3.12' of git://git.infradead.org/linux-mvebu into next/soc
From Jason Cooper: mvebu drivers changes for v3.12 - MBus devicetree bindings - devbus update for address decoding window, cleanup * tag 'drivers-3.12' of git://git.infradead.org/linux-mvebu: (35 commits) memory: mvebu-devbus: Remove unused variable ARM: mvebu: Relocate PCIe node in Armada 370 RD board ARM: mvebu: Fix AXP-WiFi-AP DT for MBUS DT binding ARM: mvebu: add support for the AXP WiFi AP board ARM: mvebu: use dts pre-processor for mv78230 PCI: mvebu: Adapt to the new device tree layout bus: mvebu-mbus: Add devicetree binding ARM: kirkwood: Relocate PCIe device tree nodes ARM: kirkwood: Introduce MBUS_ID ARM: kirkwood: Introduce MBus DT node ARM: kirkwood: Use the preprocessor on device tree files ARM: kirkwood: Split DT and legacy MBus initialization ARM: mvebu: Relocate Armada 370/XP PCIe device tree nodes ARM: mvebu: Relocate Armada 370/XP DeviceBus device tree nodes ARM: mvebu: Add BootROM to Armada 370/XP device tree ARM: mvebu: Add MBus to Armada 370/XP device tree ARM: mvebu: Use the preprocessor on Armada 370/XP device tree files ARM: mvebu: Initialize MBus using the DT binding ARM: mvebu: Remove the harcoded BootROM window allocation bus: mvebu-mbus: Factorize Armada 370/XP data structures ... Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-mvebu')
-rw-r--r--arch/arm/mach-mvebu/armada-370-xp.c34
-rw-r--r--arch/arm/mach-mvebu/platsmp.c25
2 files changed, 25 insertions, 34 deletions
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
index 97cbb8021919..829b57306328 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/armada-370-xp.c
@@ -34,44 +34,12 @@ static void __init armada_370_xp_map_io(void)
34 debug_ll_io_init(); 34 debug_ll_io_init();
35} 35}
36 36
37/*
38 * This initialization will be replaced by a DT-based
39 * initialization once the mvebu-mbus driver gains DT support.
40 */
41
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)
48{
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);
53
54 if (of_machine_is_compatible("marvell,armada370"))
55 mbus_soc_name = "marvell,armada370-mbus";
56 else
57 mbus_soc_name = "marvell,armadaxp-mbus";
58
59 dn = of_find_node_by_name(NULL, "internal-regs");
60 BUG_ON(!dn);
61
62 mvebu_mbus_init(mbus_soc_name,
63 of_translate_address(dn, &mbus_wins_offs),
64 ARMADA_370_XP_MBUS_WINS_SIZE,
65 of_translate_address(dn, &sdram_wins_offs),
66 ARMADA_370_XP_SDRAM_WINS_SIZE);
67}
68
69static void __init armada_370_xp_timer_and_clk_init(void) 37static void __init armada_370_xp_timer_and_clk_init(void)
70{ 38{
71 of_clk_init(NULL); 39 of_clk_init(NULL);
72 armada_370_xp_timer_init(); 40 armada_370_xp_timer_init();
73 coherency_init(); 41 coherency_init();
74 armada_370_xp_mbus_init(); 42 BUG_ON(mvebu_mbus_dt_init());
75#ifdef CONFIG_CACHE_L2X0 43#ifdef CONFIG_CACHE_L2X0
76 l2x0_of_init(0, ~0UL); 44 l2x0_of_init(0, ~0UL);
77#endif 45#endif
diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c
index ce81d3031405..c6b00fce6d8d 100644
--- a/arch/arm/mach-mvebu/platsmp.c
+++ b/arch/arm/mach-mvebu/platsmp.c
@@ -21,6 +21,7 @@
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/of.h> 23#include <linux/of.h>
24#include <linux/of_address.h>
24#include <linux/mbus.h> 25#include <linux/mbus.h>
25#include <asm/cacheflush.h> 26#include <asm/cacheflush.h>
26#include <asm/smp_plat.h> 27#include <asm/smp_plat.h>
@@ -29,6 +30,9 @@
29#include "pmsu.h" 30#include "pmsu.h"
30#include "coherency.h" 31#include "coherency.h"
31 32
33#define AXP_BOOTROM_BASE 0xfff00000
34#define AXP_BOOTROM_SIZE 0x100000
35
32void __init set_secondary_cpus_clock(void) 36void __init set_secondary_cpus_clock(void)
33{ 37{
34 int thiscpu; 38 int thiscpu;
@@ -114,10 +118,29 @@ static void __init armada_xp_smp_init_cpus(void)
114 118
115void __init armada_xp_smp_prepare_cpus(unsigned int max_cpus) 119void __init armada_xp_smp_prepare_cpus(unsigned int max_cpus)
116{ 120{
121 struct device_node *node;
122 struct resource res;
123 int err;
124
117 set_secondary_cpus_clock(); 125 set_secondary_cpus_clock();
118 flush_cache_all(); 126 flush_cache_all();
119 set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0); 127 set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0);
120 mvebu_mbus_add_window("bootrom", 0xfff00000, SZ_1M); 128
129 /*
130 * In order to boot the secondary CPUs we need to ensure
131 * the bootROM is mapped at the correct address.
132 */
133 node = of_find_compatible_node(NULL, NULL, "marvell,bootrom");
134 if (!node)
135 panic("Cannot find 'marvell,bootrom' compatible node");
136
137 err = of_address_to_resource(node, 0, &res);
138 if (err < 0)
139 panic("Cannot get 'bootrom' node address");
140
141 if (res.start != AXP_BOOTROM_BASE ||
142 resource_size(&res) != AXP_BOOTROM_SIZE)
143 panic("The address for the BootROM is incorrect");
121} 144}
122 145
123struct smp_operations armada_xp_smp_ops __initdata = { 146struct smp_operations armada_xp_smp_ops __initdata = {