summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-11-01 03:17:39 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-11-01 03:17:39 +0000
commit5d9355182da08cd8062e4f9082629cced1e569b9 (patch)
treeaf2ddb8f0af27c8bbb8937825e459458c18cd0df
parentbcbb47b88b5a5a0822d4cb3442877f80310fa4ee (diff)
parent4910b93547c1d05dd0282dee9ba8bf54e44a789e (diff)
downloaduboot-imx-o-mr1-iot-preview-6.tar.gz
Snap for 4427960 from 4910b93547c1d05dd0282dee9ba8bf54e44a789e to oc-mr1-iot-releaseandroid-o-mr1-iot-preview-6o-mr1-iot-preview-6
Change-Id: I317eb674e14ec78e30515e26686131d73ff055d4
-rw-r--r--configs/mx6ul_nxpu_iopb_defconfig3
-rw-r--r--configs/mx6ul_nxpu_iopb_trusty_defconfig3
-rw-r--r--configs/mx6ul_spriot_defconfig3
-rwxr-xr-xconfigs/pico-imx6dl_defconfig3
-rw-r--r--configs/pico-imx7d-trusty_defconfig3
-rw-r--r--configs/pico-imx7d_defconfig3
-rw-r--r--configs/picosom-imx6ul-trusty_defconfig3
-rw-r--r--configs/picosom-imx6ul_defconfig3
-rw-r--r--drivers/usb/gadget/f_fastboot.c49
-rw-r--r--include/configs/mx_android_common.h2
10 files changed, 65 insertions, 10 deletions
diff --git a/configs/mx6ul_nxpu_iopb_defconfig b/configs/mx6ul_nxpu_iopb_defconfig
index 70f36cac4c..a8d365c21b 100644
--- a/configs/mx6ul_nxpu_iopb_defconfig
+++ b/configs/mx6ul_nxpu_iopb_defconfig
@@ -2,6 +2,9 @@ CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6ul_nxpu_iopb/imximage.cf
CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6UL_NXPU_IOPB=y
+CONFIG_FASTBOOT=y
+CONFIG_CMD_FASTBOOT=y
+CONFIG_ANDROID_BOOT_IMAGE=y
CONFIG_BOOTDELAY=-2
CONFIG_EFI_PARTITION=y
CONFIG_BOARD_EARLY_INIT_F=y
diff --git a/configs/mx6ul_nxpu_iopb_trusty_defconfig b/configs/mx6ul_nxpu_iopb_trusty_defconfig
index a1cac16ef9..c8e99b439c 100644
--- a/configs/mx6ul_nxpu_iopb_trusty_defconfig
+++ b/configs/mx6ul_nxpu_iopb_trusty_defconfig
@@ -4,6 +4,9 @@ CONFIG_ARCH_MX6=y
CONFIG_IMX_TRUSTY_OS=y
CONFIG_AVB_ATX=y
CONFIG_TARGET_MX6UL_NXPU_IOPB=y
+CONFIG_FASTBOOT=y
+CONFIG_CMD_FASTBOOT=y
+CONFIG_ANDROID_BOOT_IMAGE=y
CONFIG_BOOTDELAY=-2
CONFIG_EFI_PARTITION=y
CONFIG_BOARD_EARLY_INIT_F=y
diff --git a/configs/mx6ul_spriot_defconfig b/configs/mx6ul_spriot_defconfig
index f67fc0d078..030437cb66 100644
--- a/configs/mx6ul_spriot_defconfig
+++ b/configs/mx6ul_spriot_defconfig
@@ -3,6 +3,9 @@ CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_MX6UL=y
CONFIG_TARGET_MX6UL_SPRIOT=y
+CONFIG_FASTBOOT=y
+CONFIG_CMD_FASTBOOT=y
+CONFIG_ANDROID_BOOT_IMAGE=y
CONFIG_BOOTDELAY=-2
CONFIG_EFI_PARTITION=y
CONFIG_BOARD_EARLY_INIT_F=y
diff --git a/configs/pico-imx6dl_defconfig b/configs/pico-imx6dl_defconfig
index 5ab49878ea..09a21233fb 100755
--- a/configs/pico-imx6dl_defconfig
+++ b/configs/pico-imx6dl_defconfig
@@ -4,6 +4,9 @@ CONFIG_ARCH_MX6=y
CONFIG_TARGET_PICO_IMX6DL=y
CONFIG_SYS_MALLOC_F=y
CONFIG_SYS_MALLOC_F_LEN=0x400
+CONFIG_FASTBOOT=y
+CONFIG_CMD_FASTBOOT=y
+CONFIG_ANDROID_BOOT_IMAGE=y
CONFIG_BOOTDELAY=-2
CONFIG_EFI_PARTITION=y
CONFIG_VIDEO=y
diff --git a/configs/pico-imx7d-trusty_defconfig b/configs/pico-imx7d-trusty_defconfig
index 3f27a9ad58..69fcf7d1fa 100644
--- a/configs/pico-imx7d-trusty_defconfig
+++ b/configs/pico-imx7d-trusty_defconfig
@@ -7,6 +7,9 @@ CONFIG_TARGET_PICO_IMX7D=y
CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
CONFIG_SYS_MALLOC_F=y
CONFIG_SYS_MALLOC_F_LEN=0x400
+CONFIG_FASTBOOT=y
+CONFIG_CMD_FASTBOOT=y
+CONFIG_ANDROID_BOOT_IMAGE=y
CONFIG_BOOTDELAY=-2
CONFIG_EFI_PARTITION=y
CONFIG_VIDEO=y
diff --git a/configs/pico-imx7d_defconfig b/configs/pico-imx7d_defconfig
index bff1e9bae9..70e61f8d76 100644
--- a/configs/pico-imx7d_defconfig
+++ b/configs/pico-imx7d_defconfig
@@ -5,6 +5,9 @@ CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
CONFIG_TARGET_PICO_IMX7D=y
CONFIG_SYS_MALLOC_F=y
CONFIG_SYS_MALLOC_F_LEN=0x400
+CONFIG_FASTBOOT=y
+CONFIG_CMD_FASTBOOT=y
+CONFIG_ANDROID_BOOT_IMAGE=y
CONFIG_BOOTDELAY=-2
CONFIG_EFI_PARTITION=y
CONFIG_VIDEO=y
diff --git a/configs/picosom-imx6ul-trusty_defconfig b/configs/picosom-imx6ul-trusty_defconfig
index 95ed189d92..af99c09dd2 100644
--- a/configs/picosom-imx6ul-trusty_defconfig
+++ b/configs/picosom-imx6ul-trusty_defconfig
@@ -6,6 +6,9 @@ CONFIG_AVB_ATX=y
CONFIG_TARGET_PICOSOM_IMX6UL=y
CONFIG_SYS_MALLOC_F=y
CONFIG_SYS_MALLOC_F_LEN=0x400
+CONFIG_FASTBOOT=y
+CONFIG_CMD_FASTBOOT=y
+CONFIG_ANDROID_BOOT_IMAGE=y
CONFIG_BOOTDELAY=-2
CONFIG_EFI_PARTITION=y
CONFIG_BOARD_EARLY_INIT_F=y
diff --git a/configs/picosom-imx6ul_defconfig b/configs/picosom-imx6ul_defconfig
index 0fce71d05c..c326ab6c09 100644
--- a/configs/picosom-imx6ul_defconfig
+++ b/configs/picosom-imx6ul_defconfig
@@ -4,6 +4,9 @@ CONFIG_ARCH_MX6=y
CONFIG_TARGET_PICOSOM_IMX6UL=y
CONFIG_SYS_MALLOC_F=y
CONFIG_SYS_MALLOC_F_LEN=0x400
+CONFIG_FASTBOOT=y
+CONFIG_CMD_FASTBOOT=y
+CONFIG_ANDROID_BOOT_IMAGE=y
CONFIG_BOOTDELAY=-2
CONFIG_EFI_PARTITION=y
CONFIG_BOARD_EARLY_INIT_F=y
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 5862e59632..ddd9cc9d39 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -2756,6 +2756,15 @@ static int fastboot_set_alt(struct usb_function *f,
ret = -EINVAL;
goto err;
}
+#ifdef CONFIG_ANDROID_THINGS_SUPPORT
+ /*
+ * fastboot host end implement to get data in one bulk package so need
+ * large buffer for the "fastboot upload" and "fastboot get_staged".
+ */
+ if (f_fb->in_req->buf)
+ free(f_fb->in_req->buf);
+ f_fb->in_req->buf = memalign(CONFIG_SYS_CACHELINE_SIZE, EP_BUFFER_SIZE * 32);
+#endif
f_fb->in_req->complete = fastboot_complete;
ret = usb_ep_queue(f_fb->out_ep, f_fb->out_req, 0);
@@ -2961,8 +2970,9 @@ static int get_single_var(char *cmd, char *response)
char *str = cmd;
size_t chars_left;
const char *s;
- int mmc_no = 0;
- struct blk_desc *dev_desc;
+ struct mmc *mmc;
+ int mmc_dev_no;
+ int blksz;
chars_left = FASTBOOT_RESPONSE_LEN - strlen(response) - 1;
@@ -3006,13 +3016,14 @@ static int get_single_var(char *cmd, char *response)
snprintf(response + strlen(response), chars_left, "0x%x", CONFIG_FASTBOOT_BUF_SIZE);
} else if (!strcmp_l1("erase-block-size", cmd)) {
- mmc_no = fastboot_devinfo.dev_id;
- dev_desc = blk_get_dev("mmc", mmc_no);
- snprintf(response + strlen(response), chars_left, "0x%x", (unsigned int)dev_desc->blksz);
+ mmc_dev_no = mmc_get_env_dev();
+ mmc = find_mmc_device(mmc_dev_no);
+ blksz = get_block_size();
+ snprintf(response + strlen(response), chars_left, "0x%x",
+ (blksz * mmc->erase_grp_size));
} else if (!strcmp_l1("logical-block-size", cmd)) {
- mmc_no = fastboot_devinfo.dev_id;
- dev_desc = blk_get_dev("mmc", mmc_no);
- snprintf(response + strlen(response), chars_left, "0x%x", (unsigned int)dev_desc->blksz);
+ blksz = get_block_size();
+ snprintf(response + strlen(response), chars_left, "0x%x", blksz);
} else if (!strcmp_l1("serialno", cmd)) {
s = get_serial();
if (s)
@@ -3279,6 +3290,25 @@ static void rx_handler_dl_image(struct usb_ep *ep, struct usb_request *req)
usb_ep_queue(ep, req, 0);
}
+static void cb_upload(struct usb_ep *ep, struct usb_request *req)
+{
+ char response[FASTBOOT_RESPONSE_LEN];
+
+ if (!download_bytes || download_bytes > (EP_BUFFER_SIZE * 32)) {
+ sprintf(response, "FAIL");
+ fastboot_tx_write_str(response);
+ return;
+ }
+
+ printf("Will upload %d bytes.\n", download_bytes);
+ snprintf(response, FASTBOOT_RESPONSE_LEN, "DATA%08x", download_bytes);
+ fastboot_tx_write_str(response);
+
+ fastboot_tx_write((const char *)(interface.transfer_buffer), download_bytes);
+
+ snprintf(response,FASTBOOT_RESPONSE_LEN, "OKAY");
+ fastboot_tx_write_str(response);
+}
static void cb_download(struct usb_ep *ep, struct usb_request *req)
{
char *cmd = req->buf;
@@ -3638,6 +3668,9 @@ static const struct cmd_dispatch_info cmd_dispatch_info[] = {
.cmd = "getvar:",
.cb = cb_getvar,
}, {
+ .cmd = "upload",
+ .cb = cb_upload,
+ }, {
.cmd = "download:",
.cb = cb_download,
}, {
diff --git a/include/configs/mx_android_common.h b/include/configs/mx_android_common.h
index f58f21add4..6a00ef229e 100644
--- a/include/configs/mx_android_common.h
+++ b/include/configs/mx_android_common.h
@@ -23,8 +23,6 @@
#define CONFIG_G_DNL_MANUFACTURER "FSL"
#define CONFIG_USB_FUNCTION_FASTBOOT
-#define CONFIG_CMD_FASTBOOT
-#define CONFIG_ANDROID_BOOT_IMAGE
#define CONFIG_FASTBOOT_FLASH
#define CONFIG_FSL_FASTBOOT