Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 1 | # |
Rohit Ner | b9bed28 | 2022-05-11 03:06:07 -0700 | [diff] [blame] | 2 | # Copyright (c) 2017-2022, ARM Limited and Contributors. All rights reserved. |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
Haojian Zhuang | 1b4b412 | 2018-01-25 16:13:05 +0800 | [diff] [blame] | 7 | # Non-TF Boot ROM |
| 8 | BL2_AT_EL3 := 1 |
| 9 | |
Victor Chong | 9128768 | 2017-05-28 00:14:37 +0900 | [diff] [blame] | 10 | # On Hikey960, the TSP can execute from TZC secure area in DRAM. |
Victor Chong | 4d64c2b | 2018-02-01 00:37:49 +0900 | [diff] [blame] | 11 | HIKEY960_TSP_RAM_LOCATION ?= dram |
Victor Chong | 9128768 | 2017-05-28 00:14:37 +0900 | [diff] [blame] | 12 | ifeq (${HIKEY960_TSP_RAM_LOCATION}, dram) |
| 13 | HIKEY960_TSP_RAM_LOCATION_ID = HIKEY960_DRAM_ID |
| 14 | else ifeq (${HIKEY960_TSP_RAM_LOCATION}, sram) |
Victor Chong | 4d64c2b | 2018-02-01 00:37:49 +0900 | [diff] [blame] | 15 | HIKEY960_TSP_RAM_LOCATION_ID = HIKEY960_SRAM_ID |
Victor Chong | 9128768 | 2017-05-28 00:14:37 +0900 | [diff] [blame] | 16 | else |
| 17 | $(error "Currently unsupported HIKEY960_TSP_RAM_LOCATION value") |
| 18 | endif |
| 19 | |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 20 | CRASH_CONSOLE_BASE := PL011_UART6_BASE |
| 21 | COLD_BOOT_SINGLE_CPU := 1 |
Leo Yan | 3886dc6 | 2020-03-02 22:15:08 +0800 | [diff] [blame] | 22 | PLAT_PL061_MAX_GPIOS := 232 |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 23 | PROGRAMMABLE_RESET_ADDRESS := 1 |
David Cunado | c5b0c0f | 2017-10-31 23:19:21 +0000 | [diff] [blame] | 24 | ENABLE_SVE_FOR_NS := 0 |
Haojian Zhuang | 32052ab | 2019-09-14 18:43:51 +0800 | [diff] [blame] | 25 | PLAT_PARTITION_BLOCK_SIZE := 4096 |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 26 | |
| 27 | # Process flags |
Victor Chong | 9128768 | 2017-05-28 00:14:37 +0900 | [diff] [blame] | 28 | $(eval $(call add_define,HIKEY960_TSP_RAM_LOCATION_ID)) |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 29 | $(eval $(call add_define,CRASH_CONSOLE_BASE)) |
Kaihua Zhong | 39ff2ee | 2018-07-16 17:33:48 +0800 | [diff] [blame] | 30 | $(eval $(call add_define,PLAT_PL061_MAX_GPIOS)) |
Haojian Zhuang | 32052ab | 2019-09-14 18:43:51 +0800 | [diff] [blame] | 31 | $(eval $(call add_define,PLAT_PARTITION_BLOCK_SIZE)) |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 32 | |
Victor Chong | 7d787f5 | 2017-08-16 13:53:56 +0900 | [diff] [blame] | 33 | # Add the build options to pack Trusted OS Extra1 and Trusted OS Extra2 images |
| 34 | # in the FIP if the platform requires. |
| 35 | ifneq ($(BL32_EXTRA1),) |
Masahiro Yamada | 9c5ca52 | 2018-01-26 11:42:01 +0900 | [diff] [blame] | 36 | $(eval $(call TOOL_ADD_IMG,bl32_extra1,--tos-fw-extra1)) |
Victor Chong | 7d787f5 | 2017-08-16 13:53:56 +0900 | [diff] [blame] | 37 | endif |
| 38 | ifneq ($(BL32_EXTRA2),) |
Masahiro Yamada | 9c5ca52 | 2018-01-26 11:42:01 +0900 | [diff] [blame] | 39 | $(eval $(call TOOL_ADD_IMG,bl32_extra2,--tos-fw-extra2)) |
Victor Chong | 7d787f5 | 2017-08-16 13:53:56 +0900 | [diff] [blame] | 40 | endif |
| 41 | |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 42 | USE_COHERENT_MEM := 1 |
| 43 | |
Antonio Nino Diaz | 50a4d1a | 2019-02-01 12:22:22 +0000 | [diff] [blame] | 44 | PLAT_INCLUDES := -Iplat/hisilicon/hikey960/include |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 45 | |
Antonio Nino Diaz | 582c2d7 | 2018-09-24 17:23:47 +0100 | [diff] [blame] | 46 | PLAT_BL_COMMON_SOURCES := drivers/arm/pl011/aarch64/pl011_console.S \ |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 47 | drivers/delay_timer/delay_timer.c \ |
| 48 | drivers/delay_timer/generic_delay_timer.c \ |
Antonio Nino Diaz | 582c2d7 | 2018-09-24 17:23:47 +0100 | [diff] [blame] | 49 | lib/xlat_tables/aarch64/xlat_tables.c \ |
| 50 | lib/xlat_tables/xlat_tables_common.c \ |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 51 | plat/hisilicon/hikey960/aarch64/hikey960_common.c \ |
| 52 | plat/hisilicon/hikey960/hikey960_boardid.c |
| 53 | |
| 54 | HIKEY960_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \ |
| 55 | drivers/arm/gic/v2/gicv2_main.c \ |
| 56 | drivers/arm/gic/v2/gicv2_helpers.c \ |
| 57 | plat/common/plat_gicv2.c |
| 58 | |
| 59 | BL1_SOURCES += bl1/tbbr/tbbr_img_desc.c \ |
Kaihua Zhong | 39ff2ee | 2018-07-16 17:33:48 +0800 | [diff] [blame] | 60 | drivers/arm/pl061/pl061_gpio.c \ |
| 61 | drivers/gpio/gpio.c \ |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 62 | drivers/io/io_block.c \ |
| 63 | drivers/io/io_fip.c \ |
| 64 | drivers/io/io_storage.c \ |
| 65 | drivers/synopsys/ufs/dw_ufs.c \ |
| 66 | drivers/ufs/ufs.c \ |
| 67 | lib/cpus/aarch64/cortex_a53.S \ |
| 68 | plat/hisilicon/hikey960/aarch64/hikey960_helpers.S \ |
Haojian Zhuang | d82e29d | 2018-03-05 13:20:33 +0800 | [diff] [blame] | 69 | plat/hisilicon/hikey960/hikey960_bl1_setup.c \ |
| 70 | plat/hisilicon/hikey960/hikey960_bl_common.c \ |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 71 | plat/hisilicon/hikey960/hikey960_io_storage.c \ |
| 72 | ${HIKEY960_GIC_SOURCES} |
Haojian Zhuang | 1f73c0c | 2017-06-01 14:03:22 +0800 | [diff] [blame] | 73 | |
Haojian Zhuang | a94d75d | 2018-01-29 12:45:28 +0800 | [diff] [blame] | 74 | BL2_SOURCES += common/desc_image_load.c \ |
Kaihua Zhong | 39ff2ee | 2018-07-16 17:33:48 +0800 | [diff] [blame] | 75 | drivers/arm/pl061/pl061_gpio.c \ |
| 76 | drivers/gpio/gpio.c \ |
Haojian Zhuang | a94d75d | 2018-01-29 12:45:28 +0800 | [diff] [blame] | 77 | drivers/io/io_block.c \ |
Haojian Zhuang | 1f73c0c | 2017-06-01 14:03:22 +0800 | [diff] [blame] | 78 | drivers/io/io_fip.c \ |
| 79 | drivers/io/io_storage.c \ |
Haojian Zhuang | 32052ab | 2019-09-14 18:43:51 +0800 | [diff] [blame] | 80 | drivers/partition/gpt.c \ |
| 81 | drivers/partition/partition.c \ |
Haojian Zhuang | 1b4b412 | 2018-01-25 16:13:05 +0800 | [diff] [blame] | 82 | drivers/synopsys/ufs/dw_ufs.c \ |
Haojian Zhuang | 1f73c0c | 2017-06-01 14:03:22 +0800 | [diff] [blame] | 83 | drivers/ufs/ufs.c \ |
Haojian Zhuang | 1b4b412 | 2018-01-25 16:13:05 +0800 | [diff] [blame] | 84 | lib/cpus/aarch64/cortex_a53.S \ |
| 85 | plat/hisilicon/hikey960/aarch64/hikey960_helpers.S \ |
Haojian Zhuang | a94d75d | 2018-01-29 12:45:28 +0800 | [diff] [blame] | 86 | plat/hisilicon/hikey960/hikey960_bl2_mem_params_desc.c \ |
Haojian Zhuang | 1f73c0c | 2017-06-01 14:03:22 +0800 | [diff] [blame] | 87 | plat/hisilicon/hikey960/hikey960_bl2_setup.c \ |
Haojian Zhuang | d82e29d | 2018-03-05 13:20:33 +0800 | [diff] [blame] | 88 | plat/hisilicon/hikey960/hikey960_bl_common.c \ |
Haojian Zhuang | a94d75d | 2018-01-29 12:45:28 +0800 | [diff] [blame] | 89 | plat/hisilicon/hikey960/hikey960_image_load.c \ |
Haojian Zhuang | 1f73c0c | 2017-06-01 14:03:22 +0800 | [diff] [blame] | 90 | plat/hisilicon/hikey960/hikey960_io_storage.c \ |
| 91 | plat/hisilicon/hikey960/hikey960_mcu_load.c |
Haojian Zhuang | 1b5c225 | 2017-06-01 15:20:46 +0800 | [diff] [blame] | 92 | |
Victor Chong | 7d787f5 | 2017-08-16 13:53:56 +0900 | [diff] [blame] | 93 | ifeq (${SPD},opteed) |
| 94 | BL2_SOURCES += lib/optee/optee_utils.c |
| 95 | endif |
Victor Chong | 2d9a42d | 2017-08-17 15:21:10 +0900 | [diff] [blame] | 96 | |
Rohit Ner | b9bed28 | 2022-05-11 03:06:07 -0700 | [diff] [blame] | 97 | include lib/zlib/zlib.mk |
| 98 | PLAT_INCLUDES += -Ilib/zlib |
| 99 | BL2_SOURCES += $(ZLIB_SOURCES) |
| 100 | |
Haojian Zhuang | 1b5c225 | 2017-06-01 15:20:46 +0800 | [diff] [blame] | 101 | BL31_SOURCES += drivers/arm/cci/cci.c \ |
Leo Yan | 3886dc6 | 2020-03-02 22:15:08 +0800 | [diff] [blame] | 102 | drivers/arm/pl061/pl061_gpio.c \ |
| 103 | drivers/gpio/gpio.c \ |
Haojian Zhuang | 1b5c225 | 2017-06-01 15:20:46 +0800 | [diff] [blame] | 104 | lib/cpus/aarch64/cortex_a53.S \ |
| 105 | lib/cpus/aarch64/cortex_a72.S \ |
| 106 | lib/cpus/aarch64/cortex_a73.S \ |
Antonio Nino Diaz | 582c2d7 | 2018-09-24 17:23:47 +0100 | [diff] [blame] | 107 | plat/common/plat_psci_common.c \ |
Haojian Zhuang | 1b5c225 | 2017-06-01 15:20:46 +0800 | [diff] [blame] | 108 | plat/hisilicon/hikey960/aarch64/hikey960_helpers.S \ |
| 109 | plat/hisilicon/hikey960/hikey960_bl31_setup.c \ |
Leo Yan | 3886dc6 | 2020-03-02 22:15:08 +0800 | [diff] [blame] | 110 | plat/hisilicon/hikey960/hikey960_bl_common.c \ |
Haojian Zhuang | 1b5c225 | 2017-06-01 15:20:46 +0800 | [diff] [blame] | 111 | plat/hisilicon/hikey960/hikey960_pm.c \ |
| 112 | plat/hisilicon/hikey960/hikey960_topology.c \ |
| 113 | plat/hisilicon/hikey960/drivers/pwrc/hisi_pwrc.c \ |
| 114 | plat/hisilicon/hikey960/drivers/ipc/hisi_ipc.c \ |
| 115 | ${HIKEY960_GIC_SOURCES} |
Victor Chong | cb27a35 | 2017-07-12 01:07:29 +0900 | [diff] [blame] | 116 | |
Teddy Reed | dd3f0a8 | 2018-09-03 17:38:50 -0400 | [diff] [blame] | 117 | ifneq (${TRUSTED_BOARD_BOOT},0) |
| 118 | |
| 119 | include drivers/auth/mbedtls/mbedtls_crypto.mk |
| 120 | include drivers/auth/mbedtls/mbedtls_x509.mk |
| 121 | |
Teddy Reed | dd3f0a8 | 2018-09-03 17:38:50 -0400 | [diff] [blame] | 122 | AUTH_SOURCES := drivers/auth/auth_mod.c \ |
| 123 | drivers/auth/crypto_mod.c \ |
| 124 | drivers/auth/img_parser_mod.c \ |
Manish V Badarkhe | 043fd62 | 2020-05-16 16:36:39 +0100 | [diff] [blame] | 125 | drivers/auth/tbbr/tbbr_cot_common.c |
Teddy Reed | dd3f0a8 | 2018-09-03 17:38:50 -0400 | [diff] [blame] | 126 | |
| 127 | BL1_SOURCES += ${AUTH_SOURCES} \ |
| 128 | plat/common/tbbr/plat_tbbr.c \ |
| 129 | plat/hisilicon/hikey960/hikey960_tbbr.c \ |
Manish V Badarkhe | 043fd62 | 2020-05-16 16:36:39 +0100 | [diff] [blame] | 130 | plat/hisilicon/hikey960/hikey960_rotpk.S \ |
| 131 | drivers/auth/tbbr/tbbr_cot_bl1.c |
Teddy Reed | dd3f0a8 | 2018-09-03 17:38:50 -0400 | [diff] [blame] | 132 | |
| 133 | BL2_SOURCES += ${AUTH_SOURCES} \ |
| 134 | plat/common/tbbr/plat_tbbr.c \ |
| 135 | plat/hisilicon/hikey960/hikey960_tbbr.c \ |
Manish V Badarkhe | 043fd62 | 2020-05-16 16:36:39 +0100 | [diff] [blame] | 136 | plat/hisilicon/hikey960/hikey960_rotpk.S \ |
| 137 | drivers/auth/tbbr/tbbr_cot_bl2.c |
Teddy Reed | dd3f0a8 | 2018-09-03 17:38:50 -0400 | [diff] [blame] | 138 | |
| 139 | ROT_KEY = $(BUILD_PLAT)/rot_key.pem |
| 140 | ROTPK_HASH = $(BUILD_PLAT)/rotpk_sha256.bin |
| 141 | |
| 142 | $(eval $(call add_define_val,ROTPK_HASH,'"$(ROTPK_HASH)"')) |
| 143 | $(BUILD_PLAT)/bl1/hikey960_rotpk.o: $(ROTPK_HASH) |
| 144 | $(BUILD_PLAT)/bl2/hikey960_rotpk.o: $(ROTPK_HASH) |
| 145 | |
| 146 | certificates: $(ROT_KEY) |
| 147 | $(ROT_KEY): | $(BUILD_PLAT) |
| 148 | @echo " OPENSSL $@" |
| 149 | $(Q)openssl genrsa 2048 > $@ 2>/dev/null |
| 150 | |
| 151 | $(ROTPK_HASH): $(ROT_KEY) |
| 152 | @echo " OPENSSL $@" |
| 153 | $(Q)openssl rsa -in $< -pubout -outform DER 2>/dev/null |\ |
| 154 | openssl dgst -sha256 -binary > $@ 2>/dev/null |
| 155 | endif |
| 156 | |
Victor Chong | cb27a35 | 2017-07-12 01:07:29 +0900 | [diff] [blame] | 157 | # Enable workarounds for selected Cortex-A53 errata. |
| 158 | ERRATA_A53_836870 := 1 |
| 159 | ERRATA_A53_843419 := 1 |
| 160 | ERRATA_A53_855873 := 1 |
Leo Yan | 453940d | 2017-11-22 17:10:39 +0800 | [diff] [blame] | 161 | |
| 162 | FIP_ALIGN := 512 |