From 05f26fcb571340b17beaca16939a025a9c0b4cdd Mon Sep 17 00:00:00 2001 From: Eric Biederman Date: Wed, 11 Jun 2003 21:55:00 +0000 Subject: - Factoring of auto.c - Implementation of fallback/normal support for the amd solo board - Minor bugfix in romcc git-svn-id: svn://svn.coreboot.org/coreboot/trunk@867 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/arch/i386/include/arch/romcc_io.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/arch/i386/include') diff --git a/src/arch/i386/include/arch/romcc_io.h b/src/arch/i386/include/arch/romcc_io.h index 66e6dc07cd..8366a4d529 100644 --- a/src/arch/i386/include/arch/romcc_io.h +++ b/src/arch/i386/include/arch/romcc_io.h @@ -53,6 +53,9 @@ static void wrmsr(unsigned long index, msr_t msr) (((FN) & 0x07) << 8) | \ ((WHERE) & 0xFF)) +#define PCI_ID(VENDOR_ID, DEVICE_ID) \ + ((((DEVICE_ID) & 0xFFFF) << 16) | ((VENDOR_ID) & 0xFFFF)) + static unsigned char pci_read_config8(unsigned addr) { outl(0x80000000 | (addr & ~3), 0xCF8); @@ -88,3 +91,16 @@ static void pci_write_config32(unsigned addr, unsigned int value) outl(0x80000000 | (addr & ~3), 0xCF8); outl(value, 0xCFC); } + +static unsigned pci_locate_device(unsigned pci_id, unsigned addr) +{ + addr &= ~0xff; + for(; addr <= PCI_ADDR(255, 31, 7, 0); addr += PCI_ADDR(0,0,1,0)) { + unsigned int id; + id = pci_read_config32(addr); + if (id == pci_id) { + return addr; + } + } + return ~0U; +} -- cgit v1.2.3