aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bus
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-04-14 09:47:01 -0400
committerJason Cooper <jason@lakedaemon.net>2014-04-24 01:00:36 -0400
commit5686a1e5aa436c49187a60052d5885fb1f541ce6 (patch)
tree4cc42805d26105ac25227e3129c7911437d2c417 /drivers/bus
parent501f928e009760f4987d4630265bb9fff28a6ecc (diff)
bus: mvebu: pass the coherency availability information at init time
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>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/mvebu-mbus.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index 293e2e0a0a87..ff02fc90fc21 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -694,7 +694,6 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
694 phys_addr_t sdramwins_phys_base, 694 phys_addr_t sdramwins_phys_base,
695 size_t sdramwins_size) 695 size_t sdramwins_size)
696{ 696{
697 struct device_node *np;
698 int win; 697 int win;
699 698
700 mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size); 699 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,
707 return -ENOMEM; 706 return -ENOMEM;
708 } 707 }
709 708
710 np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
711 if (np) {
712 mbus->hw_io_coherency = 1;
713 of_node_put(np);
714 }
715
716 for (win = 0; win < mbus->soc->num_wins; win++) 709 for (win = 0; win < mbus->soc->num_wins; win++)
717 mvebu_mbus_disable_window(mbus, win); 710 mvebu_mbus_disable_window(mbus, win);
718 711
@@ -882,7 +875,7 @@ static void __init mvebu_mbus_get_pcie_resources(struct device_node *np,
882 } 875 }
883} 876}
884 877
885int __init mvebu_mbus_dt_init(void) 878int __init mvebu_mbus_dt_init(bool is_coherent)
886{ 879{
887 struct resource mbuswins_res, sdramwins_res; 880 struct resource mbuswins_res, sdramwins_res;
888 struct device_node *np, *controller; 881 struct device_node *np, *controller;
@@ -920,6 +913,8 @@ int __init mvebu_mbus_dt_init(void)
920 return -EINVAL; 913 return -EINVAL;
921 } 914 }
922 915
916 mbus_state.hw_io_coherency = is_coherent;
917
923 /* Get optional pcie-{mem,io}-aperture properties */ 918 /* Get optional pcie-{mem,io}-aperture properties */
924 mvebu_mbus_get_pcie_resources(np, &mbus_state.pcie_mem_aperture, 919 mvebu_mbus_get_pcie_resources(np, &mbus_state.pcie_mem_aperture,
925 &mbus_state.pcie_io_aperture); 920 &mbus_state.pcie_io_aperture);