blob: 3628dc3566c07c653891eb55053e5a171fb02541 [file] [log] [blame]
Tony Xief6118cc2016-01-15 17:17:32 +08001#
2# Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are met:
6#
7# Redistributions of source code must retain the above copyright notice, this
8# list of conditions and the following disclaimer.
9#
10# Redistributions in binary form must reproduce the above copyright notice,
11# this list of conditions and the following disclaimer in the documentation
12# and/or other materials provided with the distribution.
13#
14# Neither the name of ARM nor the names of its contributors may be used
15# to endorse or promote products derived from this software without specific
16# prior written permission.
17#
18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28# POSSIBILITY OF SUCH DAMAGE.
29#
30
31RK_PLAT := plat/rockchip
32RK_PLAT_SOC := ${RK_PLAT}/${PLAT}
33RK_PLAT_COMMON := ${RK_PLAT}/common
34
35PLAT_INCLUDES := -I${RK_PLAT_COMMON}/ \
36 -I${RK_PLAT_COMMON}/include/ \
37 -I${RK_PLAT_COMMON}/pmusram \
38 -I${RK_PLAT_COMMON}/drivers/pmu/ \
39 -I${RK_PLAT_SOC}/ \
40 -I${RK_PLAT_SOC}/drivers/pmu/ \
Caesar Wanged6b9a52016-08-11 02:11:45 +080041 -I${RK_PLAT_SOC}/drivers/pwm/ \
Tony Xief6118cc2016-01-15 17:17:32 +080042 -I${RK_PLAT_SOC}/drivers/soc/ \
Caesar Wang9740bba2016-08-25 08:37:42 +080043 -I${RK_PLAT_SOC}/drivers/dram/ \
Tony Xief6118cc2016-01-15 17:17:32 +080044 -I${RK_PLAT_SOC}/include/ \
45
46RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
47 drivers/arm/gic/v3/gicv3_main.c \
48 drivers/arm/gic/v3/gicv3_helpers.c \
49 plat/common/plat_gicv3.c \
50 ${RK_PLAT}/common/rockchip_gicv3.c
51
Soby Mathewcc037c12016-04-08 16:42:58 +010052PLAT_BL_COMMON_SOURCES := lib/xlat_tables/xlat_tables_common.c \
53 lib/xlat_tables/aarch64/xlat_tables.c \
Tony Xief6118cc2016-01-15 17:17:32 +080054 plat/common/aarch64/plat_common.c \
Soby Mathewf6c41082016-05-03 12:31:18 +010055 plat/common/plat_psci_common.c
Tony Xief6118cc2016-01-15 17:17:32 +080056
57BL31_SOURCES += ${RK_GIC_SOURCES} \
58 drivers/arm/cci/cci.c \
Soby Mathew17231132016-08-08 12:33:06 +010059 drivers/console/aarch64/console.S \
60 drivers/ti/uart/aarch64/16550_console.S \
Tony Xief6118cc2016-01-15 17:17:32 +080061 drivers/delay_timer/delay_timer.c \
Antonio Nino Diaz2361fcc2016-05-05 15:25:02 +010062 drivers/delay_timer/generic_delay_timer.c \
Caesar Wang038f6aa2016-05-25 19:21:43 +080063 drivers/gpio/gpio.c \
Tony Xief6118cc2016-01-15 17:17:32 +080064 lib/cpus/aarch64/cortex_a53.S \
65 lib/cpus/aarch64/cortex_a72.S \
66 plat/common/aarch64/platform_mp_stack.S \
67 ${RK_PLAT_COMMON}/aarch64/plat_helpers.S \
68 ${RK_PLAT_COMMON}/bl31_plat_setup.c \
Caesar Wang3e3c5b02016-05-25 19:03:04 +080069 ${RK_PLAT_COMMON}/params_setup.c \
Tony Xief6118cc2016-01-15 17:17:32 +080070 ${RK_PLAT_COMMON}/pmusram/pmu_sram_cpus_on.S \
71 ${RK_PLAT_COMMON}/pmusram/pmu_sram.c \
Tony Xief6118cc2016-01-15 17:17:32 +080072 ${RK_PLAT_COMMON}/plat_pm.c \
73 ${RK_PLAT_COMMON}/plat_topology.c \
74 ${RK_PLAT_COMMON}/aarch64/platform_common.c \
Caesar Wangc1bf6462016-06-21 14:44:01 +080075 ${RK_PLAT_COMMON}/rockchip_sip_svc.c \
76 ${RK_PLAT_SOC}/plat_sip_calls.c \
Caesar Wang038f6aa2016-05-25 19:21:43 +080077 ${RK_PLAT_SOC}/drivers/gpio/rk3399_gpio.c \
Tony Xief6118cc2016-01-15 17:17:32 +080078 ${RK_PLAT_SOC}/drivers/pmu/pmu.c \
Caesar Wangb4003742016-10-12 08:10:12 +080079 ${RK_PLAT_SOC}/drivers/pmu/pmu_fw.c \
Caesar Wanged6b9a52016-08-11 02:11:45 +080080 ${RK_PLAT_SOC}/drivers/pwm/pwm.c \
Caesar Wang9740bba2016-08-25 08:37:42 +080081 ${RK_PLAT_SOC}/drivers/soc/soc.c \
Caesar Wanga8456902016-10-27 01:12:34 +080082 ${RK_PLAT_SOC}/drivers/dram/dfs.c \
Caesar Wangf33eb2c2016-10-27 01:13:16 +080083 ${RK_PLAT_SOC}/drivers/dram/suspend.c \
Caesar Wang9740bba2016-08-25 08:37:42 +080084 ${RK_PLAT_SOC}/drivers/dram/dram.c \
85 ${RK_PLAT_SOC}/drivers/dram/dram_spec_timing.c
Tony Xief6118cc2016-01-15 17:17:32 +080086
87ENABLE_PLAT_COMPAT := 0
Caesar Wangd90f43e2016-10-11 09:36:00 +080088
89$(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT))
Caesar Wangb4003742016-10-12 08:10:12 +080090
91# M0 source build
92PLAT_M0 := ${PLAT}m0
Julius Werner705aeeb2016-10-31 19:18:47 -070093BUILD_M0 := ${BUILD_PLAT}/m0
Caesar Wangb4003742016-10-12 08:10:12 +080094
Julius Werner705aeeb2016-10-31 19:18:47 -070095RK3399M0FW=${BUILD_M0}/${PLAT_M0}.bin
Caesar Wangb4003742016-10-12 08:10:12 +080096$(eval $(call add_define,RK3399M0FW))
97
98# CCACHE_EXTRAFILES is needed because ccache doesn't handle .incbin
99export CCACHE_EXTRAFILES
100${BUILD_PLAT}/bl31/pmu_fw.o: CCACHE_EXTRAFILES=$(RK3399M0FW)
101${RK_PLAT_SOC}/drivers/pmu/pmu_fw.c: $(RK3399M0FW)
102
Julius Werner705aeeb2016-10-31 19:18:47 -0700103$(eval $(call MAKE_PREREQ_DIR,${BUILD_M0},))
Caesar Wangb4003742016-10-12 08:10:12 +0800104.PHONY: $(RK3399M0FW)
Julius Werner705aeeb2016-10-31 19:18:47 -0700105$(RK3399M0FW): | ${BUILD_M0}
106 $(MAKE) -C ${RK_PLAT_SOC}/drivers/m0 BUILD=$(abspath ${BUILD_PLAT}/m0)