From d3f1396e9bd45551444dd510ab693e7d58be6267 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Tue, 25 Sep 2007 00:16:31 +0000 Subject: [PATCH] Add more information to the device structure, so an Open Firmware device tree can be created from data in struct device. Signed-off-by: Jens Freimann Acked-by: Uwe Hermann git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@499 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- device/pci_device.c | 9 +++++++++ include/device/device.h | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/device/pci_device.c b/device/pci_device.c index dc2e52da28..e76c2e4caf 100644 --- a/device/pci_device.c +++ b/device/pci_device.c @@ -964,6 +964,15 @@ struct device *pci_probe_dev(struct device *dev, struct bus *bus, /* Read the rest of the PCI configuration information. */ hdr_type = pci_read_config8(dev, PCI_HEADER_TYPE); class = pci_read_config32(dev, PCI_CLASS_REVISION); + dev->status = pci_read_config16(dev, PCI_STATUS); + dev->revision = pci_read_config8(dev, PCI_REVISION_ID); + dev->cache_line = pci_read_config8(dev, PCI_CACHE_LINE_SIZE); + dev->irq_line = pci_read_config8(dev, PCI_INTERRUPT_LINE); + dev->irq_pin = pci_read_config8(dev, PCI_INTERRUPT_PIN); + dev->min_gnt = pci_read_config8(dev, PCI_MIN_GNT); + dev->max_lat = pci_read_config8(dev, PCI_MAX_LAT); + dev->subsystem_vendor = pci_read_config16(dev, PCI_SUBSYSTEM_VENDOR_ID); + dev->subsystem_device = pci_read_config16(dev, PCI_SUBSYSTEM_ID); /* Store the interesting information in the device structure. */ dev->vendor = id & 0xffff; diff --git a/include/device/device.h b/include/device/device.h index 646839b445..33b81519b7 100644 --- a/include/device/device.h +++ b/include/device/device.h @@ -188,6 +188,16 @@ struct device { char dtsname[MAX_DTSNAME_SIZE]; /* the name from the dts */ unsigned vendor; unsigned device; + u16 status; + u8 revision; + u8 cache_line; + u8 irq_line; + u8 irq_pin; + u8 min_gnt; + u8 max_lat; + u16 subsystem_vendor; + u16 subsystem_device; + unsigned int class; /* 3 bytes: (base,sub,prog-if) */ unsigned int hdr_type; /* PCI header type */ unsigned int enabled : 1; /* set if we should enable the device */