2 Copyright 2010, The AROS Development Team. All rights reserved.
8 #include <proto/exec.h>
10 #include <aros/debug.h>
12 #include "agp_private.h"
14 #undef HiddAGPBridgeDeviceAttrBase
15 #define HiddAGPBridgeDeviceAttrBase (SD(cl)->hiddAGPBridgeDeviceAB)
17 OOP_Object
* METHOD(SiSAgp3BridgeDevice
, Root
, New
)
19 o
= (OOP_Object
*)OOP_DoSuperMethod(cl
, o
, (OOP_Msg
) msg
);
24 BOOL
METHOD(SiSAgp3BridgeDevice
, Hidd_AGPBridgeDevice
, Initialize
)
26 struct HIDDGenericBridgeDeviceData
* gbddata
=
27 OOP_INST_DATA(SD(cl
)->genericBridgeDeviceClass
, o
);
29 struct pHidd_AGPBridgeDevice_ScanAndDetectDevices saddmsg
= {
30 mID
: OOP_GetMethodID(IID_Hidd_AGPBridgeDevice
, moHidd_AGPBridgeDevice_ScanAndDetectDevices
)
33 ULONG major
, minor
= 0;
34 OOP_Object
* bridgedev
= NULL
;
35 UBYTE bridgeagpcap
= 0;
37 /* Scan for bridge and agp devices */
38 if (!OOP_DoMethod(o
, (OOP_Msg
)&saddmsg
))
41 /* Check if bridge is a supported SiS bridge */
42 if (gbddata
->bridge
->VendorID
!= 0x1039)
45 /* Check if version is at least 3.5 */
46 bridgedev
= gbddata
->bridge
->PciDevice
;
47 bridgeagpcap
= gbddata
->bridge
->AgpCapability
;
49 /* Getting version info */
50 major
= (readconfigbyte(bridgedev
, bridgeagpcap
+ AGP_VERSION_REG
) >> 4) & 0xf;
51 minor
= readconfigbyte(bridgedev
, bridgeagpcap
+ AGP_VERSION_REG
) & 0xf;
52 D(bug("[AGP] [SiS] Read config: AGP version %d.%d\n", major
, minor
));
54 /* In case of SiS only 3.5 bridges are guaranteed to be AGP3 compliant */
55 if (!((major
== 3) && (minor
>= 5)))
59 gbddata
->bridgemode
= readconfiglong(bridgedev
, bridgeagpcap
+ AGP_STATUS_REG
);
60 D(bug("[AGP] [SiS] Reading mode: 0x%x\n", gbddata
->bridgemode
));
62 /* Execute standard AGP3 initialize */
63 if (OOP_DoSuperMethod(cl
, o
, (OOP_Msg
) msg
))
65 gbddata
->state
= STATE_INITIALIZED
;