All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: <linuxppc-dev@ozlabs.org>
Subject: [PATCH 6/13] [POWERPC] pci32: Add platform option to enable /proc PCI domains
Date: Wed, 12 Dec 2007 16:22:58 +1100	[thread overview]
Message-ID: <20071212052302.D964EDDF77@ozlabs.org> (raw)
In-Reply-To: <1197436973.110379.888292904645.qpush@grosgo>

This adds flags the platforms can use to enable domain numbers
in /proc/bus/pci.

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

 arch/powerpc/kernel/pci-common.c |   16 ++++++++++++++++
 arch/powerpc/kernel/pci_64.c     |    8 --------
 include/asm-powerpc/pci-bridge.h |    5 +++++
 include/asm-powerpc/pci.h        |   15 ++++-----------
 4 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 2a980d5..b2a5395 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -639,3 +639,19 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
 		hose->mem_resources[memno-1] = tmp;
 	}
 }
+
+/* Decide whether to display the domain number in /proc */
+int pci_proc_domain(struct pci_bus *bus)
+{
+	struct pci_controller *hose = pci_bus_to_host(bus);
+#ifdef CONFIG_PPC64
+	return hose->buid != 0;
+#else
+	if (!(ppc_pci_flags & PPC_PCI_ENABLE_PROC_DOMAINS))
+		return 0;
+	if (ppc_pci_flags & PPC_PCI_COMPAT_DOMAIN_0)
+		return hose->global_number != 0;
+	return 1;
+#endif
+}
+
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 115becf..1b7c810 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -570,14 +570,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
 	return 0;
 }
 
-/* Decide whether to display the domain number in /proc */
-int pci_proc_domain(struct pci_bus *bus)
-{
-	struct pci_controller *hose = pci_bus_to_host(bus);
-	return hose->buid != 0;
-}
-
-
 #ifdef CONFIG_HOTPLUG
 
 int pcibios_unmap_io_space(struct pci_bus *bus)
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index 2972f0d..fed8f52 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -30,6 +30,11 @@ enum {
 	 * ISA forwarding enabled
 	 */
 	PPC_PCI_CAN_SKIP_ISA_ALIGN	= 0x00000008,
+
+	/* Enable domain numbers in /proc */
+	PPC_PCI_ENABLE_PROC_DOMAINS	= 0x00000010,
+	/* ... except for domain 0 */
+	PPC_PCI_COMPAT_DOMAIN_0		= 0x00000020,
 };
 
 
diff --git a/include/asm-powerpc/pci.h b/include/asm-powerpc/pci.h
index 47cc117..2883f56 100644
--- a/include/asm-powerpc/pci.h
+++ b/include/asm-powerpc/pci.h
@@ -98,9 +98,6 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
 #define get_pci_dma_ops()	NULL
 #endif
 
-/* Decide whether to display the domain number in /proc */
-extern int pci_proc_domain(struct pci_bus *bus);
-
 #else /* 32-bit */
 
 #ifdef CONFIG_PCI
@@ -112,17 +109,14 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
 	*strategy_parameter = ~0UL;
 }
 #endif
-
-/* Set the name of the bus as it appears in /proc/bus/pci */
-static inline int pci_proc_domain(struct pci_bus *bus)
-{
-	return 0;
-}
-
 #endif /* CONFIG_PPC64 */
 
 extern int pci_domain_nr(struct pci_bus *bus);
 
+/* Decide whether to display the domain number in /proc */
+extern int pci_proc_domain(struct pci_bus *bus);
+
+
 struct vm_area_struct;
 /* Map a range of PCI memory or I/O space for a device into user space */
 int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
-- 
1.5.3.7

  parent reply	other threads:[~2007-12-12  5:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-12  5:22 [PATCH 0/13] [POWERPC] PCI updates & merges Benjamin Herrenschmidt
2007-12-12  5:22 ` [PATCH 1/13] [POWERPC] pci32: remove bogus alignment message Benjamin Herrenschmidt
2007-12-12  5:22 ` [PATCH 2/13] [POWERPC] pci32: use generic pci_assign_unassign_resources Benjamin Herrenschmidt
2007-12-12  5:22 ` [PATCH 3/13] [POWERPC] pci32: Remove PowerMac P2P bridge IO hack Benjamin Herrenschmidt
2007-12-12  5:22 ` [PATCH 4/13] [POWERPC] pci32: Add flags modifying the PCI code behaviour Benjamin Herrenschmidt
2007-12-12  5:22 ` [PATCH 5/13] [POWERPC] pci32: Remove obsolete PowerMac bus number hack Benjamin Herrenschmidt
2007-12-12  5:22 ` Benjamin Herrenschmidt [this message]
2007-12-12  5:22 ` [PATCH 7/13] [POWERPC] Merge pcibios_resource_to_bus/bus_to_resource Benjamin Herrenschmidt
2007-12-12  5:23 ` [PATCH 8/13] [POWERPC] Merge PCI resource fixups Benjamin Herrenschmidt
2007-12-12  5:23 ` [PATCH 9/13] [POWERPC] Merge PCI resource allocation & assignment Benjamin Herrenschmidt
2007-12-12  5:23 ` [PATCH 10/13] [POWERPC] Updates/fixes to 32 bits pcibios_enable_device() Benjamin Herrenschmidt
2007-12-12  5:23 ` [PATCH 11/13] [POWERPC] Merge 32 and 64 bits pcibios_enable_device Benjamin Herrenschmidt
2007-12-12  5:23 ` [PATCH 13/13] [POWERPC] Clear pci_probe_only on 64 bits PowerMac Benjamin Herrenschmidt
2007-12-12  5:23 ` [PATCH 12/13] [POWERPC] Fixup powermac enable device hook 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=20071212052302.D964EDDF77@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.