Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 1 | # |
| 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 | |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 31 | RK_PLAT := plat/rockchip |
| 32 | RK_PLAT_SOC := ${RK_PLAT}/${PLAT} |
| 33 | RK_PLAT_COMMON := ${RK_PLAT}/common |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 34 | |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 35 | PLAT_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/ \ |
| 41 | -I${RK_PLAT_SOC}/drivers/pwm/ \ |
Xing Zheng | 22a9871 | 2017-02-24 14:56:41 +0800 | [diff] [blame] | 42 | -I${RK_PLAT_SOC}/drivers/secure/ \ |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 43 | -I${RK_PLAT_SOC}/drivers/soc/ \ |
| 44 | -I${RK_PLAT_SOC}/drivers/dram/ \ |
| 45 | -I${RK_PLAT_SOC}/include/ \ |
Xing Zheng | 93280b7 | 2016-10-26 21:25:26 +0800 | [diff] [blame] | 46 | -I${RK_PLAT_SOC}/include/shared/ \ |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 47 | |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 48 | RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \ |
| 49 | drivers/arm/gic/v3/gicv3_main.c \ |
| 50 | drivers/arm/gic/v3/gicv3_helpers.c \ |
| 51 | plat/common/plat_gicv3.c \ |
| 52 | ${RK_PLAT}/common/rockchip_gicv3.c |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 53 | |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 54 | PLAT_BL_COMMON_SOURCES := lib/xlat_tables/xlat_tables_common.c \ |
| 55 | lib/xlat_tables/aarch64/xlat_tables.c \ |
| 56 | plat/common/aarch64/plat_common.c \ |
Soby Mathew | f6c4108 | 2016-05-03 12:31:18 +0100 | [diff] [blame] | 57 | plat/common/plat_psci_common.c |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 58 | |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 59 | BL31_SOURCES += ${RK_GIC_SOURCES} \ |
| 60 | drivers/arm/cci/cci.c \ |
| 61 | drivers/console/aarch64/console.S \ |
| 62 | drivers/ti/uart/aarch64/16550_console.S \ |
| 63 | drivers/delay_timer/delay_timer.c \ |
| 64 | drivers/delay_timer/generic_delay_timer.c \ |
| 65 | drivers/gpio/gpio.c \ |
| 66 | lib/cpus/aarch64/cortex_a53.S \ |
| 67 | lib/cpus/aarch64/cortex_a72.S \ |
| 68 | plat/common/aarch64/platform_mp_stack.S \ |
| 69 | ${RK_PLAT_COMMON}/aarch64/plat_helpers.S \ |
| 70 | ${RK_PLAT_COMMON}/bl31_plat_setup.c \ |
| 71 | ${RK_PLAT_COMMON}/params_setup.c \ |
| 72 | ${RK_PLAT_COMMON}/pmusram/pmu_sram_cpus_on.S \ |
| 73 | ${RK_PLAT_COMMON}/pmusram/pmu_sram.c \ |
| 74 | ${RK_PLAT_COMMON}/plat_pm.c \ |
| 75 | ${RK_PLAT_COMMON}/plat_topology.c \ |
| 76 | ${RK_PLAT_COMMON}/aarch64/platform_common.c \ |
| 77 | ${RK_PLAT_COMMON}/rockchip_sip_svc.c \ |
| 78 | ${RK_PLAT_SOC}/plat_sip_calls.c \ |
| 79 | ${RK_PLAT_SOC}/drivers/gpio/rk3399_gpio.c \ |
| 80 | ${RK_PLAT_SOC}/drivers/pmu/pmu.c \ |
| 81 | ${RK_PLAT_SOC}/drivers/pmu/pmu_fw.c \ |
Xing Zheng | 93280b7 | 2016-10-26 21:25:26 +0800 | [diff] [blame] | 82 | ${RK_PLAT_SOC}/drivers/pmu/m0_ctl.c \ |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 83 | ${RK_PLAT_SOC}/drivers/pwm/pwm.c \ |
Xing Zheng | 22a9871 | 2017-02-24 14:56:41 +0800 | [diff] [blame] | 84 | ${RK_PLAT_SOC}/drivers/secure/secure.c \ |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 85 | ${RK_PLAT_SOC}/drivers/soc/soc.c \ |
| 86 | ${RK_PLAT_SOC}/drivers/dram/dfs.c \ |
| 87 | ${RK_PLAT_SOC}/drivers/dram/dram.c \ |
| 88 | ${RK_PLAT_SOC}/drivers/dram/dram_spec_timing.c \ |
| 89 | ${RK_PLAT_SOC}/drivers/dram/suspend.c |
Tony Xie | f6118cc | 2016-01-15 17:17:32 +0800 | [diff] [blame] | 90 | |
Derek Basehore | b9be54b | 2016-10-20 16:19:22 -0700 | [diff] [blame] | 91 | ENABLE_PLAT_COMPAT := 0 |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 92 | |
| 93 | $(eval $(call add_define,PLAT_EXTRA_LD_SCRIPT)) |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 94 | |
| 95 | # M0 source build |
| 96 | PLAT_M0 := ${PLAT}m0 |
Julius Werner | 705aeeb | 2016-10-31 19:18:47 -0700 | [diff] [blame] | 97 | BUILD_M0 := ${BUILD_PLAT}/m0 |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 98 | |
Julius Werner | 705aeeb | 2016-10-31 19:18:47 -0700 | [diff] [blame] | 99 | RK3399M0FW=${BUILD_M0}/${PLAT_M0}.bin |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 100 | $(eval $(call add_define,RK3399M0FW)) |
| 101 | |
| 102 | # CCACHE_EXTRAFILES is needed because ccache doesn't handle .incbin |
| 103 | export CCACHE_EXTRAFILES |
| 104 | ${BUILD_PLAT}/bl31/pmu_fw.o: CCACHE_EXTRAFILES=$(RK3399M0FW) |
| 105 | ${RK_PLAT_SOC}/drivers/pmu/pmu_fw.c: $(RK3399M0FW) |
| 106 | |
Julius Werner | 705aeeb | 2016-10-31 19:18:47 -0700 | [diff] [blame] | 107 | $(eval $(call MAKE_PREREQ_DIR,${BUILD_M0},)) |
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) |