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.9 07/07/25 SMI" | |
47 | # | |
48 | ||
49 | TOP = ../../.. | |
50 | ||
51 | PLATFORM = huron | |
52 | ||
53 | include ../../Makefile.family | |
54 | ||
55 | ############################################## | |
56 | # | |
57 | # Platform configuration | |
58 | # | |
59 | PLAT_OPTIONS = -DSUPPORT_NIAGARA2_1x -DFALLS_FPGA | |
60 | ||
61 | # | |
62 | # Workarounds | |
63 | # | |
64 | ||
65 | # Reset/Config doesn't properly initialize tick/stick | |
66 | PLAT_OPTIONS += -DRESETCONFIG_BROKENTICK | |
67 | # Tick Index is not set correctly in D-SFAR on TICKCMP/STICKCMP CEs | |
68 | PLAT_OPTIONS += -DERRATA_TICK_INDEX | |
69 | ||
70 | # Workaround to add intr_cookie APIs to INTR API Group v1.0 | |
71 | PLAT_OPTIONS += -DSOLARIS_ERRATUM_6496266 | |
72 | ||
73 | # Solaris assumes the fault-address on a TSB miss is page-aligned | |
74 | # c.f. 6376362 | |
75 | PLAT_OPTIONS += -DTSBMISS_ALIGN_ADDR | |
76 | ||
77 | # LDoms 1.0 Erratum; to avoid the unreliable reset caused by the PLX8532AA | |
78 | # PCI-E switch chips on Ontario systems, we force a power-cycle when resetting | |
79 | # the last domain in the system - which should as defined by best practices | |
80 | # be the control domain. | |
81 | ||
82 | # Solaris 'px' driver implementation of VPCI 1.1 support is broken. | |
83 | PLAT_OPTIONS += -DSOLARIS_ERRATUM_6538898 | |
84 | ||
85 | # The data in the Tick Copare Array diagnostic registers may be incorrect | |
86 | # erratum 197 | |
87 | PLAT_OPTIONS += -DTCA_ECC_ERRATA | |
88 | ||
89 | # A read of a ASR/PR/HPR register causes the ECC in an IRF register | |
90 | # to be checked. If we have an IRFC in the register which is checked | |
91 | # we get another error trap. | |
92 | # erratum 199 | |
93 | PLAT_OPTIONS += -DIRF_ECC_ERRATA | |
94 | ||
95 | # The store ACK counter in the SPU can overflow. To make this less likely | |
96 | # to happen, we stop the CWQ during MAU store operations. | |
97 | # erratum 192 | |
98 | PLAT_OPTIONS += -DERRATA_192 | |
99 | ||
100 | ######################################## | |
101 | ||
102 | RESET = ../dumbreset/ | |
103 | ||
104 | TRAP_SRCS = traptable.s traps_common.s | |
105 | TRAP_OBJS = $(TRAP_SRCS:.s=.o) | |
106 | ||
107 | Q_SRCS = main.s setup.s mmu.s l2subr.s \ | |
108 | chipsubr.s mmu_common.s \ | |
109 | vpci_piu.s vpiu_errs.s \ | |
110 | hcall_ncs.s rng.s \ | |
111 | svc_common.s svcinternal.s svc_vbsc.s ssi.s errs_common.s errors_subr.s \ | |
112 | intr.s intr_huron.s subr.s hcall.s \ | |
113 | hcall_core.s hcall_diag.s hcall_intr.s hcall_soft_state.s \ | |
114 | hcall_vpci.s hcall_cpu.s hcall_groups.s \ | |
115 | hcall_mmu.s hcall_niagara2.s \ | |
116 | heartbeat.s ldc.s hvctl.s hv_common_cmds.s \ | |
117 | errors_cmp.s errors_mmu.s errors_l2_cache.s errors_l1_cache.s \ | |
118 | errors_common.s errors_traps.s errors_soc.s \ | |
119 | error_tables.s errors_ssi.s niu.s \ | |
120 | fpga_uart.s vdev_intr.s vdev_console.s bootload.s cwq.s \ | |
121 | vdev_simdisk.s cyclic.s vpci_msi.s instr_emul.s | |
122 | ||
123 | Q_OBJS = $(Q_SRCS:.s=.o) | |
124 | ||
125 | PLATFORMC_LINT_SRCS = \ | |
126 | $(PLATFORM_SRC)/config.c \ | |
127 | $(PLATFORM_SRC)/init_huron.c \ | |
128 | $(PLATFORM_SRC)/res_piu_pcie.c | |
129 | ||
130 | PLATFORMC_SRCS = \ | |
131 | config.c \ | |
132 | init_huron.c \ | |
133 | res_network.c \ | |
134 | res_niu_network.c \ | |
135 | res_piu_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_cwq.c \ | |
147 | res_pcie.c \ | |
148 | init.c \ | |
149 | hvcontrol.c \ | |
150 | support.c \ | |
151 | $(FAMILYC_SRCS) \ | |
152 | $(PLATFORMC_SRCS) | |
153 | ||
154 | QC_OBJS = $(QC_SRCS:.c=.o) | |
155 | ||
156 | RESET_SRCS = reset.o | |
157 | RESET_OBJS = $(RESET_SRCS:.s=.o) | |
158 | ||
159 | OBJS = begin.o $(TRAP_OBJS) $(PLAT_OBJS) $(Q_OBJS) $(QC_OBJS) version.o end.o | |
160 | ||
161 | all :: reset.bin q.bin | |
162 | ||
163 | $(OBJS): offsets.h | |
164 | ||
165 | VERSION_SRC = $(FAMILY_SRC)/version.s | |
166 | BEGIN_SRC = $(FAMILY_SRC)/begin.s | |
167 | END_SRC = $(FAMILY_SRC)/end.s | |
168 | ||
169 | version.o: $(VERSION_SRC) | |
170 | @echo "Version: $(QVERSION)" | |
171 | $(AS) $(ASFLAGS) -DVERSION="\"$(QVERSION)\"" -DINFO="\"$(QINFO)\"" $< -o $@ $(FAMILY_SRC)/version.s | |
172 | ||
173 | begin.o: $(BEGIN_SRC) | |
174 | ||
175 | end.o: $(END_SRC) | |
176 | ||
177 | versioninfo: | |
178 | @echo "Version: $(QVERSION)" | |
179 | ||
180 | q.bin: q | |
181 | $(OBJCOPY) -O binary q q.bin | |
182 | @what q.bin | |
183 | @ls -l q.bin | |
184 | ||
185 | q: chkasm $(OBJS) $(FAMILY_SRC)/mapfile.q | |
186 | $(LD) -o $@ -e start_master -dn -z defs -M $(FAMILY_SRC)/mapfile.q $(OBJS) | |
187 | @size q | |
188 | ||
189 | q.dis: q0 | |
190 | dis q0 > $@ | |
191 | ||
192 | q0: $(Q_OBJS) $(FAMILY_SRC)/mapfile.q0 | |
193 | $(LD) -o $@ -e start_master -dn -z defs -M $(FAMILY_SRC)/mapfile.q0 $(OBJS) | |
194 | ||
195 | reset.bin: reset | |
196 | $(OBJCOPY) -O binary reset reset.bin | |
197 | ||
198 | reset: $(RESET_OBJS) $(RESET)/mapfile | |
199 | $(LD) -o $@ -e start_reset -dn -z defs -M $(RESET)/mapfile $(RESET_OBJS) | |
200 | ||
201 | ||
202 | # This would work but only dumps the .text, nothing else | |
203 | # elfdump -N .text -w q.bin q | |
204 | ||
205 | offsets.h: $(PLATFORM_SRC)/offsets.in | |
206 | @grep "^#" $(PLATFORM_SRC)/offsets.in > offsets-n2.c | |
207 | $(CC) -xdebugformat=stabs $(CFLAGS) $(CPPFLAGS) -g -S -o offsets-n2.s offsets-n2.c | |
208 | @grep -v "^#" $(PLATFORM_SRC)/offsets.in > offsets.tmp | |
209 | $(STABS) -t genassym -m lp64 offsets.tmp < offsets-n2.s | \ | |
210 | egrep -v '[0-f]+ c-enum' > offsets.h | |
211 | @$(RM) offsets-n2.c offsets-n2.s offsets.tmp | |
212 | ||
213 | offsets.chk: $(PLATFORM_SRC)/offsets.in | |
214 | @grep "^#" $(PLATFORM_SRC)/offsets.in > offsetschk-n2.c | |
215 | $(CC) -xdebugformat=stabs $(CFLAGS) $(CPPFLAGS) -g -S -o offsetschk-n2.s offsetschk-n2.c | |
216 | @grep -v "^#" $(PLATFORM_SRC)/offsets.in > offsetschk.tmp | |
217 | $(STABS) -t asmcheck -m lp64 offsetschk.tmp < offsetschk-n2.s | \ | |
218 | egrep -v '[0-f]+ c-enum' > offsets.chk | |
219 | @$(RM) offsetschk-n2.c offsetschk-n2.s offsetschk.tmp | |
220 | ||
221 | chkasm :: offsets.chk | |
222 | $(ASCHK) -u -s -n offsets.chk $(PLATFORM_SRC)/*.s $(FAMILY_SRC)/*.s $(RESET)/*.s $(COMMON_SRC)/*.s | |
223 | ||
224 | LINT_SRCS += $(FAMILYC_LINT_SRCS) $(PLATFORMC_LINT_SRCS) | |
225 | ||
226 | lint :: | |
227 | $(LINT) $(LINT_FLAGS) $(ALL_INC) $(PLAT_OPTIONS) $(LINT_SRCS) | |
228 | ||
229 | ||
230 | %.o: $(PLATFORM_SRC)/%.s | |
231 | $(COMPILE.s) -o $@ $< | |
232 | ||
233 | %.o: $(FAMILY_SRC)/%.s | |
234 | $(COMPILE.s) -o $@ $< | |
235 | ||
236 | %.o: $(COMMON_SRC)/%.s | |
237 | $(COMPILE.s) -o $@ $< | |
238 | ||
239 | %.o: $(PLATFORM_SRC)/%.c | |
240 | $(COMPILE.c) -o $@ $< | |
241 | ||
242 | %.o: $(FAMILY_SRC)/%.c | |
243 | $(COMPILE.c) -o $@ $< | |
244 | ||
245 | %.o: $(COMMON_SRC)/%.c | |
246 | $(COMPILE.c) -o $@ $< | |
247 | ||
248 | %.o: $(RESET)/%.s | |
249 | $(COMPILE.s) -o $@ $< |