summaryrefslogtreecommitdiff
path: root/usr/src/uts/sun4u/Makefile.sun4u
blob: 3d86669afdbec2e5b0f37360831d9d970a8045ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#

#
# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
# Copyright (c) 2013 Andrew Stormont.  All rights reserved.
# Copyright 2019 Peter Tribble.
#
#	This makefile contains the common definitions for the sun4u unix
#	and all sun4u implementation architecture dependent modules.
#

#
#	Machine type (implementation architecture):
#
PLATFORM	 = sun4u
PROMIF		 = ieee1275
PSMBASE		 = $(UTSBASE)/../psm

#
#	uname -m value
#
UNAME_M		= $(PLATFORM)

#
# Definitions for the platform-specific /platform directories.
#
# PLATFORMS designates those sun4u machines which have no platform
# specific code.
#
# IMPLEMENTATIONS is used to designate sun4u machines which do have
# platform specific modules (perhaps including their own unix).  All
# code specific to a given implementation resides in the appropriately
# named subdirectory.   This requires these platforms to have their
# own Makefiles to define ROOT_PLAT_DIRS, USR_PLAT_DIRS, etc.
#
# So if we had an implementation named 'foo', we would need the following
# Makefiles in the foo subdirectory:
#
#	sun4u/foo/Makefile
#	sun4u/foo/Makefile.foo
#	sun4u/foo/Makefile.targ
#

#
# /usr/platform/$(IMPLEMENTED_PLATFORM) is created as a directory that
# all the $(LINKED_PLATFORMS) link to.
#
IMPLEMENTED_PLATFORM	= SUNW,Ultra-2

LINKED_PLATFORMS	+= SUNW,Ultra-30
LINKED_PLATFORMS	+= SUNW,Ultra-60

#
# all PLATFORMS that do not belong in the $(IMPLEMENTATIONS) list
# ie. all desktop platforms
#
PLATFORMS                = $(IMPLEMENTED_PLATFORM)
PLATFORMS               += $(LINKED_PLATFORMS)

ROOT_PLAT_DIRS		= $(PLATFORMS:%=$(ROOT_PLAT_DIR)/%)
USR_PLAT_DIRS		= $(PLATFORMS:%=$(USR_PLAT_DIR)/%)

USR_DESKTOP_DIR		= $(USR_PLAT_DIR)/$(IMPLEMENTED_PLATFORM)
USR_DESKTOP_INC_DIR	= $(USR_DESKTOP_DIR)/include
USR_DESKTOP_SBIN_DIR	= $(USR_DESKTOP_DIR)/sbin
USR_DESKTOP_LIB_DIR	= $(USR_DESKTOP_DIR)/lib

#
# Welcome to SPARC V9.
#

#
#	Define supported builds
#
DEF_BUILDS	= $(DEF_BUILDS64)
ALL_BUILDS	= $(ALL_BUILDS64)

#
#	Everybody needs to know how to build modstubs.o and to locate unix.o
#
UNIX_DIR	 = $(UTSBASE)/$(PLATFORM)/unix
GENLIB_DIR	 = $(UTSBASE)/$(PLATFORM)/genunix
MODSTUBS_DIR	 = $(UNIX_DIR)
DSF_DIR		 = $(UTSBASE)/$(PLATFORM)/genassym
LINTS_DIR	 = $(OBJS_DIR)
LINT_LIB_DIR	 = $(UTSBASE)/$(PLATFORM)/lint-libs/$(OBJS_DIR)

DTRACESTUBS_O	 = $(OBJS_DIR)/dtracestubs.o
DTRACESTUBS	 = $(OBJS_DIR)/libdtracestubs.so

UNIX_O		 = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
MODSTUBS_O	 = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
GENLIB		 = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so

LINT_LIB	 = $(LINT_LIB_DIR)/llib-lunix.ln
GEN_LINT_LIB	 = $(LINT_LIB_DIR)/llib-lgenunix.ln

LINT64_DIRS	 = $(LINT64_BUILDS:%=$(UTSBASE)/$(PLATFORM)/lint-libs/%)
LINT64_FILES	 = $(LINT64_DIRS:%=%/llib-l$(MODULE).ln)

#
#	cpu and platform modules need to know how to build their own symcheck module
#
PLATMOD		 = platmod
PLATLIB		 = $(PLAT_DIR)/$(OBJS_DIR)/libplatmod.so

