]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | /* |
2 | * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
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. | |
11 | * | |
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 | |
18 | * under the License. | |
19 | * | |
20 | * @APPLE_LICENSE_HEADER_END@ | |
21 | */ | |
22 | /* | |
23 | * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. | |
24 | * | |
25 | * DRI: Josh de Cesare | |
26 | * | |
27 | */ | |
28 | ||
29 | #include <IOKit/IODeviceTreeSupport.h> | |
30 | ||
31 | #include "PowerStar.h" | |
32 | #include "../drvAppleOHare/OHare.h" | |
33 | ||
34 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
35 | ||
36 | #define super ApplePlatformExpert | |
37 | ||
38 | OSDefineMetaClassAndStructors(PowerStarPE, ApplePlatformExpert); | |
39 | ||
40 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
41 | ||
42 | bool PowerStarPE::start(IOService *provider) | |
43 | { | |
44 | setChipSetType(kChipSetTypePowerStar); | |
45 | ||
46 | // See if it is a Hooper or Kanga. | |
47 | if (IODTMatchNubWithKeys(provider, "('AAPL,3400/2400', 'AAPL,3500')")) { | |
48 | configureEthernet(provider); | |
49 | } | |
50 | ||
51 | _pePMFeatures = kStdPowerBookPMFeatures; | |
52 | _pePrivPMFeatures = kStdPowerBookPrivPMFeatures; | |
53 | _peNumBatteriesSupported = kStdPowerBookNumBatteries; | |
54 | ||
55 | return super::start(provider); | |
56 | } | |
57 | ||
58 | bool PowerStarPE::platformAdjustService(IOService *service) | |
59 | { | |
60 | if (!strcmp(service->getName(), "chips65550")) { | |
61 | service->setProperty("Ignore VBL", "", 0); | |
62 | return true; | |
63 | } | |
64 | ||
65 | return true; | |
66 | } | |
67 | ||
68 | void PowerStarPE::configureEthernet(IOService *provider) | |
69 | { | |
70 | OSCollectionIterator *nodeList; | |
71 | IORegistryEntry *node, *enet, *ohare; | |
72 | OSArray *interruptNames, *interruptSources; | |
73 | OSSymbol *interruptControllerName; | |
74 | OSData *tempData; | |
75 | long tempSource; | |
76 | ||
77 | enet = 0; | |
78 | ohare = 0; | |
79 | ||
80 | // Find the node for DEC21041. | |
81 | nodeList = IODTFindMatchingEntries(provider, kIODTRecursive, | |
82 | "'pci1011,14'"); | |
83 | if (nodeList) { | |
84 | while ((node = (IORegistryEntry *)nodeList->getNextObject())) { | |
85 | enet = node; | |
86 | } | |
87 | nodeList->release(); | |
88 | } | |
89 | ||
90 | if (enet == 0) return; | |
91 | ||
92 | // Set the 'Network Connection' property to '10BaseT'. | |
93 | enet->setProperty("Network Connection", "10BaseT"); | |
94 | ||
95 | // Add a 'built-in' property so IONetworkStack will treat it as built in. | |
96 | enet->setProperty("built-in", "", 0); | |
97 | ||
98 | // If it is there, find the node for the second ohare. | |
99 | nodeList = IODTFindMatchingEntries(provider, kIODTRecursive, | |
100 | "'pci106b,7'"); | |
101 | if (nodeList) { | |
102 | while ((node = (IORegistryEntry *)nodeList->getNextObject())) { | |
103 | ohare = node; | |
104 | } | |
105 | nodeList->release(); | |
106 | } | |
107 | ||
108 | if (ohare == 0) return; | |
109 | ||
110 | interruptNames = OSDynamicCast(OSArray, | |
111 | enet->getProperty(gIOInterruptControllersKey)); | |
112 | interruptControllerName = (OSSymbol *)OSSymbol::withCStringNoCopy("SecondaryInterruptController"); | |
113 | interruptNames->setObject(0, interruptControllerName); | |
114 | interruptControllerName->release(); | |
115 | ||
116 | interruptSources = OSDynamicCast(OSArray, | |
117 | enet->getProperty(gIOInterruptSpecifiersKey)); | |
118 | tempSource = 28; | |
119 | tempData = OSData::withBytes(&tempSource, sizeof(tempSource)); | |
120 | interruptSources->setObject(0, tempData); | |
121 | tempData->release(); | |
122 | } |