PciDevice.py revision 1310
1from Device import FooPioDevice, DmaDevice
2
3simobj PciConfigData(FooPioDevice):
4    addr = 0xffffffffffffffff
5    VendorID = Param.UInt16("Vendor ID")
6    DeviceID = Param.UInt16("Device ID")
7    Command = Param.UInt16(0, "Command")
8    Status = Param.UInt16(0, "Status")
9    Revision = Param.UInt8(0, "Device")
10    ProgIF = Param.UInt8(0, "Programming Interface")
11    SubClassCode = Param.UInt8(0, "Sub-Class Code")
12    ClassCode = Param.UInt8(0, "Class Code")
13    CacheLineSize = Param.UInt8(0, "System Cacheline Size")
14    LatencyTimer = Param.UInt8(0, "PCI Latency Timer")
15    HeaderType = Param.UInt8(0, "PCI Header Type")
16    BIST = Param.UInt8(0, "Built In Self Test")
17
18    BAR0 = Param.UInt32(0x00, "Base Address Register 0")
19    BAR1 = Param.UInt32(0x00, "Base Address Register 1")
20    BAR2 = Param.UInt32(0x00, "Base Address Register 2")
21    BAR3 = Param.UInt32(0x00, "Base Address Register 3")
22    BAR4 = Param.UInt32(0x00, "Base Address Register 4")
23    BAR5 = Param.UInt32(0x00, "Base Address Register 5")
24    BAR0Size = Param.UInt32(0, "Base Address Register 0 Size")
25    BAR1Size = Param.UInt32(0, "Base Address Register 1 Size")
26    BAR2Size = Param.UInt32(0, "Base Address Register 2 Size")
27    BAR3Size = Param.UInt32(0, "Base Address Register 3 Size")
28    BAR4Size = Param.UInt32(0, "Base Address Register 4 Size")
29    BAR5Size = Param.UInt32(0, "Base Address Register 5 Size")
30
31    CardbusCIS = Param.UInt32(0x00, "Cardbus Card Information Structure")
32    SubsystemID = Param.UInt16(0x00, "Subsystem ID")
33    SubsystemVendorID = Param.UInt16(0x00, "Subsystem Vendor ID")
34    ExpansionROM = Param.UInt32(0x00, "Expansion ROM Base Address")
35    InterruptLine = Param.UInt8(0x00, "Interrupt Line")
36    InterruptPin = Param.UInt8(0x00, "Interrupt Pin")
37    MaximumLatency = Param.UInt8(0x00, "Maximum Latency")
38    MinimumGrant = Param.UInt8(0x00, "Minimum Grant")
39
40simobj PciConfigAll(FooPioDevice):
41    pass
42
43simobj PciDevice(DmaDevice):
44    abstract = True
45    pci_bus = Param.Int("PCI bus")
46    pci_dev = Param.Int("PCI device number")
47    pci_func = Param.Int("PCI function code")
48    configdata = Param.PciConfigData(Super, "PCI Config data")
49    configspace = Param.PciConfigAll(Super, "PCI Configspace")
50    addr = 0xffffffffffffffff
51