]> git.karo-electronics.de Git - linux-beck.git/commitdiff
bus: mvebu: pass the coherency availability information at init time
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 14 Apr 2014 13:47:01 +0000 (15:47 +0200)
committerJason Cooper <jason@lakedaemon.net>
Thu, 24 Apr 2014 05:00:36 +0000 (05:00 +0000)
Until now, the mvebu-mbus was guessing by itself whether hardware I/O
coherency was available or not by poking into the Device Tree to see
if the coherency fabric Device Tree node was present or not.

However, on some upcoming SoCs, the presence or absence of the
coherency fabric DT node isn't sufficient: in CONFIG_SMP, the
coherency can be enabled, but not in !CONFIG_SMP.

In order to clean this up, the mvebu_mbus_dt_init() function is
extended to get a boolean argument telling whether coherency is
enabled or not. Therefore, the logic to decide whether coherency is
available or not now belongs to the core SoC code instead of the
mvebu-mbus driver itself, which is much better.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1397483228-25625-4-git-send-email-thomas.petazzoni@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
arch/arm/mach-kirkwood/board-dt.c
arch/arm/mach-mvebu/board-v7.c
arch/arm/mach-mvebu/dove.c
arch/arm/mach-mvebu/kirkwood.c
drivers/bus/mvebu-mbus.c
include/linux/mbus.h

index 2801da49e2a36bfea53cf1fd5a084c51dbac42a6..ff18ff20f71fe4b1f41e4fc032342f6be9c4a7f5 100644 (file)
@@ -195,7 +195,7 @@ static void __init kirkwood_dt_init(void)
 {
        kirkwood_disable_mbus_error_propagation();
 
-       BUG_ON(mvebu_mbus_dt_init());
+       BUG_ON(mvebu_mbus_dt_init(false));
 
 #ifdef CONFIG_CACHE_FEROCEON_L2
        feroceon_of_init();
index 333fca8fdc41c2cf667a849b7461bd8fb2c9baac..1730e0cdb6f67989f309699b24afd53b79923dd5 100644 (file)
@@ -58,7 +58,7 @@ static void __init mvebu_timer_and_clk_init(void)
        of_clk_init(NULL);
        clocksource_of_init();
        coherency_init();
-       BUG_ON(mvebu_mbus_dt_init());
+       BUG_ON(mvebu_mbus_dt_init(coherency_available()));
 #ifdef CONFIG_CACHE_L2X0
        l2x0_of_init(0, ~0UL);
 #endif
index 5e5a43624237681f6f85b288147880babc66fef6..b50464ec1130ff0b5961990d2684953c582d44cc 100644 (file)
@@ -23,7 +23,7 @@ static void __init dove_init(void)
 #ifdef CONFIG_CACHE_TAUROS2
        tauros2_init(0);
 #endif
-       BUG_ON(mvebu_mbus_dt_init());
+       BUG_ON(mvebu_mbus_dt_init(false));
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
index 120207fc36f1f87d210c98d747bb28ee914015a0..a77e0bae9c55686143ac16aaed32754e8eb637a8 100644 (file)
@@ -169,7 +169,7 @@ static void __init kirkwood_dt_init(void)
 {
        kirkwood_disable_mbus_error_propagation();
 
-       BUG_ON(mvebu_mbus_dt_init());
+       BUG_ON(mvebu_mbus_dt_init(false));
 
 #ifdef CONFIG_CACHE_FEROCEON_L2
        feroceon_of_init();
index 293e2e0a0a87c7d9877c27524fd98503ba16c1cf..ff02fc90fc2129fa1247689530bbc04d451ba5a9 100644 (file)
@@ -694,7 +694,6 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
                                         phys_addr_t sdramwins_phys_base,
                                         size_t sdramwins_size)
 {
-       struct device_node *np;
        int win;
 
        mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size);
@@ -707,12 +706,6 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
                return -ENOMEM;
        }
 
-       np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
-       if (np) {
-               mbus->hw_io_coherency = 1;
-               of_node_put(np);
-       }
-
        for (win = 0; win < mbus->soc->num_wins; win++)
                mvebu_mbus_disable_window(mbus, win);
 
@@ -882,7 +875,7 @@ static void __init mvebu_mbus_get_pcie_resources(struct device_node *np,
        }
 }
 
-int __init mvebu_mbus_dt_init(void)
+int __init mvebu_mbus_dt_init(bool is_coherent)
 {
        struct resource mbuswins_res, sdramwins_res;
        struct device_node *np, *controller;
@@ -920,6 +913,8 @@ int __init mvebu_mbus_dt_init(void)
                return -EINVAL;
        }
 
+       mbus_state.hw_io_coherency = is_coherent;
+
        /* Get optional pcie-{mem,io}-aperture properties */
        mvebu_mbus_get_pcie_resources(np, &mbus_state.pcie_mem_aperture,
                                          &mbus_state.pcie_io_aperture);
index 345b8c53b8974d7a6cc271fda41c851ee5835f7c..550c88fb0267f158c26d05714e411805ba15ee90 100644 (file)
@@ -73,6 +73,6 @@ int mvebu_mbus_del_window(phys_addr_t base, size_t size);
 int mvebu_mbus_init(const char *soc, phys_addr_t mbus_phys_base,
                    size_t mbus_size, phys_addr_t sdram_phys_base,
                    size_t sdram_size);
-int mvebu_mbus_dt_init(void);
+int mvebu_mbus_dt_init(bool is_coherent);
 
 #endif /* __LINUX_MBUS_H */