CPUNAME		 = cpu
CPULIB		 = $(CPU_DIR)/$(OBJS_DIR)/libcpu.so

SYM_MOD		 = $(OBJS_DIR)/unix.sym

#
#	Include the makefiles which define build rule templates, the
#	collection of files per module, and a few specific flags. Note
#	that order is significant, just as with an include path. The
#	first build rule template which matches the files name will be
#	used. By including these in order from most machine dependent
#	to most machine independent, we allow a machine dependent file
#	to be used in preference over a machine independent version
#	(Such as a machine specific optimization, which preserves the
#	interfaces.)
#
include $(UTSBASE)/sun4/Makefile.files
include $(UTSBASE)/$(PLATFORM)/Makefile.files
include $(UTSBASE)/sfmmu/Makefile.files
include $(UTSBASE)/sparc/v9/Makefile.files
include $(UTSBASE)/sparc/Makefile.files
include $(UTSBASE)/sun/Makefile.files
include $(SRC)/psm/promif/$(PROMIF)/common/Makefile.files
include $(SRC)/psm/promif/$(PROMIF)/$(PLATFORM)/Makefile.files
include $(UTSBASE)/common/Makefile.files

#
#	Include machine independent rules. Note that this does not imply
#	that the resulting module from rules in Makefile.uts is	machine
#	independent. Only that the build rules are machine independent.
#
include $(UTSBASE)/Makefile.uts

# These come after Makefile.uts.
IMPLEMENTATIONS		 = tazmo
IMPLEMENTATIONS		+= javelin
IMPLEMENTATIONS		+= darwin
IMPLEMENTATIONS		+= quasar
IMPLEMENTATIONS		+= grover
IMPLEMENTATIONS		+= enchilada
IMPLEMENTATIONS		+= taco
IMPLEMENTATIONS		+= mpxu
IMPLEMENTATIONS		+= excalibur
IMPLEMENTATIONS		+= serengeti
IMPLEMENTATIONS		+= littleneck
IMPLEMENTATIONS		+= daktari
IMPLEMENTATIONS		+= cherrystone
IMPLEMENTATIONS		+= fjlite
IMPLEMENTATIONS		+= schumacher
IMPLEMENTATIONS		+= blade
IMPLEMENTATIONS		+= boston
IMPLEMENTATIONS		+= seattle
IMPLEMENTATIONS		+= chicago
IMPLEMENTATIONS		+= sunfire
IMPLEMENTATIONS		+= lw8
IMPLEMENTATIONS		+= opl
IMPLEMENTATIONS		+= lw2plus

#
#	machine specific optimization, override default in Makefile.master
#
CC_XARCH	= -m64 -xarch=sparcvis
AS_XARCH	= -xarch=v9a
COPTIMIZE	= -xO3
CCMODE		= -Xa

CFLAGS		= -xchip=ultra $(CCABS32) $(CCREGSYM)
CFLAGS		+= $(CC_XARCH)
CFLAGS		+= $(COPTIMIZE)
CFLAGS		+= $(EXTRA_CFLAGS)
CFLAGS		+= $(XAOPT)
CFLAGS		+= $(INLINES) -D_ASM_INLINES
CFLAGS		+= $(CCMODE)
CFLAGS		+= $(SPACEFLAG)
CFLAGS		+= $(CERRWARN)
CFLAGS		+= $(CTF_FLAGS_$(CLASS))
CFLAGS		+= $(CSTD)
CFLAGS		+= $(CCUNBOUND)
CFLAGS		+= $(CCNOAUTOINLINE)
CFLAGS		+= $(CCSTATICSYM)
CFLAGS		+= $(CC32BITCALLERS)
CFLAGS		+= $(IROPTFLAG)
CFLAGS		+= $(CGLOBALSTATIC)
CFLAGS		+= -xregs=no%float
CFLAGS		+= -xstrconst
CFLAGS		+= $(CSOURCEDEBUGFLAGS)
CFLAGS		+= $(CUSERFLAGS)

ASFLAGS		+= $(AS_XARCH)

AS_INC_PATH	+= -I$(DSF_DIR)/$(OBJS_DIR)

LINT_KMODS	+= $(GENUNIX_KMODS)

LINT_DEFS = -m64

