xref: /titanic_51/usr/src/uts/sun4u/Makefile.sun4u (revision fe0e7ec4d916b05b52d8c7cc8a3e6a1b28e77b6f)
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		+= boston .WAIT
104IMPLEMENTATIONS		+= seattle .WAIT
105IMPLEMENTATIONS		+= chicago
106
107
108ROOT_PLAT_DIRS		= $(PLATFORMS:%=$(ROOT_PLAT_DIR)/%)
109USR_PLAT_DIRS		= $(PLATFORMS:%=$(USR_PLAT_DIR)/%)
110
111USR_DESKTOP_DIR		= $(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM)
112USR_DESKTOP_INC_DIR	= $(USR_DESKTOP_DIR)/include
113USR_DESKTOP_SBIN_DIR	= $(USR_DESKTOP_DIR)/sbin
114USR_DESKTOP_LIB_DIR	= $(USR_DESKTOP_DIR)/lib
115
116#
117# Welcome to SPARC V9.
118#
119
120#
121#	Define supported builds
122#
123DEF_BUILDS	= $(DEF_BUILDS64)
124ALL_BUILDS	= $(ALL_BUILDS64)
125
126#
127#	Everybody needs to know how to build modstubs.o and to locate unix.o
128#
129UNIX_DIR	 = $(UTSBASE)/$(PLATFORM)/unix
130GENLIB_DIR	 = $(UTSBASE)/$(PLATFORM)/genunix
131MODSTUBS_DIR	 = $(UNIX_DIR)
132DSF_DIR		 = $(UTSBASE)/$(PLATFORM)/genassym
133LINTS_DIR	 = $(OBJS_DIR)
134LINT_LIB_DIR	 = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)
135
136DTRACESTUBS_O	 = $(OBJS_DIR)/dtracestubs.o
137DTRACESTUBS	 = $(OBJS_DIR)/libdtracestubs.so
138
139UNIX_O		 = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
140MODSTUBS_O	 = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
141GENLIB	 	 = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
142
143LINT_LIB	 = $(LINT_LIB_DIR)/llib-lunix.ln
144GEN_LINT_LIB	 = $(LINT_LIB_DIR)/llib-lgenunix.ln
145
146LINT64_DIRS	 = $(LINT64_BUILDS:%=$(UTSBASE)/$(PLATFORM)/lint-libs/%)
147LINT64_FILES	 = $(LINT64_DIRS:%=%/llib-l$(MODULE).ln)
148
149#
150#	cpu and platform modules need to know how to build their own symcheck module
151#
152PLATMOD		 = platmod
153PLATLIB		 = $(PLAT_DIR)/$(OBJS_DIR)/libplatmod.so
154
155CPUNAME		 = cpu
156CPULIB		 = $(CPU_DIR)/$(OBJS_DIR)/libcpu.so
157
158SYM_MOD		 = $(OBJS_DIR)/unix.sym
159
160#
161#	Include the makefiles which define build rule templates, the
162#	collection of files per module, and a few specific flags. Note
163#	that order is significant, just as with an include path. The
164#	first build rule template which matches the files name will be
165#	used. By including these in order from most machine dependent
166#	to most machine independent, we allow a machine dependent file
167#	to be used in preference over a machine independent version
168#	(Such as a machine specific optimization, which preserves the
169#	interfaces.)
170#
171include $(UTSBASE)/sun4/Makefile.files
172include $(UTSBASE)/$(PLATFORM)/Makefile.files
173include $(UTSBASE)/sfmmu/Makefile.files
174include $(UTSBASE)/sparc/v9/Makefile.files
175include $(UTSBASE)/sparc/Makefile.files
176include $(UTSBASE)/sun/Makefile.files
177include $(SRC)/psm/promif/$(PROMIF)/common/Makefile.files
178include $(SRC)/psm/promif/$(PROMIF)/$(PLATFORM)/Makefile.files
179include $(UTSBASE)/common/Makefile.files
180
181#
182#	Include machine independent rules. Note that this does not imply
183#	that the resulting module from rules in Makefile.uts is	machine
184#	independent. Only that the build rules are machine independent.
185#
186include $(UTSBASE)/Makefile.uts
187
188#
189#	machine specific optimization, override default in Makefile.master
190#
191CC_XARCH	= -xarch=v9a
192AS_XARCH	= -xarch=v9a
193COPTIMIZE	= -xO3
194CCMODE		= -Xa
195
196CFLAGS		= -xchip=ultra $(CCABS32) $(CCREGSYM)
197CFLAGS		+= $(CC_XARCH)
198CFLAGS		+= $(COPTIMIZE)
199CFLAGS		+= $(EXTRA_CFLAGS)
200CFLAGS		+= $(XAOPT)
201CFLAGS		+= $(INLINES) -D_ASM_INLINES
202CFLAGS		+= $(CCMODE)
203CFLAGS		+= $(SPACEFLAG)
204CFLAGS		+= $(CERRWARN)
205CFLAGS		+= $(CTF_FLAGS)
206CFLAGS		+= $(C99MODE)
207CFLAGS		+= $(CCUNBOUND)
208CFLAGS		+= -xregs=no%float
209
210ASFLAGS		+= $(AS_XARCH)
211
212AS_INC_PATH	+= -I$(DSF_DIR)/$(OBJS_DIR)
213
214LINT_KMODS	+= $(GENUNIX_KMODS)
215
216LINT_DEFS	= -Xarch=v9
217
218#
219#	The following must be defined for all implementations:
220#
221#	MAPFILE:		ld mapfile for the build of kernel/unix.
222#	MODSTUBS:		Module stubs source file.
223#	GENCONST_SRC:		genconst.c
224#	OFFSETS:		offsets.in
225#	PLATFORM_OFFSETS:	Platform specific mach_offsets.in
226#	FDOFFSETS:		fd_offsets.in
227#
228MAPFILE		 = $(UTSBASE)/sun4/conf/Mapfile
229MODSTUBS	 = $(UTSBASE)/sparc/ml/modstubs.s
230GENCONST_SRC	 = $(UTSBASE)/sun4/ml/genconst.c
231OFFSETS		 = $(UTSBASE)/sun4/ml/offsets.in
232PLATFORM_OFFSETS = $(UTSBASE)/sun4u/ml/mach_offsets.in
233FDOFFSETS 	 = $(UTSBASE)/sun/io/fd_offsets.in
234
235#
236#	Define the actual specific platforms
237#
238
239MACHINE_DEFS	= -D$(PLATFORM) -D_MACHDEP -DSFMMU
240
241$(MPSAS_BUILD)MACHINE_DEFS      += -DMPSAS
242
243#
244#	Software workarounds for hardware "features"
245#
246
247include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds
248
249#
250#	Debugging level
251#
252#	Special knowledge of which special debugging options effect which
253#	file is used to optimize the build if these flags are changed.
254#
255#	XXX: The above could possibly be done for more flags and files, but
256#	     is left as an experiment to the interested reader. Be forewarned,
257#	     that excessive use could lead to maintenance difficulties.
258#
259#	Note: kslice can be enabled for the sun4u, but is disabled by default
260#	      in all cases.
261#
262
263DEBUG_DEFS_OBJ64	=
264DEBUG_DEFS_DBG64	= -DDEBUG
265DEBUG_DEFS		= $(DEBUG_DEFS_$(BUILD_TYPE))
266
267DEBUG_COND_OBJ64	:sh = echo \\043
268DEBUG_COND_DBG64	=
269IF_DEBUG_OBJ		= $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
270
271$(IF_DEBUG_OBJ)trap.o		:=	DEBUG_DEFS	+= -DTRAPDEBUG
272$(IF_DEBUG_OBJ)mach_trap.o	:=	DEBUG_DEFS	+= -DTRAPDEBUG
273$(IF_DEBUG_OBJ)syscall_trap.o	:=	DEBUG_DEFS	+= -DSYSCALLTRACE
274$(IF_DEBUG_OBJ)clock.o		:=	DEBUG_DEFS	+= -DKSLICE=0
275
276IF_TRAPTRACE_OBJ = $(IF_DEBUG_OBJ)
277# comment this out for a non-debug kernel with TRAPTRACE
278#IF_TRAPTRACE_OBJ = $(OBJS_DIR)/
279
280$(IF_TRAPTRACE_OBJ)locore.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
281$(IF_TRAPTRACE_OBJ)mach_locore.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
282$(IF_TRAPTRACE_OBJ)mlsetup.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
283$(IF_TRAPTRACE_OBJ)syscall_trap.o 	:=	DEBUG_DEFS	+= -DTRAPTRACE
284$(IF_TRAPTRACE_OBJ)startup.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
285$(IF_TRAPTRACE_OBJ)mach_startup.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
286$(IF_TRAPTRACE_OBJ)mp_startup.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
287$(IF_TRAPTRACE_OBJ)mach_mp_startup.o 	:=	DEBUG_DEFS	+= -DTRAPTRACE
288$(IF_TRAPTRACE_OBJ)cpu_states.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
289$(IF_TRAPTRACE_OBJ)mach_cpu_states.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
290$(IF_TRAPTRACE_OBJ)interrupt.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
291$(IF_TRAPTRACE_OBJ)mach_interrupt.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
292$(IF_TRAPTRACE_OBJ)mach_sfmmu_asm.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
293$(IF_TRAPTRACE_OBJ)sfmmu_asm.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
294$(IF_TRAPTRACE_OBJ)trap_table.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
295$(IF_TRAPTRACE_OBJ)xc.o			:=	DEBUG_DEFS	+= -DTRAPTRACE
296$(IF_TRAPTRACE_OBJ)mach_xc.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
297$(IF_TRAPTRACE_OBJ)wbuf.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
298$(IF_TRAPTRACE_OBJ)trap.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
299$(IF_TRAPTRACE_OBJ)mach_trap.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
300$(IF_TRAPTRACE_OBJ)cheetah_asm.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
301
302# Comment these out if you don't want dispatcher lock statistics.
303
304#$(IF_DEBUG_OBJ)lock_prim.o	:= DEBUG_DEFS	+= -DDISP_LOCK_STATS
305#$(IF_DEBUG_OBJ)disp.o		:= DEBUG_DEFS	+= -DDISP_LOCK_STATS
306
307# Comment these out if you don't want dispatcher debugging
308
309#$(IF_DEBUG_OBJ)lock_prim.o	:= DEBUG_DEFS	+= -DDISP_DEBUG
310
311#
312#	Build `options'. These are mostly historical and the need for these
313#	is largely removed by the module technology. However, the static
314#	build will continue to require these.
315#
316OPTION_DEFS	 = -DC2_AUDIT
317
318#
319#	Collect the preprocessor definitions to be associated with *all*
320#	files.
321#
322ALL_DEFS	 = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
323		   $(OPTION_DEFS)
324GENCONST_DEFS	 = $(MACHINE_DEFS) $(OPTION_DEFS)
325
326#
327# ----- TRANSITIONAL SECTION --------------------------------------------------
328#
329
330#
331#	Not everything which *should* be a module is a module yet. The
332#	following is a list of such objects which are currently part of
333#	the base kernel but should soon become kmods.
334#
335MACH_NOT_YET_KMODS	 = $(AUTOCONF_OBJS)
336
337#
338# ----- END OF TRANSITIONAL SECTION -------------------------------------------
339#
340
341#
342#	The kernels modules which are "implementation architecture"
343#	specific for this machine are enumerated below. Note that most
344#	of these modules must exist (in one form or another) for each
345#	architecture.
346#
347#	Common Drivers (usually pseudo drivers) (/kernel/drv):
348#
349
350#
351#	Machine Specific Driver Modules (/kernel/drv):
352#
353#	XXX: How many of these are really machine specific?
354#
355DRV_KMODS	+= bbc_beep
356DRV_KMODS	+= cgsix
357DRV_KMODS	+= cpc
358DRV_KMODS	+= dma fd
359DRV_KMODS	+= rootnex sbusmem upa64s zs zsh
360DRV_KMODS	+= sbus
361DRV_KMODS	+= pcisch pcipsy simba
362DRV_KMODS	+= px
363DRV_KMODS	+= ebus
364DRV_KMODS	+= su
365DRV_KMODS	+= tod
366DRV_KMODS	+= sf
367DRV_KMODS	+= power
368DRV_KMODS	+= epic
369DRV_KMODS       += fcode
370DRV_KMODS	+= grbeep
371DRV_KMODS	+= pcf8584 mi2cv i2bsc max1617 seeprom tda8444 pca9556 ics951601 adm1031
372DRV_KMODS	+= lm75 ltc1427 pcf8591 pcf8574 smbus_ara ssc050 ssc100
373DRV_KMODS	+= pic16f819
374DRV_KMODS	+= pic16f747
375DRV_KMODS	+= scmi2c
376DRV_KMODS	+= adm1026
377DRV_KMODS	+= us
378DRV_KMODS	+= ppm schppm jbusppm m1535ppm
379DRV_KMODS	+= mc-us3
380DRV_KMODS	+= mc-us3i
381DRV_KMODS       += smbus
382DRV_KMODS	+= db21554
383DRV_KMODS	+= gpio_87317
384DRV_KMODS	+= isadma
385DRV_KMODS	+= sbbc
386DRV_KMODS	+= pmubus
387DRV_KMODS	+= pmugpio
388DRV_KMODS	+= rmcadm
389DRV_KMODS	+= rmc_comm
390DRV_KMODS	+= rmclomv
391DRV_KMODS	+= pmc
392DRV_KMODS	+= wrsmd
393DRV_KMODS	+= memtest
394DRV_KMODS	+= trapstat
395DRV_KMODS	+= dmfe
396DRV_KMODS	+= ctsmc
397
398#
399#	Exec Class Modules (/kernel/exec):
400#
401EXEC_KMODS	+=
402
403#
404#	Scheduling Class Modules (/kernel/sched):
405#
406SCHED_KMODS	+=
407
408#
409#	File System Modules (/kernel/fs):
410#
411FS_KMODS	+=
412
413#
414#	Streams Modules (/kernel/strmod):
415#
416STRMOD_KMODS	+= kb
417
418#
419#	'System' Modules (/kernel/sys):
420#
421SYS_KMODS	+=
422
423#
424#	'User' Modules (/kernel/misc):
425#
426MISC_KMODS	+= obpsym bootdev vis cpr platmod md5 sha1 i2c_svc
427MISC_KMODS	+= sbd
428
429MISC_KMODS	+= fcodem fcpci gptwocfg gptwo_cpu pcicfg.e
430MISC_KMODS	+= kmech_krb5
431MISC_KMODS	+= zuluvm
432
433#
434#	Software Cryptographic Providers (/kernel/crypto):
435#
436CRYPTO_KMODS	+= aes
437CRYPTO_KMODS	+= arcfour
438CRYPTO_KMODS	+= des
439CRYPTO_KMODS	+= rsa
440
441#
442#	generic-unix module (/kernel/genunix):
443#
444GENUNIX_KMODS	+= genunix
445
446#	'User' "Modules" excluded from the Full Kernel lint target:
447#
448NLMISC_KMODS	+= forthdebug
449
450#
451#	Modules eXcluded from the product:
452#
453XMODS		+=
454
455#
456#	cpu modules
457#
458CPU_KMODS	+= cheetah cheetahplus jalapeno serrano spitfire hummingbird
459
460#
461#	sun4u 'TOD' Modules (/platform/.../kernel/tod):
462#
463TOD_KMODS	+= todds1287 todds1337 todmostek todstarfire todsg todstarcat
464TOD_KMODS	+= todm5819 todm5819p_rmc todblade todm5823 todbq4802
465
466#
467#	Performance Counter BackEnd Modules (/usr/kernel/pcbe):
468#
469PCBE_KMODS	+= us234_pcbe
470