# ========== Copyright Header Begin ==========================================
# Hypervisor Software File: Makefile.platform
# Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
# - Do no alter or remove copyright notices
# - Redistribution and use of this software in source and binary forms, with
# or without modification, are permitted provided that the following
# - Redistribution of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistribution in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# Neither the name of Sun Microsystems, Inc. or the names of contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
# This software is provided "AS IS," without a warranty of any kind.
# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
# MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
# ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
# DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
# OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
# FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
# DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
# ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
# SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
# You acknowledge that this software is not designed, licensed or
# intended for use in the design, construction, operation or maintenance of
# ========== Copyright Header End ============================================
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
# ident "@(#)Makefile.platform 1.9 07/07/25 SMI"
include ../../Makefile.family
##############################################
PLAT_OPTIONS = -DSUPPORT_NIAGARA2_1x -DFALLS_FPGA
# Reset/Config doesn't properly initialize tick/stick
PLAT_OPTIONS += -DRESETCONFIG_BROKENTICK
# Tick Index is not set correctly in D-SFAR on TICKCMP/STICKCMP CEs
PLAT_OPTIONS += -DERRATA_TICK_INDEX
# Workaround to add intr_cookie APIs to INTR API Group v1.0
PLAT_OPTIONS += -DSOLARIS_ERRATUM_6496266
# Solaris assumes the fault-address on a TSB miss is page-aligned
PLAT_OPTIONS += -DTSBMISS_ALIGN_ADDR
# LDoms 1.0 Erratum; to avoid the unreliable reset caused by the PLX8532AA
# PCI-E switch chips on Ontario systems, we force a power-cycle when resetting
# the last domain in the system - which should as defined by best practices
# Solaris 'px' driver implementation of VPCI 1.1 support is broken.
PLAT_OPTIONS += -DSOLARIS_ERRATUM_6538898
# The data in the Tick Copare Array diagnostic registers may be incorrect
PLAT_OPTIONS += -DTCA_ECC_ERRATA
# A read of a ASR/PR/HPR register causes the ECC in an IRF register
# to be checked. If we have an IRFC in the register which is checked
# we get another error trap.
PLAT_OPTIONS += -DIRF_ECC_ERRATA
# The store ACK counter in the SPU can overflow. To make this less likely
# to happen, we stop the CWQ during MAU store operations.
PLAT_OPTIONS += -DERRATA_192
########################################
TRAP_SRCS = traptable.s traps_common.s
TRAP_OBJS = $(TRAP_SRCS:.s=.o)
Q_SRCS = main.s setup.s mmu.s l2subr.s \
chipsubr.s mmu_common.s \
svc_common.s svcinternal.s svc_vbsc.s ssi.s errs_common.s errors_subr.s \
intr.s intr_huron.s subr.s hcall.s \
hcall_core.s hcall_diag.s hcall_intr.s hcall_soft_state.s \
hcall_vpci.s hcall_cpu.s hcall_groups.s \
hcall_mmu.s hcall_niagara2.s \
heartbeat.s ldc.s hvctl.s hv_common_cmds.s \
errors_cmp.s errors_mmu.s errors_l2_cache.s errors_l1_cache.s \
errors_common.s errors_traps.s errors_soc.s \
error_tables.s errors_ssi.s niu.s \
fpga_uart.s vdev_intr.s vdev_console.s bootload.s cwq.s \
vdev_simdisk.s cyclic.s vpci_msi.s instr_emul.s
$(PLATFORM_SRC)/config.c \
$(PLATFORM_SRC)/init_huron.c \
$(PLATFORM_SRC)/res_piu_pcie.c
QC_OBJS = $(QC_SRCS:.c=.o)
RESET_OBJS = $(RESET_SRCS:.s=.o)
OBJS = begin.o $(TRAP_OBJS) $(PLAT_OBJS) $(Q_OBJS) $(QC_OBJS) version.o end.o
VERSION_SRC = $(FAMILY_SRC)/version.s
BEGIN_SRC = $(FAMILY_SRC)/begin.s
END_SRC = $(FAMILY_SRC)/end.s
version.o: $(VERSION_SRC)
@echo "Version: $(QVERSION)"
$(AS) $(ASFLAGS) -DVERSION="\"$(QVERSION)\"" -DINFO="\"$(QINFO)\"" $< -o $@ $(FAMILY_SRC)/version.s
@echo "Version: $(QVERSION)"
$(OBJCOPY) -O binary q q.bin
q: chkasm $(OBJS) $(FAMILY_SRC)/mapfile.q
$(LD) -o $@ -e start_master -dn -z defs -M $(FAMILY_SRC)/mapfile.q $(OBJS)
q0: $(Q_OBJS) $(FAMILY_SRC)/mapfile.q0
$(LD) -o $@ -e start_master -dn -z defs -M $(FAMILY_SRC)/mapfile.q0 $(OBJS)
$(OBJCOPY) -O binary reset reset.bin
reset: $(RESET_OBJS) $(RESET)/mapfile
$(LD) -o $@ -e start_reset -dn -z defs -M $(RESET)/mapfile $(RESET_OBJS)
# This would work but only dumps the .text, nothing else
# elfdump -N .text -w q.bin q
offsets.h: $(PLATFORM_SRC)/offsets.in
@grep "^#" $(PLATFORM_SRC)/offsets.in > offsets-n2.c
$(CC) -xdebugformat=stabs $(CFLAGS) $(CPPFLAGS) -g -S -o offsets-n2.s offsets-n2.c
@grep -v "^#" $(PLATFORM_SRC)/offsets.in > offsets.tmp
$(STABS) -t genassym -m lp64 offsets.tmp < offsets-n2.s | \
egrep -v '[0-f]+ c-enum' > offsets.h
@$(RM) offsets-n2.c offsets-n2.s offsets.tmp
offsets.chk: $(PLATFORM_SRC)/offsets.in
@grep "^#" $(PLATFORM_SRC)/offsets.in > offsetschk-n2.c
$(CC) -xdebugformat=stabs $(CFLAGS) $(CPPFLAGS) -g -S -o offsetschk-n2.s offsetschk-n2.c
@grep -v "^#" $(PLATFORM_SRC)/offsets.in > offsetschk.tmp
$(STABS) -t asmcheck -m lp64 offsetschk.tmp < offsetschk-n2.s | \
egrep -v '[0-f]+ c-enum' > offsets.chk
@$(RM) offsetschk-n2.c offsetschk-n2.s offsetschk.tmp
$(ASCHK) -u -s -n offsets.chk $(PLATFORM_SRC)/*.s $(FAMILY_SRC)/*.s $(RESET)/*.s $(COMMON_SRC)/*.s
LINT_SRCS += $(FAMILYC_LINT_SRCS) $(PLATFORMC_LINT_SRCS)
$(LINT) $(LINT_FLAGS) $(ALL_INC) $(PLAT_OPTIONS) $(LINT_SRCS)