3 * \brief PCI Bus Driver
\r
4 * \author John Hodge (thePowersGang)
\r
10 * \brief PCI Class Codes
\r
14 PCI_CLASS_PRE20 = 0x00,
\r
18 PCI_CLASS_MULTIMEDIA,
\r
25 PCI_CLASS_PROCESSORS,
\r
26 PCI_CLASS_SERIALBUS,
\r
27 PCI_CLASS_MISC = 0xFF
\r
30 enum ePCIOverClasses
\r
32 PCI_OC_PCIBRIDGE = 0x060400,
\r
33 PCI_OC_SCSI = 0x010000
\r
36 typedef enum ePCI_BARTypes tPCI_BARType;
\r
41 PCI_BARTYPE_MEM, // Any memory type
\r
42 PCI_BARTYPE_MEMP, // Prefetchable memory
\r
43 PCI_BARTYPE_MEMNP, // Non-prefetchable memory
\r
44 PCI_BARTYPE_MEM32, // 32-bit memory
\r
45 PCI_BARTYPE_MEM64 // 64-bit memory
\r
48 #define PCI_CMD_IOENABLE (1 << 0)
\r
49 #define PCI_CMD_MEMENABLE (1 << 1)
\r
50 #define PCI_CMD_BUSMASTER (1 << 2) // Device can behave as a bus master
\r
51 #define PCI_CMD_SPECIALCYCLES (1 << 3) // Can monitor 'Special Cycle' operations
\r
52 #define PCI_CMD_WRAINVAL (1 << 4) // Memory 'Write and Invalidate' can be generated
\r
53 #define PCI_CMD_VGAPALSNOOP (1 << 5) // VGA Palette Snoop enabled
\r
54 #define PCI_CMD_PARITYERRRESP (1 << 6) // Pairity Error Response (suppress PERR# generation)
\r
55 #define PCI_CMD_SERRENABLE (1 << 8) // Enable SERR# Driver
\r
56 #define PCI_CMD_FASTBACKBACK (1 << 9) // Fast Back-Back Enable
\r
57 #define PCI_CMD_INTDISABLE (1 <<10) // Disable generation of INTx# signals
\r
59 typedef int tPCIDev;
\r
62 * \brief Count PCI Devices
\r
64 * Counts the number of devices with specified Vendor and Device IDs
\r
66 extern int PCI_CountDevices(Uint16 VendorID, Uint16 DeviceID);
\r
67 extern tPCIDev PCI_GetDevice(Uint16 VendorID, Uint16 DeviceID, int index);
\r
69 * \param ClassCode (Class:SubClass:PI)
\r
71 extern tPCIDev PCI_GetDeviceByClass(Uint32 ClassCode, Uint32 Mask, tPCIDev prev);
\r
73 extern int PCI_GetDeviceInfo(tPCIDev id, Uint16 *Vendor, Uint16 *Device, Uint32 *Class);
\r
74 extern int PCI_GetDeviceVersion(tPCIDev id, Uint8 *Revision);
\r
75 extern int PCI_GetDeviceSubsys(tPCIDev id, Uint16 *SubsystemVendor, Uint16 *SubsystemID);
\r
77 extern Uint32 PCI_ConfigRead(tPCIDev id, int Offset, int Size);
\r
78 extern void PCI_ConfigWrite(tPCIDev id, int Offset, int Size, Uint32 Value);
\r
80 extern Uint16 PCI_SetCommand(tPCIDev id, Uint16 SBits, Uint16 CBits);
\r
81 extern Uint8 PCI_GetIRQ(tPCIDev id);
\r
82 extern Uint32 PCI_GetBAR(tPCIDev id, int BAR);
\r
83 extern Uint64 PCI_GetValidBAR(tPCIDev id, int BAR, tPCI_BARType BARType);
\r
84 //extern Uint16 PCI_AssignPort(tPCIDev id, int bar, int count);
\r