1
0
Fork 0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-05-28 18:36:21 +02:00
openwrt/package/boot/arm-trusted-firmware-mvebu/Makefile

244 lines
6.8 KiB
Makefile
Raw Normal View History

#
# 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
PKG_VERSION:=2.7
PKG_RELEASE:=6
PKG_HASH:=53422dc649153838e03820330ba17cb10afe3e330ecde0db11e4d5f1361a33e6
PKG_MAINTAINER:=Vladimir Vid <vladimir.vid@sartura.hr>
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/trusted-firmware-a.mk
include $(INCLUDE_DIR)/package.mk
define Trusted-Firmware-A/Default
BUILD_TARGET:=mvebu
BUILD_SUBTARGET:=cortexa53
TFA_IMAGE:=flash-image.bin uart-images.tgz.bin
UBOOT:=
DDR_TOPOLOGY:=
CLOCKSPRESET:=
endef
define Trusted-Firmware-A/espressobin-512mb
NAME:=Marvell ESPRESSObin (512MB)
DEPENDS:=+u-boot-espressobin
BUILD_DEVICES:=globalscale_espressobin
UBOOT:=espressobin
DDR_TOPOLOGY:=0
CLOCKSPRESET:=CPU_1000_DDR_800
PLAT:=a3700
endef
define Trusted-Firmware-A/espressobin-v3-v5-1gb-1cs
NAME:=Marvell ESPRESSObin V3-V5 (1GB 1CS)
DEPENDS:=+u-boot-espressobin
BUILD_DEVICES:=globalscale_espressobin
UBOOT:=espressobin
DDR_TOPOLOGY:=4
CLOCKSPRESET:=CPU_1000_DDR_800
PLAT:=a3700
endef
define Trusted-Firmware-A/espressobin-v3-v5-1gb-2cs
NAME:=Marvell ESPRESSObin V3-V5 (1GB, 2CS)
DEPENDS:=+u-boot-espressobin
BUILD_DEVICES:=globalscale_espressobin
UBOOT:=espressobin
DDR_TOPOLOGY:=2
CLOCKSPRESET:=CPU_1000_DDR_800
PLAT:=a3700
endef
define Trusted-Firmware-A/espressobin-v3-v5-2gb
NAME:=Marvell ESPRESSObin V3-V5 (2GB)
DEPENDS:=+u-boot-espressobin
BUILD_DEVICES:=globalscale_espressobin
UBOOT:=espressobin
DDR_TOPOLOGY:=7
CLOCKSPRESET:=CPU_1000_DDR_800
PLAT:=a3700
endef
define Trusted-Firmware-A/espressobin-v7-1gb
NAME:=Marvell ESPRESSObin V7 (1GB)
DEPENDS:=+u-boot-espressobin
BUILD_DEVICES:=globalscale_espressobin-v7
UBOOT:=espressobin
DDR_TOPOLOGY:=5
CLOCKSPRESET:=CPU_1000_DDR_800
PLAT:=a3700
endef
define Trusted-Firmware-A/espressobin-v7-2gb
NAME:=Marvell ESPRESSObin V7 (2GB)
DEPENDS:=+u-boot-espressobin
BUILD_DEVICES:=globalscale_espressobin-v7
UBOOT:=espressobin
DDR_TOPOLOGY:=6
CLOCKSPRESET:=CPU_1000_DDR_800
PLAT:=a3700
endef
define Trusted-Firmware-A/udpu
NAME:=Methode uDPU
DEPENDS:=+u-boot-uDPU
BUILD_DEVICES:=methode_udpu
UBOOT:=uDPU
DDR_TOPOLOGY:=0
CLOCKSPRESET:=CPU_1000_DDR_800
PLAT:=a3700
endef
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
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 \
edpu
TFA_MAKE_FLAGS += \
CROSS_CM3=$(BUILD_DIR)/$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION)/bin/arm-none-eabi- \
BL33=$(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.bin \
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) \
HOST_LDFLAGS="$(HOST_LDFLAGS)" \
HOST_CPPFLAGS="$(HOST_CPPFLAGS)" \
USE_COHERENT_MEM=0 \
FIP_ALIGN=0x100 \
DDR_TOPOLOGY=$(DDR_TOPOLOGY) \
CLOCKSPRESET=$(CLOCKSPRESET) \
A3700_UTILS_COMMIT_ID=$(A3700_UTILS_RELEASE) \
MV_DDR_COMMIT_ID=$(MV_DDR_RELEASE) \
all \
mrvl_flash \
mrvl_uart
A3700_UTILS_NAME:=a3700-utils
A3700_UTILS_RELEASE:=1d977157
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
VERSION:=1d977157e37151b272f88f2406a245c833fb2d8c
MIRROR_HASH:=322821ec8c04afea260254e927c59cd1ec0bd84e7ec6507cc1f155f18afb8eb9
SUBDIR:=$(A3700_UTILS_NAME)
endef
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
MV_DDR_NAME:=mv-ddr-marvell
MV_DDR_RELEASE:=d5acc10c
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
VERSION:=d5acc10c287e40cc2feeb28710b92e45c93c702c
MIRROR_HASH:=c149ab737935b5fb822f48da8e2d7fba4388f48e645f9f6da857bee20f0333ea
SUBDIR:=$(MV_DDR_NAME)
endef
MOX_BB_NAME:=mox-boot-builder
arm-trusted-firmware-mvebu: bump mox-boot-builder to v2022.06.11 Remove the gold patch, since upstream doesn't hardcode it anymore. 406454d wtmi: Don't print another newline on standalone build ec97868 Bump mox-imager commit e4c4b9d wtmi: Call main from C code in startup 4c1d3ff wtmi: Move startup assmebly to C file as inline assmebly ee570ea wtmi: Indent Makefiles 18a7c0b wtmi: Use -f{function,data}-sections and --gc-sections 47ad100 wtmi: Use bfd linker instead of gold 5e34aa1 wtmi: Keep .data* and .bss* sections in linker scripts 7a4e3d2 wtmi: compressed, reload_helper: Discard .ARM* section d943726 wtmi: compressed: Keep main function in linker script d4f0fc6 wtmi: Keep main function in linker script 092148c wtmi: Fix -Warray-bounds warning 469e1b6 wtmi: Add do_div() implementation from Linux 90f46a0 Bump mox-imager commit 8bc6254 wtmi: Always use gold and link with --rosegment and --gc-sections flags 0b68a33 wtmi: Implement Marvell's OTP write commands 53d2a1c Bump mox-imager commit b4c34b4 Rename arm-trusted-firmware to trusted-firmware-a 5f79ace Sync mox-imager submodule URL a1cdd32 Sync TF-A submodule URL 58ef1af Sync u-boot submodule URL 90d28e1 wtmi: Check argument validity in Marvell's CMD_OTP_READ_1B command more 3a48cf1 Bump mox-imager commit 807a3e1 wtmi: Implement Marvell's OTP read commands 77b1232 wtmi: Enable OTP read/write mailbox commands 9724d41 wtmi: Add is_secure_boot() 03de0c1 Bump mox-imager commit 2133601 wtmi: Fix efuse_write_row_with_ecc_lock() for masked ECC rows 545a89f wtmi: Don't allow masked rows in efuse_write_row_with_ecc_lock() 94ebc98 wtmi: Don't program already programmed bits in efuse_raw_write() 2369750 wtmi: Remove inline specifier from is_row_masked() 53e2636 wtmi: Use ARRAY_SIZE() cc3e23b wtmi: Remove duplicate checks 89d24be Makefile: ignore clean target errors 9ee8b8d Bump mox-imager commit 489262b Bump mox-imager commit 79d2f32 deploy: Print board type in deploy output 78f15b0 deploy: Print board version without board type bits in deploy output e69fdfa deploy: Always determine 512 MiB RAM when deploying RIPE Atlas Probe d1f7d07 deploy: Write eMMC Boot Mode into OTP when deploying RIPE Atlas Probe d43a089 Bump mox-imager commit 49ac21d deploy: Use get_ram_size() from ddr.c 1e7705d Print DDR type and size when initializing 6f85e72 Move get_ram_size() to ddr.c edb1079 wtmi: Rename Atlas_RIPE to RIPE_Atlas e6a3aee wtmi: Inform about board type in CMD_BOARD_INFO 50aeae5 wtmi: Read only bits 53:48 of row eFuse 42 as board version b882398 wtmi: Add README.md (document OTP content) c068431 wtmi: Add ARRAY_SIZE() macro 4af2317 wtmi: Use 50 MHz as SPI clock rate 226fc5c wtmi: Add fast spi_write() function 518c914 wtmi: clock: Check for zero loops, not argument, in ndelay() / udelay() 89a21c5 wtmi: Fix comment 7b3e11a wtmi: Add clk command to print xtal and TBG clock rates 5127638 wtmi: Use the signed keyword when defining signed types fb31ed2 wtmi: Fix DDR training failure check 1b1b938 wtmi: clock: Check for zero in ndelay() / udelay() c0ee09a wtmi: Print correct DDR version in debug message edfb875 Bump mox-imager commit 85cb5e3 Bump mox-imager commit c4e9334 wtmi: debug: interpret char 127 as backspace a778fd9 Bump mox-imager commit Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-06-21 14:09:40 +02:00
MOX_BB_RELEASE:=v2022.06.11
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)
arm-trusted-firmware-mvebu: bump mox-boot-builder to v2022.06.11 Remove the gold patch, since upstream doesn't hardcode it anymore. 406454d wtmi: Don't print another newline on standalone build ec97868 Bump mox-imager commit e4c4b9d wtmi: Call main from C code in startup 4c1d3ff wtmi: Move startup assmebly to C file as inline assmebly ee570ea wtmi: Indent Makefiles 18a7c0b wtmi: Use -f{function,data}-sections and --gc-sections 47ad100 wtmi: Use bfd linker instead of gold 5e34aa1 wtmi: Keep .data* and .bss* sections in linker scripts 7a4e3d2 wtmi: compressed, reload_helper: Discard .ARM* section d943726 wtmi: compressed: Keep main function in linker script d4f0fc6 wtmi: Keep main function in linker script 092148c wtmi: Fix -Warray-bounds warning 469e1b6 wtmi: Add do_div() implementation from Linux 90f46a0 Bump mox-imager commit 8bc6254 wtmi: Always use gold and link with --rosegment and --gc-sections flags 0b68a33 wtmi: Implement Marvell's OTP write commands 53d2a1c Bump mox-imager commit b4c34b4 Rename arm-trusted-firmware to trusted-firmware-a 5f79ace Sync mox-imager submodule URL a1cdd32 Sync TF-A submodule URL 58ef1af Sync u-boot submodule URL 90d28e1 wtmi: Check argument validity in Marvell's CMD_OTP_READ_1B command more 3a48cf1 Bump mox-imager commit 807a3e1 wtmi: Implement Marvell's OTP read commands 77b1232 wtmi: Enable OTP read/write mailbox commands 9724d41 wtmi: Add is_secure_boot() 03de0c1 Bump mox-imager commit 2133601 wtmi: Fix efuse_write_row_with_ecc_lock() for masked ECC rows 545a89f wtmi: Don't allow masked rows in efuse_write_row_with_ecc_lock() 94ebc98 wtmi: Don't program already programmed bits in efuse_raw_write() 2369750 wtmi: Remove inline specifier from is_row_masked() 53e2636 wtmi: Use ARRAY_SIZE() cc3e23b wtmi: Remove duplicate checks 89d24be Makefile: ignore clean target errors 9ee8b8d Bump mox-imager commit 489262b Bump mox-imager commit 79d2f32 deploy: Print board type in deploy output 78f15b0 deploy: Print board version without board type bits in deploy output e69fdfa deploy: Always determine 512 MiB RAM when deploying RIPE Atlas Probe d1f7d07 deploy: Write eMMC Boot Mode into OTP when deploying RIPE Atlas Probe d43a089 Bump mox-imager commit 49ac21d deploy: Use get_ram_size() from ddr.c 1e7705d Print DDR type and size when initializing 6f85e72 Move get_ram_size() to ddr.c edb1079 wtmi: Rename Atlas_RIPE to RIPE_Atlas e6a3aee wtmi: Inform about board type in CMD_BOARD_INFO 50aeae5 wtmi: Read only bits 53:48 of row eFuse 42 as board version b882398 wtmi: Add README.md (document OTP content) c068431 wtmi: Add ARRAY_SIZE() macro 4af2317 wtmi: Use 50 MHz as SPI clock rate 226fc5c wtmi: Add fast spi_write() function 518c914 wtmi: clock: Check for zero loops, not argument, in ndelay() / udelay() 89a21c5 wtmi: Fix comment 7b3e11a wtmi: Add clk command to print xtal and TBG clock rates 5127638 wtmi: Use the signed keyword when defining signed types fb31ed2 wtmi: Fix DDR training failure check 1b1b938 wtmi: clock: Check for zero in ndelay() / udelay() c0ee09a wtmi: Print correct DDR version in debug message edfb875 Bump mox-imager commit 85cb5e3 Bump mox-imager commit c4e9334 wtmi: debug: interpret char 127 as backspace a778fd9 Bump mox-imager commit Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-06-21 14:09:40 +02:00
HASH:=75e7661c38f4f5e6d8910dd789d6d9ffd8652455548b68c98e5bf45eaab5b6eb
endef
CM3_GCC_NAME:=gcc-arm
CM3_GCC_RELEASE:=11.2-2022.02
CM3_GCC_VERSION:=$(HOST_ARCH)-arm-none-eabi
CM3_GCC_SOURCE=$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION).tar.xz
define Download/cm3-gcc
FILE:=$(CM3_GCC_SOURCE)
URL:=https://developer.arm.com/-/media/Files/downloads/gnu/$(CM3_GCC_RELEASE)/binrel
ifeq ($(HOST_ARCH),aarch64)
HASH:=ef1d82e5894e3908cb7ed49c5485b5b95deefa32872f79c2b5f6f5447cabf55f
else
HASH:=8c5acd5ae567c0100245b0556941c237369f210bceb196edfe5a2e7532c60326
endif
endef
define Build/Clean
rm -rf \
$(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)
endef
define Build/Prepare
# Download sources
$(eval $(call Download,a3700-utils))
$(eval $(call Download,mv-ddr-marvell))
$(eval $(call Download,mox-boot-builder))
$(eval $(call Download,cryptopp))
$(eval $(call Download,cm3-gcc))
$(call Build/Prepare/Default,)
$(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)
endef
define Build/Compile
+$(MAKE) \
CROSS_CM3=$(BUILD_DIR)/$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION)/bin/arm-none-eabi- \
WTMI_VERSION=$(MOX_BB_RELEASE) \
CRYPTOPP_PATH=$PWD/cryptopp/ \
-C $(BUILD_DIR)/$(MOX_BB_NAME)-$(MOX_BB_RELEASE) \
wtmi_app.bin
$(call Build/Compile/Default)
endef
$(eval $(call BuildPackage/Trusted-Firmware-A))