From: Minkyu Kang Date: Tue, 5 Jan 2010 00:10:47 +0000 (+0900) Subject: s5pc1xx: checking cpu revision at bootloader downloading X-Git-Tag: JA02_20100111~28^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3fe17c70d7ecb77aa933b128df5ceee303f16cb;p=kernel%2Fu-boot.git s5pc1xx: checking cpu revision at bootloader downloading Signed-off-by: Minkyu Kang --- 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 */ {