Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / obp / obp / arch / sun4v / niagara1-hw / release / dropins.src
CommitLineData
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# id: @(#)dropins.src 1.1 07/06/22
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#
55version2
56
57# create the code to execute fcode dropins
58source{
59caps off
60" /packages/SUNW,builtin-drivers" find-device
61
62 headerless
63 : load-driver ( str$ -- )
64 find-drop-in if ( adr,len )
65 >r dup >r 1 byte-load ( )
66 r> r> free-drop-in ( )
67 then ( )
68 ;
69 headers
70
71 : interrupt-property ( n -- ) " interrupts" integer-property ;
72
73 : get-fcode ( adr1 len1 adr2 len2 -- true | false )
74 find-drop-in if
75 2dup >r >r
76 rot min rot swap move
77 r> r> free-drop-in
78 true
79 else 2drop false
80 then
81 ;
82
83 headers
84
85}source
86
87build ${MAKEDI}
88
89target bootprom.bin bootprom
90
91depend ${BP}/dev/southbridge/ontario/isa/depend.mk
92target isa.fc SUNW,isa
93source{
94 \ Load the ISA bridge driver
95 : class060100 ( -- )
96 " SUNW,isa" load-driver
97
98 " /pci@7c0/pci@0/pci@2/pci@0,2/sound@1" find-package if
99 delete-device drop
100 then
101
102 " /pci@7c0/pci@0/pci@1/pci@0/sound@1" find-package if
103 delete-device drop
104 then
105
106 \ Per HW evaluation the bridge needs to be 'tuned' to increase the
107 \ throughput of DMA writes to Southbridge devices. The fix is to
108 \ program 0x031C91CA00451870 into the pci@0 side of the bridge at offset 0x178.
109 \ Reference cr 6400117.
110 my-parent ihandle>phandle ( phandle )
111 " reg" rot get-package-property drop ( prop,len )
112 decode-int nip nip
113 h# 00451870 over h# 178 wbsplit d# 28 << + + " config-l!" $call-parent
114 h# 031C91CA swap h# 17c wbsplit d# 28 << + + " config-l!" $call-parent
115 ;
116}source
117
118depend ${BP}/dev/sun4v-devices/vnexus/depend.mk
119target vnexus.fc SUNW,vnexus
120source{
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
132depend ${BP}/pkg/termemu/fonts.mk
133external font.di
134
135# Sunlogo
136depend ${BP}/pkg/sunlogo/logo.mk
137external sun-logo.di
138
139# Keyboard Translator Package
140depend ${BP}/pkg/keyboard/translator/kbdtrans.mk
141external kbdtrans.di
142
143# Sun USB Keyboard Tables
144depend ${BP}/pkg/keyboard/tables/usb/keyboard.mk
145external usbkbds.di
146
147# vchannel support
148depend ${BP}/dev/sun4v-devices/vchannel/depend.mk
149target vchannel.fc sun4v-chan-dev
150source{
151 : SUNW,sun4v-channel-devices ( -- ) " sun4v-chan-dev" load-driver ;
152}source
153
154# vNET support
155depend ${BP}/dev/sun4v-devices/vnet/depend.mk
156target vnet.fc sun4v-vnet
157source{
158 : SUNW,sun4v-network ( -- ) " sun4v-vnet" load-driver ;
159}source
160
161# vDisk support
162depend ${BP}/dev/sun4v-devices/vdisk/depend.mk
163target vdisk.fc sun4v-vdisk
164source{
165 : SUNW,sun4v-disk ( -- ) " sun4v-vdisk" load-driver ;
166}source
167
168# Virtual console
169depend ${BP}/dev/sun4v-devices/console/depend.mk
170target console.fc sun4v-console
171source{
172 : SUNW,sun4v-console ( -- ) " sun4v-console" load-driver ;
173}source
174
175# Network boot support package
176depend ${BP}/pkg/netinet/obptftp.mk
177external obptftp.di
178
179# Sun4v PCI driver
180depend ${BP}/dev/sun4v-devices/vpci/depend.mk
181target vpci.fc sun4v-vpci
182buildoptions vpci.fc:= FTHFLAGS += [define] 64BIT-ASSIGNED?
183source{
184 : pciex ( -- )
185 " sun4v-vpci" load-driver
186 ;
187}source
188
189# vebus on fire
190depend ${BP}/dev/sun4v-devices/vebus/depend.mk
191target vebus.fc sun4v-ebus
192source{
193 : vebus ( -- )
194 " sun4v-ebus" load-driver
195 ;
196}source
197
198# Intel Gigabit Ethernet
199depend ${BP}/dev/network/ophir/depend.mk
200target ophir.fc ophir
201source{
202 \ Use the subsystem vendor id 0x108e for Sun so we ensure that
203 \ we don't attach the Ophir driver to PCI-E cards. If we do,
204 \ it's possible that the Ophir driver could blow away the EEPROM
205 \ MAC, and the system wouldn't be able to recover the MAC.
206 : pciex8086,105e.108e.105e ( -- )
207 " ophir" load-driver
208 ;
209
210 \ Also attach to SERDES part. We are not concerned about
211 \ corrupting the EEPROM for the SERDES version, since it's
212 \ not used on plugin cards.
213 alias pciex8086,1060.8086.105e pciex8086,105e.108e.105e
214
215}source
216
217# Serial ttya
218depend ${BP}/dev/ebus-devices/su-serial/depend.mk
219target su-serial.fc su-serial
220source{
221 : ebus-serial ( -- )
222 " serial" device-name
223 1 interrupt-property
224 " su16550" encode-string
225 " su" encode-string encode+ " compatible" property
226 " su-serial" load-driver
227 ;
228 alias ebus-0,c2c000 ebus-serial
229 alias ebus-0,3fffff8 ebus-serial
230}source
231
232# Broadcom Gigabit Ethernet
233depend ${BP}/dev/network/bge/depend.mk
234target bge.fc bge
235source{
236 : pci14e4,1659 ( -- )
237 " bge" load-driver
238 ;
239 alias pci14e4,1659.14e4.1659 pci14e4,1659 \ BCM5703
240 alias pci14e4,16a7.14e4.9 pci14e4,1659 \ BCM5703?
241 alias pci14e4,1648.108e.1648 pci14e4,1659 \ BCM5704
242 alias pci14e4,1648.14e4.1648 pci14e4,1659 \ BCM5704
243 alias pci14e4,1668.108e.1668 pci14e4,1659 \ BCM5714
244 alias pci14e4,1668.14e4.1668 pci14e4,1659 \ BCM5714
245}source
246
247# virtual flashprom support
248# WARNING - BINDING ON A "name" PROPERTY
249depend ${BP}/dev/sun4v-devices/flashprom/depend.mk
250target flashprom.fc sun4v-flashprom
251source{
252 : flashprom ( -- ) " sun4v-flashprom" load-driver ;
253}source
254
255# hypervisor TOD
256depend ${BP}/dev/sun4v-devices/tod/depend.mk
257target tod.fc sun4v-tod
258source{
259 : SUNW,sun4v-tod ( -- ) " sun4v-tod" load-driver ;
260}source
261
262# SAS LSI 1064 driver (PCI-E version)
263# depend ${BP}/dev/scsi/adapters/lsi1064/depend.mk
264# buildoptions lsi1064.di:= MAKEDI = ${ROOT}/bin/makedi
265# target lsi1064.fc pci1000,56
266# source{
267# : pci1000,56 ( -- )
268# " pci1000,56" load-driver
269# ;
270# alias pci1000,50.1000.1000 pci1000,56
271# alias pci1000,56.1000.1000 pci1000,56
272# alias pciex1000,50.1000.1000 pci1000,56
273# alias pciex1000,50.1000.3010 pci1000,56
274# alias pciex1000,56.1000.1000 pci1000,56
275# alias pciex1000,56.1000.3010 pci1000,56
276# alias pciex1000,58.1000.1000 pci1000,56
277# alias pciex1000,58.1000.3010 pci1000,56
278# alias pci1000,50.1000.3020 pci1000,56
279# }source
280
281# Dec bridge
282depend ${BP}/dev/pci-bridge/dec21152/depend.mk
283target dec21152.fc class060400
284source{
285 : class060400 ( -- )
286 " class060400" load-driver
287
288 \ broadcom magic
289 \ Lots of spurrious interrupts generated by broadcom when booting.
290 \ Broadcom said well, why don't you try clearing this undocumented
291 \ vendor specific config register, and it worked...
292 my-space " config-l@" $call-self h# 1041166 = if
293 0 my-space h# b4 + " config-l!" $call-self
294 then
295 ;
296}source
297
298# Legacy Southbridge Support below
299
300# Serial line A
301depend ${BP}/dev/southbridge/isa-devices/serial/depend.mk
302target serial.fc SUNW,tty
303source{
304 : isa-0,3f8 ( -- )
305 " ttya" encode-string " console" property
306 " SUNW,tty" load-driver
307 " console" delete-property
308 ;
309}source
310
311# an IDE controller
312depend ${BP}/dev/ide/pci/depend.mk
313target ide.fc class010100
314source{
315 : class010100 ( -- ) " class010100" load-driver ;
316 alias class01018a class010100
317 alias class01018f class010100
318 alias class0101ff class010100
319}source
320
321# onboard USB driver
322depend ${BP}/dev/southbridge/usb/depend.mk
323target southusb.fc usb
324source{
325 : pci10b9,5237 ( -- )
326 1 interrupt-property
327 " usb" load-driver
328 ;
329}source
330
331depend ${BP}/dev/usb-devices/device/depend.mk
332target device.fc device
333source{
334 : device ( -- adr len true | false ) " device" get-fcode ;
335}source
336
337depend ${BP}/dev/usb-devices/combined/depend.mk
338target combined.fc combined
339source{
340 : combined ( -- adr len true | false ) " combined" get-fcode ;
341}source
342
343depend ${BP}/dev/usb-devices/interface/depend.mk
344target interface.fc interface
345source{
346 : interface ( -- adr len true | false ) " interface" get-fcode ;
347}source
348
349depend ${BP}/dev/usb-devices/hub/depend.mk
350target hub.fc hub
351source{
352 : hub ( -- adr len true | false ) " hub" get-fcode ;
353}source
354
355depend ${BP}/dev/usb-devices/kbd/depend.mk
356target usbkbd.fc kbd
357source{
358 : kbd ( -- adr len true | false ) " kbd" get-fcode ;
359}source
360
361# finish the dropins
362source{
363device-end
364caps on
365}source