586ec319f2cd50d81520d06a9cf272faa1e195ea
[openwrt/svn-archive/archive.git] / target / linux / mvebu / patches-3.10 / 0054-ARM-mvebu-Initialize-MBus-using-the-DT-binding.patch
1 From 08fe0e166c06fd86d6c8eed145d6508c3e5efaac Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Tue, 21 May 2013 11:12:00 -0300
4 Subject: [PATCH 054/203] ARM: mvebu: Initialize MBus using the DT binding
5
6 Now that the mbus device tree binding has been introduced, we can
7 switch over to it.
8
9 Also, and since the initialization of the mbus driver is quite
10 fundamental for the system to work properly, this patch adds a BUG()
11 in case mbus fails to initialize.
12
13 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
14 Tested-by: Andrew Lunn <andrew@lunn.ch>
15 Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
16 ---
17 arch/arm/mach-mvebu/armada-370-xp.c | 34 +---------------------------------
18 1 file changed, 1 insertion(+), 33 deletions(-)
19
20 --- a/arch/arm/mach-mvebu/armada-370-xp.c
21 +++ b/arch/arm/mach-mvebu/armada-370-xp.c
22 @@ -35,44 +35,12 @@ static void __init armada_370_xp_map_io(
23 debug_ll_io_init();
24 }
25
26 -/*
27 - * This initialization will be replaced by a DT-based
28 - * initialization once the mvebu-mbus driver gains DT support.
29 - */
30 -
31 -#define ARMADA_370_XP_MBUS_WINS_OFFS 0x20000
32 -#define ARMADA_370_XP_MBUS_WINS_SIZE 0x100
33 -#define ARMADA_370_XP_SDRAM_WINS_OFFS 0x20180
34 -#define ARMADA_370_XP_SDRAM_WINS_SIZE 0x20
35 -
36 -static void __init armada_370_xp_mbus_init(void)
37 -{
38 - char *mbus_soc_name;
39 - struct device_node *dn;
40 - const __be32 mbus_wins_offs = cpu_to_be32(ARMADA_370_XP_MBUS_WINS_OFFS);
41 - const __be32 sdram_wins_offs = cpu_to_be32(ARMADA_370_XP_SDRAM_WINS_OFFS);
42 -
43 - if (of_machine_is_compatible("marvell,armada370"))
44 - mbus_soc_name = "marvell,armada370-mbus";
45 - else
46 - mbus_soc_name = "marvell,armadaxp-mbus";
47 -
48 - dn = of_find_node_by_name(NULL, "internal-regs");
49 - BUG_ON(!dn);
50 -
51 - mvebu_mbus_init(mbus_soc_name,
52 - of_translate_address(dn, &mbus_wins_offs),
53 - ARMADA_370_XP_MBUS_WINS_SIZE,
54 - of_translate_address(dn, &sdram_wins_offs),
55 - ARMADA_370_XP_SDRAM_WINS_SIZE);
56 -}
57 -
58 static void __init armada_370_xp_timer_and_clk_init(void)
59 {
60 mvebu_clocks_init();
61 armada_370_xp_timer_init();
62 coherency_init();
63 - armada_370_xp_mbus_init();
64 + BUG_ON(mvebu_mbus_dt_init());
65 #ifdef CONFIG_CACHE_L2X0
66 l2x0_of_init(0, ~0UL);
67 #endif