feat(juno): update Linux kernel and U-Boot

At the moment we use a Linaro 5.3.0 kernel and some Linaro v2019.07
U-Boot version for the Juno Linux testing. Not only are those versions
outdated, but the old kernel does not exercise all features of recent
TF-A (for instance SOCID and TRNG).
Switch to mainline U-Boot (v2021.10) and mainline Linux (v5.15.5). We
then use a Busybox based initrd that drops into a user prompt.

Instructions to build these binaries from scratch using upstream source
repository are available in the readme.txt file [1].

To avoid picking up something from USB or the network, provide a changed
U-Boot environment, which drops all other boot targets except the NOR
flash ("afs" in U-Boot). For this to work, we need to fix the U-Boot
environment flash address in the images.txt files.

[1] http://files.oss.arm.com/downloads/tf-a/linux_boot/

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Change-Id: Idbce5c9c78d5fa48e34804ea5e877bfa162686d7
diff --git a/juno_utils.sh b/juno_utils.sh
index 421d997..e0dd44c 100644
--- a/juno_utils.sh
+++ b/juno_utils.sh
@@ -13,8 +13,14 @@
 
 psci_reset2_scp_bl2_url="$tfa_downloads/psci_reset2/scp_bl2.bin"
 uboot_bl33_url="$linaro_release/juno-latest-oe-uboot/SOFTWARE/bl33-uboot.bin"
+ml_uboot_bl33_url="$tfa_downloads/linux_boot/u-boot-juno.bin"
+uboot_env_url="$tfa_downloads/linux_boot/u-boot-env.bin"
 optee_fip_url="$linaro_release/juno-ack-android-uboot/SOFTWARE/fip.bin"
 
+linux_image_url="$tfa_downloads/linux_boot/Image.gz"
+# Busybox based initrd
+linux_busybox_initrd_url="$tfa_downloads/linux_boot/initbb.img"
+
 juno_recovery_root="$linaro_release/juno-latest-oe-uboot"
 
 uboot32_fip_url="$linaro_release/juno32-latest-oe-uboot/SOFTWARE/fip.bin"
@@ -59,6 +65,20 @@
 	archive_file "uboot.bin"
 }
 
+get_ml_uboot_bin() {
+	url="$ml_uboot_bl33_url" saveas="uboot.bin" fetch_file
+	archive_file "uboot.bin"
+	url="$uboot_env_url" saveas="blank.img" fetch_file
+	archive_file "blank.img"
+}
+
+get_linux_image() {
+	url="$linux_image_url" saveas="Image" fetch_file
+	archive_file "Image"
+	url="$linux_busybox_initrd_url" saveas="ramdisk.img" fetch_file
+	archive_file "ramdisk.img"
+}
+
 gen_recovery_image32() {
 	url="$juno32_recovery_root" gen_recovery_image "$@"
 }
@@ -80,6 +100,12 @@
 		cp -f "$@" "$zip_dir/SOFTWARE"
 	fi
 
+	# The Linaro recovery image has a bug in the images.txt files, which
+	# puts the U-Boot environment in the wrong place (the address is
+	# relative to the beginning of NOR flash, it's not an absolute MMIO
+	# address). Fix that up so that we can update the environment.
+	sed -ie "s/0x0BFC0000/0x03FC0000/" "$zip_dir"/SITE1/HBI0262?/images.txt
+
 	# If an image.txt file was specified, replace all image.txt file inside
 	# the recovery with the specified one.
 	if upon "$image_txt"; then