1#
2# Copyright (c) 2017, 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
28ARCH := arm
29ARM_CPU := cortex-a7
30WITH_LIB_SM := 1
31WITH_LIB_SM_MONITOR := 1
32WITH_LIB_VERSION := 1
33WITH_VIRT_TIMER_INIT ?= 1
34
35# TEE memory phys address and size
36MEMBASE ?= 0x9e000000
37MEMSIZE ?= 0x02000000
38
39# TEE kernel virt address
40KERNEL_BASE ?= $(MEMBASE)
41
42# Enable TZ controller
43WITH_TZASC ?= true
44
45GLOBAL_INCLUDES += \
46	$(LOCAL_DIR)/common/include \
47	$(LOCAL_DIR)/soc/$(PLATFORM_SOC)/include \
48
49MODULE_SRCS := \
50	$(LOCAL_DIR)/debug.c \
51	$(LOCAL_DIR)/platform.c \
52	$(LOCAL_DIR)/drivers/imx_uart.c \
53
54#include SOC specific rules if they exists
55-include $(LOCAL_DIR)/soc/$(PLATFORM_SOC)/rules.mk
56
57ifeq (true,$(call TOBOOL,$(WITH_TZASC)))
58MODULE_SRCS += \
59	$(LOCAL_DIR)/tzasc.c
60
61MODULE_DEFINES += \
62	WITH_TZASC=1
63endif
64
65ifeq (true,$(call TOBOOL,$(WITH_VIRT_TIMER_INIT)))
66MODULE_SRCS += \
67	$(LOCAL_DIR)/vtimer.S
68
69MODULE_DEFINES += \
70	WITH_VIRT_TIMER_INIT=1
71endif
72
73MODULE_DEPS += \
74	dev/interrupt/arm_gic \
75	dev/timer/arm_generic \
76
77GLOBAL_DEFINES += \
78	CONFIG_CONSOLE_TTY_BASE=$(CONFIG_CONSOLE_TTY_BASE) \
79	MEMBASE=$(MEMBASE) \
80	MEMSIZE=$(MEMSIZE) \
81	MMU_WITH_TRAMPOLINE=1
82
83LINKER_SCRIPT += \
84	$(BUILDDIR)/system-onesegment.ld
85
86include make/module.mk
87