summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cleopatre/u-boot-1.1.6/common/cmd_spidboot.c21
-rw-r--r--cleopatre/u-boot-1.1.6/include/configs/spc300_arch.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/cleopatre/u-boot-1.1.6/common/cmd_spidboot.c b/cleopatre/u-boot-1.1.6/common/cmd_spidboot.c
index 28bf69f27c..f2d2721f95 100644
--- a/cleopatre/u-boot-1.1.6/common/cmd_spidboot.c
+++ b/cleopatre/u-boot-1.1.6/common/cmd_spidboot.c
@@ -34,6 +34,7 @@
#include <asm/arch/wdt.h>
#include <asm/arch/ips/uart.h>
#if defined (CONFIG_CHIP_MSE500)
+#include <asm/arch/sram-mapping.h>
#include <asm/arch/ips/hardware/msepll.h>
#include <asm/arch/ips/hardware/mseafe.h>
#include <asm/arch/ips/hardware/iomux.h>
@@ -522,6 +523,26 @@ static int select_image(int img_nb)
uint version_len;
spidcom_image_desc_image_type_t prev_img_type = SPIDCOM_IMG_DESC_IMAGE_TYPE_UNKNOWN;
int i;
+#if defined (CONFIG_CHIP_MSE500)
+ volatile sram_autoswitch_data_t *autoswitch_data = (volatile sram_autoswitch_data_t *) SRAM_DATA_PA_PTR (autoswitch);
+
+ if (!strncmp ((const char *)autoswitch_data->magic, MSE500_AUTOSWITCH_MAGIC,
+ MSE500_AUTOSWITCH_MAGIC_SIZE)
+ && ((autoswitch_data->slot <= 1) && (autoswitch_data->slot >= 0)))
+ {
+ if (load_header (&img_desc[autoswitch_data->slot],
+ (char *)img_addr[autoswitch_data->slot]) >= 0)
+ {
+ int state = check_img (&img_desc[autoswitch_data->slot],
+ (char *)img_addr[autoswitch_data->slot]);
+ if (state == IMAGE_OK || state == IMAGE_OK_ORIGIN)
+ {
+ autoswitch_en = 1;
+ return autoswitch_data->slot;
+ }
+ }
+ }
+#endif
for (i=0; i<img_nb; i++)
{
diff --git a/cleopatre/u-boot-1.1.6/include/configs/spc300_arch.h b/cleopatre/u-boot-1.1.6/include/configs/spc300_arch.h
index 2bacdb1820..9c91b3c41a 100644
--- a/cleopatre/u-boot-1.1.6/include/configs/spc300_arch.h
+++ b/cleopatre/u-boot-1.1.6/include/configs/spc300_arch.h
@@ -56,6 +56,7 @@
# define CONFIG_CHIP_FEATURE_MSEPLL 1
# define CONFIG_CHIP_FEATURE_IOMUX 1
# define CONFIG_CHIP_FEATURE_MSEETH 1
+# define CONFIG_CHIP_FEATURE_SRAM 1
# define CONFIG_AFE_MSEAFE 1
# define CONFIG_CHIP_TYPE "MSE500"
#else