From 496542bc2d3c1b0ff19adc2e2fb6c4bf0fecefe2 Mon Sep 17 00:00:00 2001 From: Ravi Babu Date: Mon, 26 Dec 2016 17:10:54 +0530 Subject: fastboot: qspi: fix for dual stage qspi u-boot failure The u-boot region was not erased correctly in fastboot qspi erase command, which leads to failed to boot to u-boot in qspi bootmode. Change-Id: Ibc6c4d1fb94f3c9ed5c8800398866c1e5337bae6 Signed-off-by: Ravi Babu [verified android] Signed-off-by: Praneeth Bajjuri --- drivers/usb/gadget/f_fastboot.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index ece16005a1..c64d3173f5 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -622,19 +622,15 @@ static void fastboot_update_bootloader(char *cmd) reset_fastboot_cmd(); if (strncmp("xloader", cmd, 7) == 0) { + printf("%s:xloader\n", __func__); sprintf(cmdbuf, "sf write 0x%x 0 40000", (unsigned int)CONFIG_FASTBOOT_BUF_ADDR); add_fastboot_cmd(0, cmdbuf); - sprintf(cmdbuf, "sf update 0x%x 0 40000", - (unsigned int)CONFIG_FASTBOOT_BUF_ADDR); - add_fastboot_cmd(1, cmdbuf); } else if (strncmp("bootloader", cmd, 10) == 0) { - sprintf(cmdbuf, "sf write 0x%x 40000 80000", + printf("%s:bootloader\n", __func__); + sprintf(cmdbuf, "sf write 0x%x 40000 100000", (unsigned int)CONFIG_FASTBOOT_BUF_ADDR); add_fastboot_cmd(0, cmdbuf); - sprintf(cmdbuf, "sf update 0x%x 40000 80000", - (unsigned int)CONFIG_FASTBOOT_BUF_ADDR); - add_fastboot_cmd(1, cmdbuf); } run_fastboot_cmd(); } @@ -845,7 +841,7 @@ static void cb_oem(struct usb_ep *ep, struct usb_request *req) flash_spi = 1; add_fastboot_cmd(0, "sf probe 0"); add_fastboot_cmd(1, "sf erase 0 0x40000"); - add_fastboot_cmd(2, "sf erase 0x40000 0x80000"); + add_fastboot_cmd(2, "sf erase 0x40000 0x100000"); } else if (strncmp("unlock", cmd + 4, 8) == 0) { fastboot_tx_write_str("FAILnot implemented"); return ; -- cgit v1.2.3