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