Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 1 | # |
Andrey Skvortsov | aa93a4a | 2023-12-08 17:07:07 +0300 | [diff] [blame^] | 2 | # Copyright (c) 2016-2024, ARM Limited and Contributors. All rights reserved. |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 3 | # |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | # SPDX-License-Identifier: BSD-3-Clause |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 5 | # |
| 6 | |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 7 | RK_PLAT := plat/rockchip |
| 8 | RK_PLAT_SOC := ${RK_PLAT}/${PLAT} |
| 9 | RK_PLAT_COMMON := ${RK_PLAT}/common |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 10 | |
Christoph Müllner | 05ceda7 | 2019-04-24 09:52:54 +0200 | [diff] [blame] | 11 | DISABLE_BIN_GENERATION := 1 |
| 12 | |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 13 | PLAT_INCLUDES := -I${RK_PLAT_COMMON}/ \ |
| 14 | -I${RK_PLAT_COMMON}/include/ \ |
Heiko Stuebner | 385476e | 2019-03-05 13:46:41 +0100 | [diff] [blame] | 15 | -I${RK_PLAT_COMMON}/aarch64/ \ |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 16 | -I${RK_PLAT_COMMON}/drivers/pmu/ \ |
| 17 | -I${RK_PLAT_SOC}/ \ |
| 18 | -I${RK_PLAT_SOC}/drivers/pmu/ \ |
| 19 | -I${RK_PLAT_SOC}/drivers/pwm/ \ |
Xing Zheng | 22a9871 | 2017-02-24 14:56:41 +0800 | [diff] [blame] | 20 | -I${RK_PLAT_SOC}/drivers/secure/ \ |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 21 | -I${RK_PLAT_SOC}/drivers/soc/ \ |
| 22 | -I${RK_PLAT_SOC}/drivers/dram/ \ |
Ziyuan Xu | 48890e2 | 2016-10-27 19:07:35 +0800 | [diff] [blame] | 23 | -I${RK_PLAT_SOC}/drivers/dp/ \ |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 24 | -I${RK_PLAT_SOC}/include/ \ |
Xing Zheng | 93280b7 | 2016-10-26 21:25:26 +0800 | [diff] [blame] | 25 | -I${RK_PLAT_SOC}/include/shared/ \ |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 26 | |
Alexei Fedorov | 84f1b5d | 2020-03-23 18:45:17 +0000 | [diff] [blame] | 27 | # Include GICv3 driver files |
| 28 | include drivers/arm/gic/v3/gicv3.mk |
| 29 | |
| 30 | RK_GIC_SOURCES := ${GICV3_SOURCES} \ |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 31 | plat/common/plat_gicv3.c \ |
| 32 | ${RK_PLAT}/common/rockchip_gicv3.c |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 33 | |
Julius Werner | f1d230c | 2019-05-30 16:57:15 -0700 | [diff] [blame] | 34 | PLAT_BL_COMMON_SOURCES := common/desc_image_load.c \ |
| 35 | lib/bl_aux_params/bl_aux_params.c \ |
Julius Werner | 65d5267 | 2019-05-24 20:37:58 -0700 | [diff] [blame] | 36 | lib/xlat_tables/xlat_tables_common.c \ |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 37 | lib/xlat_tables/aarch64/xlat_tables.c \ |
Antonio Nino Diaz | a64b152 | 2018-10-16 16:39:12 +0100 | [diff] [blame] | 38 | plat/common/aarch64/crash_console_helpers.S \ |
Soby Mathew | f6c4108 | 2016-05-03 12:31:18 +0100 | [diff] [blame] | 39 | plat/common/plat_psci_common.c |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 40 | |
Christoph Müllner | b4660d8 | 2020-11-20 22:06:16 +0100 | [diff] [blame] | 41 | ifneq (${ENABLE_STACK_PROTECTOR},0) |
| 42 | PLAT_BL_COMMON_SOURCES += ${RK_PLAT_COMMON}/rockchip_stack_protector.c |
| 43 | endif |
| 44 | |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 45 | BL31_SOURCES += ${RK_GIC_SOURCES} \ |
| 46 | drivers/arm/cci/cci.c \ |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 47 | drivers/ti/uart/aarch64/16550_console.S \ |
| 48 | drivers/delay_timer/delay_timer.c \ |
| 49 | drivers/delay_timer/generic_delay_timer.c \ |
| 50 | drivers/gpio/gpio.c \ |
| 51 | lib/cpus/aarch64/cortex_a53.S \ |
| 52 | lib/cpus/aarch64/cortex_a72.S \ |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 53 | ${RK_PLAT_COMMON}/aarch64/plat_helpers.S \ |
| 54 | ${RK_PLAT_COMMON}/bl31_plat_setup.c \ |
| 55 | ${RK_PLAT_COMMON}/params_setup.c \ |
Heiko Stuebner | 385476e | 2019-03-05 13:46:41 +0100 | [diff] [blame] | 56 | ${RK_PLAT_COMMON}/aarch64/pmu_sram_cpus_on.S \ |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 57 | ${RK_PLAT_COMMON}/plat_pm.c \ |
| 58 | ${RK_PLAT_COMMON}/plat_topology.c \ |
| 59 | ${RK_PLAT_COMMON}/aarch64/platform_common.c \ |
| 60 | ${RK_PLAT_COMMON}/rockchip_sip_svc.c \ |
| 61 | ${RK_PLAT_SOC}/plat_sip_calls.c \ |
| 62 | ${RK_PLAT_SOC}/drivers/gpio/rk3399_gpio.c \ |
| 63 | ${RK_PLAT_SOC}/drivers/pmu/pmu.c \ |
Andrey Skvortsov | aa93a4a | 2023-12-08 17:07:07 +0300 | [diff] [blame^] | 64 | ${RK_PLAT_SOC}/drivers/pmu/pmu_fw.S \ |
Xing Zheng | 93280b7 | 2016-10-26 21:25:26 +0800 | [diff] [blame] | 65 | ${RK_PLAT_SOC}/drivers/pmu/m0_ctl.c \ |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 66 | ${RK_PLAT_SOC}/drivers/pwm/pwm.c \ |
Xing Zheng | 22a9871 | 2017-02-24 14:56:41 +0800 | [diff] [blame] | 67 | ${RK_PLAT_SOC}/drivers/secure/secure.c \ |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 68 | ${RK_PLAT_SOC}/drivers/soc/soc.c \ |
| 69 | ${RK_PLAT_SOC}/drivers/dram/dfs.c \ |
| 70 | ${RK_PLAT_SOC}/drivers/dram/dram.c \ |
| 71 | ${RK_PLAT_SOC}/drivers/dram/dram_spec_timing.c \ |
| 72 | ${RK_PLAT_SOC}/drivers/dram/suspend.c |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 73 | |
Julius Werner | c708778 | 2017-06-09 15:22:44 -0700 | [diff] [blame] | 74 | include lib/coreboot/coreboot.mk |
Heiko Stuebner | 6fd5b94 | 2019-04-24 20:26:51 +0200 | [diff] [blame] | 75 | include lib/libfdt/libfdt.mk |
Julius Werner | c708778 | 2017-06-09 15:22:44 -0700 | [diff] [blame] | 76 | |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 77 | $(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT)) |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 78 | |
Caesar Wang | e804c10 | 2017-06-28 08:40:26 +0800 | [diff] [blame] | 79 | # Enable workarounds for selected Cortex-A53 erratas. |
| 80 | ERRATA_A53_855873 := 1 |
| 81 | |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 82 | # M0 source build |
| 83 | PLAT_M0 := ${PLAT}m0 |
Julius Werner | 705aeeb | 2016-10-31 19:18:47 -0700 | [diff] [blame] | 84 | BUILD_M0 := ${BUILD_PLAT}/m0 |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 85 | |
Julius Werner | 705aeeb | 2016-10-31 19:18:47 -0700 | [diff] [blame] | 86 | RK3399M0FW=${BUILD_M0}/${PLAT_M0}.bin |
Joshua Watt | 4f2d8ac | 2019-12-13 13:44:55 -0600 | [diff] [blame] | 87 | $(eval $(call add_define_val,RK3399M0FW,\"$(RK3399M0FW)\")) |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 88 | |
Lin Huang | 00960ba | 2018-04-20 15:55:21 +0800 | [diff] [blame] | 89 | RK3399M0PMUFW=${BUILD_M0}/${PLAT_M0}pmu.bin |
Joshua Watt | 4f2d8ac | 2019-12-13 13:44:55 -0600 | [diff] [blame] | 90 | $(eval $(call add_define_val,RK3399M0PMUFW,\"$(RK3399M0PMUFW)\")) |
Lin Huang | 00960ba | 2018-04-20 15:55:21 +0800 | [diff] [blame] | 91 | |
Ziyuan Xu | fea19ed | 2019-10-08 10:27:05 +0800 | [diff] [blame] | 92 | ifdef PLAT_RK_DP_HDCP |
| 93 | BL31_SOURCES += ${RK_PLAT_SOC}/drivers/dp/cdn_dp.c |
| 94 | |
Ziyuan Xu | 48890e2 | 2016-10-27 19:07:35 +0800 | [diff] [blame] | 95 | HDCPFW=${RK_PLAT_SOC}/drivers/dp/hdcp.bin |
Joshua Watt | 4f2d8ac | 2019-12-13 13:44:55 -0600 | [diff] [blame] | 96 | $(eval $(call add_define_val,HDCPFW,\"$(HDCPFW)\")) |
Ziyuan Xu | 48890e2 | 2016-10-27 19:07:35 +0800 | [diff] [blame] | 97 | |
Ziyuan Xu | fea19ed | 2019-10-08 10:27:05 +0800 | [diff] [blame] | 98 | ${BUILD_PLAT}/bl31/cdn_dp.o: CCACHE_EXTRAFILES=$(HDCPFW) |
| 99 | ${RK_PLAT_SOC}/drivers/dp/cdn_dp.c: $(HDCPFW) |
| 100 | endif |
| 101 | |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 102 | # CCACHE_EXTRAFILES is needed because ccache doesn't handle .incbin |
| 103 | export CCACHE_EXTRAFILES |
Lin Huang | 00960ba | 2018-04-20 15:55:21 +0800 | [diff] [blame] | 104 | ${BUILD_PLAT}/bl31/pmu_fw.o: CCACHE_EXTRAFILES=$(RK3399M0FW):$(RK3399M0PMUFW) |
Andrey Skvortsov | aa93a4a | 2023-12-08 17:07:07 +0300 | [diff] [blame^] | 105 | ${RK_PLAT_SOC}/drivers/pmu/pmu_fw.S: $(RK3399M0FW) |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 106 | |
Masahiro Yamada | e2395b4 | 2017-11-04 03:12:28 +0900 | [diff] [blame] | 107 | $(eval $(call MAKE_PREREQ_DIR,${BUILD_M0},${BUILD_PLAT})) |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 108 | .PHONY: $(RK3399M0FW) |
Julius Werner | 705aeeb | 2016-10-31 19:18:47 -0700 | [diff] [blame] | 109 | $(RK3399M0FW): | ${BUILD_M0} |
| 110 | $(MAKE) -C ${RK_PLAT_SOC}/drivers/m0 BUILD=$(abspath ${BUILD_PLAT}/m0) |
David Cunado | c5b0c0f | 2017-10-31 23:19:21 +0000 | [diff] [blame] | 111 | |
| 112 | # Do not enable SVE |
| 113 | ENABLE_SVE_FOR_NS := 0 |