blob: c73df6d767e3fcc1831391ef46cc723a4fc37d22 [file] [log] [blame]
Tony Xief6118cc2016-01-15 17:17:32 +08001#
dp-arm230011c2017-03-07 11:02:47 +00002# Copyright (c) 2016-2017, 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
Derek Basehoreb9be54b2016-10-20 16:19:22 -070011PLAT_INCLUDES := -I${RK_PLAT_COMMON}/ \
12 -I${RK_PLAT_COMMON}/include/ \
Heiko Stuebner385476e2019-03-05 13:46:41 +010013 -I${RK_PLAT_COMMON}/aarch64/ \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070014 -I${RK_PLAT_COMMON}/drivers/pmu/ \
15 -I${RK_PLAT_SOC}/ \
16 -I${RK_PLAT_SOC}/drivers/pmu/ \
17 -I${RK_PLAT_SOC}/drivers/pwm/ \
Xing Zheng22a98712017-02-24 14:56:41 +080018 -I${RK_PLAT_SOC}/drivers/secure/ \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070019 -I${RK_PLAT_SOC}/drivers/soc/ \
20 -I${RK_PLAT_SOC}/drivers/dram/ \
Ziyuan Xu48890e22016-10-27 19:07:35 +080021 -I${RK_PLAT_SOC}/drivers/dp/ \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070022 -I${RK_PLAT_SOC}/include/ \
Xing Zheng93280b72016-10-26 21:25:26 +080023 -I${RK_PLAT_SOC}/include/shared/ \
Tony Xief6118cc2016-01-15 17:17:32 +080024
Derek Basehoreb9be54b2016-10-20 16:19:22 -070025RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
Derek Basehore2707c3d2018-01-23 17:18:57 -080026 drivers/arm/gic/v3/arm_gicv3_common.c \
27 drivers/arm/gic/v3/gic500.c \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070028 drivers/arm/gic/v3/gicv3_main.c \
29 drivers/arm/gic/v3/gicv3_helpers.c \
30 plat/common/plat_gicv3.c \
31 ${RK_PLAT}/common/rockchip_gicv3.c
Tony Xief6118cc2016-01-15 17:17:32 +080032
Derek Basehoreb9be54b2016-10-20 16:19:22 -070033PLAT_BL_COMMON_SOURCES := lib/xlat_tables/xlat_tables_common.c \
34 lib/xlat_tables/aarch64/xlat_tables.c \
Antonio Nino Diaza64b1522018-10-16 16:39:12 +010035 plat/common/aarch64/crash_console_helpers.S \
Soby Mathewf6c41082016-05-03 12:31:18 +010036 plat/common/plat_psci_common.c
Tony Xief6118cc2016-01-15 17:17:32 +080037
Derek Basehoreb9be54b2016-10-20 16:19:22 -070038BL31_SOURCES += ${RK_GIC_SOURCES} \
39 drivers/arm/cci/cci.c \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070040 drivers/ti/uart/aarch64/16550_console.S \
41 drivers/delay_timer/delay_timer.c \
42 drivers/delay_timer/generic_delay_timer.c \
43 drivers/gpio/gpio.c \
44 lib/cpus/aarch64/cortex_a53.S \
45 lib/cpus/aarch64/cortex_a72.S \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070046 ${RK_PLAT_COMMON}/aarch64/plat_helpers.S \
47 ${RK_PLAT_COMMON}/bl31_plat_setup.c \
48 ${RK_PLAT_COMMON}/params_setup.c \
Heiko Stuebner385476e2019-03-05 13:46:41 +010049 ${RK_PLAT_COMMON}/aarch64/pmu_sram_cpus_on.S \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070050 ${RK_PLAT_COMMON}/plat_pm.c \
51 ${RK_PLAT_COMMON}/plat_topology.c \
52 ${RK_PLAT_COMMON}/aarch64/platform_common.c \
53 ${RK_PLAT_COMMON}/rockchip_sip_svc.c \
54 ${RK_PLAT_SOC}/plat_sip_calls.c \
Ziyuan Xu48890e22016-10-27 19:07:35 +080055 ${RK_PLAT_SOC}/drivers/dp/cdn_dp.c \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070056 ${RK_PLAT_SOC}/drivers/gpio/rk3399_gpio.c \
57 ${RK_PLAT_SOC}/drivers/pmu/pmu.c \
58 ${RK_PLAT_SOC}/drivers/pmu/pmu_fw.c \
Xing Zheng93280b72016-10-26 21:25:26 +080059 ${RK_PLAT_SOC}/drivers/pmu/m0_ctl.c \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070060 ${RK_PLAT_SOC}/drivers/pwm/pwm.c \
Xing Zheng22a98712017-02-24 14:56:41 +080061 ${RK_PLAT_SOC}/drivers/secure/secure.c \
Derek Basehoreb9be54b2016-10-20 16:19:22 -070062 ${RK_PLAT_SOC}/drivers/soc/soc.c \
63 ${RK_PLAT_SOC}/drivers/dram/dfs.c \
64 ${RK_PLAT_SOC}/drivers/dram/dram.c \
65 ${RK_PLAT_SOC}/drivers/dram/dram_spec_timing.c \
66 ${RK_PLAT_SOC}/drivers/dram/suspend.c
Tony Xief6118cc2016-01-15 17:17:32 +080067
Julius Wernerf39c8062017-08-02 16:31:04 -070068MULTI_CONSOLE_API := 1
Caesar Wangd90f43e2016-10-11 09:36:00 +080069
Julius Wernerc7087782017-06-09 15:22:44 -070070include lib/coreboot/coreboot.mk
Heiko Stuebner6fd5b942019-04-24 20:26:51 +020071include lib/libfdt/libfdt.mk
Julius Wernerc7087782017-06-09 15:22:44 -070072
Caesar Wangd90f43e2016-10-11 09:36:00 +080073$(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT))
Caesar Wangb4003742016-10-12 08:10:12 +080074
Caesar Wange804c102017-06-28 08:40:26 +080075# Enable workarounds for selected Cortex-A53 erratas.
76ERRATA_A53_855873 := 1
77
Caesar Wangb4003742016-10-12 08:10:12 +080078# M0 source build
79PLAT_M0 := ${PLAT}m0
Julius Werner705aeeb2016-10-31 19:18:47 -070080BUILD_M0 := ${BUILD_PLAT}/m0
Caesar Wangb4003742016-10-12 08:10:12 +080081
Julius Werner705aeeb2016-10-31 19:18:47 -070082RK3399M0FW=${BUILD_M0}/${PLAT_M0}.bin
Caesar Wangb4003742016-10-12 08:10:12 +080083$(eval $(call add_define,RK3399M0FW))
84
Lin Huang00960ba2018-04-20 15:55:21 +080085RK3399M0PMUFW=${BUILD_M0}/${PLAT_M0}pmu.bin
86$(eval $(call add_define,RK3399M0PMUFW))
87
Ziyuan Xu48890e22016-10-27 19:07:35 +080088HDCPFW=${RK_PLAT_SOC}/drivers/dp/hdcp.bin
89$(eval $(call add_define,HDCPFW))
90
Caesar Wangb4003742016-10-12 08:10:12 +080091# CCACHE_EXTRAFILES is needed because ccache doesn't handle .incbin
92export CCACHE_EXTRAFILES
Lin Huang00960ba2018-04-20 15:55:21 +080093${BUILD_PLAT}/bl31/pmu_fw.o: CCACHE_EXTRAFILES=$(RK3399M0FW):$(RK3399M0PMUFW)
Caesar Wangb4003742016-10-12 08:10:12 +080094${RK_PLAT_SOC}/drivers/pmu/pmu_fw.c: $(RK3399M0FW)
95
Ziyuan Xu48890e22016-10-27 19:07:35 +080096${BUILD_PLAT}/bl31/cdn_dp.o: CCACHE_EXTRAFILES=$(HDCPFW)
97${RK_PLAT_SOC}/drivers/dp/cdn_dp.c: $(HDCPFW)
98
Masahiro Yamadae2395b42017-11-04 03:12:28 +090099$(eval $(call MAKE_PREREQ_DIR,${BUILD_M0},${BUILD_PLAT}))
Caesar Wangb4003742016-10-12 08:10:12 +0800100.PHONY: $(RK3399M0FW)
Julius Werner705aeeb2016-10-31 19:18:47 -0700101$(RK3399M0FW): | ${BUILD_M0}
102 $(MAKE) -C ${RK_PLAT_SOC}/drivers/m0 BUILD=$(abspath ${BUILD_PLAT}/m0)
David Cunadoc5b0c0f2017-10-31 23:19:21 +0000103
104# Do not enable SVE
105ENABLE_SVE_FOR_NS := 0