linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: <linuxppc-dev@ozlabs.org>
Subject: [PATCH 17/32] powerpc: Add DMA ops support for of_plaform_device to Cell
Date: Sat, 11 Nov 2006 17:25:04 +1100	[thread overview]
Message-ID: <20061111062534.EB80468383@ozlabs.org> (raw)
In-Reply-To: <1163226282.72526.823314634857.qpush@butch>

This patch adds a bus device notifier to the of_platform bus type on
cell to setup the DMA operations for of_platform_devices. We currently
use the PCI operations as Cell use a special version of them that
happens to be suitable for our needs.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

 arch/powerpc/platforms/cell/setup.c |   37 +++++++++++++++++++++++++++++++++---
 1 file changed, 34 insertions(+), 3 deletions(-)

Index: linux-cell/arch/powerpc/platforms/cell/setup.c
===================================================================
--- linux-cell.orig/arch/powerpc/platforms/cell/setup.c	2006-11-10 16:24:37.000000000 +1100
+++ linux-cell/arch/powerpc/platforms/cell/setup.c	2006-11-10 16:44:51.000000000 +1100
@@ -30,6 +30,7 @@
 #include <linux/console.h>
 #include <linux/mutex.h>
 #include <linux/memory_hotplug.h>
+#include <linux/notifier.h>
 
 #include <asm/mmu.h>
 #include <asm/processor.h>
@@ -82,10 +83,41 @@ static void cell_progress(char *s, unsig
 	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
+	 */
+	register_bus_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;
 

  parent reply	other threads:[~2006-11-11  6:25 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-11  6:24 [PATCH 0/32] My current serie of patches for 2.6.20 for review Benjamin Herrenschmidt
2006-11-11  6:24 ` [PATCH 1/32] ibmveth: Remove ibmveth "liobn" field Benjamin Herrenschmidt
2006-11-11  6:24 ` [PATCH 2/32] Call platform_notify_remove later Benjamin Herrenschmidt
2006-11-11  6:24 ` [PATCH 3/32] Driver core: add notification of bus events Benjamin Herrenschmidt
2006-11-11  6:24 ` [PATCH 4/32] arch provides generic iomap missing accessors Benjamin Herrenschmidt
2006-11-11  6:24 ` [PATCH 5/32] Add arch specific dev_archdata to struct device Benjamin Herrenschmidt
2006-11-11  6:24 ` [PATCH 6/32] Change ACPI to use dev_archdata instead of firmware_data Benjamin Herrenschmidt
2006-11-11  6:24 ` [PATCH 7/32] powerpc: Make pci_read_irq_line the default Benjamin Herrenschmidt
2006-11-14  4:20   ` Zang Roy-r61911
2006-11-14  4:41     ` Benjamin Herrenschmidt
2006-11-14  5:14       ` Zang Roy-r61911
2006-11-11  6:24 ` [PATCH 8/32] powerpc: Remove ppc_md.pci_map_irq & ppc_swizzle for ARCH=powerpc Benjamin Herrenschmidt
2006-11-11  6:24 ` [PATCH 9/32] powerpc: Generic DCR infrastructure Benjamin Herrenschmidt
2006-11-11  6:24 ` [PATCH 10/32] powerpc: Make EMAC use generic DCR access methods Benjamin Herrenschmidt
2006-11-11  6:24 ` [PATCH 11/32] powerpc: Support for DCR based MPIC Benjamin Herrenschmidt
2006-11-11  6:24 ` [PATCH 12/32] powerpc: Improve MPIC driver auto-configuration from DT Benjamin Herrenschmidt
2006-11-11  6:24 ` [PATCH 13/32] powerpc: Native cell support for MPIC in southbridge Benjamin Herrenschmidt
2006-11-11  6:24 ` [PATCH 14/32] powerpc: Souped-up of_platform_device support Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 15/32] powerpc: Hook of_platform_bus_probe with cell Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 16/32] powerpc: Refactor 64 bits DMA operations Benjamin Herrenschmidt
2006-11-11  6:25 ` Benjamin Herrenschmidt [this message]
2006-11-11  6:25 ` [PATCH 18/32] powerpc: Resolve the parent address of a PCI bus range Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 19/32] powerpc: Resolve the BUID fir RTAS PCI config space accesses Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 20/32] powerpc: Add "parent" struct device for PCI host bridges Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 21/32] powerpc: Generic OF platform driver " Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 22/32] powerpc: Cell fixup DMA offset for new southbridge Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 23/32] powerpc: Allow hooking of PCI MMIO & PIO accessors on 64 bits Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 24/32] powerpc: Cell "Spider" MMIO workarounds Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 25/32] powerpc: spider uses low level BE MMIO accessors Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 26/32] powerpc: Add an optional offset to direct DMA on 64 bits Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 27/32] powerpc: Make direct DMA use node local allocations Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 28/32] powerpc: Make cell use direct DMA ops Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 29/32] powerpc: Cell iommu support Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 30/32] powerpc: remove ioremap64 and fixup_bigphys_addr Benjamin Herrenschmidt
2006-11-11  6:25 ` [PATCH 31/32] powerpc: Merge 32 and 64 bits asm-powerpc/io.h Benjamin Herrenschmidt
2006-11-12 20:38   ` Guennadi Liakhovetski
2006-11-11  6:25 ` [PATCH 32/32] powerpc: Fix a typo in new style SPE mapping code Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2006-11-10  7:44 [PATCH 0/32] My current serie of patches for 2.6.20 for review Benjamin Herrenschmidt
2006-11-10  7:44 ` [PATCH 17/32] powerpc: Add DMA ops support for of_plaform_device to Cell Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061111062534.EB80468383@ozlabs.org \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).