2 Copyright 2011, The AROS Development Team. All rights reserved.
6 #include <aros/debug.h>
9 #include "pcimockhardware.h"
10 #include "pcimockhardware_intern.h"
11 #include "pcimock_intern.h"
13 OOP_Object
* METHOD(SIS661FXMockHardware
, Root
, New
)
15 o
= (OOP_Object
*)OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
19 /* Allocate address space regions */
20 ALLOC_ASR(hwdata
, PCI_CONFIG_SPACE
, 256);
21 ALLOC_ASR(hwdata
, PCI_BAR0
, 0x4000000);
23 /* Fill in pci config space */
24 SET_ASR_DWORD(hwdata
, PCI_CONFIG_SPACE
, 0x00, 0x06611039); /* PCICS_PRODUCT, PCICS_VENDOR */
25 SET_ASR_DWORD(hwdata
, PCI_CONFIG_SPACE
, 0x04, 0x00100007); /* PCICS_STATUS, PCICS_COMMAND */
26 SET_ASR_DWORD(hwdata
, PCI_CONFIG_SPACE
, 0x08, 0x06000011); /* PCICS_CLASS, PCICS_SUBCLASS, PCICS_PROGIF, PCICS_REVISION */
27 SET_ASR_DWORD(hwdata
, PCI_CONFIG_SPACE
, 0x0c, 0x00000000); /* PCICS_BIST, PCICS_HEADERTYPE, PCICS_LATENCY, PCICS_CACHELS */
28 SET_ASR_DWORD(hwdata
, PCI_CONFIG_SPACE
, 0x10, hwdata
->Regions
[PCI_BAR0
].Address
); /* PCICS_BAR0 */
29 SET_ASR_DWORD(hwdata
, PCI_CONFIG_SPACE
, 0x2c, 0x00000000); /* PCICS_SUBSYSTEM, PCICS_SUBVENDOR */
30 SET_ASR_DWORD(hwdata
, PCI_CONFIG_SPACE
, 0x34, 0x00000080); /* PCICS_CAP_PTR */
31 SET_ASR_DWORD(hwdata
, PCI_CONFIG_SPACE
, 0x3c, 0x00000000); /* PCICS_INT_PIN, PCICS_INT_LINE */
34 SET_ASR_DWORD(hwdata
, PCI_CONFIG_SPACE
, 0x80, 0x0030ff02); /* AGP VERSION 3.0, CAPABILITY: END, CAPABILITY: PCICAP_AGP */
37 SET_ASR_DWORD(hwdata
, PCI_CONFIG_SPACE
, 0x84, 0x1f004e1b); /* bridgemode */
38 SET_ASR_DWORD(hwdata
, PCI_CONFIG_SPACE
, 0x94, 0x00000040); /* AGP_SIS_APER_SIZE */
43 VOID
METHOD(SIS661FXMockHardware
, Hidd_PCIMockHardware
, MemoryReadAtAddress
)
47 /* Detect in which address space the address is located and get relative offset */
48 struct RegionAndOffset rao
= HIDDPCIMockHardwareDetectRegionAndOffset(hwdata
, msg
->memoryaddress
);
53 if (rao
.Region
== PCI_CONFIG_SPACE
)
79 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);
82 VOID
METHOD(SIS661FXMockHardware
, Hidd_PCIMockHardware
, MemoryChangedAtAddress
)
86 /* Detect in which address space the address is located and get relative offset */
87 struct RegionAndOffset rao
= HIDDPCIMockHardwareDetectRegionAndOffset(hwdata
, msg
->memoryaddress
);
92 if (rao
.Region
== PCI_CONFIG_SPACE
)
104 OOP_DoSuperMethod(cl
, o
, (OOP_Msg
)msg
);