blob: c03a2f6b3ded49fce1e89f6721d0f07c63072f07 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001LOCAL_DIR := $(GET_LOCAL_DIR)
2MODULE := ${LOCAL_DIR}
3
4GLOBAL_INCLUDES += \
5 $(LOCAL_DIR)/include
6
7MODULE_SRCS += \
8 $(LOCAL_DIR)/target.c
9
10PLATFORM := mt8512
11
12SPI_NAND_PROJECT := y
13
14TZ_PART_NAME := tee_a
15RECOVERY_TZ_PART_NAME = tee_b
16DTBO_PART_NAME := dtbo
17BOOT_PART_NAME := boot_a
18RECOVERY_BOOT_PART_NAME = boot_b
19
20ifeq ($(WITH_KERNEL_VM),1)
21# The physical dram address is 0x40000000 and its virtual address 0xffff00000d600000
22# The CACHED_MEMPOOL_ADDR virtual address would be 0xffff00000d600000 + 0x4000000 = 0xffff000011600000
23# The UNCACHED_MEMPOOL_ADDR virtual address would be 0xffff000011600000UL + 0x0AA00000 = 0xffff00001C000000UL
24# The BL33_ADDR virtual address would be 0xffff00000d600000 + 0x1e00000 = 0xffff00000f400000
25# The NAND_BUF_ADDR virtual address would be 0xffff00001C000000UL + 0x00200000 = 0xffff00001C200000UL
26CACHED_MEMPOOL_ADDR := 0xffff00000e600000UL
27UNCACHED_MEMPOOL_ADDR := 0xffff000010600000UL
28BL33_ADDR := 0xffff000011000000UL
29NAND_BUF_ADDR := 0xffff000010900000UL
30else
31CACHED_MEMPOOL_ADDR := 0x41000000
32UNCACHED_MEMPOOL_ADDR := 0x43000000
33BL33_ADDR := 0x43a00000
34NAND_BUF_ADDR := 0x43300000
35endif
36
37CACHED_MEMPOOL_SIZE := 0x2000000 # 48MB
38UNCACHED_MEMPOOL_SIZE := 0x0007D000 # 500k
39
40SCRATCH_SIZE := 0x800000 # 8MB
41
42MAX_TEE_DRAM_SIZE := 0x00400000 # 4M
43MAX_KERNEL_SIZE := 0x01000000 # 16M
44MAX_DTB_SIZE := 0x00200000 # 2M
45MAX_LZ4_BUF_SIZE := 0x00100000 # 1M
46MAX_NAND_BUF_SIZE := 0x00100000 # 1M
47
48# CACHED_MEMPOOL_ADDR + CACHED_MEMPOOL_SIZE for upgrade
49# CACHED_MEMPOOL_ADDR + MAX_TEE_DRAM_SIZE + MAX_KERNEL_SIZE
50# + MAX_DTB_SIZE + MAX_LZ4_BUF_SIZE for boot
51
52GLOBAL_CFLAGS += -DTZ_PART_NAME=\"$(TZ_PART_NAME)\" \
53 -DDTBO_PART_NAME=\"$(DTBO_PART_NAME)\" \
54 -DBOOT_PART_NAME=\"$(BOOT_PART_NAME)\" \
55 -DRECOVERY_BOOT_PART_NAME=\"$(RECOVERY_BOOT_PART_NAME)\" \
56 -DRECOVERY_TZ_PART_NAME=\"$(RECOVERY_TZ_PART_NAME)\" \
57
58GLOBAL_DEFINES += CACHED_MEMPOOL_ADDR=$(CACHED_MEMPOOL_ADDR) \
59 CACHED_MEMPOOL_SIZE=$(CACHED_MEMPOOL_SIZE) \
60 UNCACHED_MEMPOOL_ADDR=$(UNCACHED_MEMPOOL_ADDR) \
61 UNCACHED_MEMPOOL_SIZE=$(UNCACHED_MEMPOOL_SIZE) \
62 SCRATCH_SIZE=$(SCRATCH_SIZE) \
63 BL33_ADDR=$(BL33_ADDR) \
64 NAND_BUF_ADDR=$(NAND_BUF_ADDR)
65
66include make/module.mk