blob: 2394dcea91464f1c9acc6832ef5f4682d0b2fa8d [file] [log] [blame]
Tony Xief6118cc2016-01-15 17:17:32 +08001#
Andrey Skvortsovaa93a4a2023-12-08 17:07:07 +03002# Copyright (c) 2016-2024, ARM Limited and Contributors. All rights reserved.
Tony Xief6118cc2016-01-15 17:17:32 +08003#
dp-armfa3cf0b2017-05-03 09:38:09 +01004# SPDX-License-Identifier: BSD-3-Clause
Tony Xief6118cc2016-01-15 17:17:32 +08005#
6
Derek Basehoreb9be54b2016-10-20 16:19:22 -07007RK_PLAT := plat/rockchip
8RK_PLAT_SOC := ${RK_PLAT}/${PLAT}
9RK_PLAT_COMMON := ${RK_PLAT}/common
Tony Xief6118cc2016-01-15 17:17:32 +080010
Christoph Müllner05ceda72019-04-24 09:52:54 +020011DISABLE_BIN_GENERATION := 1
12
Derek Basehoreb9be54b2016-10-20 16:19:22 -070013PLAT_INCLUDES := -I${RK_PLAT_COMMON}/ \
14 -I${RK_PLAT_COMMON}/include/ \
Heiko Stuebner385476e2019-03-05 13:46:41 +010015 -I${RK_PLAT_COMMON}/aarch64/ \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070016 -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 Zheng22a98712017-02-24 14:56:41 +080020 -I${RK_PLAT_SOC}/drivers/secure/ \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070021 -I${RK_PLAT_SOC}/drivers/soc/ \
22 -I${RK_PLAT_SOC}/drivers/dram/ \
Ziyuan Xu48890e22016-10-27 19:07:35 +080023 -I${RK_PLAT_SOC}/drivers/dp/ \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070024 -I${RK_PLAT_SOC}/include/ \
Xing Zheng93280b72016-10-26 21:25:26 +080025 -I${RK_PLAT_SOC}/include/shared/ \
Tony Xief6118cc2016-01-15 17:17:32 +080026
Alexei Fedorov84f1b5d2020-03-23 18:45:17 +000027# Include GICv3 driver files
28include drivers/arm/gic/v3/gicv3.mk
29
30RK_GIC_SOURCES := ${GICV3_SOURCES} \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070031 plat/common/plat_gicv3.c \
32 ${RK_PLAT}/common/rockchip_gicv3.c
Tony Xief6118cc2016-01-15 17:17:32 +080033
Julius Wernerf1d230c2019-05-30 16:57:15 -070034PLAT_BL_COMMON_SOURCES := common/desc_image_load.c \
35 lib/bl_aux_params/bl_aux_params.c \
Julius Werner65d52672019-05-24 20:37:58 -070036 lib/xlat_tables/xlat_tables_common.c \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070037 lib/xlat_tables/aarch64/xlat_tables.c \
Antonio Nino Diaza64b1522018-10-16 16:39:12 +010038 plat/common/aarch64/crash_console_helpers.S \
Soby Mathewf6c41082016-05-03 12:31:18 +010039 plat/common/plat_psci_common.c
Tony Xief6118cc2016-01-15 17:17:32 +080040
Christoph Müllnerb4660d82020-11-20 22:06:16 +010041ifneq (${ENABLE_STACK_PROTECTOR},0)
42PLAT_BL_COMMON_SOURCES += ${RK_PLAT_COMMON}/rockchip_stack_protector.c
43endif
44
Derek Basehoreb9be54b2016-10-20 16:19:22 -070045BL31_SOURCES += ${RK_GIC_SOURCES} \
46 drivers/arm/cci/cci.c \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070047 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 Basehoreb9be54b2016-10-20 16:19:22 -070053 ${RK_PLAT_COMMON}/aarch64/plat_helpers.S \
54 ${RK_PLAT_COMMON}/bl31_plat_setup.c \
55 ${RK_PLAT_COMMON}/params_setup.c \
Heiko Stuebner385476e2019-03-05 13:46:41 +010056 ${RK_PLAT_COMMON}/aarch64/pmu_sram_cpus_on.S \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070057 ${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 Skvortsovaa93a4a2023-12-08 17:07:07 +030064 ${RK_PLAT_SOC}/drivers/pmu/pmu_fw.S \
Xing Zheng93280b72016-10-26 21:25:26 +080065 ${RK_PLAT_SOC}/drivers/pmu/m0_ctl.c \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070066 ${RK_PLAT_SOC}/drivers/pwm/pwm.c \
Xing Zheng22a98712017-02-24 14:56:41 +080067 ${RK_PLAT_SOC}/drivers/secure/secure.c \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070068 ${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 Xief6118cc2016-01-15 17:17:32 +080073
Julius Wernerc7087782017-06-09 15:22:44 -070074include lib/coreboot/coreboot.mk
Heiko Stuebner6fd5b942019-04-24 20:26:51 +020075include lib/libfdt/libfdt.mk
Julius Wernerc7087782017-06-09 15:22:44 -070076
Caesar Wangd90f43e2016-10-11 09:36:00 +080077$(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT))
Caesar Wangb4003742016-10-12 08:10:12 +080078
Caesar Wange804c102017-06-28 08:40:26 +080079# Enable workarounds for selected Cortex-A53 erratas.
80ERRATA_A53_855873 := 1
81
Caesar Wangb4003742016-10-12 08:10:12 +080082# M0 source build
83PLAT_M0 := ${PLAT}m0
Julius Werner705aeeb2016-10-31 19:18:47 -070084BUILD_M0 := ${BUILD_PLAT}/m0
Caesar Wangb4003742016-10-12 08:10:12 +080085
Julius Werner705aeeb2016-10-31 19:18:47 -070086RK3399M0FW=${BUILD_M0}/${PLAT_M0}.bin
Joshua Watt4f2d8ac2019-12-13 13:44:55 -060087$(eval $(call add_define_val,RK3399M0FW,\"$(RK3399M0FW)\"))
Caesar Wangb4003742016-10-12 08:10:12 +080088
Lin Huang00960ba2018-04-20 15:55:21 +080089RK3399M0PMUFW=${BUILD_M0}/${PLAT_M0}pmu.bin
Joshua Watt4f2d8ac2019-12-13 13:44:55 -060090$(eval $(call add_define_val,RK3399M0PMUFW,\"$(RK3399M0PMUFW)\"))
Lin Huang00960ba2018-04-20 15:55:21 +080091
Ziyuan Xufea19ed2019-10-08 10:27:05 +080092ifdef PLAT_RK_DP_HDCP
93BL31_SOURCES += ${RK_PLAT_SOC}/drivers/dp/cdn_dp.c
94
Ziyuan Xu48890e22016-10-27 19:07:35 +080095HDCPFW=${RK_PLAT_SOC}/drivers/dp/hdcp.bin
Joshua Watt4f2d8ac2019-12-13 13:44:55 -060096$(eval $(call add_define_val,HDCPFW,\"$(HDCPFW)\"))
Ziyuan Xu48890e22016-10-27 19:07:35 +080097
Ziyuan Xufea19ed2019-10-08 10:27:05 +080098${BUILD_PLAT}/bl31/cdn_dp.o: CCACHE_EXTRAFILES=$(HDCPFW)
99${RK_PLAT_SOC}/drivers/dp/cdn_dp.c: $(HDCPFW)
100endif
101
Caesar Wangb4003742016-10-12 08:10:12 +0800102# CCACHE_EXTRAFILES is needed because ccache doesn't handle .incbin
103export CCACHE_EXTRAFILES
Lin Huang00960ba2018-04-20 15:55:21 +0800104${BUILD_PLAT}/bl31/pmu_fw.o: CCACHE_EXTRAFILES=$(RK3399M0FW):$(RK3399M0PMUFW)
Andrey Skvortsovaa93a4a2023-12-08 17:07:07 +0300105${RK_PLAT_SOC}/drivers/pmu/pmu_fw.S: $(RK3399M0FW)
Caesar Wangb4003742016-10-12 08:10:12 +0800106
Masahiro Yamadae2395b42017-11-04 03:12:28 +0900107$(eval $(call MAKE_PREREQ_DIR,${BUILD_M0},${BUILD_PLAT}))
Caesar Wangb4003742016-10-12 08:10:12 +0800108.PHONY: $(RK3399M0FW)
Julius Werner705aeeb2016-10-31 19:18:47 -0700109$(RK3399M0FW): | ${BUILD_M0}
110 $(MAKE) -C ${RK_PLAT_SOC}/drivers/m0 BUILD=$(abspath ${BUILD_PLAT}/m0)
David Cunadoc5b0c0f2017-10-31 23:19:21 +0000111
112# Do not enable SVE
113ENABLE_SVE_FOR_NS := 0