Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | # ========== Copyright Header Begin ========================================== |
2 | # | |
3 | # Hypervisor Software File: dropins.src | |
4 | # | |
5 | # Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
6 | # | |
7 | # - Do no alter or remove copyright notices | |
8 | # | |
9 | # - Redistribution and use of this software in source and binary forms, with | |
10 | # or without modification, are permitted provided that the following | |
11 | # conditions are met: | |
12 | # | |
13 | # - Redistribution of source code must retain the above copyright notice, | |
14 | # this list of conditions and the following disclaimer. | |
15 | # | |
16 | # - Redistribution in binary form must reproduce the above copyright notice, | |
17 | # this list of conditions and the following disclaimer in the | |
18 | # documentation and/or other materials provided with the distribution. | |
19 | # | |
20 | # Neither the name of Sun Microsystems, Inc. or the names of contributors | |
21 | # may be used to endorse or promote products derived from this software | |
22 | # without specific prior written permission. | |
23 | # | |
24 | # This software is provided "AS IS," without a warranty of any kind. | |
25 | # ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, | |
26 | # INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A | |
27 | # PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN | |
28 | # MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR | |
29 | # ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR | |
30 | # DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN | |
31 | # OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR | |
32 | # FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE | |
33 | # DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, | |
34 | # ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF | |
35 | # SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | |
36 | # | |
37 | # You acknowledge that this software is not designed, licensed or | |
38 | # intended for use in the design, construction, operation or maintenance of | |
39 | # any nuclear facility. | |
40 | # | |
41 | # ========== Copyright Header End ============================================ | |
42 | # @(#)dropins.src 1.2 07/08/06 | |
43 | # purpose: | |
44 | # copyright: Copyright 2007 Sun Microsystems, Inc. All rights reserved. | |
45 | # copyright: Use is subject to license terms. | |
46 | # | |
47 | # | |
48 | # Format: key <data> | |
49 | # build <command to run> | |
50 | # depend <file> | |
51 | # target <dropin-src> <dropin-name> | |
52 | # source{ [code] terminated by }source | |
53 | # include <file> | |
54 | # | |
55 | version2 | |
56 | ||
57 | message Remove old hardware support from code! | |
58 | # Because we are putting Niagara2 support back into the common | |
59 | # sources before we decomission support for P1.0 hardware, we | |
60 | # must still support the old Southbridge device, and all the | |
61 | # hacks that went with it. Eventually, we can remove the following: | |
62 | # - IDE driver | |
63 | # - ISA driver | |
64 | # - PCI bridge hack | |
65 | # - 'no-device' method | |
66 | # Also, there is a hack in the sun4v pci FCode driver to workaround | |
67 | # Niagara2 erratum 106. That can be removed when we stop supporting | |
68 | # version 1.0 Niagara2 chips. | |
69 | ||
70 | # create the code to execute fcode dropins | |
71 | source{ | |
72 | caps off | |
73 | " /packages/SUNW,builtin-drivers" find-device | |
74 | ||
75 | headerless | |
76 | : load-driver ( str$ -- ) | |
77 | find-drop-in if ( adr,len ) | |
78 | >r dup >r 1 byte-load ( ) | |
79 | r> r> free-drop-in ( ) | |
80 | then ( ) | |
81 | ; | |
82 | ||
83 | \ This is what we do if a device is probed, but we don't | |
84 | \ want to create a device node for it. | |
85 | \ The "delete-device" is just a list monkey that removes | |
86 | \ the specified phandle from its parent's list of children. | |
87 | \ There is no deallocation of resources, and the phandle | |
88 | \ continues to point to a valid device. | |
89 | \ | |
90 | \ Remove this method when we no longer support P1.0 hardware | |
91 | : no-device ( flag -- ) | |
92 | if | |
93 | current-device delete-device drop | |
94 | -1 throw | |
95 | then | |
96 | ; | |
97 | ||
98 | : interrupt-property ( n -- ) " interrupts" integer-property ; | |
99 | ||
100 | : get-fcode ( adr1 len1 adr2 len2 -- true | false ) | |
101 | find-drop-in if | |
102 | 2dup >r >r | |
103 | rot min rot swap move | |
104 | r> r> free-drop-in | |
105 | true | |
106 | else 2drop false | |
107 | then | |
108 | ; | |
109 | ||
110 | headers | |
111 | ||
112 | }source | |
113 | ||
114 | build ${MAKEDI} | |
115 | ||
116 | target bootprom.bin bootprom | |
117 | ||
118 | depend ${BP}/dev/sun4v-devices/vnexus/depend.mk | |
119 | target vnexus.fc SUNW,vnexus | |
120 | source{ | |
121 | : onboard-devices ( -- ) | |
122 | diagnostic-mode? if | |
123 | ." Loading onboard drivers: " | |
124 | then | |
125 | 0 0 " 100" " /" begin-package | |
126 | " SUNW,vnexus" load-driver | |
127 | end-package | |
128 | ; | |
129 | }source | |
130 | ||
131 | # Fonts | |
132 | depend ${BP}/pkg/termemu/fonts.mk | |
133 | external font.di | |
134 | ||
135 | # Sunlogo | |
136 | depend ${BP}/pkg/sunlogo/logo.mk | |
137 | external sun-logo.di | |
138 | ||
139 | # Keyboard Translator Package | |
140 | depend ${BP}/pkg/keyboard/translator/kbdtrans.mk | |
141 | external kbdtrans.di | |
142 | ||
143 | # Sun USB Keyboard Tables | |
144 | depend ${BP}/pkg/keyboard/tables/usb/keyboard.mk | |
145 | external usbkbds.di | |
146 | ||
147 | # Network boot support package | |
148 | depend ${BP}/pkg/netinet/obptftp.mk | |
149 | external obptftp.di | |
150 | ||
151 | # Sun4v PCI FCode driver | |
152 | depend ${BP}/dev/sun4v-devices/vpci/depend.mk | |
153 | target vpci.fc sun4v-vpci | |
154 | buildoptions vpci.fc:= FTHFLAGS += [define] 64BIT-ASSIGNED? | |
155 | buildoptions vpci.fc:= FTHFLAGS += [define] N2-ERRATUM-106 | |
156 | source{ | |
157 | : pciex ( -- ) | |
158 | " sun4v-vpci" load-driver | |
159 | ; | |
160 | }source | |
161 | ||
162 | # vebus on huron | |
163 | depend ${BP}/dev/sun4v-devices/vebus/depend.mk | |
164 | target vebus.fc sun4v-ebus | |
165 | source{ | |
166 | : vebus ( -- ) | |
167 | " sun4v-ebus" load-driver | |
168 | ; | |
169 | }source | |
170 | ||
171 | # Serial ttya | |
172 | depend ${BP}/dev/ebus-devices/su-serial/depend.mk | |
173 | target su-serial.fc su-serial | |
174 | source{ | |
175 | : ebus-serial ( -- ) | |
176 | " serial" device-name | |
177 | 1 interrupt-property | |
178 | " su16550" encode-string | |
179 | " su" encode-string encode+ " compatible" property | |
180 | " su-serial" load-driver | |
181 | ; | |
182 | alias ebus-0,ca0000 ebus-serial | |
183 | }source | |
184 | ||
185 | # Niagara2 performace counter driver | |
186 | depend ${BP}/dev/sun4v-devices/n2/perf-cntr/depend.mk | |
187 | target perf-cntr.fc sun4v-perf-cnt | |
188 | source{ | |
189 | : SUNW,n2piu-pr ( -- ) | |
190 | " sun4v-perf-cnt" load-driver | |
191 | ; | |
192 | }source | |
193 | ||
194 | # Niagara2 NIU nexus driver | |
195 | depend ${BP}/dev/sun4v-devices/niu-nexus/depend.mk | |
196 | target niu-nexus.fc niu-nexus | |
197 | source{ | |
198 | : SUNW,niumx ( -- ) | |
199 | " niu-nexus" load-driver | |
200 | ; | |
201 | }source | |
202 | ||
203 | # Intel Gigabit Ethernet | |
204 | depend ${BP}/dev/network/ophir/depend.mk | |
205 | target ophir.fc ophir | |
206 | source{ | |
207 | \ Use the subsystem vendor id 0x108e for Sun so we ensure that | |
208 | \ we don't attach the Ophir driver to PCI-E cards. If we do, | |
209 | \ it's possible that the Ophir driver could blow away the EEPROM | |
210 | \ MAC, and the system wouldn't be able to recover the MAC. | |
211 | : pciex8086,105e.108e.105e ( -- ) | |
212 | " ophir" load-driver | |
213 | ; | |
214 | ||
215 | }source | |
216 | ||
217 | # Niagara2 NIU network device driver | |
218 | depend ${BP}/dev/network/neptune/niu/depend.mk | |
219 | target niu.fc niu-network | |
220 | source{ | |
221 | : SUNW,niusl ( -- ) | |
222 | " niu-network" load-driver | |
223 | ; | |
224 | }source | |
225 | ||
226 | # virtual flashprom support | |
227 | depend ${BP}/dev/sun4v-devices/flashprom/depend.mk | |
228 | target flashprom.fc sun4v-flashprom | |
229 | source{ | |
230 | : flashprom ( -- ) " sun4v-flashprom" load-driver ; | |
231 | }source | |
232 | ||
233 | # virtual console | |
234 | depend ${BP}/dev/sun4v-devices/console/depend.mk | |
235 | target console.fc sun4v-console | |
236 | source{ | |
237 | : SUNW,sun4v-console ( -- ) " sun4v-console" load-driver ; | |
238 | }source | |
239 | ||
240 | # vchannel support | |
241 | depend ${BP}/dev/sun4v-devices/vchannel/depend.mk | |
242 | target vchannel.fc sun4v-chan-dev | |
243 | source{ | |
244 | : SUNW,sun4v-channel-devices ( -- ) " sun4v-chan-dev" load-driver ; | |
245 | }source | |
246 | ||
247 | # vNET support | |
248 | depend ${BP}/dev/sun4v-devices/vnet/depend.mk | |
249 | target vnet.fc sun4v-vnet | |
250 | source{ | |
251 | : SUNW,sun4v-network ( -- ) " sun4v-vnet" load-driver ; | |
252 | }source | |
253 | ||
254 | # vDisk support | |
255 | depend ${BP}/dev/sun4v-devices/vdisk/depend.mk | |
256 | target vdisk.fc sun4v-vdisk | |
257 | source{ | |
258 | : SUNW,sun4v-disk ( -- ) " sun4v-vdisk" load-driver ; | |
259 | }source | |
260 | ||
261 | # hypervisor TOD | |
262 | depend ${BP}/dev/sun4v-devices/tod/depend.mk | |
263 | target tod.fc sun4v-tod | |
264 | source{ | |
265 | : SUNW,sun4v-tod ( -- ) " sun4v-tod" load-driver ; | |
266 | }source | |
267 | ||
268 | # SAS LSI 1064 driver (PCI-E version) | |
269 | # depend ${BP}/dev/scsi/adapters/lsi1064/depend.mk | |
270 | # buildoptions lsi1064.di:= MAKEDI = ${ROOT}/bin/makedi | |
271 | # target lsi1064.fc pci1000,56 | |
272 | # source{ | |
273 | # : pci1000,56 ( -- ) | |
274 | # " pci1000,56" load-driver | |
275 | # ; | |
276 | # alias pci1000,50.1000.1000 pci1000,56 | |
277 | # alias pci1000,56.1000.1000 pci1000,56 | |
278 | # alias pciex1000,50.1000.1000 pci1000,56 | |
279 | # alias pciex1000,50.1000.3010 pci1000,56 | |
280 | # alias pciex1000,56.1000.1000 pci1000,56 | |
281 | # alias pciex1000,56.1000.3010 pci1000,56 | |
282 | # alias pciex1000,58.1000.1000 pci1000,56 | |
283 | # alias pciex1000,58.1000.3010 pci1000,56 | |
284 | # alias pciex1000,58.1000.3080 pci1000,56 | |
285 | # alias pci1000,50.1000.3020 pci1000,56 | |
286 | # }source | |
287 | ||
288 | # Dec bridge | |
289 | depend ${BP}/dev/pci-bridge/dec21152/depend.mk | |
290 | target dec21152.fc class060400 | |
291 | source{ | |
292 | : class060400 ( -- ) | |
293 | \ The pci-express bridge that shows up as the "parent" to all the southbridge | |
294 | \ devices actually disables Legacy IO if the IO base/limit are set to decode | |
295 | \ that range (0 - fff). So we need to setup all the parent bridges EXCEPT | |
296 | \ the southbridge to decode that range. We also don't want anyone else to be | |
297 | \ allocated those resources. So we put those resources on the free list, and | |
298 | \ then allocate them right before we load the southbridge driver. | |
299 | \ | |
300 | \ This hack can be removed when we no longer support p1.0 hardware | |
301 | \ | |
302 | \ This trick depends on | |
303 | \ 1. IO address are allocated from 0 up | |
304 | \ 2. No IO devices are probed before the southbridge. | |
305 | ||
306 | my-space " config-l@" $call-parent h# 524910b9 = if \ SOUTHBRIDGE | |
307 | my-space h# 100.0000 or h# 1000 h# 1000 " resource-alloc" | |
308 | $call-parent drop | |
309 | then | |
310 | ||
311 | " class060400" load-driver | |
312 | ; | |
313 | }source | |
314 | ||
315 | # onboard IDE controller | |
316 | # Remove the IDE driver with P1.0 support | |
317 | depend ${BP}/dev/ide/pci/depend.mk | |
318 | # buildoptions ide.fc:= FTHFLAGS += [define] M1575-workarounds | |
319 | target ide.fc class010100 | |
320 | source{ | |
321 | : class010100 ( -- ) | |
322 | " class010100" load-driver | |
323 | ; | |
324 | alias class01018a class010100 | |
325 | alias class01018f class010100 | |
326 | }source | |
327 | ||
328 | # Legacy interface controller | |
329 | # Remove the Isa driver (and driver source code) with P1.0 support | |
330 | depend ${BP}/dev/southbridge/huron/isa/depend.mk | |
331 | target isa.fc pci10b9,1575 | |
332 | # The following flag toggles between using sideband interrupts | |
333 | # and virtual wire INTX messages for the Southbridge | |
334 | buildoptions isa.fc:= FTHFLAGS += [define] INTX-MESSAGES? | |
335 | source{ | |
336 | : pci10b9,1575 ( -- ) | |
337 | " pci10b9,1575" load-driver | |
338 | -1 no-device \ delete the node after init | |
339 | ; | |
340 | alias pci10b9,1575.10b9.1575 pci10b9,1575 | |
341 | ||
342 | }source | |
343 | ||
344 | # Existing *LEGACY* on-board USB controller. Only on P0 Huron. Remove when | |
345 | # P0 no longer needs to be supported. | |
346 | source{ | |
347 | : pci10b9,5237 ( -- ) | |
348 | \ Set "USB Reset Mux" bit in the ULI 1575 to ensure that | |
349 | \ software induced controller resets are handled correctly | |
350 | h# 46 " config-b@" $call-parent 8 or h# 46 " config-b!" $call-parent | |
351 | " ohci" load-driver | |
352 | ; | |
353 | alias pci10b9,5237.10b9.5237 pci10b9,5237 | |
354 | }source | |
355 | ||
356 | # ===== USB2 driver block. Ends at ====== # | |
357 | # onboard USB 1.0 driver | |
358 | depend ${BP}/dev/usb2/hcd/ohci/depend.mk | |
359 | target ohci.fc ohci | |
360 | source{ | |
361 | : pci1033,35 ( -- ) | |
362 | " ohci" load-driver | |
363 | ; | |
364 | alias pci1033,35.1033.35 pci1033,35 | |
365 | }source | |
366 | ||
367 | # onboard USB 2.0 driver | |
368 | depend ${BP}/dev/usb2/hcd/ehci/depend.mk | |
369 | buildoptions ehci.fc:= FTHFLAGS += [define] set-usb20-char | |
370 | target ehci.fc ehci | |
371 | source{ | |
372 | : pci1033,e0 ( -- ) | |
373 | " ehci" load-driver | |
374 | ; | |
375 | alias pci1033,e0.1033.e0 pci1033,e0 | |
376 | }source | |
377 | ||
378 | ||
379 | depend ${BP}/dev/usb2/device/device/depend.mk | |
380 | target usbdevice.fc usbdevice | |
381 | source{ | |
382 | : usbdevice ( -- adr len true | false ) " usbdevice" get-fcode ; | |
383 | alias device usbdevice | |
384 | }source | |
385 | ||
386 | depend ${BP}/dev/usb2/device/hub/depend.mk | |
387 | target hub.fc hub | |
388 | source{ | |
389 | : hub ( -- adr len true | false ) " hub" get-fcode ; | |
390 | alias usb,class9 hub | |
391 | }source | |
392 | ||
393 | depend ${BP}/dev/usb2/device/keyboard/depend.mk | |
394 | target usbkbd.fc usbkbd | |
395 | source{ | |
396 | : usbkbd ( -- adr len true | false ) " usbkbd" get-fcode ; | |
397 | alias usbif,class3.1.1 usbkbd | |
398 | }source | |
399 | ||
400 | depend ${BP}/dev/usb2/device/storage/depend.mk | |
401 | target usbstorage.fc usbstorage | |
402 | source{ | |
403 | : usbstorage ( -- adr len true | false ) " usbstorage" get-fcode ; | |
404 | alias usbif,class8 usbstorage | |
405 | }source | |
406 | # ===== End USB2 driver block. ====== # | |
407 | ||
408 | # finish the dropins | |
409 | source{ | |
410 | device-end | |
411 | caps on | |
412 | }source |