summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/imx8
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2019-01-03 00:50:24 -0800
committerYe Li <ye.li@nxp.com>2019-01-08 21:46:31 -0800
commitcddb0fde374769dccff44275a5072c5e28e41446 (patch)
treeb07a3b25149132bccc5b23ea4478a281b9d74738 /arch/arm/mach-imx/imx8
parent1f6b3efc62cb277fd4316d8ed5115f47b09369a0 (diff)
MLK-20559-6 f_sdp: Support searching and loading FIT or container image
Add support to f_sdp to search and load iMX8 container image or iMX8M FIT image by new UUU command SDPV. When using the SDPV, the uuu will continue to send out data after first level boot loader used by ROM. This means uuu won't skip to the offset of the second boot loader, and the padding data before second boot loader will be sent out. So we have to search the FIT header or container header in the buffer that SDP received. The new BCD value is used by uuu to distinguish if the SPL supports the SDPV. Signed-off-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'arch/arm/mach-imx/imx8')
-rw-r--r--arch/arm/mach-imx/imx8/parser.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/arch/arm/mach-imx/imx8/parser.c b/arch/arm/mach-imx/imx8/parser.c
index 1a170fb63e..f7315cbf28 100644
--- a/arch/arm/mach-imx/imx8/parser.c
+++ b/arch/arm/mach-imx/imx8/parser.c
@@ -2,7 +2,6 @@
/*
* Copyright 2018 NXP
*/
-
#include <common.h>
#include <spl.h>
#include <errno.h>
@@ -17,6 +16,7 @@
#define MMC_DEV 0
#define QSPI_DEV 1
+#define RAM_DEV 3
#define SEC_SECURE_RAM_BASE (0x31800000UL)
#define SEC_SECURE_RAM_END_BASE (SEC_SECURE_RAM_BASE + 0xFFFFUL)
@@ -35,11 +35,11 @@ static int current_dev_type = MMC_DEV;
static int start_offset;
static void *device;
-static int read(int start, int len, void *load_addr)
+static int read(u32 start, u32 len, void *load_addr)
{
int ret = -ENODEV;
- if (!device) {
+ if (!device && current_dev_type != RAM_DEV) {
debug("No device selected\n");
return ret;
}
@@ -74,6 +74,11 @@ static int read(int start, int len, void *load_addr)
}
#endif
+ if (current_dev_type == RAM_DEV) {
+ memcpy(load_addr, (const void *)(ulong)start, len);
+ ret = 0;
+ }
+
return ret;
}
@@ -204,6 +209,7 @@ static int read_auth_container(struct spl_image_info *spl_image)
if (!image) {
ret = -EINVAL;
+ sc_misc_seco_authenticate(ipcHndl, SC_MISC_REL_CONTAINER, 0);
goto out;
}
@@ -258,3 +264,18 @@ int spi_load_image_parse_container(struct spl_image_info *spl_image,
return ret;
}
+
+int sdp_load_image_parse_container(struct spl_image_info *spl_image,
+ unsigned long offset)
+{
+ int ret = 0;
+
+ current_dev_type = RAM_DEV;
+ device = NULL;
+
+ start_offset = offset;
+
+ ret = read_auth_container(spl_image);
+
+ return ret;
+}