usbd: Erase the qboot also when write ubi image
authorMinkyu Kang <mk7.kang@samsung.com>
Thu, 20 May 2010 00:34:49 +0000 (09:34 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Thu, 20 May 2010 00:34:49 +0000 (09:34 +0900)
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
common/cmd_usbd.c

index ead999b..bfe34c6 100644 (file)
@@ -947,6 +947,17 @@ static int process_data(struct usbd_ops *usbd)
 
        /* File Systems */
        case IMG_FILESYSTEM:
+               /* Erase the qboot also when write ubi image */
+               {
+                       int qboot_id;
+                       qboot_id = get_part_id("qboot");
+
+                       if (qboot_id != -1) {
+                               sprintf(offset, "%x", parts[qboot_id]->offset);
+                               sprintf(length, "%x", parts[qboot_id]->size);
+                               nand_cmd(0, offset, length, NULL);
+                       }
+               }
                ret = write_file_system(ramaddr, len, offset, length,
                                part_id, ubi_update);
                break;