aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-highbank
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 22:13:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 22:13:12 -0400
commitca41cc96b2813221b05af57d0355157924de5a07 (patch)
tree093d4ca55e6dc4f77c7c8486ec47e9e625e84f17 /arch/arm/mach-highbank
parent3151367f8778a1789d6f6e6f6c642681b6cd6d64 (diff)
parent461b6f0d3d7d4e556035463b531136b034b7433e (diff)
Merge branch 'for-v3.7' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping
Pull CMA and DMA-mapping updates from Marek Szyprowski: "This time the pull request is rather small, because the further redesign patches were not ready on time. This pull request consists of the patches which extend ARM DMA-mapping subsystem with support for CPU coherent (ACP) DMA busses. The first client of the new version is HighBank SATA driver. The second part of the pull request includes various cleanup for both CMA common code and ARM DMA-mapping subsystem." Fix up trivial add-add conflict due to the "dma-coherent" DT property being added next to the "calxeda,port-phys" property for the Calxeda AHCI controller. * 'for-v3.7' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping: ARM: dma-mapping: Remove unsed var at arm_coherent_iommu_unmap_page ARM: highbank: add coherent DMA setup ARM: kill off arch_is_coherent ARM: add coherent iommu dma ops ARM: add coherent dma ops ARM: dma-mapping: Refrain noisy console message ARM: dma-mapping: Small logical clean up drivers: dma-contiguous: refactor dma_alloc_from_contiguous()
Diffstat (limited to 'arch/arm/mach-highbank')
-rw-r--r--arch/arm/mach-highbank/highbank.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index af1da34ccf9d..40e36a50304c 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -15,6 +15,7 @@
15 */ 15 */
16#include <linux/clk.h> 16#include <linux/clk.h>
17#include <linux/clkdev.h> 17#include <linux/clkdev.h>
18#include <linux/dma-mapping.h>
18#include <linux/io.h> 19#include <linux/io.h>
19#include <linux/irq.h> 20#include <linux/irq.h>
20#include <linux/irqdomain.h> 21#include <linux/irqdomain.h>
@@ -23,6 +24,7 @@
23#include <linux/of_platform.h> 24#include <linux/of_platform.h>
24#include <linux/of_address.h> 25#include <linux/of_address.h>
25#include <linux/smp.h> 26#include <linux/smp.h>
27#include <linux/amba/bus.h>
26 28
27#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
28#include <asm/smp_plat.h> 30#include <asm/smp_plat.h>
@@ -149,11 +151,61 @@ static void highbank_power_off(void)
149 cpu_do_idle(); 151 cpu_do_idle();
150} 152}
151 153
154static int highbank_platform_notifier(struct notifier_block *nb,
155 unsigned long event, void *__dev)
156{
157 struct resource *res;
158 int reg = -1;
159 struct device *dev = __dev;
160
161 if (event != BUS_NOTIFY_ADD_DEVICE)
162 return NOTIFY_DONE;
163
164 if (of_device_is_compatible(dev->of_node, "calxeda,hb-ahci"))
165 reg = 0xc;
166 else if (of_device_is_compatible(dev->of_node, "calxeda,hb-sdhci"))
167 reg = 0x18;
168 else if (of_device_is_compatible(dev->of_node, "arm,pl330"))
169 reg = 0x20;
170 else if (of_device_is_compatible(dev->of_node, "calxeda,hb-xgmac")) {
171 res = platform_get_resource(to_platform_device(dev),
172 IORESOURCE_MEM, 0);
173 if (res) {
174 if (res->start == 0xfff50000)
175 reg = 0;
176 else if (res->start == 0xfff51000)
177 reg = 4;
178 }
179 }
180
181 if (reg < 0)
182 return NOTIFY_DONE;
183
184 if (of_property_read_bool(dev->of_node, "dma-coherent")) {
185 writel(0xff31, sregs_base + reg);
186 set_dma_ops(dev, &arm_coherent_dma_ops);
187 } else
188 writel(0, sregs_base + reg);
189
190 return NOTIFY_OK;
191}
192
193static struct notifier_block highbank_amba_nb = {
194 .notifier_call = highbank_platform_notifier,
195};
196
197static struct notifier_block highbank_platform_nb = {
198 .notifier_call = highbank_platform_notifier,
199};
200
152static void __init highbank_init(void) 201static void __init highbank_init(void)
153{ 202{
154 pm_power_off = highbank_power_off; 203 pm_power_off = highbank_power_off;
155 highbank_pm_init(); 204 highbank_pm_init();
156 205
206 bus_register_notifier(&platform_bus_type, &highbank_platform_nb);
207 bus_register_notifier(&amba_bustype, &highbank_amba_nb);
208
157 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 209 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
158} 210}
159 211