summaryrefslogtreecommitdiff
path: root/util/vgabios/pci-userspace.h
diff options
context:
space:
mode:
authorLi-Ta Lo <ollie@lanl.gov>2004-07-08 17:18:27 +0000
committerLi-Ta Lo <ollie@lanl.gov>2004-07-08 17:18:27 +0000
commit815212652994a43d3e05dc864343b722b70a129d (patch)
treec4f0d5c97b4c175f40889e126b816a5d7036151d /util/vgabios/pci-userspace.h
parent4c5060dc2bf8f944c54361f7913d20d02fff65a0 (diff)
added testbios for V2
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1624 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/vgabios/pci-userspace.h')
-rw-r--r--util/vgabios/pci-userspace.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/util/vgabios/pci-userspace.h b/util/vgabios/pci-userspace.h
new file mode 100644
index 0000000000..094433070f
--- /dev/null
+++ b/util/vgabios/pci-userspace.h
@@ -0,0 +1,55 @@
+#include "pci.h"
+
+typedef unsigned long pciaddr_t;
+typedef u8 byte;
+typedef u16 word;
+
+struct pci_dev {
+ struct pci_dev *next; /* Next device in the chain */
+ word bus; /* Higher byte can select host bridges */
+ byte dev, func; /* Device and function */
+
+ /* These fields are set by pci_fill_info() */
+ int known_fields; /* Set of info fields already known */
+ word vendor_id, device_id; /* Identity of the device */
+ int irq; /* IRQ number */
+ pciaddr_t base_addr[6]; /* Base addresses */
+ pciaddr_t size[6]; /* Region sizes */
+ pciaddr_t rom_base_addr; /* Expansion ROM base address */
+ pciaddr_t rom_size; /* Expansion ROM size */
+
+ /* Fields used internally: */
+ void *access;
+ void *methods;
+ byte *cache; /* Cached information */
+ int cache_len;
+ int hdrtype; /* Direct methods: header type */
+ void *aux; /* Auxillary data */
+};
+
+
+struct pci_filter {
+ int bus, slot, func; /* -1 = ANY */
+ int vendor, device;
+};
+
+
+#define PCITAG struct pci_filter *
+#define pciVideoPtr struct pci_dev *
+
+extern int pciNumBuses;
+
+int pciInit(void);
+int pciExit(void);
+
+
+PCITAG findPci(unsigned short bx);
+u32 pciSlotBX(pciVideoPtr pvp);
+
+void pciWriteLong(PCITAG tag, u32 idx, u32 data);
+void pciWriteWord(PCITAG tag, u32 idx, u16 data);
+void pciWriteByte(PCITAG tag, u32 idx, u8 data);
+
+u32 pciReadLong(PCITAG tag, u32 idx);
+u16 pciReadWord(PCITAG tag, u32 idx);
+u8 pciReadByte(PCITAG tag, u32 idx);