06 May, 2020

40 commits

  • Modify mx6ul defconfig files to enable fastboot in
    mx6ul_14x14 and mx6ul_9x9 EVK boards

    Signed-off-by: Joakim Zhang
    Signed-off-by: Ye Li
    (cherry picked from commit a9a7715eb2471cdf01c160ac269f822abbd80cdc)

    Ye Li
     
  • Modify deconfig files to enable fastboot in
    mx6ull_14x14 and mx6ull_9x9 EVK boards

    Signed-off-by: Joakim Zhang
    Signed-off-by: Ye Li
    (cherry picked from commit 41d3fd64b8791847d58a89cbb05b7135c012f323)

    Ye Li
     
  • iMX7ULP EVK boards enable fastboot as default to support uuu.

    Signed-off-by: Shenwei Wang
    Acked-by : Frank Li

    (cherry picked from commit 035506e86e4f054ec6e75a52e5d7fdbb0f18f8cd)
    Signed-off-by: Ye Li
    (cherry picked from commit 610f6b43c47ac963744442ec9801abf3ec0af784)

    Shenwei Wang
     
  • i.MX6SL boards enable fastboot as default.
    uuu will use fastboot command to write eMMC/SD/SPINOR.

    Signed-off-by: Xiaoning Wang
    Signed-off-by: Ye Li
    (cherry picked from commit d26e641870ff45c4cb48177603f46d566eb0cc4a)

    Ye Li
     
  • i.MX6SoloX SABRE boards enable fastboot as default.
    uuu will use fastboot command to write eMMC/SD/QSPI/NAND

    Signed-off-by: Xiaoning Wang
    Signed-off-by: Ye Li
    (cherry picked from commit 231ccd13a0c2f18b2fe7fec7d23fc22df06e0324)

    Ye Li
     
  • i.MX6SLL boards enable fastboot as default.
    Support: mx6sllevk_defconfig
    mx6sllevk_epdc_defconfig
    mx6sllevk_optee_defconfig
    mx6sllevk_plugin_defconfig
    uuu will use fastboot command to write emmc.

    Signed-off-by: Xiaoning Wang
    Signed-off-by: Ye Li
    (cherry picked from commit f3879673fa179a9c93a7f58de264b4ab463181db)

    Ye Li
     
  • To support the uuu, pack the common qspi header with u-boot binary for
    i.MX6/7 qspi u-boot.

    1. The qspi-header file need to be copied out of source tree.
    2. In mkimage flags, we need to add $(QSPI-HEADER) and %$(PLUGIN).bin.
    Otherwise it will fails to filter out $(QSPI-HEADER) and $(PLUGIN).bin because the $(PLUGIN) is
    extend to full path.
    3. u-boot-dtb.imx and u-boot.imx are updated to add qspi-header.

    Signed-off-by: Han Xu
    (cherry picked from commit 2804e4248bf638165c54c450528a14fe27cc58cd)
    (cherry picked from commit 23b270202916fe32450590c4e9330916e97c18f6)
    Signed-off-by: Ye Li

    Han Xu
     
  • i.MX6DL boards enable fastboot as default, support both sabresd and
    sabreauto.
    uuu will use fastboot command to write emmc.

    Signed-off-by: Xiaoning Wang
    Signed-off-by: Ye Li
    (cherry picked from commit 248dfa629aaef0ed72b8d3a86f4df2fed737eeb9)

    Ye Li
     
  • Modify defconfig files to enable fastboot in mx6qsabre SDB/ARD boards

    Signed-off-by: Joakim Zhang
    Signed-off-by: Ye Li
    (cherry picked from commit f4c7c993f6df4c8be69a0283c8b02c5df4aaf291)

    Ye Li
     
  • Modify defconfig files to enable fastboot in mx6qpsabre SDB/ARD boards

    Signed-off-by: Joakim Zhang
    Signed-off-by: Ye Li
    (cherry picked from commit 2de4c0110145b07009bb19ca5dfd809bb554369b)

    Ye Li
     
  • Enable fastboot configurations in mx6solo sabresd and sabreauto
    defconfigs to support UUU. Since the DDR size on mx6solo sabre
    boards is smaller, also change the fastboot buffer to 256MB.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit 8435fc2e868e7cdd82a36081a97ab73a894b4531)

    Ye Li
     
  • Enable the SPL SDP driver and FASTBOOT driver in iMX8QXP MEK board
    defconfigs to support running UUU

    Signed-off-by: Ye Li
    (cherry picked from commit c0e91ab4f97448a1e529a07513079f859e57df5e)

    Ye Li
     
  • Enable the SPL SDP driver and FASTBOOT driver in MEK board defconfigs

    Signed-off-by: Ye Li
    (cherry picked from commit 29b514bd91919cbfbe638f1474d370c2aae42896)

    Ye Li
     
  • Currenlty U1 and U2 low power modes are allowed in device mode.
    Allowing U1 and U2 low power modes during data transfers in
    device mode is causing U1 exit failure on some USB3 host: which
    will transite to SS.inactive instead of U0, then host will send
    warm reset and ultimately result in reenumeration. This is observed
    on UUU tool with some PC host. Hence disable U1 and U2 low power
    modes for now.

    USB3 spec 7.5.10.4.2 Exit from Recovery.Configuration
    The port shall transition to eSS.Inactive when the following
    conditions are met:
    1. Either the Ux_EXIT_TIMER or the 6-ms timer
    (tRecoveryConfigurationTimeout) times out.
    2. For a downstream port, the transition to Recovery is not to
    attempt a Hot Reset.

    Signed-off-by: Li Jun
    (cherry picked from commit ae0cdc741f7313398539f7b576ced73871f6cd71)
    (cherry picked from commit ac852ce99326e75806e007587fb695c48107d602)

    Li Jun
     
  • As endpoint.maxpackt is set at init for super speed, we can't use it
    for USB2 connection, we need use the right max packet length according
    to connection speed.

    Signed-off-by: Li Jun
    (cherry picked from commit 9c6bb3684649b4ae6f0275b5ad3799ea5c8f32df)
    (cherry picked from commit be0f3cddac9fc393c1868b9b28e9291cf4746638)

    Li Jun
     
  • As we need standard usb_ep's desc, so set it when enable ep.

    Reviewed-by: Peter Chen
    Signed-off-by: Li Jun
    (cherry picked from commit 7d7097a07f8b770840f2e1e240b8cd004a9478b0)
    (cherry picked from commit 42729e2debb41b1e5a0edc71bc04babb10746f7d)

    Li Jun
     
  • Change to use wMaxPacketSize of current speed EP desc for request
    length wrap up.

    Reviewed-by: Peter Chen
    Signed-off-by: Li Jun
    (cherry picked from commit 0d7928ce976d7bcca8e5e27dc1f1645d41460838)
    (cherry picked from commit fb75480f0e1b015f865a303b889a8066338f6483)

    Li Jun
     
  • Remove the gadget driver speed check, and set its max_speed to
    be USB_SPEED_HIGH.

    Reviewed-by: Ye Li
    Reviewed-by: Peter Chen
    Tested-by: faqiang.zhu
    Signed-off-by: Li Jun
    (cherry picked from commit d2eda0a1834e3f4747642a57b36dd76e80e0a101)
    (cherry picked from commit e6d08aa94646a50b03c2b2993b70485d553a2d11)

    Li Jun
     
  • If one of functions is not super speed capable, we need force the udc
    to be high speed, this is an equivalent implementation of
    usb_gadget_udc_set_speed() in kernel but simple, which set the gadget
    max_speed to be high speed, so afterwards when start gadget duc can
    set the HW to be USB 2.0 mode.

    Reviewed-by: Ye Li
    Reviewed-by: Peter Chen
    Tested-by: faqiang.zhu
    Signed-off-by: Li Jun
    (cherry picked from commit 86247b0c88380cc5982b57f094f9b74fec01de31)
    (cherry picked from commit 3583e50d412357be216906824d4c6886395f2258)

    Li Jun
     
  • Change the dwc3 device mode to be super speed capable.

    Reviewed-by: Ye Li
    Reviewed-by: Peter Chen
    Tested-by: faqiang.zhu
    Signed-off-by: Li Jun
    (cherry picked from commit a9dac41fea56c0f41c5d15acd53a232bb1785841)
    (cherry picked from commit 5b506ed4ca952429e819d2765ade20c0178e5a1b)

    Li Jun
     
  • Set its max_speed to be super speed.

    Reviewed-by: Ye Li
    Reviewed-by: Peter Chen
    Tested-by: faqiang.zhu
    Signed-off-by: Li Jun
    (cherry picked from commit dfe8582b06721c9dca8103baec83e6aca4b27b44)
    (cherry picked from commit 9ad7c85b3bb28d99398243f0dcf1d8513df4384c)

    Li Jun
     
  • Add super speed EP config.

    Reviewed-by: Ye Li
    Reviewed-by: Peter Chen
    Tested-by: faqiang.zhu
    Signed-off-by: Li Jun
    (cherry picked from commit a7b7085dec66602bf8905ba3f4ca9235de400366)
    (cherry picked from commit fb0fd21cd06fd54bb86e217fb4e8bfed39941468)

    Li Jun
     
  • This patch is to add usb gadget super speed support in common
    driver, including BOS descriptor and select the super speed
    descriptor from function driver.

    Reviewed-by: Ye Li
    Reviewed-by: Peter Chen
    Tested-by: faqiang.zhu
    Signed-off-by: Li Jun
    (cherry picked from commit b0bc5f6d1292158a068446771c10a4e7285f9623)
    (cherry picked from commit 363267844637123d4fcfb924d624882b02059082)

    Li Jun
     
  • Always use the new added config for os_desc_config to fix cdev->
    os_desc_config may miss set in case we restart usb gadget driver.

    Signed-off-by: Li Jun
    (cherry picked from commit e8efb32e9b7a4fe45c7f21e86052c7f5bcdb6695)
    (cherry picked from commit 8481dd21ded1782a5efcf0efab86aa99313f74c2)
    (cherry picked from commit e77bc59cf1a0ca536beb9279e816ac960bfe00c2)

    Jun Li
     
  • The current way to set cdev->os_desc_config is wrong if user restart
    fastboot, as the old config is not used anymore and new allocated
    usb_configuration will be used, so set the os_desc_config while
    usb_add_config.

    Reviewed-by: Ye Li
    Signed-off-by: Li Jun
    Signed-off-by: Peter Chen
    (cherry picked from commit d401df4812e6c4b368b1c4aa02b584563822b59e)
    (cherry picked from commit c7cd977fcde8b165891bee80acaeb2bace5a2c5b)
    (cherry picked from commit 7decc7985d22bd8400d20e80a16e5e5a93f22798)

    Jun Li
     
  • Add device interface GUID for Microsoft Extended Properties Feature
    Descriptor.

    Signed-off-by: Li Jun
    (cherry picked from commit afee07bcc82b4f1900731a5a68ad920dc89fe88c)
    (cherry picked from commit a505d1ed5f58123f9aec131a0920d1e2672fbd11)
    (cherry picked from commit 36977b1b8e918bc14b465c9164ae0fa72e7fc7da)

    Li Jun
     
  • Enable WCID(Microsoft Compatible ID Feature Descriptor) for mfgtool.

    Signed-off-by: Li Jun
    (cherry picked from commit 7a98d176be377e5df4f7199445977318aa868272)
    (cherry picked from commit 02ce3d544361ddf56f4d790ea56b3bc1b86f8833)
    (cherry picked from commit 244066e0016ba3b8646bcd4356a2c044775adec9)

    Li Jun
     
  • This is a proting patch from linux kernel: 37a3a533429e
    ("usb: gadget: OS Feature Descriptors support"), the original commit
    log see below:

    There is a custom (non-USB IF) extension to the USB standard:

    http://msdn.microsoft.com/library/windows/hardware/gg463182

    They grant permission to use the specification - there is
    "Microsoft OS Descriptor Specification License Agreement"
    under the link mentioned above, and its Section 2 "Grant
    of License", letter (b) reads:

    "Patent license. Microsoft hereby grants to You a nonexclusive,
    royalty-free, nontransferable, worldwide license under Microsoft’s
    patents embodied solely within the Specification and that are owned
    or licensable by Microsoft to make, use, import, offer to sell,
    sell and distribute directly or indirectly to Your Licensees Your
    Implementation. You may sublicense this patent license to Your
    Licensees under the same terms and conditions."

    The said extension is maintained by Microsoft for Microsoft.

    Yet it is fairly common for various devices to use it, and a
    popular proprietary operating system expects devices to provide
    "OS descriptors", so Linux-based USB gadgets whishing to be able
    to talk to a variety of operating systems should be able to provide
    the "OS descriptors".

    This patch adds optional support for gadgets whishing to expose
    the so called "OS Feature Descriptors", that is "Extended Compatibility ID"
    and "Extended Properties".

    Hosts which do request "OS descriptors" from gadgets do so during
    the enumeration phase and before the configuration is set with
    SET_CONFIGURATION. What is more, those hosts never ask for configurations
    at indices other than 0. Therefore, gadgets whishing to provide
    "OS descriptors" must designate one configuration to be used with
    this kind of hosts - this is what os_desc_config is added for in
    struct usb_composite_dev. There is an additional advantage to it:
    if a gadget provides "OS descriptors" and designates one configuration
    to be used with such non-USB-compliant hosts it can invoke
    "usb_add_config" in any order because the designated configuration
    will be reported to be at index 0 anyway.

    This patch also adds handling vendor-specific requests addressed
    at device or interface and related to handling "OS descriptors"."

    Signed-off-by: Li Jun
    (cherry picked from commit 859be2fc12dbd1b99e140641f2d7fa14df29c9dd)
    (cherry picked from commit b524637d502ca75e6eb385b59df708f858a6da2a)
    (cherry picked from commit 56ac0900c5182055a771fd2777f0bbb2295f49a8)

    Li Jun
     
  • As other users may use utf8_to_utf16le() to convert the utf8
    to utf16 for usb, so move it to head file.

    Signed-off-by: Li Jun
    (cherry picked from commit 94870cb6b587243e0a68ee9a3ec43540d76152cc)
    (cherry picked from commit 80150d76172e4443179ddfe8f91c39126493cffa)
    (cherry picked from commit 2d84420646336bc8e9ffea23122ef6c28d3a4f89)

    Li Jun
     
  • This is a porting patch from linux kernel: 19824d5eeece
    ("usb: gadget: OS String support"), original commit log
    see below:

    "There is a custom (non-USB IF) extension to the USB standard:

    http://msdn.microsoft.com/library/windows/hardware/gg463182

    They grant permission to use the specification - there is
    "Microsoft OS Descriptor Specification License Agreement"
    under the link mentioned above, and its Section 2 "Grant
    of License", letter (b) reads:

    "Patent license. Microsoft hereby grants to You a nonexclusive,
    royalty-free, nontransferable, worldwide license under Microsoft’s
    patents embodied solely within the Specification and that are owned
    or licensable by Microsoft to make, use, import, offer to sell,
    sell and distribute directly or indirectly to Your Licensees Your
    Implementation. You may sublicense this patent license to Your
    Licensees under the same terms and conditions."

    The said extension is maintained by Microsoft for Microsoft.

    Yet it is fairly common for various devices to use it, and a
    popular proprietary operating system expects devices to provide
    "OS descriptors", so Linux-based USB gadgets whishing to be able
    to talk to a variety of operating systems should be able to provide
    the "OS descriptors".

    This patch adds optional support for gadgets whishing to expose
    the so called "OS String" under index 0xEE of language 0.
    The contents of the string is generated based on the qw_sign
    array and b_vendor_code.

    Interested gadgets need to set the cdev->use_os_string flag,
    fill cdev->qw_sign with appropriate values and fill cdev->b_vendor_code
    with a value of their choice.

    This patch does not however implement responding to any vendor-specific
    USB requests."

    Signed-off-by: Li Jun
    (cherry picked from commit b6ea0aaee307be0defaf8dc2c1eae9110bdae9a7)
    (cherry picked from commit ccc7596829c33eb1b616e3f5ba434edff444f805)
    (cherry picked from commit 98d8afdca42c1f0e7a875b628e0fb398af2cdea7)

    Li Jun
     
  • The SPL loads the FIT image FDT part to an address related with the device
    block length. This length is 512 for SD/MMC and is 1 for other devices
    like SDP, NOR, NAND, SPI, etc.
    When signing FIT image, we use fixed address caculated by SD/MMC block length
    to sign FDT part. Thus, when booting through uuu, this causes mismatch and
    gets authentication failed.

    Fix the issue by providing a override function for this FIT buffer address.
    When secure boot is enabled, adjust the addresses of other devices to be same
    with SD/MMC.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit 710efd3ccb99e144bd30af8e1ee46459b4a54dd6)
    (cherry picked from commit f48835f0b6b801cb267b4c27a50136c93dfd3bcf)

    Ye Li
     
  • Stop the usb device controller before enter kernel, this is required
    to make kernel can properly init usb controller with it's in stopped
    state.

    Suggested-by: Ye.Li
    Reviewed-by: Ye Li
    Signed-off-by: Li Jun
    (cherry picked from commit 27d6b4cf3d8d6701aeb800b307ef52afd18540ba)
    (cherry picked from commit dfcd809622bd994937724dc8c3252c16a2131056)

    Li Jun
     
  • uuu will use fastboot command to write emmc, enable it as
    default for iMX8MM EVK board

    Signed-off-by: Frank Li
    Signed-off-by: Ye Li
    (cherry picked from commit ed6898da1c1a78dbf59ac4d6d291bc25e14c636e)

    Ye Li
     
  • As there is problem with super speed with SDP, we force the dwc3
    usb speed to be high speed.

    Signed-off-by: Li Jun
    (cherry picked from commit eeb6a8d545e4810df6e3ce2125fa69a1781ea605)
    (cherry picked from commit 6f2cb1d190acebd5e55260c1eaeb3b7666c1f70c)

    Li Jun
     
  • As the SDP protocol use the predefined ep num for communication, we can't
    change its name hence reset its ep num while do ep autoconfig, this is
    only apply for SPL.

    Signed-off-by: Li Jun
    (cherry picked from commit bc76fe6dad1e8d6e5a98eea635a57b0feb4fefcf)
    (cherry picked from commit 4931d49ae958ca8c3d28a9c206228d7458afd4bd)

    Li Jun
     
  • uuu can download whole uboot and run it
    fastboot also enabled.

    Signed-off-by: Frank Li
    (cherry picked from commit 21ce8ab67d0a8eae3df91b074ffad9fb4b987961)
    Signed-off-by: Ye Li
    (cherry picked from commit 95a805fe1fb46b0a49e89bfb99ebe0dd70705927)

    Frank Li
     
  • Enable DWC3 USB support at i.MX850D platform

    Signed-off-by: Li Jun
    Signed-off-by: Frank Li
    (cherry picked from commit 7c3d2a17bf85e97a486d01e231480baaa7e7a167)
    (cherry picked from commit 1dd830df85ef684d8b6acd4655204ce7bd6be997)

    Frank Li
     
  • When booting from USB device, change u-boot autoboot to default
    run UUU bootcmd or enter fastboot directly for android.

    Signed-off-by: Ye Li
    (cherry picked from commit eba8710106348a283940b851080b049bc7fbe466)

    Ye Li
     
  • Add the uuu environment to each board, when booting from USB, the
    u-boot will use them by default

    Signed-off-by: Ye Li
    (cherry picked from commit e36e653ca2f5b0e879d84925219455790acaf2d2)

    Ye Li
     
  • For flash devices, like spi nor, weim nor and qspi/flexspi,
    we don't define the ENV in MMC, but UUU fastboot always use the
    mmc_get_env_dev. So we have to decouple the function with
    CONFIG_ENV_IS_IN_MMC

    Signed-off-by: Ye Li
    (cherry picked from commit ef480647da5686403c7fed09aaf47ca1ace54731)

    Ye Li