2019-10-25 15:24:38 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2019 Sartura Ltd.
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
2021-06-08 02:19:59 +00:00
|
|
|
PKG_VERSION:=2.5
|
|
|
|
PKG_RELEASE:=$(AUTORELEASE)
|
|
|
|
PKG_HASH:=ad8a2ffcbcd12d919723da07630fc0840c3c2fba7656d1462e45488e42995d7c
|
2019-10-25 15:24:38 +00:00
|
|
|
|
|
|
|
PKG_MAINTAINER:=Vladimir Vid <vladimir.vid@sartura.hr>
|
|
|
|
|
2020-09-23 01:25:30 +00:00
|
|
|
include $(INCLUDE_DIR)/trusted-firmware-a.mk
|
2019-10-25 15:24:38 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
2020-09-23 01:25:30 +00:00
|
|
|
define Trusted-Firmware-A/Default
|
|
|
|
BUILD_TARGET:=mvebu
|
|
|
|
BUILD_SUBTARGET:=cortexa53
|
2021-01-17 07:37:58 +00:00
|
|
|
TFA_IMAGE:=flash-image.bin uart-images.tgz.bin
|
2020-09-23 01:25:30 +00:00
|
|
|
UBOOT:=
|
|
|
|
DDR_TOPOLOGY:=
|
|
|
|
CLOCKSPRESET:=
|
2019-10-25 15:24:38 +00:00
|
|
|
endef
|
|
|
|
|
2020-09-23 01:25:30 +00:00
|
|
|
|
|
|
|
define Trusted-Firmware-A/espressobin-512mb
|
|
|
|
NAME:=Marvell ESPRESSObin (512MB)
|
2019-11-02 12:14:08 +00:00
|
|
|
DEPENDS:=+u-boot-espressobin
|
2020-09-23 01:25:30 +00:00
|
|
|
BUILD_DEVICES:=globalscale_espressobin
|
2019-11-02 12:14:08 +00:00
|
|
|
UBOOT:=espressobin
|
|
|
|
DDR_TOPOLOGY:=0
|
2021-01-17 07:38:53 +00:00
|
|
|
CLOCKSPRESET:=CPU_1000_DDR_800
|
2019-11-02 12:14:08 +00:00
|
|
|
PLAT:=a3700
|
|
|
|
endef
|
|
|
|
|
2020-09-23 01:25:30 +00:00
|
|
|
define Trusted-Firmware-A/espressobin-v3-v5-1gb-1cs
|
|
|
|
NAME:=Marvell ESPRESSObin V3-V5 (1GB 1CS)
|
2019-11-02 12:14:08 +00:00
|
|
|
DEPENDS:=+u-boot-espressobin
|
2020-09-23 01:25:30 +00:00
|
|
|
BUILD_DEVICES:=globalscale_espressobin
|
2019-11-02 12:14:08 +00:00
|
|
|
UBOOT:=espressobin
|
2020-10-06 15:28:31 +00:00
|
|
|
DDR_TOPOLOGY:=4
|
2021-01-17 07:38:53 +00:00
|
|
|
CLOCKSPRESET:=CPU_1000_DDR_800
|
2019-11-02 12:14:08 +00:00
|
|
|
PLAT:=a3700
|
|
|
|
endef
|
|
|
|
|
2020-09-23 01:25:30 +00:00
|
|
|
define Trusted-Firmware-A/espressobin-v3-v5-1gb-2cs
|
|
|
|
NAME:=Marvell ESPRESSObin V3-V5 (1GB, 2CS)
|
2019-11-02 12:14:08 +00:00
|
|
|
DEPENDS:=+u-boot-espressobin
|
2020-09-23 01:25:30 +00:00
|
|
|
BUILD_DEVICES:=globalscale_espressobin
|
2019-11-02 12:14:08 +00:00
|
|
|
UBOOT:=espressobin
|
|
|
|
DDR_TOPOLOGY:=2
|
2021-01-17 07:38:53 +00:00
|
|
|
CLOCKSPRESET:=CPU_1000_DDR_800
|
2019-11-02 12:14:08 +00:00
|
|
|
PLAT:=a3700
|
|
|
|
endef
|
|
|
|
|
2020-09-23 01:25:30 +00:00
|
|
|
define Trusted-Firmware-A/espressobin-v3-v5-2gb
|
|
|
|
NAME:=Marvell ESPRESSObin V3-V5 (2GB)
|
2019-11-02 12:14:08 +00:00
|
|
|
DEPENDS:=+u-boot-espressobin
|
2020-09-23 01:25:30 +00:00
|
|
|
BUILD_DEVICES:=globalscale_espressobin
|
2019-11-02 12:14:08 +00:00
|
|
|
UBOOT:=espressobin
|
|
|
|
DDR_TOPOLOGY:=7
|
2021-01-17 07:38:53 +00:00
|
|
|
CLOCKSPRESET:=CPU_1000_DDR_800
|
2019-11-02 12:14:08 +00:00
|
|
|
PLAT:=a3700
|
|
|
|
endef
|
|
|
|
|
2020-09-23 01:25:30 +00:00
|
|
|
define Trusted-Firmware-A/espressobin-v7-1gb
|
|
|
|
NAME:=Marvell ESPRESSObin V7 (1GB)
|
2019-11-02 12:14:08 +00:00
|
|
|
DEPENDS:=+u-boot-espressobin
|
2020-09-23 01:25:30 +00:00
|
|
|
BUILD_DEVICES:=globalscale_espressobin-v7
|
2019-11-02 12:14:08 +00:00
|
|
|
UBOOT:=espressobin
|
|
|
|
DDR_TOPOLOGY:=5
|
2021-01-17 07:38:53 +00:00
|
|
|
CLOCKSPRESET:=CPU_1000_DDR_800
|
2019-11-02 12:14:08 +00:00
|
|
|
PLAT:=a3700
|
|
|
|
endef
|
|
|
|
|
2020-09-23 01:25:30 +00:00
|
|
|
define Trusted-Firmware-A/espressobin-v7-2gb
|
|
|
|
NAME:=Marvell ESPRESSObin V7 (2GB)
|
2019-11-02 12:14:08 +00:00
|
|
|
DEPENDS:=+u-boot-espressobin
|
2020-09-23 01:25:30 +00:00
|
|
|
BUILD_DEVICES:=globalscale_espressobin-v7
|
2019-11-02 12:14:08 +00:00
|
|
|
UBOOT:=espressobin
|
|
|
|
DDR_TOPOLOGY:=6
|
2021-01-17 07:38:53 +00:00
|
|
|
CLOCKSPRESET:=CPU_1000_DDR_800
|
2019-11-02 12:14:08 +00:00
|
|
|
PLAT:=a3700
|
|
|
|
endef
|
|
|
|
|
2020-09-23 01:25:30 +00:00
|
|
|
define Trusted-Firmware-A/udpu
|
|
|
|
NAME:=Methode uDPU
|
2019-10-25 15:24:38 +00:00
|
|
|
DEPENDS:=+u-boot-uDPU
|
2020-09-23 01:25:30 +00:00
|
|
|
BUILD_DEVICES:=methode_udpu
|
2019-10-25 15:24:38 +00:00
|
|
|
UBOOT:=uDPU
|
2019-11-02 12:14:08 +00:00
|
|
|
DDR_TOPOLOGY:=0
|
2019-10-25 15:24:38 +00:00
|
|
|
CLOCKSPRESET:=CPU_1000_DDR_800
|
|
|
|
PLAT:=a3700
|
|
|
|
endef
|
|
|
|
|
2020-09-23 01:25:30 +00:00
|
|
|
|
|
|
|
TFA_TARGETS:= \
|
|
|
|
espressobin-512mb \
|
|
|
|
espressobin-v3-v5-1gb-1cs \
|
|
|
|
espressobin-v3-v5-1gb-2cs \
|
|
|
|
espressobin-v3-v5-2gb \
|
|
|
|
espressobin-v7-1gb \
|
|
|
|
espressobin-v7-2gb \
|
|
|
|
udpu
|
|
|
|
|
|
|
|
TFA_MAKE_FLAGS += \
|
2021-06-08 06:31:39 +00:00
|
|
|
CROSS_CM3=$(STAGING_DIR_IMAGE)/$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION)/bin/arm-none-eabi- \
|
2020-09-23 01:25:30 +00:00
|
|
|
BL33=$(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.bin \
|
|
|
|
MV_DDR_PATH=$(STAGING_DIR_IMAGE)/$(MV_DDR_NAME) \
|
|
|
|
WTP=$(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME) \
|
2021-06-08 03:42:51 +00:00
|
|
|
WTMI_IMG=$(STAGING_DIR_IMAGE)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE)/wtmi_app.bin \
|
2021-06-08 02:19:59 +00:00
|
|
|
USE_COHERENT_MEM=0 \
|
|
|
|
FIP_ALIGN=0x100 \
|
2020-09-23 01:25:30 +00:00
|
|
|
DDR_TOPOLOGY=$(DDR_TOPOLOGY) \
|
|
|
|
CLOCKSPRESET=$(CLOCKSPRESET) \
|
2021-01-18 15:54:26 +00:00
|
|
|
A3700_UTILS_COMMIT_ID=$(A3700_UTILS_RELEASE) \
|
|
|
|
MV_DDR_COMMIT_ID=$(MV_DDR_RELEASE) \
|
2020-09-23 01:25:30 +00:00
|
|
|
all \
|
2021-06-08 02:19:59 +00:00
|
|
|
mrvl_flash \
|
|
|
|
mrvl_uart
|
2020-09-23 01:25:30 +00:00
|
|
|
|
2019-10-25 15:24:38 +00:00
|
|
|
A3700_UTILS_NAME:=a3700-utils
|
2021-06-08 02:20:26 +00:00
|
|
|
A3700_UTILS_RELEASE:=2efdb10f
|
2019-10-25 15:24:38 +00:00
|
|
|
A3700_UTILS_SOURCE=$(A3700_UTILS_NAME)-$(A3700_UTILS_RELEASE).tar.bz2
|
|
|
|
|
|
|
|
define Download/a3700-utils
|
|
|
|
FILE:=$(A3700_UTILS_SOURCE)
|
|
|
|
PROTO:=git
|
|
|
|
URL:=https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git
|
2021-06-08 02:20:26 +00:00
|
|
|
VERSION:=2efdb10f3524c534d276002adf81fec06e0f1cf2
|
|
|
|
MIRROR_HASH:=4476e1bacfa7abb4a1303c6cf3aa7d067038b24090dfd5da13ca2a72a0d5c7a4
|
2019-10-25 15:24:38 +00:00
|
|
|
SUBDIR:=$(A3700_UTILS_NAME)
|
|
|
|
endef
|
|
|
|
|
|
|
|
MV_DDR_NAME:=mv-ddr-marvell
|
2021-06-08 02:20:54 +00:00
|
|
|
MV_DDR_RELEASE:=02e23dbc
|
2019-10-25 15:24:38 +00:00
|
|
|
MV_DDR_SOURCE:=$(MV_DDR_NAME)-$(MV_DDR_RELEASE).tar.bz2
|
|
|
|
|
|
|
|
define Download/mv-ddr-marvell
|
|
|
|
FILE:=$(MV_DDR_SOURCE)
|
|
|
|
PROTO:=git
|
|
|
|
URL:=https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git
|
2021-06-08 02:20:54 +00:00
|
|
|
VERSION:=02e23dbcf8dd22e038986052d99319a0eba8f25f
|
|
|
|
MIRROR_HASH:=d87dcc288b3895d1a1a78908fc607976d500b317ef81edfe667035579df0b440
|
2019-10-25 15:24:38 +00:00
|
|
|
SUBDIR:=$(MV_DDR_NAME)
|
|
|
|
endef
|
|
|
|
|
2021-06-08 03:42:51 +00:00
|
|
|
MOX_BB_NAME:=mox-boot-builder
|
|
|
|
MOX_BB_RELEASE:=v2021.04.09
|
|
|
|
MOX_BB_SOURCE:=$(MOX_BB_NAME)-$(MOX_BB_RELEASE).tar.bz2
|
|
|
|
|
|
|
|
define Download/mox-boot-builder
|
|
|
|
FILE:=$(MOX_BB_SOURCE)
|
|
|
|
URL:=https://gitlab.nic.cz/turris/mox-boot-builder/-/archive/$(MOX_BB_RELEASE)
|
|
|
|
HASH:=f0ed4fa25006e36a07d4256f633e3f25d6f8898dbe2e081e578251a182885520
|
|
|
|
endef
|
|
|
|
|
2021-06-08 06:31:39 +00:00
|
|
|
CM3_GCC_NAME:=gcc-arm
|
|
|
|
CM3_GCC_RELEASE:=10.2-2020.11
|
|
|
|
CM3_GCC_VERSION:=$(HOST_ARCH)-arm-none-eabi
|
|
|
|
CM3_GCC_SOURCE=$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION).tar.xz
|
2019-10-25 15:24:38 +00:00
|
|
|
|
2021-06-08 06:31:39 +00:00
|
|
|
define Download/cm3-gcc
|
|
|
|
FILE:=$(CM3_GCC_SOURCE)
|
|
|
|
URL:=https://developer.arm.com/-/media/Files/downloads/gnu-a/$(CM3_GCC_RELEASE)/binrel
|
|
|
|
HASH:=bf7ee185936d22d787b80c8da573f72ead5675695331fb8b590f0133ef1f6bb9
|
2019-10-25 15:24:38 +00:00
|
|
|
endef
|
|
|
|
|
2021-06-08 02:19:16 +00:00
|
|
|
define Build/Clean
|
|
|
|
rm -rf \
|
|
|
|
$(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME) \
|
|
|
|
$(STAGING_DIR_IMAGE)/$(MV_DDR_NAME) \
|
2021-06-08 03:42:51 +00:00
|
|
|
$(STAGING_DIR_IMAGE)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE) \
|
2021-06-08 06:31:39 +00:00
|
|
|
$(STAGING_DIR_IMAGE)/$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION)
|
2021-06-08 02:19:16 +00:00
|
|
|
endef
|
|
|
|
|
2019-10-25 15:24:38 +00:00
|
|
|
define Build/Prepare
|
|
|
|
# Download sources
|
|
|
|
$(eval $(call Download,a3700-utils))
|
|
|
|
$(eval $(call Download,mv-ddr-marvell))
|
2021-06-08 03:42:51 +00:00
|
|
|
$(eval $(call Download,mox-boot-builder))
|
2021-06-08 06:31:39 +00:00
|
|
|
$(eval $(call Download,cm3-gcc))
|
2019-10-25 15:24:38 +00:00
|
|
|
|
2020-08-19 18:30:25 +00:00
|
|
|
$(call Build/Prepare/Default,)
|
2019-10-25 15:24:38 +00:00
|
|
|
|
|
|
|
mkdir -p $(STAGING_DIR_IMAGE)
|
|
|
|
$(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(A3700_UTILS_SOURCE)
|
2021-06-08 02:19:59 +00:00
|
|
|
echo "master" > $(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME)/branch.txt
|
2021-01-18 15:54:26 +00:00
|
|
|
$(call PatchDir/Default,$(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME),./patches-a3700-utils)
|
2019-10-25 15:24:38 +00:00
|
|
|
$(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(MV_DDR_SOURCE)
|
2021-06-08 02:19:59 +00:00
|
|
|
echo "master" > $(STAGING_DIR_IMAGE)/$(MV_DDR_NAME)/branch.txt
|
2021-01-18 15:54:26 +00:00
|
|
|
$(call PatchDir/Default,$(STAGING_DIR_IMAGE)/$(MV_DDR_NAME),./patches-mv-ddr-marvell)
|
2021-06-08 03:42:51 +00:00
|
|
|
$(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(MOX_BB_SOURCE)
|
|
|
|
$(call PatchDir/Default,$(STAGING_DIR_IMAGE)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE),./patches-mox-boot-builder)
|
2021-06-08 06:31:39 +00:00
|
|
|
$(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(CM3_GCC_SOURCE)
|
2019-10-25 15:24:38 +00:00
|
|
|
endef
|
|
|
|
|
2021-06-08 03:42:51 +00:00
|
|
|
define Build/Compile
|
|
|
|
+$(MAKE) \
|
|
|
|
CROSS_CM3=$(STAGING_DIR_IMAGE)/$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION)/bin/arm-none-eabi- \
|
|
|
|
WTMI_VERSION=$(MOX_BB_RELEASE) \
|
|
|
|
-C $(STAGING_DIR_IMAGE)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE) \
|
|
|
|
wtmi_app.bin
|
|
|
|
$(call Build/Compile/Default)
|
|
|
|
endef
|
|
|
|
|
2020-09-23 01:25:30 +00:00
|
|
|
$(eval $(call BuildPackage/Trusted-Firmware-A))
|