mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Deepak Saxena <dsaxena@mvista.com>
To: mochel@osdl.org, torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2.5] Make root PCI bus child of system_bus in device tree
Date: Tue, 25 Mar 2003 16:16:22 -0700	[thread overview]
Message-ID: <20030325231622.GA8231@xanadu.az.mvista.com> (raw)

All,

The following patch updates the PCI subsystem so that root PCI host 
bridges appear as devices hanging off the system bus instead of root 
level devices.  To me, this makes more sense from a topology point of 
view since most systems look as such:

  cpu0 <-- sys_bus --> Memory Controller/PCI Bridge  <-- sys_bus --> cpu1
                                  |
                                  |
                                  |
  <---------------------------- Root Level PCI Bus -------------------->


Even on system on a chip designs, the PCI bridge unit and the CPU core are 
physically connected over the system bus.  A PCI host bridge always connects 
the system/cpu/local bus to the PCI bus, so I think the device tree should 
represent this.  

I'm not sure if this is the best solution as we could have embedded systems 
where the root PCI bus is hanging off from something like a Rapid I/O bus or 
other non-CPU bus, so maybe we should just kill pci_scan_bus() and force all 
platforms to use pci_scan_bus_parented() so developers can best determine how 
to map their system's topology to the device tree?

Thanks,
~Deepak


diff -Nru a/drivers/base/sys.c b/drivers/base/sys.c
--- a/drivers/base/sys.c	Tue Mar 25 16:07:06 2003
+++ b/drivers/base/sys.c	Tue Mar 25 16:07:06 2003
@@ -21,7 +21,7 @@
 #include <linux/string.h>
 
 /* The default system device parent. */
-static struct device system_bus = {
+struct device system_bus = {
        .name           = "System Bus",
        .bus_id         = "sys",
 };
@@ -144,6 +144,7 @@
 	return device_register(&system_bus);
 }
 
+EXPORT_SYMBOL(system_bus);
 EXPORT_SYMBOL(system_bus_type);
 EXPORT_SYMBOL(sys_device_register);
 EXPORT_SYMBOL(sys_device_unregister);
diff -Nru a/include/linux/device.h b/include/linux/device.h
--- a/include/linux/device.h	Tue Mar 25 16:07:06 2003
+++ b/include/linux/device.h	Tue Mar 25 16:07:06 2003
@@ -353,6 +353,7 @@
 extern void sys_device_unregister(struct sys_device *);
 
 extern struct bus_type system_bus_type;
+extern struct device system_bus;
 
 /* drivers/base/platform.c */
 
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Tue Mar 25 16:07:06 2003
+++ b/include/linux/pci.h	Tue Mar 25 16:07:06 2003
@@ -537,12 +537,12 @@
 struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata);
 static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata)
 {
-	return pci_scan_bus_parented(NULL, bus, ops, sysdata);
+	return pci_scan_bus_parented(&system_bus, bus, ops, sysdata);
 }
 struct pci_bus *pci_alloc_primary_bus_parented(struct device * parent, int bus);
 static inline struct pci_bus *pci_alloc_primary_bus(int bus)
 {
-	return pci_alloc_primary_bus_parented(NULL, bus);
+	return pci_alloc_primary_bus_parented(&system_bus, bus);
 }
 int pci_scan_slot(struct pci_bus *bus, int devfn);
 void pci_bus_add_devices(struct pci_bus *bus);

-- 
Deepak Saxena
MontaVista Software - Powering the Embedded Revolution - www.mvista.com


             reply	other threads:[~2003-03-25 23:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-25 23:16 Deepak Saxena [this message]
2003-03-26  0:35 ` Alan Cox
2003-03-25 23:31   ` Deepak Saxena
2003-03-25 22:40     ` Patrick Mochel

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=20030325231622.GA8231@xanadu.az.mvista.com \
    --to=dsaxena@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    --cc=torvalds@transmeta.com \
    /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

all inboxes | Powered by JetHome®