#
#	The following must be defined for all implementations:
#
#	MAPFILE:		ld mapfile for the build of kernel/unix.
#	MODSTUBS:		Module stubs source file.
#	GENCONST_SRC:		genconst.c
#	OFFSETS:		offsets.in
#	PLATFORM_OFFSETS:	Platform specific mach_offsets.in
#	FDOFFSETS:		fd_offsets.in
#
MAPFILE		 = $(UTSBASE)/sun4/conf/Mapfile
MODSTUBS	 = $(UTSBASE)/sparc/ml/modstubs.s
GENCONST_SRC	 = $(UTSBASE)/sun4/ml/genconst.c
OFFSETS		 = $(UTSBASE)/sun4/ml/offsets.in
PLATFORM_OFFSETS = $(UTSBASE)/sun4u/ml/mach_offsets.in
FDOFFSETS	 = $(UTSBASE)/sun/io/fd_offsets.in

#
#	Define the actual specific platforms
#

MACHINE_DEFS	= -D$(PLATFORM) -D_MACHDEP -DSFMMU

#
#	Software workarounds for hardware "features"
#

include $(UTSBASE)/$(PLATFORM)/Makefile.workarounds

#
#	Debugging level
#
#	Special knowledge of which special debugging options effect which
#	file is used to optimize the build if these flags are changed.
#
#	XXX: The above could possibly be done for more flags and files, but
#	     is left as an experiment to the interested reader. Be forewarned,
#	     that excessive use could lead to maintenance difficulties.
#
#	Note: kslice can be enabled for the sun4u, but is disabled by default
#	      in all cases.
#

DEBUG_DEFS_OBJ64	=
DEBUG_DEFS_DBG64	= -DDEBUG
DEBUG_DEFS		= $(DEBUG_DEFS_$(BUILD_TYPE))

DEBUG_COND_OBJ64	= $(POUND_SIGN)
DEBUG_COND_DBG64	=
IF_DEBUG_OBJ		= $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/

$(IF_DEBUG_OBJ)trap.o		:=	DEBUG_DEFS	+= -DTRAPDEBUG
$(IF_DEBUG_OBJ)mach_trap.o	:=	DEBUG_DEFS	+= -DTRAPDEBUG
$(IF_DEBUG_OBJ)syscall_trap.o	:=	DEBUG_DEFS	+= -DSYSCALLTRACE
$(IF_DEBUG_OBJ)clock.o		:=	DEBUG_DEFS	+= -DKSLICE=0

IF_TRAPTRACE_OBJ = $(IF_DEBUG_OBJ)
# comment this out for a non-debug kernel with TRAPTRACE
#IF_TRAPTRACE_OBJ = $(OBJS_DIR)/

$(IF_TRAPTRACE_OBJ)mach_locore.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)mlsetup.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)syscall_trap.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)startup.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)mach_startup.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)mp_startup.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)cpu_states.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)mach_cpu_states.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)interrupt.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)mach_interrupt.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)sfmmu_asm.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)trap_table.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)xc.o			:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)mach_xc.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)wbuf.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)trap.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)mach_trap.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)x_call.o		:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)spitfire_asm.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)us3_common_asm.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)us3_cheetah_asm.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)us3_cheetahplus_asm.o :=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)us3_jalapeno_asm.o	:=	DEBUG_DEFS	+= -DTRAPTRACE
$(IF_TRAPTRACE_OBJ)opl_olympus_asm.o	:=	DEBUG_DEFS	+= -DTRAPTRACE

# Comment these out if you don't want dispatcher lock statistics.

#$(IF_DEBUG_OBJ)lock_prim.o	:= DEBUG_DEFS	+= -DDISP_LOCK_STATS
#$(IF_DEBUG_OBJ)disp.o		:= DEBUG_DEFS	+= -DDISP_LOCK_STATS

# Comment these out if you don't want dispatcher debugging

#$(IF_DEBUG_OBJ)lock_prim.o	:= DEBUG_DEFS	+= -DDISP_DEBUG

#
#	Collect the preprocessor definitions to be associated with *all*
#	files.
#
ALL_DEFS	 = $(MACHINE_DEFS) $(WORKAROUND_DEFS) $(DEBUG_DEFS) \
		   $(OPTION_DEFS)
GENCONST_DEFS	 = $(MACHINE_DEFS) $(OPTION_DEFS)

#
# ----- TRANSITIONAL SECTION --------------------------------------------------
#

