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 18/27] powerpc: Resolve the BUID fir RTAS PCI config space accesses
Date: Mon, 06 Nov 2006 18:05:51 +1100	[thread overview]
Message-ID: <20061106070707.ADF2467DF3@ozlabs.org> (raw)
In-Reply-To: <1162796738.274582.277491064706.qpush@grosgo>

The BUID is the first entry of a PCI host bridge "reg" property.

Now that PCI busses can be anywhere in the device-tree, we need to
fully translate the value there to a CPU physical address before
we can use it with RTAS.

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

 arch/powerpc/kernel/rtas_pci.c |   27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

Index: linux-cell/arch/powerpc/kernel/rtas_pci.c
===================================================================
--- linux-cell.orig/arch/powerpc/kernel/rtas_pci.c	2006-10-26 17:32:35.000000000 +1000
+++ linux-cell/arch/powerpc/kernel/rtas_pci.c	2006-10-26 17:34:21.000000000 +1000
@@ -231,32 +231,13 @@ void __init init_pci_config_tokens (void
 
 unsigned long __devinit get_phb_buid (struct device_node *phb)
 {
-	int addr_cells;
-	const unsigned int *buid_vals;
-	unsigned int len;
-	unsigned long buid;
-
-	if (ibm_read_pci_config == -1) return 0;
+	struct resource r;
 
-	/* PHB's will always be children of the root node,
-	 * or so it is promised by the current firmware. */
-	if (phb->parent == NULL)
-		return 0;
-	if (phb->parent->parent)
+	if (ibm_read_pci_config == -1)
 		return 0;
-
-	buid_vals = get_property(phb, "reg", &len);
-	if (buid_vals == NULL)
+	if (of_address_to_resource(phb, 0, &r))
 		return 0;
-
-	addr_cells = prom_n_addr_cells(phb);
-	if (addr_cells == 1) {
-		buid = (unsigned long) buid_vals[0];
-	} else {
-		buid = (((unsigned long)buid_vals[0]) << 32UL) |
-			(((unsigned long)buid_vals[1]) & 0xffffffff);
-	}
-	return buid;
+	return r.start;
 }
 
 static int phb_set_bus_ranges(struct device_node *dev,

  parent reply	other threads:[~2006-11-06  7:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-06  7:05 [PATCH 0/27] My current serie of patches for 2.6.20 for review Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 1/27] ibmveth: Remove ibmveth "liobn" field Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 3/27] Driver core: add notification of bus events Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 2/27] Call platform_notify_remove later Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 4/27] arch provides generic iomap missing accessors Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 5/27] powerpc: Make pci_read_irq_line the default Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 6/27] powerpc: Remove ppc_md.pci_map_irq & ppc_swizzle for ARCH=powerpc Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 7/27] powerpc: Generic DCR infrastructure Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 8/27] powerpc: Make EMAC use generic DCR access methods Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 9/27] powerpc: Support for DCR based MPIC Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 10/27] powerpc: Improve MPIC driver auto-configuration from DT Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 11/27] powerpc: Native cell support for MPIC in southbridge Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 12/27] powerpc: Souped-up of_platform_device support Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 13/27] powerpc: Hook of_platform_bus_probe with cell Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 15/27] powerpc: PCI use new bus device notifier Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 14/27] powerpc: Refactor 64 bits DMA operations Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 16/27] powerpc: Add DMA ops support for of_plaform_device to Cell Benjamin Herrenschmidt
2006-11-06  7:05 ` Benjamin Herrenschmidt [this message]
2006-11-06  7:05 ` [PATCH 17/27] powerpc: Resolve the parent address of a PCI bus range Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 19/27] powerpc: Add "parent" struct device for PCI host bridges Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 20/27] powerpc: Generic OF platform driver " Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 21/27] powerpc: Cell fixup DMA offset for new southbridge Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 22/27] s2io ppc64 fix for readq/writeq Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 23/27] powerpc: Allow hooking of PCI MMIO & PIO accessors on 64 bits Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 24/27] powerpc: Cell "Spider" MMIO workarounds Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 25/27] powerpc: remove ioremap64 and fixup_bigphys_addr Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 26/27] powerpc: Merge 32 and 64 bits asm-powerpc/io.h Benjamin Herrenschmidt
2006-11-06  7:05 ` [PATCH 27/27] powerpc: EMAC of_platform_device support for Cell using Axon 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=20061106070707.ADF2467DF3@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).