From a1493fdaa75a31c05812c59b1a30d9c12eebdc7e Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Sat, 11 Nov 2006 17:25:04 +1100 Subject: [PATCH] --- yaml --- r: 42222 b: refs/heads/master c: 868108784ccf0add6ac593bfbc2eb5a0804af48d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/powerpc/platforms/cell/setup.c | 37 +++++++++++++++++++++-- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 9c70fc43027e..61d50669e7eb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 12d04eef927bf61328af2c7cbe756c96f98ac3bf +refs/heads/master: 868108784ccf0add6ac593bfbc2eb5a0804af48d diff --git a/trunk/arch/powerpc/platforms/cell/setup.c b/trunk/arch/powerpc/platforms/cell/setup.c index d704bc19a646..b39753f16d48 100644 --- a/trunk/arch/powerpc/platforms/cell/setup.c +++ b/trunk/arch/powerpc/platforms/cell/setup.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -82,10 +83,41 @@ static void cell_progress(char *s, unsigned short hex) printk("*** %04x : %s\n", hex, s ? s : ""); } +static int cell_of_bus_notify(struct notifier_block *nb, unsigned long action, + void *data) +{ + struct device *dev = data; + + if (action != BUS_NOTIFY_ADD_DEVICE) + return 0; + + /* For now, we just use the PCI DMA ops for everything, though + * we'll need something better when we have a real iommu + * implementation. + */ + dev->archdata.dma_ops = pci_dma_ops; + + return 0; +} + +static struct notifier_block cell_of_bus_notifier = { + .notifier_call = cell_of_bus_notify +}; + + static int __init cell_publish_devices(void) { - if (machine_is(cell)) - of_platform_bus_probe(NULL, NULL, NULL); + if (!machine_is(cell)) + return 0; + + /* Register callbacks on OF platform device addition/removal + * to handle linking them to the right DMA operations + */ + bus_register_notifier(&of_platform_bus_type, &cell_of_bus_notifier); + + /* Publish OF platform devices for southbridge IOs */ + of_platform_bus_probe(NULL, NULL, NULL); + return 0; } device_initcall(cell_publish_devices); @@ -154,7 +186,6 @@ static void __init cell_setup_arch(void) #ifdef CONFIG_SMP smp_init_cell(); #endif - /* init to some ~sane value until calibrate_delay() runs */ loops_per_jiffy = 50000000;