Commit 5686a1e5aa436c49187a60052d5885fb1f541ce6
Committed by
Jason Cooper
1 parent
501f928e00
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
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>
Showing 6 changed files with 8 additions and 13 deletions Side-by-side Diff
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
... | ... | @@ -694,7 +694,6 @@ |
694 | 694 | phys_addr_t sdramwins_phys_base, |
695 | 695 | size_t sdramwins_size) |
696 | 696 | { |
697 | - struct device_node *np; | |
698 | 697 | int win; |
699 | 698 | |
700 | 699 | mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size); |
... | ... | @@ -707,12 +706,6 @@ |
707 | 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 | 709 | for (win = 0; win < mbus->soc->num_wins; win++) |
717 | 710 | mvebu_mbus_disable_window(mbus, win); |
718 | 711 | |
... | ... | @@ -882,7 +875,7 @@ |
882 | 875 | } |
883 | 876 | } |
884 | 877 | |
885 | -int __init mvebu_mbus_dt_init(void) | |
878 | +int __init mvebu_mbus_dt_init(bool is_coherent) | |
886 | 879 | { |
887 | 880 | struct resource mbuswins_res, sdramwins_res; |
888 | 881 | struct device_node *np, *controller; |
... | ... | @@ -919,6 +912,8 @@ |
919 | 912 | pr_err("cannot get SDRAM register address\n"); |
920 | 913 | return -EINVAL; |
921 | 914 | } |
915 | + | |
916 | + mbus_state.hw_io_coherency = is_coherent; | |
922 | 917 | |
923 | 918 | /* Get optional pcie-{mem,io}-aperture properties */ |
924 | 919 | mvebu_mbus_get_pcie_resources(np, &mbus_state.pcie_mem_aperture, |
include/linux/mbus.h