s5pc1xx: add checking routines for EVT1-Fused
authorMinkyu Kang <mk7.kang@samsung.com>
Tue, 30 Mar 2010 10:18:37 +0000 (19:18 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Tue, 30 Mar 2010 10:18:37 +0000 (19:18 +0900)
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
board/samsung/universal/universal.c
common/cmd_usbd.c

index 33bdd95..55472b8 100644 (file)
@@ -686,7 +686,10 @@ static void show_hw_revision(void)
                                s5pc1xx_set_cpu_rev(0);
                }
        } else if (mach_is_kessler()) {
-               s5pc1xx_set_cpu_rev(1);
+               if (board_is_neptune() && hwrevision(2))
+                       s5pc1xx_set_cpu_rev(2); /* EVT1-Fused */
+               else
+                       s5pc1xx_set_cpu_rev(1);
        } else if (mach_is_geminus()) {
                if ((board_rev & 0xf) < 1)
                        s5pc1xx_set_cpu_rev(0);
@@ -697,7 +700,7 @@ static void show_hw_revision(void)
        }
 
        if (cpu_is_s5pc110())
-               writel(0xc1100000 | (0xffff & s5pc1xx_get_cpu_rev()),
+               writel(0xc1100000 | (0xffff & (s5pc1xx_get_cpu_rev() ? 1 : 0)),
                                S5PC110_INFORM3);
 
        empty_device_info_buffer();
index fe8b647..3dfe312 100644 (file)
@@ -821,9 +821,17 @@ static int process_data(struct usbd_ops *usbd)
 
                        if (*img_header == 0xea000012)
                                img_rev = 0;
+                       else if (*(img_header + 0x400) == 0xea000012)
+                               img_rev = 2;
 
                        if (img_rev != s5pc1xx_get_cpu_rev()) {
-                               printf("CPU revision mismatch!\n");
+                               printf("CPU revision mismatch!\n"
+                                       "bootloader is %s%s\n"
+                                       "download image is %s%s\n",
+                                       s5pc1xx_get_cpu_rev() ? "EVT1" : "EVT0",
+                                       s5pc1xx_get_cpu_rev() == 2 ? "-Fused" : "",
+                                       img_rev ? "EVT1" : "EVT0",
+                                       img_rev == 2 ? "-Fused" : "");
                                *((ulong *) usbd->tx_data) = STATUS_ERROR;
                                usbd->send_data(usbd->tx_data, usbd->tx_len);
                                return 0;