24 May, 2019

40 commits

  • 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

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

    Signed-off-by: Joakim Zhang
    Signed-off-by: Ye Li

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

    Signed-off-by: Joakim Zhang
    Signed-off-by: Ye Li

    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

    Ye Li
     
  • CS GPIO output level is inverse and cause SPI not working. Fix
    the issue by setting current CS level

    Signed-off-by: Ye Li

    Ye Li
     
  • Enable the SPL SDP driver and FASTBOOT driver in iMX8QXP LPDDR4,
    DDR3 and DX(QXP) 17x17 validation boards.
    Move the CONFIG_USB_EHCI_HCD to defconfig, since DX(QXP) 17x17 only
    support USB OTG. Also add the USB power up/down in board for SPL

    Signed-off-by: Ye Li

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

    Signed-off-by: Ye Li

    Ye Li
     
  • Enable the SPL SDP driver and FASTBOOT driver in iMX8QM LPDDR4 and
    DDR4 validation boards. And add the uuu environment, so the UUU can
    work on these boards

    Signed-off-by: Ye Li

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

    Signed-off-by: Ye Li

    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)

    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)

    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)

    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)

    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)

    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)

    Li Jun
     
  • Keep high speed for SPL, but for normal uboot, enable super speed.

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

    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)

    Li Jun
     
  • Remove high speed force and set it to super speed by default.

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

    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)

    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)

    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)

    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)

    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)

    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)

    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)

    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)

    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)

    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)

    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)

    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)

    Li Jun
     
  • When using gcc 4.9 to build SPL, the image size is beyond current
    limitation 128KB. This gcc version is used in android tool chain. So
    enlarge the SPL max size to 148KB. This value is also aligned with
    other imx8mq/mm boards settings.

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

    Ye Li
     
  • The new uuu will change to burn entire boot image to nandfit mtdpart not
    only the FIT image. We enable REDUND offset configuration here, so that SPL will
    try to find FIT header at two locations: the begin of nandfit mtdpart and
    the 0x57c00 offset of nandfit mtdpart. This helps to be compatible with both
    old and new uuu.

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

    Ye Li
     
  • 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

    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)

    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)

    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

    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)

    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

    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

    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

    Ye Li