Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | # ========== Copyright Header Begin ========================================== |
2 | # | |
3 | # Hypervisor Software File: Makefile.platform | |
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 | # | |
43 | # Copyright 2007 Sun Microsystems, Inc. All rights reserved. | |
44 | # Use is subject to license terms. | |
45 | # | |
46 | # ident "@(#)Makefile.platform 1.17 07/06/07 SMI" | |
47 | # | |
48 | ||
49 | TOP = ../../.. | |
50 | ||
51 | PLATFORM = ontario | |
52 | ||
53 | include ../../Makefile.family | |
54 | ############################################## | |
55 | # | |
56 | # Platform configuration | |
57 | # | |
58 | PLAT_OPTIONS = | |
59 | # | |
60 | # Workarounds | |
61 | # | |
62 | # Items prefixed with DESUPPORT_NIAGARA_1x should be disabled by setting | |
63 | # the make variable DESUPPORT_NIAGARA_1x once Niagara 1.x parts are flushed. | |
64 | # | |
65 | # DESUPPORT_NIAGARA_1x=YES # Leave unset until 1.x parts obsolete | |
66 | ||
67 | # Reset/Config doesn't properly initialize tick/stick | |
68 | PLAT_OPTIONS += -DRESETCONFIG_BROKENTICK | |
69 | ||
70 | # Enable DRAM and L2$ scrubbers in hypervisor | |
71 | PLAT_OPTIONS += -DRESETCONFIG_ENABLEHWSCRUBBERS | |
72 | ||
73 | # Niagara erratum #39: Halted strand not re-awakened by interrupt | |
74 | $(DESUPPORT_NIAGARA_1x)PLAT_OPTIONS += -DNIAGARA_ERRATUM_39 | |
75 | ||
76 | # Niagara erratum #40: Locked TLB entry #63 gets replaced (now a "feature") | |
77 | PLAT_OPTIONS += -DNIAGARA_ERRATUM_40 | |
78 | ||
79 | # Niagara erratum #41: Reserved Supervisor or User SPU stxa can silently abort SPU op | |
80 | PLAT_OPTIONS += -DNIAGARA_ERRATUM_41 | |
81 | ||
82 | # Niagara erratum #43: Partial_raw Load after Block_Init_Store Hangs Thread | |
83 | $(DESUPPORT_NIAGARA_1x)PLAT_OPTIONS += -DNIAGARA_ERRATUM_43 | |
84 | ||
85 | # Fire erratum 2.0-18: Need to workaround deadlock | |
86 | PLAT_OPTIONS += -DFIRE_ERRATUM_20_18 | |
87 | ||
88 | # PLX erratum: Need to check for link training errors and abort | |
89 | # Depends on FIRE_ERRATUM_20_18 | |
90 | PLAT_OPTIONS += -DPLX_ERRATUM_LINK_HACK | |
91 | ||
92 | # Workaround to add intr_cookie APIs to INTR API Group v1.0 | |
93 | PLAT_OPTIONS += -DSOLARIS_ERRATUM_6496266 | |
94 | ||
95 | # LDoms 1.0 Erratum; to avoid the unreliable reset caused by the PLX8532AA | |
96 | # PCI-E switch chips on Ontario systems, we force a power-cycle when resetting | |
97 | # the last domain in the system - which should as defined by best practices | |
98 | # be the control domain. | |
99 | PLAT_OPTIONS += -DLDOMS_1_0_ERRATUM_POWER_CYCLE | |
100 | ||
101 | # Solaris 'px' driver implementation of VPCI 1.1 support is broken. | |
102 | PLAT_OPTIONS += -DSOLARIS_ERRATUM_6538898 | |
103 | ||
104 | ############################################## | |
105 | ||
106 | RESET = ../dumbreset | |
107 | ||
108 | TRAP_SRCS = traptable.s traps_common.s | |
109 | TRAP_OBJS = $(TRAP_SRCS:.s=.o) | |
110 | ||
111 | Q_SRCS = main.s setup.s mmu.s l2subr.s \ | |
112 | chipsubr.s mmu_common.s \ | |
113 | vpci_fire.s vpci_errs.s cpu_errs.s \ | |
114 | svc.s svc_common.s svcinternal.s svc_vbsc.s ssi.s \ | |
115 | intr.s intr_ontario.s subr.s hcall.s \ | |
116 | hcall_core.s hcall_diag.s hcall_intr.s hcall_soft_state.s \ | |
117 | hcall_ncs.s hcall_vpci.s hcall_cpu.s hcall_groups.s \ | |
118 | hcall_mmu.s hcall_niagara.s \ | |
119 | vdev_intr.s vdev_console.s vdev_simdisk.s vdev_snet.s \ | |
120 | vpci_msi.s \ | |
121 | cyclic.s errs_common.s \ | |
122 | heartbeat.s ldc.s hvctl.s hv_common_cmds.s \ | |
123 | bootload.s | |
124 | ||
125 | Q_OBJS = $(Q_SRCS:.s=.o) | |
126 | ||
127 | PLATFORMC_LINT_SRCS = \ | |
128 | $(PLATFORM_SRC)/config.c \ | |
129 | $(PLATFORM_SRC)/init_ontario.c \ | |
130 | $(PLATFORM_SRC)/res_fire_pcie.c | |
131 | ||
132 | PLATFORMC_SRCS = \ | |
133 | config.c \ | |
134 | init_ontario.c \ | |
135 | res_fire_pcie.c | |
136 | ||
137 | QC_SRCS = \ | |
138 | mdsup.c \ | |
139 | reconf.c \ | |
140 | res_guest.c \ | |
141 | res_memory.c \ | |
142 | res_vcpu.c \ | |
143 | res_ldc.c \ | |
144 | res_console.c \ | |
145 | res_mau.c \ | |
146 | res_pcie.c \ | |
147 | init.c \ | |
148 | hvcontrol.c \ | |
149 | support.c \ | |
150 | $(FAMILYC_SRCS) \ | |
151 | $(PLATFORMC_SRCS) | |
152 | ||
153 | QC_OBJS = $(QC_SRCS:.c=.o) | |
154 | ||
155 | RESET_SRCS = reset.s | |
156 | RESET_OBJS = $(RESET_SRCS:.s=.o) | |
157 | ||
158 | OBJS = begin.o $(TRAP_OBJS) $(Q_OBJS) $(QC_OBJS) version.o end.o | |
159 | ||
160 | $(OBJS): offsets.h | |
161 | ||
162 | VERSION_SRC = $(FAMILY_SRC)/version.s | |
163 | BEGIN_SRC = $(FAMILY_SRC)/begin.s | |
164 | END_SRC = $(FAMILY_SRC)/end.s | |
165 | ||
166 | version.o: $(VERSION_SRC) | |
167 | @echo "Version: $(QVERSION)" | |
168 | $(AS) $(ASFLAGS) -DVERSION="\"$(QVERSION)\"" -DINFO="\"$(QINFO)\"" $< -o $@ $(FAMILY_SRC)/version.s | |
169 | ||
170 | begin.o: $(BEGIN_SRC) | |
171 | ||
172 | end.o: $(END_SRC) | |
173 | ||
174 | versioninfo: | |
175 | @echo "Version: $(QVERSION)" | |
176 | ||
177 | q.bin: q | |
178 | $(OBJCOPY) -O binary q q.bin | |
179 | @what q.bin | |
180 | @ls -l q.bin | |
181 | ||
182 | q: chkasm $(OBJS) $(FAMILY_SRC)/mapfile.q | |
183 | $(LD) -o $@ -e start_master -dn -z defs -M $(FAMILY_SRC)/mapfile.q $(OBJS) | |
184 | @size q | |
185 | ||
186 | q.dis: q0 | |
187 | dis q0 > $@ | |
188 | ||
189 | q0: $(Q_OBJS) $(FAMILY_SRC)/mapfile.q0 | |
190 | $(LD) -o $@ -e start_master -dn -z defs -M $(FAMILY_SRC)/mapfile.q0 $(OBJS) | |
191 | ||
192 | reset.bin: reset | |
193 | $(OBJCOPY) -O binary reset reset.bin | |
194 | ||
195 | reset: $(RESET_OBJS) $(RESET)/mapfile | |
196 | $(LD) -o $@ -e start_reset -dn -z defs -M $(RESET)/mapfile $(RESET_OBJS) | |
197 | ||
198 | # This would work but only dumps the .text, nothing else | |
199 | # elfdump -N .text -w q.bin q | |
200 | ||
201 | offsets.h: $(PLATFORM_SRC)/offsets.in | |
202 | @grep "^#" $(PLATFORM_SRC)/offsets.in > offsets-n1.c | |
203 | $(CC) -xdebugformat=stabs $(CFLAGS) $(CPPFLAGS) -g -S -o offsets-n1.s offsets-n1.c | |
204 | @grep -v "^#" $(PLATFORM_SRC)/offsets.in > offsets.tmp | |
205 | $(STABS) -t genassym -m lp64 offsets.tmp < offsets-n1.s | \ | |
206 | egrep -v '[0-f]+ c-enum' > offsets.h | |
207 | @$(RM) offsets-n1.c offsets-n1.s offsets.tmp | |
208 | ||
209 | offsets.chk: $(PLATFORM_SRC)/offsets.in | |
210 | @grep "^#" $(PLATFORM_SRC)/offsets.in > offsetschk-n1.c | |
211 | $(CC) -xdebugformat=stabs $(CFLAGS) $(CPPFLAGS) -g -S -o offsetschk-n1.s offsetschk-n1.c | |
212 | @grep -v "^#" $(PLATFORM_SRC)/offsets.in > offsetschk.tmp | |
213 | $(STABS) -t asmcheck -m lp64 offsetschk.tmp < offsetschk-n1.s | \ | |
214 | egrep -v '[0-f]+ c-enum' > offsets.chk | |
215 | @$(RM) offsetschk-n1.c offsetschk-n1.s offsetschk.tmp | |
216 | ||
217 | chkasm :: offsets.chk | |
218 | $(ASCHK) -u -s -n offsets.chk $(PLATFORM_SRC)/*.s $(FAMILY_SRC)/*.s $(RESET)/*.s $(COMMON_SRC)/*.s | |
219 | ||
220 | LINT_SRCS += $(FAMILYC_LINT_SRCS) $(PLATFORMC_LINT_SRCS) | |
221 | ||
222 | lint :: offsets.h | |
223 | $(LINT) $(LINT_FLAGS) $(ALL_INC) $(PLAT_OPTIONS) $(LINT_SRCS) | |
224 | ||
225 | ||
226 | %.o: $(PLATFORM_SRC)/%.s | |
227 | $(COMPILE.s) -o $@ $< | |
228 | ||
229 | %.o: $(FAMILY_SRC)/%.s | |
230 | $(COMPILE.s) -o $@ $< | |
231 | ||
232 | %.o: $(COMMON_SRC)/%.s | |
233 | $(COMPILE.s) -o $@ $< | |
234 | ||
235 | %.o: $(PLATFORM_SRC)/%.c | |
236 | $(COMPILE.c) -o $@ $< | |
237 | ||
238 | %.o: $(FAMILY_SRC)/%.c | |
239 | $(COMPILE.c) -o $@ $< | |
240 | ||
241 | %.o: $(COMMON_SRC)/%.c | |
242 | $(COMPILE.c) -o $@ $< | |
243 | ||
244 | %.o: $(RESET)/%.s | |
245 | $(COMPILE.s) -o $@ $< | |
246 |