summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/imx8
diff options
context:
space:
mode:
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;
+}