diff options
author | Myles Watson <mylesgw@gmail.com> | 2008-11-18 19:22:52 +0000 |
---|---|---|
committer | Myles Watson <mylesgw@gmail.com> | 2008-11-18 19:22:52 +0000 |
commit | 47398cfab7b5ffb7eeb4fa7ad6a0c092eff7fc62 (patch) | |
tree | 04facbf49a80920e2aa2ea08d3ff53ffc5536ed1 /northbridge | |
parent | f75b0fe10307a65ba1114d34be526650aeff0902 (diff) | |
download | coreboot-47398cfab7b5ffb7eeb4fa7ad6a0c092eff7fc62.tar.gz coreboot-47398cfab7b5ffb7eeb4fa7ad6a0c092eff7fc62.tar.bz2 coreboot-47398cfab7b5ffb7eeb4fa7ad6a0c092eff7fc62.zip |
This patch makes northbridge/amd/k8/pci.c use pci functions.
Build tested on Serengeti.
Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Marc Jones <marcj303@gmail.com>
git-svn-id: svn://coreboot.org/repository/coreboot-v3@1043 f3766cd6-281f-0410-b1cd-43a5c92072e9
Diffstat (limited to 'northbridge')
-rw-r--r-- | northbridge/amd/k8/pci.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/northbridge/amd/k8/pci.c b/northbridge/amd/k8/pci.c index 814e0fb827f8..c1d168ee9023 100644 --- a/northbridge/amd/k8/pci.c +++ b/northbridge/amd/k8/pci.c @@ -44,11 +44,8 @@ #include <device/hypertransport.h> #include <mc146818rtc.h> #include <lib.h> -#include <lapic.h> +#include <lapic.h> -#define FX_DEVS 8 -extern struct device *__f0_dev[FX_DEVS]; -extern void get_fx_devs(void); u32 f1_read_config32(unsigned int reg); void f1_write_config32(unsigned int reg, u32 value); unsigned int amdk8_nodeid(struct device *dev); @@ -257,26 +254,23 @@ static unsigned int amdk8_scan_chains(struct device *dev, unsigned int max) * @param goal_nodeid node number * @param goal_link link number * @return 0 if not useable, 1 if useable, or 2 if the pair is free - * __f0 is initialized once in amdk8_read_resources */ static int reg_useable(unsigned reg, struct device *goal_dev, unsigned goal_nodeid, unsigned goal_link) { - struct resource *res; - unsigned nodeid, link = 0; + struct resource *res = NULL; + struct device *dev = NULL; + unsigned nodeid = 0, link = 0; int result; - res = NULL; /* Look for the resource that matches this register. */ - for (nodeid = 0; !res && (nodeid < CONFIG_MAX_PHYSICAL_CPUS); nodeid++) { - struct device *dev; - dev = __f0_dev[nodeid]; - if (!dev) - continue; + while (!res + && (dev = dev_find_pci_device(PCI_VENDOR_ID_AMD, 0x1100, dev))) { for (link = 0; !res && (link < 3); link++) { res = probe_resource(dev, 0x100 + (reg | link)); } + nodeid++; } /* If no allocated resource was found, it is free - return 2 */ @@ -400,8 +394,6 @@ static void amdk8_read_resources(struct device *dev) unsigned nodeid, link; nodeid = amdk8_nodeid(dev); - get_fx_devs(); /* Make sure __f0 is initialized */ - for (link = 0; link < dev->links; link++) { if (dev->link[link].children) { printk(BIOS_DEBUG, "amdk8_read_resources link %d\n", |