rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | LOCAL_DIR := $(GET_LOCAL_DIR) |
| 2 | MODULE := ${LOCAL_DIR} |
| 3 | |
| 4 | GLOBAL_INCLUDES += \ |
| 5 | $(LOCAL_DIR)/include |
| 6 | |
| 7 | MODULE_SRCS += \ |
| 8 | $(LOCAL_DIR)/target.c |
| 9 | |
| 10 | PLATFORM := mt8518 |
| 11 | WITH_UBOOT :=1 |
| 12 | |
| 13 | TZ_PART_NAME := tee_a |
| 14 | RECOVERY_TZ_PART_NAME = tee_b |
| 15 | DTBO_PART_NAME := dtbo |
| 16 | ifeq ($(WITH_UBOOT),1) |
| 17 | BOOT_PART_NAME := bl2_a |
| 18 | RECOVERY_BOOT_PART_NAME = bl2_b |
| 19 | else |
| 20 | BOOT_PART_NAME := boot_a |
| 21 | RECOVERY_BOOT_PART_NAME = boot_b |
| 22 | endif |
| 23 | |
| 24 | ifeq ($(WITH_KERNEL_VM),1) |
| 25 | # The physical dram address is 0x40000000 and its virtual address 0xffff00000d600000 |
| 26 | # The CACHED_MEMPOOL_ADDR virtual address would be 0xffff00000d600000 + 0x4000000 = 0xffff000011600000 |
| 27 | # The BL33_ADDR virtual address would be 0xffff00000d600000 + 0x1e00000 = 0xffff00000f400000 |
| 28 | CACHED_MEMPOOL_ADDR := 0xffff000011600000UL |
| 29 | BL33_ADDR := 0xffff00000f400000UL |
| 30 | NAND_BUF_ADDR := 0xffff00000fa00000UL |
| 31 | |
| 32 | else |
| 33 | CACHED_MEMPOOL_ADDR := 0x44000000 |
| 34 | BL33_ADDR := 0x41e00000 |
| 35 | NAND_BUF_ADDR := 0x4e300000 |
| 36 | |
| 37 | |
| 38 | endif |
| 39 | CACHED_MEMPOOL_SIZE := 0x0AA00000 # 170MB |
| 40 | |
| 41 | SCRATCH_SIZE := 0x1E00000 # 30MB |
| 42 | |
| 43 | MAX_TEE_DRAM_SIZE := 0x04000000 # 64M |
| 44 | MAX_KERNEL_SIZE := 0x02000000 # 32M |
| 45 | MAX_DTB_SIZE := 0x00200000 # 2M |
| 46 | MAX_LZ4_BUF_SIZE := 0x00100000 # 1M |
| 47 | MAX_NAND_BUF_SIZE := 0x00100000 # 1M |
| 48 | |
| 49 | # CACHED_MEMPOOL_ADDR + CACHED_MEMPOOL_SIZE for upgrade |
| 50 | # CACHED_MEMPOOL_ADDR + MAX_TEE_DRAM_SIZE + MAX_KERNEL_SIZE |
| 51 | # + MAX_DTB_SIZE + MAX_LZ4_BUF_SIZE for boot |
| 52 | |
| 53 | GLOBAL_CFLAGS += -DTZ_PART_NAME=\"$(TZ_PART_NAME)\" \ |
| 54 | -DDTBO_PART_NAME=\"$(DTBO_PART_NAME)\" \ |
| 55 | -DBOOT_PART_NAME=\"$(BOOT_PART_NAME)\" \ |
| 56 | -DRECOVERY_BOOT_PART_NAME=\"$(RECOVERY_BOOT_PART_NAME)\" \ |
| 57 | -DRECOVERY_TZ_PART_NAME=\"$(RECOVERY_TZ_PART_NAME)\" \ |
| 58 | |
| 59 | GLOBAL_DEFINES += CACHED_MEMPOOL_ADDR=$(CACHED_MEMPOOL_ADDR) \ |
| 60 | CACHED_MEMPOOL_SIZE=$(CACHED_MEMPOOL_SIZE) \ |
| 61 | BL33_ADDR=$(BL33_ADDR) \ |
| 62 | SCRATCH_SIZE=$(SCRATCH_SIZE) \ |
| 63 | NAND_BUF_ADDR=$(NAND_BUF_ADDR) \ |
| 64 | |
| 65 | MODULE_DEPS += \ |
| 66 | platform/$(PLATFORM)/drivers/nand |
| 67 | |
| 68 | include make/module.mk |