base-files: define yes/no as valid boolean options
[openwrt.git] / target / linux / mvebu / patches-3.10 / 0053-ARM-mvebu-Remove-the-harcoded-BootROM-window-allocat.patch
1 From 23a9b291a7b9ba28b31da56e6ced7a8168baa3de Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Tue, 21 May 2013 11:01:33 -0300
4 Subject: [PATCH 053/203] ARM: mvebu: Remove the harcoded BootROM window
5  allocation
6
7 The address decoding window to access the BootROM should not be
8 allocated programatically, but instead declared in the device tree.
9
10 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
11 Tested-by: Andrew Lunn <andrew@lunn.ch>
12 Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
13 ---
14  arch/arm/mach-mvebu/platsmp.c | 25 ++++++++++++++++++++++++-
15  1 file changed, 24 insertions(+), 1 deletion(-)
16
17 --- a/arch/arm/mach-mvebu/platsmp.c
18 +++ b/arch/arm/mach-mvebu/platsmp.c
19 @@ -21,6 +21,7 @@
20  #include <linux/smp.h>
21  #include <linux/clk.h>
22  #include <linux/of.h>
23 +#include <linux/of_address.h>
24  #include <linux/mbus.h>
25  #include <asm/cacheflush.h>
26  #include <asm/smp_plat.h>
27 @@ -29,6 +30,9 @@
28  #include "pmsu.h"
29  #include "coherency.h"
30  
31 +#define AXP_BOOTROM_BASE 0xfff00000
32 +#define AXP_BOOTROM_SIZE 0x100000
33 +
34  void __init set_secondary_cpus_clock(void)
35  {
36         int thiscpu;
37 @@ -115,10 +119,29 @@ static void __init armada_xp_smp_init_cp
38  
39  void __init armada_xp_smp_prepare_cpus(unsigned int max_cpus)
40  {
41 +       struct device_node *node;
42 +       struct resource res;
43 +       int err;
44 +
45         set_secondary_cpus_clock();
46         flush_cache_all();
47         set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0);
48 -       mvebu_mbus_add_window("bootrom", 0xfff00000, SZ_1M);
49 +
50 +       /*
51 +        * In order to boot the secondary CPUs we need to ensure
52 +        * the bootROM is mapped at the correct address.
53 +        */
54 +       node = of_find_compatible_node(NULL, NULL, "marvell,bootrom");
55 +       if (!node)
56 +               panic("Cannot find 'marvell,bootrom' compatible node");
57 +
58 +       err = of_address_to_resource(node, 0, &res);
59 +       if (err < 0)
60 +               panic("Cannot get 'bootrom' node address");
61 +
62 +       if (res.start != AXP_BOOTROM_BASE ||
63 +           resource_size(&res) != AXP_BOOTROM_SIZE)
64 +               panic("The address for the BootROM is incorrect");
65  }
66  
67  struct smp_operations armada_xp_smp_ops __initdata = {