2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
30 #ifndef _IOKIT_APPLEMACRISCPCI_H
31 #define _IOKIT_APPLEMACRISCPCI_H
33 #include <IOKit/pci/IOPCIBridge.h>
35 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
38 kBridgeSelfDevice
= 11
42 kMacRISCAddressSelect
= 0x48
45 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
47 class AppleMacRiscPCI
: public IOPCIBridge
49 OSDeclareDefaultStructors(AppleMacRiscPCI
)
53 IODeviceMemory
* ioMemory
;
54 IOMemoryMap
* configAddrMap
;
55 IOMemoryMap
* configDataMap
;
57 volatile UInt32
* configAddr
;
58 volatile UInt8
* configData
;
60 UInt16 coarseAddressMask
;
61 UInt16 fineAddressMask
;
63 UInt8 configDataOffsetMask
;
65 inline bool setConfigSpace( IOPCIAddressSpace space
, UInt8 offset
);
66 virtual UInt8
firstBusNum( void );
67 virtual UInt8
lastBusNum( void );
70 virtual bool start( IOService
* provider
);
71 virtual bool configure( IOService
* provider
);
75 virtual IODeviceMemory
* ioDeviceMemory( void );
77 virtual UInt32
configRead32( IOPCIAddressSpace space
, UInt8 offset
);
78 virtual void configWrite32( IOPCIAddressSpace space
,
79 UInt8 offset
, UInt32 data
);
80 virtual UInt16
configRead16( IOPCIAddressSpace space
, UInt8 offset
);
81 virtual void configWrite16( IOPCIAddressSpace space
,
82 UInt8 offset
, UInt16 data
);
83 virtual UInt8
configRead8( IOPCIAddressSpace space
, UInt8 offset
);
84 virtual void configWrite8( IOPCIAddressSpace space
,
85 UInt8 offset
, UInt8 data
);
87 virtual IOPCIAddressSpace
getBridgeSpace( void );
90 class AppleMacRiscVCI
: public AppleMacRiscPCI
92 OSDeclareDefaultStructors(AppleMacRiscVCI
)
95 virtual bool configure( IOService
* provider
);
97 virtual IODeviceMemory
* ioDeviceMemory( void );
101 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
103 /* Definitions of UniNorth Target config registers */
105 kUniNGART_BASE
= 0x8c,
106 kUniNAGP_BASE
= 0x90,
107 kUniNGART_CTRL
= 0x94,
108 kUniNINTERNAL_STATUS
= 0x98
111 kGART_INV
= 0x00000001,
112 kGART_EN
= 0x00000100,
113 kGART_2xRESET
= 0x00010000
116 class IORangeAllocator
;
118 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
120 class AppleMacRiscAGP
: public AppleMacRiscPCI
122 OSDeclareDefaultStructors(AppleMacRiscAGP
)
125 IORangeAllocator
* agpRange
;
127 IOPhysicalAddress systemBase
;
128 IOPhysicalLength systemLength
;
129 volatile UInt32
* gartArray
;
130 IOByteCount gartLength
;
131 UInt8 targetAGPRegisters
;
134 virtual IOReturn
setAGPEnable( IOAGPDevice
* master
, bool enable
,
135 IOOptionBits options
= 0 );
139 virtual bool configure( IOService
* provider
);
141 virtual IOPCIDevice
* createNub( OSDictionary
* from
);
143 virtual IOReturn
saveDeviceState( IOPCIDevice
* device
,
144 IOOptionBits options
= 0 );
145 virtual IOReturn
restoreDeviceState( IOPCIDevice
* device
,
146 IOOptionBits options
= 0 );
148 virtual IOReturn
createAGPSpace( IOAGPDevice
* master
,
149 IOOptionBits options
,
150 IOPhysicalAddress
* address
,
151 IOPhysicalLength
* length
);
153 virtual IOReturn
destroyAGPSpace( IOAGPDevice
* master
);
155 virtual IORangeAllocator
* getAGPRangeAllocator( IOAGPDevice
* master
);
157 virtual IOOptionBits
getAGPStatus( IOAGPDevice
* master
,
158 IOOptionBits options
= 0 );
159 virtual IOReturn
resetAGPDevice( IOAGPDevice
* master
,
160 IOOptionBits options
= 0 );
162 virtual IOReturn
getAGPSpace( IOAGPDevice
* master
,
163 IOPhysicalAddress
* address
,
164 IOPhysicalLength
* length
);
166 virtual IOReturn
commitAGPMemory( IOAGPDevice
* master
,
167 IOMemoryDescriptor
* memory
,
168 IOByteCount agpOffset
,
169 IOOptionBits options
= 0 );
171 virtual IOReturn
releaseAGPMemory( IOAGPDevice
* master
,
172 IOMemoryDescriptor
* memory
,
173 IOByteCount agpOffset
,
174 IOOptionBits options
= 0 );
177 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
179 #endif /* ! _IOKIT_APPLEMACRISCPCI_H */