1# 2# Copyright (c) 2015, Google, Inc. All rights reserved 3# 4# Permission is hereby granted, free of charge, to any person obtaining 5# a copy of this software and associated documentation files 6# (the "Software"), to deal in the Software without restriction, 7# including without limitation the rights to use, copy, modify, merge, 8# publish, distribute, sublicense, and/or sell copies of the Software, 9# and to permit persons to whom the Software is furnished to do so, 10# subject to the following conditions: 11# 12# The above copyright notice and this permission notice shall be 13# included in all copies or substantial portions of the Software. 14# 15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22# 23 24LOCAL_DIR := $(GET_LOCAL_DIR) 25 26MODULE := $(LOCAL_DIR) 27 28ifeq (false,$(call TOBOOL,$(KERNEL_32BIT))) 29ARCH := arm64 30else 31ARCH := arm 32endif 33ARM_CPU := armv8-a 34WITH_SMP := 1 35 36ifeq (false,$(call TOBOOL,$(HAFNIUM))) 37ifneq (2,$(GIC_VERSION)) 38ARM_MERGE_FIQ_IRQ := true 39endif 40endif 41 42MEMBASE ?= 0 43MEMSIZE ?= 1 44 45GLOBAL_INCLUDES += \ 46 $(LOCAL_DIR)/include 47 48ifeq (true,$(call TOBOOL,$(HAFNIUM))) 49MODULE_DEFINES += HAFNIUM=1 50MODULE_DEPS += dev/interrupt/hafnium 51MODULE_INCLUDES += \ 52 external/hafnium/inc/vmapi \ 53 external/hafnium/src/arch/aarch64/inc 54else 55MODULE_DEFINES += GIC_VERSION=$(GIC_VERSION) 56MODULE_DEPS += dev/interrupt/arm_gic 57endif 58 59GENERIC_ARM64_DEBUG ?= SMC_DEBUG_PUTC 60GLOBAL_DEFINES += GENERIC_ARM64_DEBUG_$(GENERIC_ARM64_DEBUG)=1 61 62MODULE_SRCS += \ 63 $(LOCAL_DIR)/debug.c \ 64 $(LOCAL_DIR)/dtb.c \ 65 $(LOCAL_DIR)/platform.c \ 66 $(LOCAL_DIR)/smc.c \ 67 68# smc.h uses a header here, but does not depend on anything else in lib/sm 69MODULE_INCLUDES += \ 70 $(TRUSTY_TOP)/trusty/kernel/lib/sm/include \ 71 72MODULE_DEPS += \ 73 dev/timer/arm_generic \ 74 75# vsock-rust only supports aarch64 (and x86_64) 76MODULE_DEPS += \ 77 dev/virtio/vsock-rust \ 78 79GLOBAL_DEFINES += \ 80 MEMBASE=$(MEMBASE) \ 81 MEMSIZE=$(MEMSIZE) \ 82 MMU_WITH_TRAMPOLINE=1 83 84LINKER_SCRIPT += \ 85 $(BUILDDIR)/system-onesegment.ld 86 87# SMC service support 88MODULE_INCLUDES += \ 89 $(TRUSTY_TOP)/trusty/kernel/services/smc/include \ 90 $(TRUSTY_TOP)/trusty/kernel/include \ 91 $(TRUSTY_TOP)/trusty/user/base/lib/smc/include \ 92 93MODULE_SRCS += \ 94 $(LOCAL_DIR)/smc_service_access_policy.c \ 95 96MODULE_DEPS += \ 97 $(LKROOT)/lib/device_tree \ 98 trusty/kernel/lib/dtb_embedded \ 99 trusty/kernel/lib/dtb_service \ 100 trusty/kernel/lib/ktipc \ 101 102ifeq ($(GENERIC_ARM64_DEBUG),FFA) 103MODULE_DEPS += trusty/kernel/lib/arm_ffa 104endif 105 106# MMIO Guard support 107MMIO_GUARD_ENABLED ?= false 108ifeq (true,$(call TOBOOL,$(MMIO_GUARD_ENABLED))) 109MODULE_DEPS += \ 110 $(LKROOT)/lib/libhypervisor 111 112MODULE_DEFINES += MMIO_GUARD_ENABLED=1 113endif 114 115include make/module.mk 116