From a3fe17c70d7ecb77aa933b128df5ceee303f16cb Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Tue, 5 Jan 2010 09:10:47 +0900 Subject: [PATCH] s5pc1xx: checking cpu revision at bootloader downloading Signed-off-by: Minkyu Kang --- common/cmd_usbd.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/common/cmd_usbd.c b/common/cmd_usbd.c index 20d2d36..507f718 100644 --- a/common/cmd_usbd.c +++ b/common/cmd_usbd.c @@ -12,7 +12,7 @@ #include /* version of USB Downloader Application */ -#define APP_VERSION "1.3.3" +#define APP_VERSION "1.3.4" #ifdef CONFIG_CMD_MTDPARTS #include @@ -720,6 +720,21 @@ static int process_data(struct usbd_ops *usbd) /* Erase and Write to NAND */ switch (part_id) { case BOOT_PART_ID: +#ifdef CONFIG_S5PC1XX + /* Workaround: for prevent revision mismatch */ + if (cpu_is_s5pc110()) { + int img_rev = 1; + long *img_header = down_ram_addr; + + if (*img_header == 0xea000012) + img_rev = 0; + + if (img_rev != s5pc1xx_get_cpu_rev()) { + printf("CPU revision mismatch!\n"); + return 0; + } + } +#endif #if defined(CONFIG_ENV_IS_IN_NAND) || defined(CONFIG_ENV_IS_IN_ONENAND) /* Erase the environment also when write bootloader */ { -- 2.7.4