summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/st/u8500/common.h1
-rw-r--r--board/st/u8500/itp.c30
-rw-r--r--board/st/u8500/itp.h2
-rw-r--r--board/st/u8500/mmc_host.c15
-rw-r--r--board/st/u8500/u8500.c57
5 files changed, 76 insertions, 29 deletions
diff --git a/board/st/u8500/common.h b/board/st/u8500/common.h
index 25dd35efe..4340d27ac 100644
--- a/board/st/u8500/common.h
+++ b/board/st/u8500/common.h
@@ -134,4 +134,5 @@ int cpu_is_u8500v11(void);
int cpu_is_u8500v1(void);
int cpu_is_u8500v2(void);
+int board_early_access(block_dev_desc_t *block_dev);
#endif /* _COMMON_H_ */
diff --git a/board/st/u8500/itp.c b/board/st/u8500/itp.c
index 033d3d03c..9a13ba8f9 100644
--- a/board/st/u8500/itp.c
+++ b/board/st/u8500/itp.c
@@ -36,6 +36,8 @@ static const struct sec_rom_cut_desc cuttable[] = {
{ 0x9001DBF4, 0x008500B0, 0x90017300 },
};
+static u32 cspsa_key;
+
static u32 itp_call_secure_service(const u32 serviceid,
const u32 secureconfig,
...)
@@ -123,6 +125,7 @@ static int itp_load_ipl(block_dev_desc_t *block_dev)
return 0;
}
+
static int itp_load_toc_entry(block_dev_desc_t *block_dev,
const char *partname,
u32 *loadaddress)
@@ -155,15 +158,30 @@ static int itp_load_toc_entry(block_dev_desc_t *block_dev,
return 0;
}
+int itp_read_config(block_dev_desc_t *block_dev)
+{
+ if (cspsa_fp_read(block_dev,
+ ITP_CSPSA_KEY,
+ &cspsa_key)) {
+ printf("itp_load_itp_and_modem: cspsa_fp_read failed\n");
+ cspsa_key = 0;
+ return 1;
+ }
+ return 0;
+}
+
+int itp_is_itp_in_config(void)
+{
+ return cspsa_key & ITP_LOAD_ITP;
+}
+
/*
* itp_load_itp_and_modem - Loads itp and modem depending on config.
* If itp is loaded ok it will be executed and u-boot execution will stop
*/
-
int itp_load_itp_and_modem(block_dev_desc_t *block_dev)
{
int retval = 0;
- u32 cspsa_key;
void (*loadaddress)(void) = NULL;
debug("\nitp_load_itp_and_modem\n");
@@ -173,14 +191,6 @@ int itp_load_itp_and_modem(block_dev_desc_t *block_dev)
goto exit;
}
- if (cspsa_fp_read(block_dev,
- ITP_CSPSA_KEY,
- &cspsa_key)) {
- printf("itp_load_itp_and_modem: cspsa_fp_read failed\n");
- retval = 1;
- goto exit;
- }
-
if (cspsa_key & ITP_LOAD_MODEM) {
if (itp_load_toc_entry(block_dev,
ITP_TOC_MODEM_NAME,
diff --git a/board/st/u8500/itp.h b/board/st/u8500/itp.h
index 13d039eed..e1faf0db0 100644
--- a/board/st/u8500/itp.h
+++ b/board/st/u8500/itp.h
@@ -21,6 +21,8 @@
#define ITP_CSPSA_KEY 0
+int itp_is_itp_in_config(void);
+int itp_read_config(block_dev_desc_t *block_dev);
int itp_load_itp_and_modem(block_dev_desc_t *block_dev);
#endif /* __ITP_H__ */
diff --git a/board/st/u8500/mmc_host.c b/board/st/u8500/mmc_host.c
index 79be58acd..d17fc6914 100644
--- a/board/st/u8500/mmc_host.c
+++ b/board/st/u8500/mmc_host.c
@@ -21,7 +21,6 @@
#include <malloc.h>
#include <div64.h>
#include "mmc_fifo.h"
-#include "itp.h"
struct mmc_host {
@@ -617,16 +616,14 @@ int board_mmc_init(bd_t *bis)
mmc_init(dev);
/*
- * In a perfect world itp_load_itp shouldn't be here but we want ITP
- * to be loaded as quickly as possible and putting it here will get the
- * shortest time to start loading ITP. Time saved by putting it here
- * compared to later is somewhere between 0.3-0.7s. That is enough to be
- * able to justify putting it here.
+ * In a perfect world board_early_access shouldn't be here but we want
+ * some functionality to be loaded as quickly as possible and putting it
+ * here will get the shortest time to start that functionality. Time
+ * saved by putting it here compared to later is somewhere between
+ * 0.3-0.7s. That is enough to be able to justify putting it here.
*/
-#ifdef CONFIG_ITP_LOAD
- itp_load_itp_and_modem(&dev->block_dev);
-#endif
+ board_early_access(&dev->block_dev);
dev = alloc_mmc_struct();
if (!dev)
diff --git a/board/st/u8500/u8500.c b/board/st/u8500/u8500.c
index 078dadfa2..93cd79d39 100644
--- a/board/st/u8500/u8500.c
+++ b/board/st/u8500/u8500.c
@@ -15,6 +15,7 @@
#include <asm/arch/ab8500.h>
#include <tc35892.h>
#include "gpio.h"
+#include "itp.h"
#include "common.h"
#ifdef CONFIG_VIDEO_LOGO
@@ -69,6 +70,10 @@
int board_id; /* set in board_late_init() */
int errno;
+#ifdef CONFIG_VIDEO_LOGO
+static int mcde_error;
+#endif
+
/*
* Flag to indicate from where to where we have to copy the initialised data.
* In case we were loaded, its value is -1 and .data must be saved for an
@@ -269,10 +274,12 @@ int dram_init(void)
}
#ifdef CONFIG_VIDEO_LOGO
-int dss_init(void)
+static int dss_init(void)
{
- uchar byte;
- puts("MCDE: ");
+ puts("\nMCDE: ");
+
+ boottime_tag("splash");
+
if (!cpu_is_u8500v11() && !cpu_is_u8500v2()) {
printf("Only HREF+ or V2 is supported\n");
goto mcde_error;
@@ -287,19 +294,44 @@ int dss_init(void)
}
printf("ready\n");
- setenv("startup_graphics", "1");
- setenv("logo", "nologo");
return 0;
mcde_error:
- setenv("startup_graphics", "0");
- setenv("logo", "0");
-
return -EINVAL;
}
#endif
+
+/*
+ * board_early_access - for functionality that needs to run before
+ * board_late_init but after board_init and emmc init.
+ */
+int board_early_access(block_dev_desc_t *block_dev)
+{
+
+#ifdef CONFIG_ITP_LOAD
+ itp_read_config(block_dev);
+#endif
+
+#ifdef CONFIG_VIDEO_LOGO
+ /* only load splash if not itp */
+#ifdef CONFIG_ITP_LOAD
+ if (!itp_is_itp_in_config())
+ mcde_error = dss_init();
+#else
+ mcde_error = dss_init();
+#endif
+#endif
+
+#ifdef CONFIG_ITP_LOAD
+ if (itp_load_itp_and_modem(block_dev))
+ return 1;
+#endif
+
+ return 0;
+}
+
unsigned int addr_vall_arr[] = {
0x8011F000, 0x0000FFFF, // Clocks for HSI TODO Enable reqd only
0x8011F008, 0x00001CFF, // Clocks for HSI TODO Enable reqd only
@@ -463,8 +495,13 @@ int board_late_init(void)
}
#endif /* CONFIG_MMC */
#ifdef CONFIG_VIDEO_LOGO
- boottime_tag("splash");
- dss_init();
+ if (mcde_error) {
+ setenv("startup_graphics", "0");
+ setenv("logo", "0");
+ } else {
+ setenv("startup_graphics", "1");
+ setenv("logo", "nologo");
+ }
#endif
/*
* Create a memargs variable which points uses either the memargs256 or