xref: /titanic_41/usr/src/uts/sun4u/Makefile.sun4u (revision 70025d765b044c6d8594bb965a2247a61e991a99)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28#	This makefile contains the common definitions for the sun4u unix
29#	and all sun4u implementation architecture dependent modules.
30#
31
32#
33#	Machine type (implementation architecture):
34#
35PLATFORM	 = sun4u
36PROMIF		 = ieee1275
37PSMBASE		 = $(UTSBASE)/../psm
38
39#
40# Definitions for the platform-specific /platform directories.
41#
42# PLATFORMS designates those sun4u machines which have no platform
43# specific code.
44#
45# IMPLEMENTATIONS is used to designate sun4u machines which do have
46# platform specific modules (perhaps including their own unix).  All
47# code specific to a given implementation resides in the appropriately
48# named subdirectory.   This requires these platforms to have their
49# own Makefiles to define ROOT_PLAT_DIRS, USR_PLAT_DIRS, etc.
50#
51# So if we had an implementation named 'foo', we would need the following
52# Makefiles in the foo subdirectory:
53#
54#	sun4u/foo/Makefile
55#	sun4u/foo/Makefile.foo
56#	sun4u/foo/Makefile.targ
57#
58
59#
60# /usr/platform/$(IMPLEMENTED_PLATFORM) is created as a directory that
61# all the $(LINKED_PLATFORMS) link to.
62#
63IMPLEMENTED_PLATFORM	= SUNW,Ultra-2
64
65LINKED_PLATFORMS	+= SUNW,Ultra-30
66LINKED_PLATFORMS	+= SUNW,Ultra-60
67
68#
69# all PLATFORMS that do not belong in the $(IMPLEMENTATIONS) list
70# ie. all desktop platforms
71#
72PLATFORMS                = $(IMPLEMENTED_PLATFORM)
73PLATFORMS               += $(LINKED_PLATFORMS)
74
75# IMPLEMENTATIONS is used by Install.sh, must not use backslash to continue
76# the lines.
77IMPLEMENTATIONS		 = tazmo .WAIT
78IMPLEMENTATIONS		+= sunfire .WAIT
79IMPLEMENTATIONS		+= starfire .WAIT
80IMPLEMENTATIONS		+= javelin .WAIT
81IMPLEMENTATIONS		+= darwin .WAIT
82IMPLEMENTATIONS		+= quasar .WAIT
83IMPLEMENTATIONS		+= grover .WAIT
84IMPLEMENTATIONS		+= enchilada .WAIT
85IMPLEMENTATIONS		+= taco .WAIT
86IMPLEMENTATIONS		+= mpxu .WAIT
87IMPLEMENTATIONS		+= ents .WAIT
88IMPLEMENTATIONS		+= chalupa .WAIT
89IMPLEMENTATIONS		+= excalibur .WAIT
90IMPLEMENTATIONS		+= montecarlo .WAIT
91IMPLEMENTATIONS		+= makaha .WAIT
92IMPLEMENTATIONS		+= serengeti .WAIT
93IMPLEMENTATIONS		+= lw8 .WAIT
94IMPLEMENTATIONS		+= littleneck .WAIT
95IMPLEMENTATIONS		+= starcat .WAIT
96IMPLEMENTATIONS		+= daktari .WAIT
97IMPLEMENTATIONS		+= cherrystone .WAIT
98IMPLEMENTATIONS		+= fjlite .WAIT
99IMPLEMENTATIONS		+= lw2plus .WAIT
100IMPLEMENTATIONS		+= snowbird .WAIT
101IMPLEMENTATIONS		+= schumacher .WAIT
102IMPLEMENTATIONS		+= blade .WAIT
103IMPLEMENTATIONS		+= chicago
104
105
106ROOT_PLAT_DIRS		= $(PLATFORMS:%=$(ROOT_PLAT_DIR)/%)
107USR_PLAT_DIRS		= $(PLATFORMS:%=$(USR_PLAT_DIR)/%)
108
109USR_DESKTOP_DIR		= $(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM)
110USR_DESKTOP_INC_DIR	= $(USR_DESKTOP_DIR)/include
111USR_DESKTOP_SBIN_DIR	= $(USR_DESKTOP_DIR)/sbin
112USR_DESKTOP_LIB_DIR	= $(USR_DESKTOP_DIR)/lib
113
114#
115# Welcome to SPARC V9.
116#
117
118#
119#	Define supported builds
120#
121DEF_BUILDS	= $(DEF_BUILDS64)
122ALL_BUILDS	= $(ALL_BUILDS64)
123
124#
125#	Everybody needs to know how to build modstubs.o and to locate unix.o
126#
127UNIX_DIR	 = $(UTSBASE)/$(PLATFORM)/unix
128GENLIB_DIR	 = $(UTSBASE)/$(PLATFORM)/genunix
129MODSTUBS_DIR	 = $(UNIX_DIR)
130DSF_DIR		 = $(UTSBASE)/$(PLATFORM)/genassym
131LINTS_DIR	 = $(OBJS_DIR)
132LINT_LIB_DIR	 = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)
133
134DTRACESTUBS_O	 = $(OBJS_DIR)/dtracestubs.o
135DTRACESTUBS	 = $(OBJS_DIR)/libdtracestubs.so
136
137UNIX_O		 = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
138MODSTUBS_O	 = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
139GENLIB	 	 = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
140
141LINT_LIB	 = $(LINT_LIB_DIR)/llib-lunix.ln
142GEN_LINT_LIB	 = $(LINT_LIB_DIR)/llib-lgenunix.ln
143
144LINT64_DIRS	 = $(LINT64_BUILDS:%=$(UTSBASE)/$(PLATFORM)/lint-libs/%)
145LINT64_FILES	 = $(LINT64_DIRS:%=%/llib-l$(MODULE).ln)
146
147#
148#	cpu and platform modules need to know how to build their own symcheck module
149#
150PLATMOD		 = platmod
151PLATLIB		 = $(PLAT_DIR)/$(OBJS_DIR)/libplatmod.so
152
153CPUNAME		 = cpu
154CPULIB		 = $(CPU_DIR)/$(OBJS_DIR)/libcpu.so
155
156SYM_MOD		 = $(OBJS_DIR)/unix.sym
157
158#
159#	Include the makefiles which define build rule templates, the
160#	collection of files per module, and a few specific flags. Note
161#	that order is significant, just as with an include path. The
162#	first build rule template which matches the files name will be
163#	used. By including these in order from most machine dependent
164#	to most machine independent, we allow a machine dependent file
165#	to be used in preference over a machine independent version
166#	(Such as a machine specific optimization, which preserves the
167#	interfaces.)
168#
169include $(UTSBASE)/sun4/Makefile.files
170include $(UTSBASE)/$(PLATFORM)/Makefile.files
171include $(UTSBASE)/sfmmu/Makefile.files
172include $(UTSBASE)/sparc/v9/Makefile.files
173include $(UTSBASE)/sparc/Makefile.files
174include $(UTSBASE)/sun/Makefile.files
175include $(SRC)/psm/promif/$(PROMIF)/common/Makefile.files
176include $(SRC)/psm/promif/$(PROMIF)/$(PLATFORM)/Makefile.files
177include $(UTSBASE)/common/Makefile.files
178
179#
180#	Include machine independent rules. Note that this does not imply
181#	that the resulting module from rules in Makefile.uts is	machine
182#	independent. Only that the build rules are machine independent.
183#
184include $(UTSBASE)/Makefile.uts
185
186#
187#	machine specific optimization, override default in Makefile.master
188#
189CC_XARCH	= -xarch=v9a
190AS_XARCH	= -xarch=v9a
191COPTIMIZE	= -xO3
192CCMODE		= -Xa
193
194CFLAGS		= -xchip=ultra $(CCABS32) $(CCREGSYM)
195CFLAGS		+= $(CC_XARCH)
196CFLAGS		+= $(COPTIMIZE)
197CFLAGS		+= $(EXTRA_CFLAGS)
198CFLAGS		+= $(XAOPT)
199CFLAGS		+= $(INLINES) -D_ASM_INLINES
200CFLAGS		+= $(CCMODE)
201CFLAGS		+= $(SPACEFLAG)
202CFLAGS		+= $(CERRWARN)
203CFLAGS		+= $(CTF_FLAGS)
204CFLAGS		+= $(C99MODE)
205CFLAGS		+= $(CCUNBOUND)
206CFLAGS		+= -xregs=no%float
207
208ASFLAGS		+= $(AS_XARCH)
209
210AS_INC_PATH	+= -I$(DSF_DIR)/$(OBJS_DIR)
211
212LINT_KMODS	+= $(GENUNIX_KMODS)
213
214LINT_DEFS	= -Xarch=v9
215
216#
217#	The following must be defined for all implementations:
218#
219#	MAPFILE:		ld mapfile for the build of kernel/unix.
220#	MODSTUBS:		Module stubs source file.
221#	GENCONST_SRC:		genconst.c
222#	OFFSETS:		offsets.in
223#	PLATFORM_OFFSETS:	Platform specific mach_offsets.in
224#	FDOFFSETS:		fd_offsets.in
225#
226MAPFILE		 = $(UTSBASE)/sun4/conf/Mapfile
227MODSTUBS	 = $(UTSBASE)/sparc/ml/modstubs.s
228GENCONST_SRC	 = $(UTSBASE)/sun4/ml/genconst.c
229OFFSETS		 = $(UTSBASE)/sun4/ml/offsets.in
230PLATFORM_OFFSETS = $(UTSBASE)/sun4u/ml/mach_offsets.in
231FDOFFSETS 	 = $(UTSBASE)/sun/io/fd_offsets.in
232
233#
234#	Define the actual specific platforms
235#
236
237MACHINE_DEFS	= -D$(PLATFORM) -D_MACHDEP -DSFMMU
238
239$(MPSAS_BUILD)MACHINE_DEFS      += -DMPSAS
240
241#
242#	Software workarounds for hardware "features"
243#
244
245include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds
246
247#
248#	Debugging level
249#
250#	Special knowledge of which special debugging options effect which
251#	file is used to optimize the build if these flags are changed.
252#
253#	XXX: The above could possibly be done for more flags and files, but
254#	     is left as an experiment to the interested reader. Be forewarned,
255#	     that excessive use could lead to maintenance difficulties.
256#
257#	Note: kslice can be enabled for the sun4u, but is disabled by default
258#	      in all cases.
259#
260
261DEBUG_DEFS_OBJ64	=
262DEBUG_DEFS_DBG64	= -DDEBUG
263DEBUG_DEFS		= $(DEBUG_DEFS_$(BUILD_TYPE))
264
265DEBUG_COND_OBJ64	:sh = echo \\043
266DEBUG_COND_DBG64	=
267IF_DEBUG_OBJ		= $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
268
269$(IF_DEBUG_OBJ)trap.o		:=	DEBUG_DEFS	+= -DTRAPDEBUG
270$(IF_DEBUG_OBJ)mach_trap.o	:=	DEBUG_DEFS	+= -DTRAPDEBUG
271$(IF_DEBUG_OBJ)syscall_trap.o	:=	DEBUG_DEFS	+= -DSYSCALLTRACE
272$(IF_DEBUG_OBJ)clock.o		:=	DEBUG_DEFS	+= -DKSLICE=0
273
274IF_TRAPTRACE_OBJ = $(IF_DEBUG_OBJ)
275# comment this out for a non-debug kernel with TRAPTRACE
276#IF_TRAPTRACE_OBJ = $(OBJS_DIR)/
277
278$(IF_TRAPTRACE_OBJ)locore.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
279$(IF_TRAPTRACE_OBJ)mach_locore.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
280$(IF_TRAPTRACE_OBJ)mlsetup.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
281$(IF_TRAPTRACE_OBJ)syscall_trap.o 	:=	DEBUG_DEFS	+= -DTRAPTRACE
282$(IF_TRAPTRACE_OBJ)startup.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
283$(IF_TRAPTRACE_OBJ)mach_startup.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
284$(IF_TRAPTRACE_OBJ)mp_startup.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
285$(IF_TRAPTRACE_OBJ)mach_mp_startup.o 	:=	DEBUG_DEFS	+= -DTRAPTRACE
286$(IF_TRAPTRACE_OBJ)cpu_states.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
287$(IF_TRAPTRACE_OBJ)mach_cpu_states.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
288$(IF_TRAPTRACE_OBJ)interrupt.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
289$(IF_TRAPTRACE_OBJ)mach_interrupt.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
290$(IF_TRAPTRACE_OBJ)mach_sfmmu_asm.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
291$(IF_TRAPTRACE_OBJ)sfmmu_asm.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
292$(IF_TRAPTRACE_OBJ)trap_table.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
293$(IF_TRAPTRACE_OBJ)xc.o			:=	DEBUG_DEFS	+= -DTRAPTRACE
294$(IF_TRAPTRACE_OBJ)mach_xc.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
295$(IF_TRAPTRACE_OBJ)wbuf.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
296$(IF_TRAPTRACE_OBJ)trap.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
297$(IF_TRAPTRACE_OBJ)mach_trap.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
298$(IF_TRAPTRACE_OBJ)cheetah_asm.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
299
300# Comment these out if you don't want dispatcher lock statistics.
301
302#$(IF_DEBUG_OBJ)lock_prim.o	:= DEBUG_DEFS	+= -DDISP_LOCK_STATS
303#$(IF_DEBUG_OBJ)disp.o		:= DEBUG_DEFS	+= -DDISP_LOCK_STATS
304
305# Comment these out if you don't want dispatcher debugging
306
307#$(IF_DEBUG_OBJ)lock_prim.o	:= DEBUG_DEFS	+= -DDISP_DEBUG
308
309#
310#	Build `options'. These are mostly historical and the need for these
311#	is largely removed by the module technology. However, the static
312#	build will continue to require these.
313#
314OPTION_DEFS	 = -DC2_AUDIT
315
316#
317#	Collect the preprocessor definitions to be associated with *all*
318#	files.
319#
320ALL_DEFS	 = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
321		   $(OPTION_DEFS)
322GENCONST_DEFS	 = $(MACHINE_DEFS) $(OPTION_DEFS)
323
324#
325# ----- TRANSITIONAL SECTION --------------------------------------------------
326#
327
328#
329#	Not everything which *should* be a module is a module yet. The
330#	following is a list of such objects which are currently part of
331#	the base kernel but should soon become kmods.
332#
333MACH_NOT_YET_KMODS	 = $(AUTOCONF_OBJS)
334
335#
336# ----- END OF TRANSITIONAL SECTION -------------------------------------------
337#
338
339#
340#	The kernels modules which are "implementation architecture"
341#	specific for this machine are enumerated below. Note that most
342#	of these modules must exist (in one form or another) for each
343#	architecture.
344#
345#	Common Drivers (usually pseudo drivers) (/kernel/drv):
346#
347
348#
349#	Machine Specific Driver Modules (/kernel/drv):
350#
351#	XXX: How many of these are really machine specific?
352#
353DRV_KMODS	+= bbc_beep
354DRV_KMODS	+= cgsix
355DRV_KMODS	+= cpc
356DRV_KMODS	+= dma fd
357DRV_KMODS	+= rootnex sbusmem upa64s zs zsh
358DRV_KMODS	+= sbus
359DRV_KMODS	+= pcisch pcipsy simba
360DRV_KMODS	+= px
361DRV_KMODS	+= ebus
362DRV_KMODS	+= su
363DRV_KMODS	+= tod
364DRV_KMODS	+= sf
365DRV_KMODS	+= power
366DRV_KMODS       += fcode
367DRV_KMODS	+= grbeep
368DRV_KMODS	+= pcf8584 mi2cv i2bsc max1617 seeprom tda8444 pca9556 ics951601 adm1031
369DRV_KMODS	+= lm75 ltc1427 pcf8591 pcf8574 smbus_ara ssc050 ssc100
370DRV_KMODS	+= pic16f819
371DRV_KMODS	+= pic16f747
372DRV_KMODS	+= scmi2c
373DRV_KMODS	+= us
374DRV_KMODS	+= ppm schppm jbusppm m1535ppm
375DRV_KMODS	+= mc-us3
376DRV_KMODS	+= mc-us3i
377DRV_KMODS       += smbus
378DRV_KMODS	+= db21554
379DRV_KMODS	+= gpio_87317
380DRV_KMODS	+= isadma
381DRV_KMODS	+= sbbc
382DRV_KMODS	+= pmubus
383DRV_KMODS	+= pmugpio
384DRV_KMODS	+= rmcadm
385DRV_KMODS	+= rmc_comm
386DRV_KMODS	+= rmclomv
387DRV_KMODS	+= pmc
388DRV_KMODS	+= wrsmd
389DRV_KMODS	+= memtest
390DRV_KMODS	+= trapstat
391DRV_KMODS	+= dmfe
392DRV_KMODS	+= ctsmc
393
394#
395#	Exec Class Modules (/kernel/exec):
396#
397EXEC_KMODS	+=
398
399#
400#	Scheduling Class Modules (/kernel/sched):
401#
402SCHED_KMODS	+=
403
404#
405#	File System Modules (/kernel/fs):
406#
407FS_KMODS	+=
408
409#
410#	Streams Modules (/kernel/strmod):
411#
412STRMOD_KMODS	+= kb
413
414#
415#	'System' Modules (/kernel/sys):
416#
417SYS_KMODS	+=
418
419#
420#	'User' Modules (/kernel/misc):
421#
422MISC_KMODS	+= obpsym bootdev vis cpr platmod md5 sha1 i2c_svc
423MISC_KMODS	+= sbd
424
425MISC_KMODS	+= fcodem fcpci gptwocfg gptwo_cpu pcicfg.e
426MISC_KMODS	+= kmech_krb5
427MISC_KMODS	+= zuluvm
428
429#
430#	Software Cryptographic Providers (/kernel/crypto):
431#
432CRYPTO_KMODS	+= aes
433CRYPTO_KMODS	+= arcfour
434CRYPTO_KMODS	+= des
435CRYPTO_KMODS	+= rsa
436
437#
438#	generic-unix module (/kernel/genunix):
439#
440GENUNIX_KMODS	+= genunix
441
442#	'User' "Modules" excluded from the Full Kernel lint target:
443#
444NLMISC_KMODS	+= forthdebug
445
446#
447#	Modules eXcluded from the product:
448#
449XMODS		+=
450
451#
452#	cpu modules
453#
454CPU_KMODS	+= cheetah cheetahplus jalapeno serrano spitfire hummingbird
455
456#
457#	sun4u 'TOD' Modules (/platform/.../kernel/tod):
458#
459TOD_KMODS	+= todds1287 todds1337 todmostek todstarfire todsg todstarcat
460TOD_KMODS	+= todm5819 todm5819p_rmc todblade todm5823 todbq4802
461
462#
463#	Performance Counter BackEnd Modules (/usr/kernel/pcbe):
464#
465PCBE_KMODS	+= us234_pcbe
466