new file mode 100644
@@ -0,0 +1,40 @@
+From 80b1efa92486a87f9e82dbf665ef612291148de8 Mon Sep 17 00:00:00 2001
+From: Adam Johnston <adam.johnston@arm.com>
+Date: Tue, 14 Jun 2022 11:19:30 +0000
+Subject: [PATCH] arm-bsp/trusted-firmware-a: N1SDP trusted boot
+
+Increase max size of BL2 on N1SDP by 4KB to enable trusted boot
+Decrease max size of BL1 on N1SDP by 8KB so BL1/BL2 fits above BL31 progbits
+
+Signed-off-by: Adam Johnston <adam.johnston@arm.com>
+Upstream-Status: Pending [Flagged to upstream]
+
+---
+ plat/arm/board/n1sdp/include/platform_def.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/plat/arm/board/n1sdp/include/platform_def.h b/plat/arm/board/n1sdp/include/platform_def.h
+index c9b81bafa..7468a31ed 100644
+--- a/plat/arm/board/n1sdp/include/platform_def.h
++++ b/plat/arm/board/n1sdp/include/platform_def.h
+@@ -91,7 +91,7 @@
+ * PLAT_ARM_MAX_BL1_RW_SIZE is calculated using the current BL1 RW debug size
+ * plus a little space for growth.
+ */
+-#define PLAT_ARM_MAX_BL1_RW_SIZE 0xE000
++#define PLAT_ARM_MAX_BL1_RW_SIZE 0xC000
+
+ /*
+ * PLAT_ARM_MAX_ROMLIB_RW_SIZE is define to use a full page
+@@ -110,7 +110,7 @@
+ * little space for growth.
+ */
+ #if TRUSTED_BOARD_BOOT
+-# define PLAT_ARM_MAX_BL2_SIZE 0x20000
++# define PLAT_ARM_MAX_BL2_SIZE 0x21000
+ #else
+ # define PLAT_ARM_MAX_BL2_SIZE 0x14000
+ #endif
+--
+2.35.1
+
@@ -2,8 +2,23 @@
COMPATIBLE_MACHINE = "n1sdp"
TFA_PLATFORM = "n1sdp"
-TFA_BUILD_TARGET = "bl31 dtbs"
-TFA_INSTALL_TARGET = "bl31 n1sdp-multi-chip n1sdp-single-chip"
+TFA_BUILD_TARGET = "all fip"
+TFA_INSTALL_TARGET = "bl1 bl2 bl31 n1sdp-multi-chip n1sdp-single-chip n1sdp_fw_config n1sdp_tb_fw_config fip"
TFA_DEBUG = "1"
-TFA_MBEDTLS = "0"
+TFA_MBEDTLS = "1"
TFA_UBOOT = "0"
+TFA_UEFI = "1"
+
+SRC_URI:append = " file://bl_size.patch"
+
+TFA_ROT_KEY= "plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem"
+
+EXTRA_OEMAKE:append = "\
+ TRUSTED_BOARD_BOOT=1 \
+ GENERATE_COT=1 \
+ CREATE_KEYS=1 \
+ ENABLE_PIE=0 \
+ ARM_ROTPK_LOCATION="devel_rsa" \
+ ROT_KEY="${TFA_ROT_KEY}" \
+ BL33=${RECIPE_SYSROOT}/firmware/uefi.bin \
+ "