diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/pasemi/setup.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index 5ddf40a66ae8..3a5d112af5e0 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c | |||
@@ -37,6 +37,10 @@ | |||
37 | #include <asm/time.h> | 37 | #include <asm/time.h> |
38 | #include <asm/of_platform.h> | 38 | #include <asm/of_platform.h> |
39 | 39 | ||
40 | #include <pcmcia/ss.h> | ||
41 | #include <pcmcia/cistpl.h> | ||
42 | #include <pcmcia/ds.h> | ||
43 | |||
40 | #include "pasemi.h" | 44 | #include "pasemi.h" |
41 | 45 | ||
42 | /* SDC reset register, must be pre-mapped at reset time */ | 46 | /* SDC reset register, must be pre-mapped at reset time */ |
@@ -308,7 +312,57 @@ static void __init pas_init_early(void) | |||
308 | iommu_init_early_pasemi(); | 312 | iommu_init_early_pasemi(); |
309 | } | 313 | } |
310 | 314 | ||
315 | #ifdef CONFIG_PCMCIA | ||
316 | static int pcmcia_notify(struct notifier_block *nb, unsigned long action, | ||
317 | void *data) | ||
318 | { | ||
319 | struct device *dev = data; | ||
320 | struct device *parent; | ||
321 | struct pcmcia_device *pdev = to_pcmcia_dev(dev); | ||
322 | |||
323 | /* We are only intereted in device addition */ | ||
324 | if (action != BUS_NOTIFY_ADD_DEVICE) | ||
325 | return 0; | ||
326 | |||
327 | parent = pdev->socket->dev.parent; | ||
328 | |||
329 | /* We know electra_cf devices will always have of_node set, since | ||
330 | * electra_cf is an of_platform driver. | ||
331 | */ | ||
332 | if (!parent->archdata.of_node) | ||
333 | return 0; | ||
334 | |||
335 | if (!of_device_is_compatible(parent->archdata.of_node, "electra-cf")) | ||
336 | return 0; | ||
337 | |||
338 | /* We use the direct ops for localbus */ | ||
339 | dev->archdata.dma_ops = &dma_direct_ops; | ||
340 | |||
341 | return 0; | ||
342 | } | ||
343 | |||
344 | static struct notifier_block pcmcia_notifier = { | ||
345 | .notifier_call = pcmcia_notify, | ||
346 | }; | ||
347 | |||
348 | static inline void pasemi_pcmcia_init(void) | ||
349 | { | ||
350 | extern struct bus_type pcmcia_bus_type; | ||
351 | |||
352 | bus_register_notifier(&pcmcia_bus_type, &pcmcia_notifier); | ||
353 | } | ||
354 | |||
355 | #else | ||
356 | |||
357 | static inline void pasemi_pcmcia_init(void) | ||
358 | { | ||
359 | } | ||
360 | |||
361 | #endif | ||
362 | |||
363 | |||
311 | static struct of_device_id pasemi_bus_ids[] = { | 364 | static struct of_device_id pasemi_bus_ids[] = { |
365 | { .type = "localbus", }, | ||
312 | { .type = "sdc", }, | 366 | { .type = "sdc", }, |
313 | {}, | 367 | {}, |
314 | }; | 368 | }; |
@@ -318,6 +372,8 @@ static int __init pasemi_publish_devices(void) | |||
318 | if (!machine_is(pasemi)) | 372 | if (!machine_is(pasemi)) |
319 | return 0; | 373 | return 0; |
320 | 374 | ||
375 | pasemi_pcmcia_init(); | ||
376 | |||
321 | /* Publish OF platform devices for SDC and other non-PCI devices */ | 377 | /* Publish OF platform devices for SDC and other non-PCI devices */ |
322 | of_platform_bus_probe(NULL, pasemi_bus_ids, NULL); | 378 | of_platform_bus_probe(NULL, pasemi_bus_ids, NULL); |
323 | 379 | ||