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
|
|
|
|
|
2022-06-21 12:09:56 +00:00
|
|
|
PKG_VERSION:=2.7
|
2023-05-17 13:08:40 +00:00
|
|
|
PKG_RELEASE:=6
|
2022-06-21 12:09:56 +00:00
|
|
|
PKG_HASH:=53422dc649153838e03820330ba17cb10afe3e330ecde0db11e4d5f1361a33e6
|
2019-10-25 15:24:38 +00:00
|
|
|
|
|
|
|
PKG_MAINTAINER:=Vladimir Vid <vladimir.vid@sartura.hr>
|
|
|
|
|
2022-08-11 21:29:52 +00:00
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
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
|
|
|
|
|
2022-09-21 16:40:59 +00:00
|
|
|
define Trusted-Firmware-A/edpu
|
|
|
|
NAME:=Methode eDPU
|
|
|
|
DEPENDS:=+u-boot-eDPU
|
|
|
|
BUILD_DEVICES:=methode_edpu
|
|
|
|
UBOOT:=eDPU
|
|
|
|
DDR_TOPOLOGY:=0
|
|
|
|
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 \
|
2022-09-21 16:40:59 +00:00
|
|
|
udpu \
|
|
|
|
edpu
|
2020-09-23 01:25:30 +00:00
|
|
|
|
|
|
|
TFA_MAKE_FLAGS += \
|
2022-09-11 16:14:17 +00:00
|
|
|
CROSS_CM3=$(BUILD_DIR)/$(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 \
|
2022-09-11 16:14:17 +00:00
|
|
|
MV_DDR_PATH=$(BUILD_DIR)/$(MV_DDR_NAME) \
|
|
|
|
WTP=$(BUILD_DIR)/$(A3700_UTILS_NAME) \
|
|
|
|
WTMI_IMG=$(BUILD_DIR)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE)/wtmi_app.bin \
|
|
|
|
CRYPTOPP_PATH=$(BUILD_DIR)/$(CRYPTOPP_NAME) \
|
2022-12-26 23:28:03 +00:00
|
|
|
HOST_LDFLAGS="$(HOST_LDFLAGS)" \
|
|
|
|
HOST_CPPFLAGS="$(HOST_CPPFLAGS)" \
|
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
|
2023-08-18 10:46:48 +00:00
|
|
|
A3700_UTILS_RELEASE:=a3e1c67
|
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
|
2023-08-18 10:46:48 +00:00
|
|
|
VERSION:=a3e1c67bb378e1d8a938e1b826cb602af83628d2
|
|
|
|
MIRROR_HASH:=0e6b8ef6423dcb52a5e282669a8aeebc6eea2d45a7c3a2c9a2fc7a749b3275a7
|
2019-10-25 15:24:38 +00:00
|
|
|
SUBDIR:=$(A3700_UTILS_NAME)
|
|
|
|
endef
|
|
|
|
|
2021-09-14 12:40:54 +00:00
|
|
|
CRYPTOPP_NAME:=cryptopp
|
|
|
|
CRYPTOPP_RELEASE:=f210224
|
|
|
|
CRYPTOPP_SOURCE=$(CRYPTOPP_NAME)-$(CRYPTOPP_RELEASE).tar.bz2
|
|
|
|
|
|
|
|
define Download/cryptopp
|
|
|
|
FILE:=$(CRYPTOPP_SOURCE)
|
|
|
|
PROTO:=git
|
|
|
|
URL:=https://github.com/weidai11/cryptopp.git
|
|
|
|
VERSION:=f2102243e6fdd48c0b2a393a0993cca228f20573
|
|
|
|
MIRROR_HASH:=74ec9e48ee04b9f2d9a1d8c4f2392ed0ab52780d7af0f70405d7bbb23d1504fa
|
|
|
|
SUBDIR:=$(CRYPTOPP_NAME)
|
|
|
|
endef
|
|
|
|
|
2019-10-25 15:24:38 +00:00
|
|
|
MV_DDR_NAME:=mv-ddr-marvell
|
2022-06-21 12:09:21 +00:00
|
|
|
MV_DDR_RELEASE:=d5acc10c
|
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
|
2022-06-21 12:09:21 +00:00
|
|
|
VERSION:=d5acc10c287e40cc2feeb28710b92e45c93c702c
|
|
|
|
MIRROR_HASH:=c149ab737935b5fb822f48da8e2d7fba4388f48e645f9f6da857bee20f0333ea
|
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
|
2022-06-21 12:09:40 +00:00
|
|
|
MOX_BB_RELEASE:=v2022.06.11
|
2021-06-08 03:42:51 +00:00
|
|
|
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)
|
2022-06-21 12:09:40 +00:00
|
|
|
HASH:=75e7661c38f4f5e6d8910dd789d6d9ffd8652455548b68c98e5bf45eaab5b6eb
|
2021-06-08 03:42:51 +00:00
|
|
|
endef
|
|
|
|
|
2021-06-08 06:31:39 +00:00
|
|
|
CM3_GCC_NAME:=gcc-arm
|
2022-06-21 12:32:50 +00:00
|
|
|
CM3_GCC_RELEASE:=11.2-2022.02
|
2021-06-08 06:31:39 +00:00
|
|
|
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)
|
2022-06-21 12:32:50 +00:00
|
|
|
URL:=https://developer.arm.com/-/media/Files/downloads/gnu/$(CM3_GCC_RELEASE)/binrel
|
2021-09-15 12:42:43 +00:00
|
|
|
ifeq ($(HOST_ARCH),aarch64)
|
2022-06-21 12:32:50 +00:00
|
|
|
HASH:=ef1d82e5894e3908cb7ed49c5485b5b95deefa32872f79c2b5f6f5447cabf55f
|
2021-09-15 12:42:43 +00:00
|
|
|
else
|
2022-06-21 12:32:50 +00:00
|
|
|
HASH:=8c5acd5ae567c0100245b0556941c237369f210bceb196edfe5a2e7532c60326
|
2021-09-15 12:42:43 +00:00
|
|
|
endif
|
2019-10-25 15:24:38 +00:00
|
|
|
endef
|
|
|
|
|
2021-06-08 02:19:16 +00:00
|
|
|
define Build/Clean
|
|
|
|
rm -rf \
|
2022-09-11 16:14:17 +00:00
|
|
|
$(BUILD_DIR)/$(CRYPTOPP_NAME) \
|
|
|
|
$(BUILD_DIR)/$(A3700_UTILS_NAME) \
|
|
|
|
$(BUILD_DIR)/$(MV_DDR_NAME) \
|
|
|
|
$(BUILD_DIR)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE) \
|
|
|
|
$(BUILD_DIR)/$(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-09-14 12:40:54 +00:00
|
|
|
$(eval $(call Download,cryptopp))
|
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
|
|
|
|
2022-09-11 16:14:17 +00:00
|
|
|
$(TAR) -C $(BUILD_DIR) -xf $(DL_DIR)/$(CRYPTOPP_SOURCE)
|
|
|
|
$(TAR) -C $(BUILD_DIR) -xf $(DL_DIR)/$(A3700_UTILS_SOURCE)
|
|
|
|
$(call PatchDir/Default,$(BUILD_DIR)/$(A3700_UTILS_NAME),./patches-a3700-utils)
|
|
|
|
$(TAR) -C $(BUILD_DIR) -xf $(DL_DIR)/$(MV_DDR_SOURCE)
|
|
|
|
$(call PatchDir/Default,$(BUILD_DIR)/$(MV_DDR_NAME),./patches-mv-ddr-marvell)
|
|
|
|
$(TAR) -C $(BUILD_DIR) -xf $(DL_DIR)/$(MOX_BB_SOURCE)
|
|
|
|
$(call PatchDir/Default,$(BUILD_DIR)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE),./patches-mox-boot-builder)
|
|
|
|
$(TAR) -C $(BUILD_DIR) -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) \
|
2022-09-11 16:14:17 +00:00
|
|
|
CROSS_CM3=$(BUILD_DIR)/$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION)/bin/arm-none-eabi- \
|
2021-06-08 03:42:51 +00:00
|
|
|
WTMI_VERSION=$(MOX_BB_RELEASE) \
|
2021-09-14 12:40:54 +00:00
|
|
|
CRYPTOPP_PATH=$PWD/cryptopp/ \
|
2022-09-11 16:14:17 +00:00
|
|
|
-C $(BUILD_DIR)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE) \
|
2021-06-08 03:42:51 +00:00
|
|
|
wtmi_app.bin
|
|
|
|
$(call Build/Compile/Default)
|
|
|
|
endef
|
|
|
|
|
2020-09-23 01:25:30 +00:00
|
|
|
$(eval $(call BuildPackage/Trusted-Firmware-A))
|