summaryrefslogtreecommitdiff
path: root/src/arch/i386
diff options
context:
space:
mode:
authorEric Biederman <ebiederm@xmission.com>2003-06-11 21:55:00 +0000
committerEric Biederman <ebiederm@xmission.com>2003-06-11 21:55:00 +0000
commit05f26fcb571340b17beaca16939a025a9c0b4cdd (patch)
treea8c830fedbd545bf11c72c6d20b9e0715ffb6fdf /src/arch/i386
parentc927b022c23a55e84d5d6aaac1deb7b95e25a878 (diff)
downloadcoreboot-05f26fcb571340b17beaca16939a025a9c0b4cdd.tar.xz
- 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
Diffstat (limited to 'src/arch/i386')
-rw-r--r--src/arch/i386/include/arch/romcc_io.h16
-rw-r--r--src/arch/i386/lib/console.c9
2 files changed, 25 insertions, 0 deletions
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;
+}
diff --git a/src/arch/i386/lib/console.c b/src/arch/i386/lib/console.c
index 83502eafd9..f3594e9786 100644
--- a/src/arch/i386/lib/console.c
+++ b/src/arch/i386/lib/console.c
@@ -136,3 +136,12 @@ static void console_init(void)
" starting...\r\n";
print_info(console_test);
}
+
+
+static void die(const char *str)
+{
+ print_emerg(str);
+ do {
+ hlt();
+ } while(1);
+}