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 51else 52MODULE_DEFINES += GIC_VERSION=$(GIC_VERSION) 53MODULE_DEPS += dev/interrupt/arm_gic 54endif 55 56GENERIC_ARM64_DEBUG ?= SMC_DEBUG_PUTC 57GLOBAL_DEFINES += GENERIC_ARM64_DEBUG_$(GENERIC_ARM64_DEBUG)=1 58 59MODULE_SRCS += \ 60 $(LOCAL_DIR)/debug.c \ 61 $(LOCAL_DIR)/dtb.c \ 62 $(LOCAL_DIR)/platform.c \ 63 $(LOCAL_DIR)/smc.c \ 64 65# smc.h uses a header here, but does not depend on anything else in lib/sm 66MODULE_INCLUDES += \ 67 $(TRUSTY_TOP)/trusty/kernel/lib/sm/include \ 68 69MODULE_DEPS += \ 70 dev/timer/arm_generic \ 71 dev/virtio/vsock-rust \ 72 73GLOBAL_DEFINES += \ 74 MEMBASE=$(MEMBASE) \ 75 MEMSIZE=$(MEMSIZE) \ 76 MMU_WITH_TRAMPOLINE=1 77 78LINKER_SCRIPT += \ 79 $(BUILDDIR)/system-onesegment.ld 80 81# SMC service support 82MODULE_INCLUDES += \ 83 $(TRUSTY_TOP)/trusty/kernel/services/smc/include \ 84 $(TRUSTY_TOP)/trusty/kernel/include \ 85 $(TRUSTY_TOP)/trusty/user/base/lib/smc/include \ 86 87MODULE_SRCS += \ 88 $(LOCAL_DIR)/smc_service_access_policy.c \ 89 90MODULE_DEPS += \ 91 $(LKROOT)/lib/device_tree \ 92 trusty/kernel/lib/dtb_embedded \ 93 trusty/kernel/lib/dtb_service \ 94 trusty/kernel/lib/ktipc \ 95 96ifeq ($(GENERIC_ARM64_DEBUG),FFA) 97MODULE_DEPS += trusty/kernel/lib/arm_ffa 98endif 99 100include make/module.mk 101