aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel/setup.c
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-01-14 05:21:02 -0500
committerMichal Simek <monstr@monstr.eu>2010-03-11 07:56:29 -0500
commitccfe27d7000668b02d10fc3e06aa49e3e3603162 (patch)
treed8d624f6bd9aebf6a848f9762b0d8ed62ee2c5a6 /arch/microblaze/kernel/setup.c
parent522dba7134d6b2e5821d3457f7941ec34f668e6d (diff)
microblaze: Support DMA
Add DMA support for Microblaze. There are some part of this new feature: 1. Basic DMA support 2. Enable DMA debug option 3. Setup notifier Ad 1. dma-mapping come from powerpc and x86 version and it is based on generic dma-mapping-common.h Ad 2. DMA support debug features which is used in generic file. For more information please look at Documentation/DMA-API.txt Ad 3. notifier is very important to setup dma_ops. Without this part for example ll_temac driver failed because there are no setup dma operations. Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/kernel/setup.c')
-rw-r--r--arch/microblaze/kernel/setup.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c
index bb8c4b9ccb80..bc325ac4efd3 100644
--- a/arch/microblaze/kernel/setup.c
+++ b/arch/microblaze/kernel/setup.c
@@ -23,6 +23,8 @@
23#include <linux/bug.h> 23#include <linux/bug.h>
24#include <linux/param.h> 24#include <linux/param.h>
25#include <linux/cache.h> 25#include <linux/cache.h>
26#include <linux/of_platform.h>
27#include <linux/dma-mapping.h>
26#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
27#include <asm/entry.h> 29#include <asm/entry.h>
28#include <asm/cpuinfo.h> 30#include <asm/cpuinfo.h>
@@ -188,3 +190,37 @@ static int microblaze_debugfs_init(void)
188} 190}
189arch_initcall(microblaze_debugfs_init); 191arch_initcall(microblaze_debugfs_init);
190#endif 192#endif
193
194static int dflt_bus_notify(struct notifier_block *nb,
195 unsigned long action, void *data)
196{
197 struct device *dev = data;
198
199 /* We are only intereted in device addition */
200 if (action != BUS_NOTIFY_ADD_DEVICE)
201 return 0;
202
203 set_dma_ops(dev, &dma_direct_ops);
204
205 return NOTIFY_DONE;
206}
207
208static struct notifier_block dflt_plat_bus_notifier = {
209 .notifier_call = dflt_bus_notify,
210 .priority = INT_MAX,
211};
212
213static struct notifier_block dflt_of_bus_notifier = {
214 .notifier_call = dflt_bus_notify,
215 .priority = INT_MAX,
216};
217
218static int __init setup_bus_notifier(void)
219{
220 bus_register_notifier(&platform_bus_type, &dflt_plat_bus_notifier);
221 bus_register_notifier(&of_platform_bus_type, &dflt_of_bus_notifier);
222
223 return 0;
224}
225
226arch_initcall(setup_bus_notifier);