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
36ifneq (2,$(GIC_VERSION))
37ARM_MERGE_FIQ_IRQ := true
38endif
39
40MEMBASE ?= 0
41MEMSIZE ?= 1
42
43GLOBAL_INCLUDES += \
44	$(LOCAL_DIR)/include
45
46MODULE_DEFINES += \
47	GIC_VERSION=$(GIC_VERSION) \
48
49GENERIC_ARM64_DEBUG ?= SMC_DEBUG_PUTC
50GLOBAL_DEFINES += GENERIC_ARM64_DEBUG_$(GENERIC_ARM64_DEBUG)=1
51
52MODULE_SRCS += \
53	$(LOCAL_DIR)/debug.c \
54	$(LOCAL_DIR)/dtb.c \
55	$(LOCAL_DIR)/platform.c \
56	$(LOCAL_DIR)/smc.c \
57
58# smc.h uses a header here, but does not depend on anything else in lib/sm
59MODULE_INCLUDES += \
60	$(TRUSTY_TOP)/trusty/kernel/lib/sm/include \
61
62MODULE_DEPS += \
63	dev/interrupt/arm_gic \
64	dev/timer/arm_generic
65
66GLOBAL_DEFINES += \
67	MEMBASE=$(MEMBASE) \
68	MEMSIZE=$(MEMSIZE) \
69	MMU_WITH_TRAMPOLINE=1
70
71LINKER_SCRIPT += \
72	$(BUILDDIR)/system-onesegment.ld
73
74# SMC service support
75MODULE_INCLUDES += \
76	$(TRUSTY_TOP)/trusty/kernel/services/smc/include \
77	$(TRUSTY_TOP)/trusty/kernel/include \
78	$(TRUSTY_TOP)/trusty/user/base/lib/smc/include \
79
80MODULE_SRCS += \
81	$(LOCAL_DIR)/smc_service_access_policy.c \
82
83MODULE_DEPS += \
84	$(LKROOT)/lib/device_tree \
85	trusty/kernel/lib/dtb_embedded \
86	trusty/kernel/lib/dtb_service \
87	trusty/kernel/lib/ktipc \
88
89include make/module.mk
90