marvell: a3k: build also mrvl_flash and mrvl_uart targets

These targets build final bootable flash and UART images which consist
of arm64 TF-A and arm32 TIM/WTMI images. For compiling arm32 part it is
required to set CROSS_CM3 variable with arm32 cross compiler and to have
A3700-utils-marvell, mv-ddr-marvell and cryptopp sources.

TF-A already contains mv-ddr-marvell package at its download server at:
https://downloads.trustedfirmware.org/tf-a/mv-ddr-marvell/

A3700-utils-marvell is available on Marvell github and it is preferred
to use the latest version from git. Following commands can be used to
create tarball with the latest version from master branch (currently at
commit f014428f4bf7feafec1dcc4c37506d847718649a):

    $ git clone https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git
    $ git -C A3700-utils-marvell checkout f014428f4bf7feafec1dcc4c37506d847718649a
    $ tar -czf A3700-utils-marvell-f014428f4bf7feafec1dcc4c37506d847718649a.tar.gz A3700-utils-marvell

Preferred version of cryptopp by Marvell is 5.6.5 but also the latest
8.5.0 is working fine. This package is needed only for building Marvell
TBB tool which builds final TIM image. Release page for version 5.6.5 is
at https://www.cryptopp.com/release565.html and direct download link is:

    https://www.cryptopp.com/cryptopp565.zip

Signed-off-by: Pali Rohár <pali@kernel.org>
Change-Id: I33a38d3add96a00f2cb38eeb09da3d4e52361d67
diff --git a/group/tf-l1-build-plat/a3700-default:nil b/group/tf-l1-build-plat/a3700-default:nil
index aab4796..00fa36b 100644
--- a/group/tf-l1-build-plat/a3700-default:nil
+++ b/group/tf-l1-build-plat/a3700-default:nil
@@ -4,3 +4,51 @@
 # SPDX-License-Identifier: BSD-3-Clause
 #
 
+pre_tf_build() {
+	targets="all mrvl_flash mrvl_uart" set_tf_build_targets
+
+	pushd "$workspace"
+
+	if [ ! -d "A3700-utils-marvell" ]; then
+		saveas="A3700-utils-marvell.tar.gz" \
+			url="$tfa_downloads/A3700-utils-marvell/A3700-utils-marvell-f014428f4bf7feafec1dcc4c37506d847718649a.tar.gz" \
+			fetch_file
+
+		tar -xzf "A3700-utils-marvell.tar.gz"
+	fi
+
+	echo "Set WTP to $workspace/A3700-utils-marvell"
+	set_hook_var "WTP" "$workspace/A3700-utils-marvell"
+
+	if [ ! -d "mv-ddr-marvell" ]; then
+		saveas="mv-ddr-marvell.tar.gz" \
+			url="$tfa_downloads/mv-ddr-marvell/mv-ddr-marvell-02e23dbcf8dd22e038986052d99319a0eba8f25f.tar.gz" \
+			fetch_file
+
+		tar -xzf "mv-ddr-marvell.tar.gz"
+	fi
+
+	echo "Set MV_DDR_PATH to $workspace/mv-ddr-marvell"
+	set_hook_var "MV_DDR_PATH" "$workspace/mv-ddr-marvell"
+
+	if [ ! -d "cryptopp" ]; then
+		saveas="cryptopp.zip" \
+			url="$tfa_downloads/cryptopp/cryptopp565.zip" \
+			fetch_file
+
+		unzip -d cryptopp "cryptopp.zip"
+	fi
+
+	echo "Set CRYPTOPP_PATH to $workspace/cryptopp"
+	set_hook_var "CRYPTOPP_PATH" "$workspace/cryptopp"
+
+	popd "$workspace"
+}
+
+post_tf_build() {
+	# Remove files in uart-images subdirectory as these files have same names as files in upper directory.
+	# Currently CI is not able to successfully finish all tests if there are two directories with same file names.
+	if [ -d "${tf_build_root}/${plat}/${mode}/uart-images" ];then
+		rm -rf ${tf_build_root}/${plat}/${mode}/uart-images
+	fi
+}
diff --git a/tf_config/a3700-default b/tf_config/a3700-default
index bf4ecd9..399cf30 100644
--- a/tf_config/a3700-default
+++ b/tf_config/a3700-default
@@ -1,2 +1,8 @@
 CROSS_COMPILE=aarch64-none-elf-
+CROSS_CM3=arm-none-eabi-
 PLAT=a3700
+BL33=/dev/null
+CM3_SYSTEM_RESET=1
+A3720_DB_PM_WAKEUP_SRC=1
+CLOCKSPRESET=CPU_1000_DDR_800
+DDR_TOPOLOGY=5