switch-coreboot/device
Ronald G. Minnich 28ecbeab88 The K8 is one example, but there are other devices (e.g. I2C) that also have
multiple links. The way this was done in v2 was a big confusing; this way is 
less so. 

The changes are easy. Getting them right has been hard :-)

First, for a k8 north that has three links, you can name each one as follows:
pci0@18,0
pci1@18,0
pci2@18,0

We have to have the same pcidevfn on these because that is how the k8 works. 
But the unit numbers (pci0, pci1, etc.) distinguish them. 

The dts will properly generate a "v3 device code" 
compatible static tree that puts the links in the right place in the 
data structure. 

The changes to dts are trivial. 
As before, dts nodes with children are understood to be a bridge. 
But what if there is a dts entry like this:
pci1@18,0 {/config/("northbridge/amd/k8/pci");};


This entry has no children in the dts. 
How does dt compiler know it is a bridge? It can not know unless 
we add information to the dts for that northbridge part. 
To ensure that all bridge devices are detected, we support the following: 
if a dts node for a device has a bridge property, e.g.: 
 {
        device_operations = "k8_ops";
       bridge;
 };

The dt compiler will treat it as a bridge whether it has children or not. 

Why would a device not have children? Because it might be attached to a
pci or other socket, and we don't know at build time if the socket is empty, 
or what might be in the socket. 

This code has been tested on dbe62 and k8 simnow, and works on each. 
It is minimal in size and it does what we need. I hope it resolves our 
discussion for now. We might want to improve or change the device code
later but, at this point, forward motion is important -- I'm on a deadline for
a very important demo Oct. 22!

Also included in this patch are new debug prints in k8 north. 

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/repository/coreboot-v3@865 f3766cd6-281f-0410-b1cd-43a5c92072e9
2008-09-17 16:36:20 +00:00
..
agp_device.c The named unions in the device tree code are obnoxious and degrade 2008-08-10 00:20:24 +00:00
cardbus_device.c Now version 3: LinuxBIOS -> coreboot rename. 2008-01-27 18:54:57 +00:00
device.c remaining fixes for log2. Simple prototype added to spd_ddr2.h 2008-08-31 20:39:48 +00:00
device_util.c Emergency patch for an ancient bug in device_util.c, self-acked: 2008-08-14 00:02:27 +00:00
hypertransport.c This set of changes gets us much farther, in fact, we get into initram. 2008-08-27 05:30:50 +00:00
Kconfig Fix Kconfig dependencies and update defconfigs. 2008-08-18 16:48:27 +00:00
Makefile small dependency fix, plus make oldconfig & co need libintl, too :) 2008-08-28 22:44:49 +00:00
pci_device.c Improve pci scan debugging. This helped me find a rather nasty bug. 2008-08-29 09:06:13 +00:00
pci_ops.c The K8 is one example, but there are other devices (e.g. I2C) that also have 2008-09-17 16:36:20 +00:00
pci_rom.c The named unions in the device tree code are obnoxious and degrade 2008-08-10 00:20:24 +00:00
pcie_device.c The named unions in the device tree code are obnoxious and degrade 2008-08-10 00:20:24 +00:00
pcix_device.c The named unions in the device tree code are obnoxious and degrade 2008-08-10 00:20:24 +00:00
pnp_device.c The named unions in the device tree code are obnoxious and degrade 2008-08-10 00:20:24 +00:00
pnp_raw.c Now version 3: LinuxBIOS -> coreboot rename. 2008-01-27 18:54:57 +00:00
root_device.c remove const from default root ops. device ops can not be const because they're 2008-04-04 03:46:39 +00:00
smbus_ops.c A lot of the v3 header files require other header files to be #included 2008-02-19 00:34:32 +00:00