14 Jun, 2018

18 commits

  • Introduce console write hypercall to let Uboot could directly
    output with xen console, this needs CONFIG_VERBOSE_DEBUG
    enabled in xen.

    Because input is not a must requirement in android VM,
    and develop pvconsole needs more efforts, so let's use
    this hypercall first.

    Signed-off-by: Peng Fan
    (cherry picked from commit 8836c3104a1edfe542e0c1cef6690bc9d3d842a0)

    Peng Fan
     
  • Introduce CONFIG_XEN to make U-Boot could be used as bootloader
    for a virtual machine.

    Without bootloader, we could successfully boot up android on XEN, but
    we need need bootloader to support A/B, dm verify and etc.

    Signed-off-by: Peng Fan

    Peng Fan
     
  • The sec_boot environment is used for AHAB secure boot. When run command
    "env default -f -a", this environment is not set due to its default value
    is not added to CONFIG_EXTRA_ENV_SETTINGS. Then the boot flow will go to
    AHAB branch to load OS container.

    Fix the issue by adding default sec_boot value to CONFIG_EXTRA_ENV_SETTINGS.

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

    Ye Li
     
  • Add the board_ehci_usb_phy_mode in board codes to overwrite the default
    in ehci-mx6 driver. Since the DRP is enabled in tcpc, we use the feature
    in board_ehci_usb_phy_mode to detect current role. Then driver can
    assign correct role type to board_usb_init and board_usb_cleanup.

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

    Ye Li
     
  • Enable the DRP, so the tcpc can try to toggle the role. This helps to
    determine the current role when we don't know whether device or host is
    connected.

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

    Ye Li
     
  • Since the PD switch callback is added to tcpc driver, we move the
    NX20P3483 settings to this callback to exit DB and set OVP.

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

    Ye Li
     
  • Introduce a callback function to setup external PD switch. When PD
    process is enabled, we call this function only when SINK_VBUS is enabled
    to avoid system power shut down.
    When PD process is disabled, since the tcpc and external PD switch may
    still in dead battery mode, set them to exit dead battery.

    This patch is used to fix two issues on iMX8MM EVK:

    1. When power on the board, by default the PTN5110 and NX20P3483 will
    enter dead battery mode. But for some cases, like timing issue for PTN5110
    and NX20P3483 (refer rework instructions CQ6), and when dual port are plugin
    power sources. There are possibility the PTN5110 does not enter dead battery mode,
    but NX20P3483 is in dead battery. So for the USB2 primary power port, we has to check
    SINK_VBUS before NX20P3483 exits dead battery, otherwise the system power will shut down

    2. For the USB1 port, when dual port are plugin power sources. We need to set both
    PTN5110 and NX20P3483 exit dead battery. Otherwise this port can't work for normal
    host/device mode.

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

    Ye Li
     
  • The board_usb_clean in ehci-mx6 always set to HOST. This is wrong
    when we running gadget. Change to use type in private data.

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

    Ye Li
     
  • There is already a PERF_TEST_2 macro controlling the performance
    settings.
    Also the removed settings in this patch is directly copied
    from i.MX8MQ which is not that correct in some settings,
    so remove them.

    Signed-off-by: Peng Fan
    (cherry picked from commit 0c8c6f616c8c819e986d4246f744e8ef7aed0919)

    Peng Fan
     
  • For all the devices used and set ACTIVE in U-Boot, U-Boot needs
    to power off all of them without the check of resource owner.

    When we create software partition before booting Linux, the resource
    own checkw will return false, and cause the power domain not powered
    off. If without the check of resource owner, the power domain in
    the other software partition could be powered off with parent
    partition could access child partition resources.

    Signed-off-by: Peng Fan
    (cherry picked from commit 3e29e8adace18035850be9d56cc277c64a221e85)

    Peng Fan
     
  • Set grant to true to grant parent able to access resources assigned
    to child partition.

    Signed-off-by: Peng Fan
    (cherry picked from commit 415e9cd60c849b55935f415e86da071c1c4aeade)

    Peng Fan
     
  • 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)

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

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

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

    Signed-off-by: Li Jun
    (cherry picked from commit 7a98d176be377e5df4f7199445977318aa868272)

    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)

    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)

    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)

    Li Jun
     
  • Since M4 will arrange some eDMA channels to its partition, the A core
    can't use them. We have to remove these eDMA channels from DTB dynamically.

    Different like other resources, disabling the eDMA channels require to modify
    the edma nodes by removing relevant registers, interrupts configurations, and
    adjust dma channels number.

    This patch searches the edma nodes from kernel DTB, checks the channels by
    binding their registers base address with their resource IDs. Then update
    the reg, interrupts, interrupt-names and dma-channels properties.

    Signed-off-by: Ye Li
    Acked-by : Robin Gong

    Ye Li
     

13 Jun, 2018

22 commits