Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 1 | # |
Marcin Wojtas | a86fe0c | 2020-06-02 15:12:06 +0200 | [diff] [blame] | 2 | # Copyright (C) 2016 - 2020 Marvell International Ltd. |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # https://spdx.org/licenses |
| 6 | |
Konstantin Porotchkin | 6ff50d5 | 2018-10-07 17:54:20 +0300 | [diff] [blame] | 7 | include tools/marvell/doimage/doimage.mk |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 8 | |
| 9 | PLAT_FAMILY := a8k |
Grzegorz Jaszczyk | 3039bce | 2019-11-05 13:14:59 +0100 | [diff] [blame] | 10 | PLAT_INCLUDE_BASE := include/plat/marvell/armada/$(PLAT_FAMILY) |
Grzegorz Jaszczyk | 2d3d86a | 2018-12-09 23:11:20 +0100 | [diff] [blame] | 11 | PLAT_COMMON_BASE := plat/marvell/armada/a8k/common |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 12 | MARVELL_DRV_BASE := drivers/marvell |
Grzegorz Jaszczyk | 3039bce | 2019-11-05 13:14:59 +0100 | [diff] [blame] | 13 | MARVELL_COMMON_BASE := plat/marvell/armada/common |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 14 | |
Konstantin Porotchkin | f51f251 | 2018-11-06 12:25:38 +0200 | [diff] [blame] | 15 | MARVELL_SVC_TEST := 0 |
| 16 | $(eval $(call add_define,MARVELL_SVC_TEST)) |
| 17 | |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 18 | ERRATA_A72_859971 := 1 |
| 19 | |
| 20 | # Enable MSS support for a8k family |
| 21 | MSS_SUPPORT := 1 |
| 22 | |
| 23 | # Disable EL3 cache for power management |
Marcin Wojtas | a86fe0c | 2020-06-02 15:12:06 +0200 | [diff] [blame] | 24 | BL31_CACHE_DISABLE := 0 |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 25 | $(eval $(call add_define,BL31_CACHE_DISABLE)) |
| 26 | |
| 27 | $(eval $(call add_define,PCI_EP_SUPPORT)) |
| 28 | $(eval $(call assert_boolean,PCI_EP_SUPPORT)) |
| 29 | |
Grzegorz Jaszczyk | 2ed16f5 | 2018-06-29 18:00:33 +0200 | [diff] [blame] | 30 | AP_NUM := 1 |
| 31 | $(eval $(call add_define,AP_NUM)) |
| 32 | |
Konstantin Porotchkin | 6ff50d5 | 2018-10-07 17:54:20 +0300 | [diff] [blame] | 33 | DOIMAGEPATH ?= tools/marvell/doimage |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 34 | DOIMAGETOOL ?= ${DOIMAGEPATH}/doimage |
| 35 | |
| 36 | ROM_BIN_EXT ?= $(BUILD_PLAT)/ble.bin |
| 37 | DOIMAGE_FLAGS += -b $(ROM_BIN_EXT) $(NAND_DOIMAGE_FLAGS) $(DOIMAGE_SEC_FLAGS) |
| 38 | |
Luka Kovacic | 49358fb | 2020-01-13 20:37:35 +0100 | [diff] [blame] | 39 | # Check whether to build system_power.c for the platform |
| 40 | ifneq ("$(wildcard $(PLAT_FAMILY_BASE)/$(PLAT)/board/system_power.c)","") |
| 41 | SYSTEM_POWER_SUPPORT = 1 |
| 42 | else |
| 43 | SYSTEM_POWER_SUPPORT = 0 |
| 44 | endif |
| 45 | |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 46 | # This define specifies DDR type for BLE |
| 47 | $(eval $(call add_define,CONFIG_DDR4)) |
| 48 | |
| 49 | MARVELL_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \ |
| 50 | drivers/arm/gic/v2/gicv2_main.c \ |
| 51 | drivers/arm/gic/v2/gicv2_helpers.c \ |
| 52 | plat/common/plat_gicv2.c |
| 53 | |
Grzegorz Jaszczyk | 2d3d86a | 2018-12-09 23:11:20 +0100 | [diff] [blame] | 54 | PLAT_INCLUDES := -I$(BOARD_DIR) \ |
Grzegorz Jaszczyk | d3d6a1c | 2019-03-28 16:09:38 +0100 | [diff] [blame] | 55 | -I$(BOARD_DIR)/board \ |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 56 | -I$(PLAT_COMMON_BASE)/include \ |
Antonio Nino Diaz | 50a4d1a | 2019-02-01 12:22:22 +0000 | [diff] [blame] | 57 | -I$(PLAT_INCLUDE_BASE)/common |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 58 | |
| 59 | PLAT_BL_COMMON_SOURCES := $(PLAT_COMMON_BASE)/aarch64/a8k_common.c \ |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 60 | drivers/ti/uart/aarch64/16550_console.S |
| 61 | |
Grzegorz Jaszczyk | 2d3d86a | 2018-12-09 23:11:20 +0100 | [diff] [blame] | 62 | BLE_PORTING_SOURCES := $(BOARD_DIR)/board/dram_port.c \ |
| 63 | $(BOARD_DIR)/board/marvell_plat_config.c |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 64 | |
| 65 | MARVELL_MOCHI_DRV += $(MARVELL_DRV_BASE)/mochi/cp110_setup.c |
| 66 | |
Christine Gharzuzi | 9a772df | 2018-06-25 13:39:37 +0300 | [diff] [blame] | 67 | BLE_SOURCES := drivers/mentor/i2c/mi2cv.c \ |
| 68 | $(PLAT_COMMON_BASE)/plat_ble_setup.c \ |
| 69 | $(MARVELL_MOCHI_DRV) \ |
| 70 | $(PLAT_COMMON_BASE)/plat_pm.c \ |
| 71 | $(MARVELL_DRV_BASE)/ap807_clocks_init.c \ |
| 72 | $(MARVELL_DRV_BASE)/thermal.c \ |
| 73 | $(PLAT_COMMON_BASE)/plat_thermal.c \ |
| 74 | $(BLE_PORTING_SOURCES) \ |
| 75 | $(MARVELL_DRV_BASE)/ccu.c \ |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 76 | $(MARVELL_DRV_BASE)/io_win.c |
| 77 | |
| 78 | BL1_SOURCES += $(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \ |
| 79 | lib/cpus/aarch64/cortex_a72.S |
| 80 | |
| 81 | MARVELL_DRV := $(MARVELL_DRV_BASE)/io_win.c \ |
| 82 | $(MARVELL_DRV_BASE)/iob.c \ |
| 83 | $(MARVELL_DRV_BASE)/mci.c \ |
| 84 | $(MARVELL_DRV_BASE)/amb_adec.c \ |
| 85 | $(MARVELL_DRV_BASE)/ccu.c \ |
| 86 | $(MARVELL_DRV_BASE)/cache_llc.c \ |
Grzegorz Jaszczyk | f47d855 | 2018-06-13 16:00:48 +0200 | [diff] [blame] | 87 | $(MARVELL_DRV_BASE)/comphy/phy-comphy-cp110.c \ |
| 88 | $(MARVELL_DRV_BASE)/mc_trustzone/mc_trustzone.c |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 89 | |
Grzegorz Jaszczyk | 2d3d86a | 2018-12-09 23:11:20 +0100 | [diff] [blame] | 90 | BL31_PORTING_SOURCES := $(BOARD_DIR)/board/marvell_plat_config.c |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 91 | |
Luka Kovacic | 49358fb | 2020-01-13 20:37:35 +0100 | [diff] [blame] | 92 | ifeq ($(SYSTEM_POWER_SUPPORT),1) |
| 93 | BL31_PORTING_SOURCES += $(PLAT_FAMILY_BASE)/$(PLAT)/board/system_power.c |
| 94 | endif |
| 95 | |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 96 | BL31_SOURCES += lib/cpus/aarch64/cortex_a72.S \ |
| 97 | $(PLAT_COMMON_BASE)/aarch64/plat_helpers.S \ |
| 98 | $(PLAT_COMMON_BASE)/aarch64/plat_arch_config.c \ |
| 99 | $(PLAT_COMMON_BASE)/plat_pm.c \ |
| 100 | $(PLAT_COMMON_BASE)/plat_bl31_setup.c \ |
| 101 | $(MARVELL_COMMON_BASE)/marvell_gicv2.c \ |
| 102 | $(MARVELL_COMMON_BASE)/mrvl_sip_svc.c \ |
| 103 | $(MARVELL_COMMON_BASE)/marvell_ddr_info.c \ |
| 104 | $(BL31_PORTING_SOURCES) \ |
| 105 | $(MARVELL_DRV) \ |
| 106 | $(MARVELL_MOCHI_DRV) \ |
| 107 | $(MARVELL_GIC_SOURCES) |
| 108 | |
| 109 | # Add trace functionality for PM |
| 110 | BL31_SOURCES += $(PLAT_COMMON_BASE)/plat_pm_trace.c |
| 111 | |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 112 | # Force builds with BL2 image on a80x0 platforms |
| 113 | ifndef SCP_BL2 |
| 114 | $(error "Error: SCP_BL2 image is mandatory for a8k family") |
| 115 | endif |
| 116 | |
| 117 | # MSS (SCP) build |
| 118 | include $(PLAT_COMMON_BASE)/mss/mss_a8k.mk |
| 119 | |
| 120 | # BLE (ROM context execution code, AKA binary extension) |
Konstantin Porotchkin | 01851db | 2018-10-03 14:21:42 +0300 | [diff] [blame] | 121 | BLE_PATH ?= $(PLAT_COMMON_BASE)/ble |
Konstantin Porotchkin | f69ec58 | 2018-06-07 18:31:14 +0300 | [diff] [blame] | 122 | |
| 123 | include ${BLE_PATH}/ble.mk |
| 124 | $(eval $(call MAKE_BL,e)) |
| 125 | |
| 126 | mrvl_flash: ${BUILD_PLAT}/${FIP_NAME} ${DOIMAGETOOL} ${BUILD_PLAT}/ble.bin |
| 127 | $(shell truncate -s %128K ${BUILD_PLAT}/bl1.bin) |
| 128 | $(shell cat ${BUILD_PLAT}/bl1.bin ${BUILD_PLAT}/${FIP_NAME} > ${BUILD_PLAT}/${BOOT_IMAGE}) |
| 129 | ${DOIMAGETOOL} ${DOIMAGE_FLAGS} ${BUILD_PLAT}/${BOOT_IMAGE} ${BUILD_PLAT}/${FLASH_IMAGE} |
| 130 | |