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) 1999 Apple Computer, Inc. All rights reserved.
29 #include <IOKit/IODeviceTreeSupport.h>
31 #include "PowerStar.h"
32 #include "../drvAppleOHare/OHare.h"
34 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
36 #define super ApplePlatformExpert
38 OSDefineMetaClassAndStructors(PowerStarPE
, ApplePlatformExpert
);
40 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
42 bool PowerStarPE::start(IOService
*provider
)
44 setChipSetType(kChipSetTypePowerStar
);
46 // See if it is a Hooper or Kanga.
47 if (IODTMatchNubWithKeys(provider
, "('AAPL,3400/2400', 'AAPL,3500')")) {
48 configureEthernet(provider
);
51 _pePMFeatures
= kStdPowerBookPMFeatures
;
52 _pePrivPMFeatures
= kStdPowerBookPrivPMFeatures
;
53 _peNumBatteriesSupported
= kStdPowerBookNumBatteries
;
55 return super::start(provider
);
58 bool PowerStarPE::platformAdjustService(IOService
*service
)
60 if (!strcmp(service
->getName(), "chips65550")) {
61 service
->setProperty("Ignore VBL", "", 0);
68 void PowerStarPE::configureEthernet(IOService
*provider
)
70 OSCollectionIterator
*nodeList
;
71 IORegistryEntry
*node
, *enet
, *ohare
;
72 OSArray
*interruptNames
, *interruptSources
;
73 OSSymbol
*interruptControllerName
;
80 // Find the node for DEC21041.
81 nodeList
= IODTFindMatchingEntries(provider
, kIODTRecursive
,
84 while ((node
= (IORegistryEntry
*)nodeList
->getNextObject())) {
90 if (enet
== 0) return;
92 // Set the 'Network Connection' property to '10BaseT'.
93 enet
->setProperty("Network Connection", "10BaseT");
95 // Add a 'built-in' property so IONetworkStack will treat it as built in.
96 enet
->setProperty("built-in", "", 0);
98 // If it is there, find the node for the second ohare.
99 nodeList
= IODTFindMatchingEntries(provider
, kIODTRecursive
,
102 while ((node
= (IORegistryEntry
*)nodeList
->getNextObject())) {
108 if (ohare
== 0) return;
110 interruptNames
= OSDynamicCast(OSArray
,
111 enet
->getProperty(gIOInterruptControllersKey
));
112 interruptControllerName
= (OSSymbol
*)OSSymbol::withCStringNoCopy("SecondaryInterruptController");
113 interruptNames
->setObject(0, interruptControllerName
);
114 interruptControllerName
->release();
116 interruptSources
= OSDynamicCast(OSArray
,
117 enet
->getProperty(gIOInterruptSpecifiersKey
));
119 tempData
= OSData::withBytes(&tempSource
, sizeof(tempSource
));
120 interruptSources
->setObject(0, tempData
);