#
#	Not everything which *should* be a module is a module yet. The
#	following is a list of such objects which are currently part of
#	the base kernel but should soon become kmods.
#
MACH_NOT_YET_KMODS	 = $(AUTOCONF_OBJS)

#
# ----- END OF TRANSITIONAL SECTION -------------------------------------------
#

#
#	The kernels modules which are "implementation architecture"
#	specific for this machine are enumerated below. Note that most
#	of these modules must exist (in one form or another) for each
#	architecture.
#
#	Common Drivers (usually pseudo drivers) (/kernel/drv):
#

#
#	Machine Specific Driver Modules (/kernel/drv):
#
#	XXX: How many of these are really machine specific?
#
DRV_KMODS	+= bbc_beep
DRV_KMODS	+= cpc
DRV_KMODS	+= fd
DRV_KMODS	+= rootnex sbusmem upa64s zs zsh
DRV_KMODS	+= sbus
DRV_KMODS	+= pcisch pcipsy simba
DRV_KMODS	+= px
DRV_KMODS	+= ebus
DRV_KMODS	+= su
DRV_KMODS	+= tod
DRV_KMODS	+= power
DRV_KMODS	+= epic
DRV_KMODS	+= grbeep
DRV_KMODS	+= pcf8584 max1617 seeprom tda8444 pca9556
DRV_KMODS	+= ics951601 adm1031
DRV_KMODS	+= lm75 ltc1427 pcf8591 pcf8574 ssc050 ssc100
DRV_KMODS	+= pic16f819
DRV_KMODS	+= pic16f747
DRV_KMODS	+= adm1026
DRV_KMODS	+= us
DRV_KMODS	+= ppm schppm jbusppm
DRV_KMODS	+= mc-us3
DRV_KMODS	+= mc-us3i
DRV_KMODS       += smbus
DRV_KMODS	+= db21554
DRV_KMODS	+= gpio_87317
DRV_KMODS	+= isadma
DRV_KMODS	+= sbbc
DRV_KMODS	+= pmubus
DRV_KMODS	+= pmugpio
DRV_KMODS	+= pmc
DRV_KMODS	+= trapstat
DRV_KMODS	+= rmc_comm
DRV_KMODS	+= rmcadm
DRV_KMODS	+= rmclomv
DRV_KMODS	+= sf
DRV_KMODS	+= nxge
DRV_KMODS	+= i2bsc
DRV_KMODS	+= mem_cache

#
#	Exec Class Modules (/kernel/exec):
#
EXEC_KMODS	+=

#
#	Scheduling Class Modules (/kernel/sched):
#
SCHED_KMODS	+=

#
#	File System Modules (/kernel/fs):
#
FS_KMODS	+=

#
#	'System' Modules (/kernel/sys):
#
SYS_KMODS	+=

#
#	'User' Modules (/kernel/misc):
#
MISC_KMODS	+= bignum
MISC_KMODS	+= obpsym bootdev vis cpr platmod md5 sha1 i2c_svc
MISC_KMODS	+= sbd

MISC_KMODS	+= opl_cfg
MISC_KMODS	+= gptwo_cpu gptwocfg
MISC_KMODS	+= pcie

#
#	Brand modules
#
BRAND_KMODS	+= sn1_brand s10_brand

#
#	Software Cryptographic Providers (/kernel/crypto):
#
CRYPTO_KMODS	+= aes
CRYPTO_KMODS	+= arcfour
CRYPTO_KMODS	+= des

#
#	generic-unix module (/kernel/genunix):
#
GENUNIX_KMODS	+= genunix

#	'User' "Modules" excluded from the Full Kernel lint target:
#

#
#	Modules eXcluded from the product:
#
XMODS		+=

#
#	cpu modules
#
CPU_KMODS	+= cheetah cheetahplus jalapeno serrano spitfire hummingbird

#
#	sun4u 'TOD' Modules (/platform/.../kernel/tod):
#
TOD_KMODS	+= todds1287 todds1337 todmostek
TOD_KMODS	+= todm5819 todblade todbq4802 todsg todopl
TOD_KMODS	+= todm5819p_rmc

#
#	Performance Counter BackEnd Modules (/usr/kernel/pcbe):
#
PCBE_KMODS	+= us234_pcbe
PCBE_KMODS	+= opl_pcbe