Gregory CLEMENT | 009f131 | 2012-08-02 11:16:29 +0300 | [diff] [blame] | 1 | /* |
Thomas Petazzoni | e12f12a | 2014-11-13 10:39:00 +0100 | [diff] [blame] | 2 | * Coherency fabric (Aurora) support for Armada 370, 375, 38x and XP |
| 3 | * platforms. |
Gregory CLEMENT | 009f131 | 2012-08-02 11:16:29 +0300 | [diff] [blame] | 4 | * |
| 5 | * Copyright (C) 2012 Marvell |
| 6 | * |
| 7 | * Yehuda Yitschak <yehuday@marvell.com> |
| 8 | * Gregory Clement <gregory.clement@free-electrons.com> |
| 9 | * Thomas Petazzoni <thomas.petazzoni@free-electrons.com> |
| 10 | * |
| 11 | * This file is licensed under the terms of the GNU General Public |
| 12 | * License version 2. This program is licensed "as is" without any |
| 13 | * warranty of any kind, whether express or implied. |
| 14 | * |
Thomas Petazzoni | e12f12a | 2014-11-13 10:39:00 +0100 | [diff] [blame] | 15 | * The Armada 370, 375, 38x and XP SOCs have a coherency fabric which is |
Gregory CLEMENT | 009f131 | 2012-08-02 11:16:29 +0300 | [diff] [blame] | 16 | * responsible for ensuring hardware coherency between all CPUs and between |
| 17 | * CPUs and I/O masters. This file initializes the coherency fabric and |
| 18 | * supplies basic routines for configuring and controlling hardware coherency |
| 19 | */ |
| 20 | |
Thomas Petazzoni | 5ab5afd | 2014-04-14 15:47:05 +0200 | [diff] [blame] | 21 | #define pr_fmt(fmt) "mvebu-coherency: " fmt |
| 22 | |
Gregory CLEMENT | 009f131 | 2012-08-02 11:16:29 +0300 | [diff] [blame] | 23 | #include <linux/kernel.h> |
| 24 | #include <linux/init.h> |
| 25 | #include <linux/of_address.h> |
| 26 | #include <linux/io.h> |
| 27 | #include <linux/smp.h> |
Gregory CLEMENT | e60304f | 2012-10-12 19:20:36 +0200 | [diff] [blame] | 28 | #include <linux/dma-mapping.h> |
| 29 | #include <linux/platform_device.h> |
Thomas Petazzoni | 5ab5afd | 2014-04-14 15:47:05 +0200 | [diff] [blame] | 30 | #include <linux/slab.h> |
| 31 | #include <linux/mbus.h> |
Thomas Petazzoni | b0063aa | 2014-05-13 18:04:30 +0200 | [diff] [blame] | 32 | #include <linux/pci.h> |
Gregory CLEMENT | 009f131 | 2012-08-02 11:16:29 +0300 | [diff] [blame] | 33 | #include <asm/smp_plat.h> |
Thomas Petazzoni | 580ff0e | 2013-06-06 12:24:28 +0200 | [diff] [blame] | 34 | #include <asm/cacheflush.h> |
Thomas Petazzoni | 497a923 | 2014-05-15 16:59:34 +0200 | [diff] [blame] | 35 | #include <asm/mach/map.h> |
Thomas Petazzoni | 1bd4d8a | 2015-01-16 17:11:29 +0100 | [diff] [blame] | 36 | #include <asm/dma-mapping.h> |
Jisheng Zhang | b12634e | 2013-11-07 17:02:38 +0800 | [diff] [blame] | 37 | #include "coherency.h" |
Thomas Petazzoni | 3943856 | 2014-05-05 17:05:26 +0200 | [diff] [blame] | 38 | #include "mvebu-soc-id.h" |
Gregory CLEMENT | 009f131 | 2012-08-02 11:16:29 +0300 | [diff] [blame] | 39 | |
Paul Gortmaker | 8bd26e3 | 2013-06-17 15:43:14 -0400 | [diff] [blame] | 40 | unsigned long coherency_phys_base; |
Gregory CLEMENT | ccd6a13 | 2014-04-14 17:10:05 +0200 | [diff] [blame] | 41 | void __iomem *coherency_base; |
Gregory CLEMENT | e60304f | 2012-10-12 19:20:36 +0200 | [diff] [blame] | 42 | static void __iomem *coherency_cpu_base; |
Thomas Petazzoni | d492ccc | 2015-07-08 16:09:20 +0200 | [diff] [blame] | 43 | static void __iomem *cpu_config_base; |
Gregory CLEMENT | 009f131 | 2012-08-02 11:16:29 +0300 | [diff] [blame] | 44 | |
| 45 | /* Coherency fabric registers */ |
Gregory CLEMENT | e60304f | 2012-10-12 19:20:36 +0200 | [diff] [blame] | 46 | #define IO_SYNC_BARRIER_CTL_OFFSET 0x0 |
| 47 | |
Thomas Petazzoni | 924d38f | 2014-04-14 15:46:59 +0200 | [diff] [blame] | 48 | enum { |
Thomas Petazzoni | 501f928 | 2014-04-14 15:47:00 +0200 | [diff] [blame] | 49 | COHERENCY_FABRIC_TYPE_NONE, |
Thomas Petazzoni | 924d38f | 2014-04-14 15:46:59 +0200 | [diff] [blame] | 50 | COHERENCY_FABRIC_TYPE_ARMADA_370_XP, |
Thomas Petazzoni | 77fa4b9 | 2014-04-14 15:47:04 +0200 | [diff] [blame] | 51 | COHERENCY_FABRIC_TYPE_ARMADA_375, |
Thomas Petazzoni | d0de932 | 2014-04-14 15:47:06 +0200 | [diff] [blame] | 52 | COHERENCY_FABRIC_TYPE_ARMADA_380, |
Thomas Petazzoni | 924d38f | 2014-04-14 15:46:59 +0200 | [diff] [blame] | 53 | }; |
| 54 | |
Uwe Kleine-König | 444d2d3 | 2015-02-18 21:19:56 +0100 | [diff] [blame] | 55 | static const struct of_device_id of_coherency_table[] = { |
Thomas Petazzoni | 924d38f | 2014-04-14 15:46:59 +0200 | [diff] [blame] | 56 | {.compatible = "marvell,coherency-fabric", |
| 57 | .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_370_XP }, |
Thomas Petazzoni | 77fa4b9 | 2014-04-14 15:47:04 +0200 | [diff] [blame] | 58 | {.compatible = "marvell,armada-375-coherency-fabric", |
| 59 | .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_375 }, |
Thomas Petazzoni | d0de932 | 2014-04-14 15:47:06 +0200 | [diff] [blame] | 60 | {.compatible = "marvell,armada-380-coherency-fabric", |
| 61 | .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_380 }, |
Gregory CLEMENT | 009f131 | 2012-08-02 11:16:29 +0300 | [diff] [blame] | 62 | { /* end of list */ }, |
| 63 | }; |
| 64 | |
Gregory CLEMENT | 2e8a594 | 2014-04-14 17:10:08 +0200 | [diff] [blame] | 65 | /* Functions defined in coherency_ll.S */ |
| 66 | int ll_enable_coherency(void); |
| 67 | void ll_add_cpu_to_smp_group(void); |
Gregory CLEMENT | 009f131 | 2012-08-02 11:16:29 +0300 | [diff] [blame] | 68 | |
Thomas Petazzoni | d492ccc | 2015-07-08 16:09:20 +0200 | [diff] [blame] | 69 | #define CPU_CONFIG_SHARED_L2 BIT(16) |
| 70 | |
| 71 | /* |
| 72 | * Disable the "Shared L2 Present" bit in CPU Configuration register |
| 73 | * on Armada XP. |
| 74 | * |
| 75 | * The "Shared L2 Present" bit affects the "level of coherence" value |
| 76 | * in the clidr CP15 register. Cache operation functions such as |
| 77 | * "flush all" and "invalidate all" operate on all the cache levels |
| 78 | * that included in the defined level of coherence. When HW I/O |
| 79 | * coherency is used, this bit causes unnecessary flushes of the L2 |
| 80 | * cache. |
| 81 | */ |
| 82 | static void armada_xp_clear_shared_l2(void) |
| 83 | { |
| 84 | u32 reg; |
| 85 | |
| 86 | if (!cpu_config_base) |
| 87 | return; |
| 88 | |
| 89 | reg = readl(cpu_config_base); |
| 90 | reg &= ~CPU_CONFIG_SHARED_L2; |
| 91 | writel(reg, cpu_config_base); |
| 92 | } |
| 93 | |
Thomas Petazzoni | b0063aa | 2014-05-13 18:04:30 +0200 | [diff] [blame] | 94 | static int mvebu_hwcc_notifier(struct notifier_block *nb, |
| 95 | unsigned long event, void *__dev) |
Gregory CLEMENT | e60304f | 2012-10-12 19:20:36 +0200 | [diff] [blame] | 96 | { |
| 97 | struct device *dev = __dev; |
| 98 | |
| 99 | if (event != BUS_NOTIFY_ADD_DEVICE) |
| 100 | return NOTIFY_DONE; |
Thomas Petazzoni | 1bd4d8a | 2015-01-16 17:11:29 +0100 | [diff] [blame] | 101 | set_dma_ops(dev, &arm_coherent_dma_ops); |
Gregory CLEMENT | e60304f | 2012-10-12 19:20:36 +0200 | [diff] [blame] | 102 | |
| 103 | return NOTIFY_OK; |
| 104 | } |
| 105 | |
Thomas Petazzoni | b0063aa | 2014-05-13 18:04:30 +0200 | [diff] [blame] | 106 | static struct notifier_block mvebu_hwcc_nb = { |
| 107 | .notifier_call = mvebu_hwcc_notifier, |
Gregory CLEMENT | e60304f | 2012-10-12 19:20:36 +0200 | [diff] [blame] | 108 | }; |
| 109 | |
Arnd Bergmann | 60f2395 | 2016-02-23 15:06:39 +0100 | [diff] [blame] | 110 | static struct notifier_block mvebu_hwcc_pci_nb __maybe_unused = { |
Ezequiel Garcia | a728b97 | 2014-07-08 10:37:37 -0300 | [diff] [blame] | 111 | .notifier_call = mvebu_hwcc_notifier, |
| 112 | }; |
| 113 | |
Sebastian Andrzej Siewior | 7fbbaeb | 2016-07-13 17:16:08 +0000 | [diff] [blame] | 114 | static int armada_xp_clear_l2_starting(unsigned int cpu) |
Thomas Petazzoni | d492ccc | 2015-07-08 16:09:20 +0200 | [diff] [blame] | 115 | { |
Sebastian Andrzej Siewior | 7fbbaeb | 2016-07-13 17:16:08 +0000 | [diff] [blame] | 116 | armada_xp_clear_shared_l2(); |
| 117 | return 0; |
Thomas Petazzoni | d492ccc | 2015-07-08 16:09:20 +0200 | [diff] [blame] | 118 | } |
| 119 | |
Thomas Petazzoni | 924d38f | 2014-04-14 15:46:59 +0200 | [diff] [blame] | 120 | static void __init armada_370_coherency_init(struct device_node *np) |
| 121 | { |
| 122 | struct resource res; |
Thomas Petazzoni | d492ccc | 2015-07-08 16:09:20 +0200 | [diff] [blame] | 123 | struct device_node *cpu_config_np; |
Thomas Petazzoni | 924d38f | 2014-04-14 15:46:59 +0200 | [diff] [blame] | 124 | |
| 125 | of_address_to_resource(np, 0, &res); |
| 126 | coherency_phys_base = res.start; |
| 127 | /* |
| 128 | * Ensure secondary CPUs will see the updated value, |
| 129 | * which they read before they join the coherency |
| 130 | * fabric, and therefore before they are coherent with |
| 131 | * the boot CPU cache. |
| 132 | */ |
| 133 | sync_cache_w(&coherency_phys_base); |
| 134 | coherency_base = of_iomap(np, 0); |
| 135 | coherency_cpu_base = of_iomap(np, 1); |
Thomas Petazzoni | d492ccc | 2015-07-08 16:09:20 +0200 | [diff] [blame] | 136 | |
| 137 | cpu_config_np = of_find_compatible_node(NULL, NULL, |
| 138 | "marvell,armada-xp-cpu-config"); |
| 139 | if (!cpu_config_np) |
| 140 | goto exit; |
| 141 | |
| 142 | cpu_config_base = of_iomap(cpu_config_np, 0); |
| 143 | if (!cpu_config_base) { |
| 144 | of_node_put(cpu_config_np); |
| 145 | goto exit; |
| 146 | } |
| 147 | |
| 148 | of_node_put(cpu_config_np); |
| 149 | |
Sebastian Andrzej Siewior | 7fbbaeb | 2016-07-13 17:16:08 +0000 | [diff] [blame] | 150 | cpuhp_setup_state_nocalls(CPUHP_AP_ARM_MVEBU_COHERENCY, |
Thomas Gleixner | 73c1b41 | 2016-12-21 20:19:54 +0100 | [diff] [blame] | 151 | "arm/mvebu/coherency:starting", |
Sebastian Andrzej Siewior | 7fbbaeb | 2016-07-13 17:16:08 +0000 | [diff] [blame] | 152 | armada_xp_clear_l2_starting, NULL); |
Thomas Petazzoni | d492ccc | 2015-07-08 16:09:20 +0200 | [diff] [blame] | 153 | exit: |
Gregory CLEMENT | 952f4ca | 2014-04-14 17:10:07 +0200 | [diff] [blame] | 154 | set_cpu_coherent(); |
Thomas Petazzoni | 924d38f | 2014-04-14 15:46:59 +0200 | [diff] [blame] | 155 | } |
| 156 | |
Thomas Petazzoni | 497a923 | 2014-05-15 16:59:34 +0200 | [diff] [blame] | 157 | /* |
Thomas Petazzoni | c5379ba | 2016-06-16 15:42:25 +0200 | [diff] [blame] | 158 | * This ioremap hook is used on Armada 375/38x to ensure that all MMIO |
| 159 | * areas are mapped as MT_UNCACHED instead of MT_DEVICE. This is |
| 160 | * needed for the HW I/O coherency mechanism to work properly without |
| 161 | * deadlock. |
Thomas Petazzoni | 497a923 | 2014-05-15 16:59:34 +0200 | [diff] [blame] | 162 | */ |
| 163 | static void __iomem * |
Thomas Petazzoni | c5379ba | 2016-06-16 15:42:25 +0200 | [diff] [blame] | 164 | armada_wa_ioremap_caller(phys_addr_t phys_addr, size_t size, |
| 165 | unsigned int mtype, void *caller) |
Thomas Petazzoni | 497a923 | 2014-05-15 16:59:34 +0200 | [diff] [blame] | 166 | { |
Thomas Petazzoni | c5379ba | 2016-06-16 15:42:25 +0200 | [diff] [blame] | 167 | mtype = MT_UNCACHED; |
Thomas Petazzoni | 497a923 | 2014-05-15 16:59:34 +0200 | [diff] [blame] | 168 | return __arm_ioremap_caller(phys_addr, size, mtype, caller); |
| 169 | } |
| 170 | |
Thomas Petazzoni | d0de932 | 2014-04-14 15:47:06 +0200 | [diff] [blame] | 171 | static void __init armada_375_380_coherency_init(struct device_node *np) |
Thomas Petazzoni | 77fa4b9 | 2014-04-14 15:47:04 +0200 | [diff] [blame] | 172 | { |
Thomas Petazzoni | 497a923 | 2014-05-15 16:59:34 +0200 | [diff] [blame] | 173 | struct device_node *cache_dn; |
| 174 | |
Thomas Petazzoni | 77fa4b9 | 2014-04-14 15:47:04 +0200 | [diff] [blame] | 175 | coherency_cpu_base = of_iomap(np, 0); |
Thomas Petazzoni | c5379ba | 2016-06-16 15:42:25 +0200 | [diff] [blame] | 176 | arch_ioremap_caller = armada_wa_ioremap_caller; |
Thomas Petazzoni | 6a02734 | 2016-06-16 15:42:26 +0200 | [diff] [blame] | 177 | pci_ioremap_set_mem_type(MT_UNCACHED); |
Thomas Petazzoni | 497a923 | 2014-05-15 16:59:34 +0200 | [diff] [blame] | 178 | |
| 179 | /* |
Thomas Petazzoni | dcad688 | 2015-01-28 12:55:45 +0100 | [diff] [blame] | 180 | * We should switch the PL310 to I/O coherency mode only if |
| 181 | * I/O coherency is actually enabled. |
| 182 | */ |
| 183 | if (!coherency_available()) |
| 184 | return; |
| 185 | |
| 186 | /* |
Thomas Petazzoni | 497a923 | 2014-05-15 16:59:34 +0200 | [diff] [blame] | 187 | * Add the PL310 property "arm,io-coherent". This makes sure the |
| 188 | * outer sync operation is not used, which allows to |
| 189 | * workaround the system erratum that causes deadlocks when |
| 190 | * doing PCIe in an SMP situation on Armada 375 and Armada |
| 191 | * 38x. |
| 192 | */ |
| 193 | for_each_compatible_node(cache_dn, NULL, "arm,pl310-cache") { |
| 194 | struct property *p; |
| 195 | |
| 196 | p = kzalloc(sizeof(*p), GFP_KERNEL); |
| 197 | p->name = kstrdup("arm,io-coherent", GFP_KERNEL); |
| 198 | of_add_property(cache_dn, p); |
| 199 | } |
Thomas Petazzoni | 77fa4b9 | 2014-04-14 15:47:04 +0200 | [diff] [blame] | 200 | } |
| 201 | |
Thomas Petazzoni | 501f928 | 2014-04-14 15:47:00 +0200 | [diff] [blame] | 202 | static int coherency_type(void) |
Gregory CLEMENT | 009f131 | 2012-08-02 11:16:29 +0300 | [diff] [blame] | 203 | { |
| 204 | struct device_node *np; |
Thomas Petazzoni | 5fbba08 | 2014-04-14 15:47:02 +0200 | [diff] [blame] | 205 | const struct of_device_id *match; |
Thomas Petazzoni | e553554 | 2014-11-13 10:38:57 +0100 | [diff] [blame] | 206 | int type; |
| 207 | |
| 208 | /* |
| 209 | * The coherency fabric is needed: |
| 210 | * - For coherency between processors on Armada XP, so only |
| 211 | * when SMP is enabled. |
| 212 | * - For coherency between the processor and I/O devices, but |
| 213 | * this coherency requires many pre-requisites (write |
| 214 | * allocate cache policy, shareable pages, SMP bit set) that |
| 215 | * are only meant in SMP situations. |
| 216 | * |
| 217 | * Note that this means that on Armada 370, there is currently |
| 218 | * no way to use hardware I/O coherency, because even when |
| 219 | * CONFIG_SMP is enabled, is_smp() returns false due to the |
| 220 | * Armada 370 being a single-core processor. To lift this |
| 221 | * limitation, we would have to find a way to make the cache |
| 222 | * policy set to write-allocate (on all Armada SoCs), and to |
| 223 | * set the shareable attribute in page tables (on all Armada |
| 224 | * SoCs except the Armada 370). Unfortunately, such decisions |
| 225 | * are taken very early in the kernel boot process, at a point |
| 226 | * where we don't know yet on which SoC we are running. |
| 227 | |
| 228 | */ |
| 229 | if (!is_smp()) |
| 230 | return COHERENCY_FABRIC_TYPE_NONE; |
Gregory CLEMENT | 009f131 | 2012-08-02 11:16:29 +0300 | [diff] [blame] | 231 | |
Thomas Petazzoni | 5fbba08 | 2014-04-14 15:47:02 +0200 | [diff] [blame] | 232 | np = of_find_matching_node_and_match(NULL, of_coherency_table, &match); |
Thomas Petazzoni | e553554 | 2014-11-13 10:38:57 +0100 | [diff] [blame] | 233 | if (!np) |
| 234 | return COHERENCY_FABRIC_TYPE_NONE; |
Thomas Petazzoni | 924d38f | 2014-04-14 15:46:59 +0200 | [diff] [blame] | 235 | |
Thomas Petazzoni | e553554 | 2014-11-13 10:38:57 +0100 | [diff] [blame] | 236 | type = (int) match->data; |
Thomas Petazzoni | 924d38f | 2014-04-14 15:46:59 +0200 | [diff] [blame] | 237 | |
Thomas Petazzoni | e553554 | 2014-11-13 10:38:57 +0100 | [diff] [blame] | 238 | of_node_put(np); |
Thomas Petazzoni | 77fa4b9 | 2014-04-14 15:47:04 +0200 | [diff] [blame] | 239 | |
Thomas Petazzoni | e553554 | 2014-11-13 10:38:57 +0100 | [diff] [blame] | 240 | return type; |
Thomas Petazzoni | 501f928 | 2014-04-14 15:47:00 +0200 | [diff] [blame] | 241 | } |
| 242 | |
Nadav Haklai | 01049a5 | 2015-07-08 17:02:30 +0200 | [diff] [blame] | 243 | int set_cpu_coherent(void) |
| 244 | { |
| 245 | int type = coherency_type(); |
| 246 | |
| 247 | if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP) { |
| 248 | if (!coherency_base) { |
| 249 | pr_warn("Can't make current CPU cache coherent.\n"); |
| 250 | pr_warn("Coherency fabric is not initialized\n"); |
| 251 | return 1; |
| 252 | } |
Thomas Petazzoni | d492ccc | 2015-07-08 16:09:20 +0200 | [diff] [blame] | 253 | |
| 254 | armada_xp_clear_shared_l2(); |
Nadav Haklai | 01049a5 | 2015-07-08 17:02:30 +0200 | [diff] [blame] | 255 | ll_add_cpu_to_smp_group(); |
| 256 | return ll_enable_coherency(); |
| 257 | } |
| 258 | |
| 259 | return 0; |
| 260 | } |
| 261 | |
Thomas Petazzoni | 501f928 | 2014-04-14 15:47:00 +0200 | [diff] [blame] | 262 | int coherency_available(void) |
| 263 | { |
Thomas Petazzoni | 1bd4d8a | 2015-01-16 17:11:29 +0100 | [diff] [blame] | 264 | return coherency_type() != COHERENCY_FABRIC_TYPE_NONE; |
Thomas Petazzoni | 501f928 | 2014-04-14 15:47:00 +0200 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | int __init coherency_init(void) |
| 268 | { |
| 269 | int type = coherency_type(); |
| 270 | struct device_node *np; |
| 271 | |
| 272 | np = of_find_matching_node(NULL, of_coherency_table); |
| 273 | |
| 274 | if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP) |
| 275 | armada_370_coherency_init(np); |
Thomas Petazzoni | d0de932 | 2014-04-14 15:47:06 +0200 | [diff] [blame] | 276 | else if (type == COHERENCY_FABRIC_TYPE_ARMADA_375 || |
| 277 | type == COHERENCY_FABRIC_TYPE_ARMADA_380) |
| 278 | armada_375_380_coherency_init(np); |
Thomas Petazzoni | 501f928 | 2014-04-14 15:47:00 +0200 | [diff] [blame] | 279 | |
Thomas Petazzoni | 2eb04ae | 2014-10-27 16:32:35 +0100 | [diff] [blame] | 280 | of_node_put(np); |
| 281 | |
Gregory CLEMENT | 009f131 | 2012-08-02 11:16:29 +0300 | [diff] [blame] | 282 | return 0; |
| 283 | } |
Thomas Petazzoni | 865e052 | 2013-06-05 09:04:55 +0200 | [diff] [blame] | 284 | |
| 285 | static int __init coherency_late_init(void) |
| 286 | { |
Thomas Petazzoni | ef01c6c | 2014-11-13 10:38:59 +0100 | [diff] [blame] | 287 | if (coherency_available()) |
| 288 | bus_register_notifier(&platform_bus_type, |
| 289 | &mvebu_hwcc_nb); |
Thomas Petazzoni | 865e052 | 2013-06-05 09:04:55 +0200 | [diff] [blame] | 290 | return 0; |
| 291 | } |
| 292 | |
| 293 | postcore_initcall(coherency_late_init); |
Thomas Petazzoni | b0063aa | 2014-05-13 18:04:30 +0200 | [diff] [blame] | 294 | |
Thomas Petazzoni | 8828ccc | 2014-05-20 17:13:03 +0200 | [diff] [blame] | 295 | #if IS_ENABLED(CONFIG_PCI) |
Thomas Petazzoni | b0063aa | 2014-05-13 18:04:30 +0200 | [diff] [blame] | 296 | static int __init coherency_pci_init(void) |
| 297 | { |
| 298 | if (coherency_available()) |
| 299 | bus_register_notifier(&pci_bus_type, |
Ezequiel Garcia | a728b97 | 2014-07-08 10:37:37 -0300 | [diff] [blame] | 300 | &mvebu_hwcc_pci_nb); |
Thomas Petazzoni | b0063aa | 2014-05-13 18:04:30 +0200 | [diff] [blame] | 301 | return 0; |
| 302 | } |
| 303 | |
| 304 | arch_initcall(coherency_pci_init); |
Thomas Petazzoni | 8828ccc | 2014-05-20 17:13:03 +0200 | [diff] [blame] | 305 | #endif |