mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2.5] Make root PCI bus child of system_bus in device tree
@ 2003-03-25 23:16 Deepak Saxena
  2003-03-26  0:35 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Deepak Saxena @ 2003-03-25 23:16 UTC (permalink / raw)
  To: mochel, torvalds; +Cc: linux-kernel

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-03-25 23:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-25 23:16 [PATCH 2.5] Make root PCI bus child of system_bus in device tree Deepak Saxena
2003-03-26  0:35 ` Alan Cox
2003-03-25 23:31   ` Deepak Saxena
2003-03-25 22:40     ` Patrick Mochel

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®