4 #include <exec/types.h>
5 #include <exec/libraries.h>
6 #include <exec/execbase.h>
7 #include <exec/nodes.h>
8 #include <exec/lists.h>
14 #include <aros/arossupportbase.h>
15 #include <exec/execbase.h>
17 #include <libraries/acpica.h>
19 #include LC_LIBDEFS_FILE
23 * On i386 we can support very old Pentium-1 motherboards with PCI
24 * configuration mechanism 2.
25 * x86-64 is much more legacy-free...
27 #define LEGACY_SUPPORT
32 OOP_AttrBase hiddPCIDriverAB
;
35 OOP_AttrBase hidd_PCIDeviceAB
;
37 OOP_Class
*driverClass
;
39 /* Low-level sub-methods */
40 ULONG (*ReadConfigLong
)(UBYTE bus
, UBYTE dev
, UBYTE sub
, UWORD reg
);
41 void (*WriteConfigLong
)(UBYTE bus
, UBYTE dev
, UBYTE sub
, UWORD reg
, ULONG val
);
43 ACPI_TABLE_MCFG
*mcfg_tbl
;
49 struct Library LibNode
;
50 struct pci_staticdata psd
;
53 /* PCI configuration mechanism 1 registers */
54 #define PCI_AddressPort 0x0cf8
55 #define PCI_DataPort 0x0cfc
58 * PCI configuration mechanism 2 registers
59 * This mechanism is obsolete long ago. But AROS runs on old hardware,
60 * and we support this.
62 #define PCI_CSEPort 0x0cf8
63 #define PCI_ForwardPort 0x0cfa
66 * PCI configuration mechanism selector register.
67 * Supported by some transition-time chipsets, like Intel Neptune.
69 #define PCI_MechSelect 0x0cfb
71 #define PCICS_VENDOR 0x00
72 #define PCICS_PRODUCT 0x02
73 #define PCICS_SUBCLASS 0x0a
75 #define PCI_CLASS_BRIDGE_HOST 0x0600
76 #define PCI_CLASS_DISPLAY_VGA 0x0300
78 #define PCI_VENDOR_INTEL 0x8086
79 #define PCI_VENDOR_COMPAQ 0x0e11
81 #define BASE(lib) ((struct pcibase*)(lib))
83 #define PSD(cl) (&((struct pcibase*)cl->UserData)->psd)
92 static inline UWORD
ReadConfigWord(struct pci_staticdata
*psd
, UBYTE bus
, UBYTE dev
, UBYTE sub
, UWORD reg
)
96 temp
.ul
= psd
->ReadConfigLong(bus
, dev
, sub
, reg
);
97 return temp
.uw
[(reg
&2)>>1];
100 ULONG
ReadConfig1Long(UBYTE bus
, UBYTE dev
, UBYTE sub
, UWORD reg
);
101 void WriteConfig1Long(UBYTE bus
, UBYTE dev
, UBYTE sub
, UWORD reg
, ULONG val
);
103 #ifdef LEGACY_SUPPORT
105 void ProbePCI(struct pci_staticdata
*psd
);