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