09 Aug, 2019

1 commit


24 May, 2019

7 commits

  • 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
     
  • 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
     
  • change the maximum oob size to 1872 for the MT29F128G08CBCCB raw NAND
    chip on i.MX8QXP

    Signed-off-by: Han Xu
    (cherry picked from commit 58dee6ac965000f93693c36c93fb3d453293c43f)
    (cherry picked from commit d297f33f4719502aa415dc7c7002c437a6af6c28)

    Han Xu
     
  • imx8mq usb xhci is a dwc3 based controller, its synopsys PHY
    can be controlled by usbmix glue layer. imx8mq has 2 USB3 instance,
    this patch enables both two USB3 controllers.

    Reviewed-by : Peng Fan
    Signed-off-by: Li Jun

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

    Li Jun
     
  • Porting the cadence USB3 (CDNS3) driver from kernel to u-boot. We only support
    the gadget (device mode), while the host mode is not supported. Users remains
    to use xhci-imx8 driver for host mode.

    Some changes in the CDNS3 driver porting:

    1. Add match_ep call back to usb_gadget_ops. The CDNS3 gadget driver replies
    on this operation to bind the usb_ep/usb_ss_ep with the endpoint descriptor
    when function layer uses usb_ep_autoconfig to add endpoint descriptors to gadget.
    So that CDNS3 driver can know the EP information and configure the EP once the
    set configuration request is received.

    2. U-boot does not have CMA, so it won't allocate uncached memory. Need to flush
    TRB and its DMA buffer before prime to usb controller and after complete transfer.

    3. In core.c, we add functions to hook with u-boot. It needs uplayer like
    to pass the register base address of each part of the USB controller.

    4. Force the CDNS3 gadget max speed to HS. The SuperSpeed is not supported by u-boot,
    so disable it in gadget driver. A configuration USB_CDNS3_GADGET_FORCE_HIGHSPEED is
    selected.

    5. Added gadget_is_cdns3 checking to provide bcdUSB value in device descriptor.

    6. Moved some new fields in usb_ep structure to usb_ss_ep, since u-boot does not have them.

    7. Remove host part codes as it is not supported by this driver.

    Signed-off-by: Ye Li
    Acked-by: Peter Chen
    (cherry picked from commit 70514bd095ff9a94e9a523845641381486284257)
    (cherry picked from commit db2cc879f7e53ead1e3615c1d61ba0b571e81dfa)

    Ye Li
     

07 Feb, 2019

3 commits

  • For legacy reasons, we will have to keep around U-Boot specific
    SPI_FLASH_BAR and SPI_TX_BYTE. Add them back to the new framework

    Signed-off-by: Vignesh R
    Reviewed-by: Jagan Teki
    Tested-by: Jagan Teki #zynq-microzed

    Vignesh R
     
  • Current U-Boot SPI NOR support (sf layer) is quite outdated as it does not
    support 4 byte addressing opcodes, SFDP table parsing and different types of
    quad mode enable sequences. Many newer flashes no longer support BANK
    registers used by sf layer to a access >16MB of flash address space.
    So, sync SPI NOR framework from Linux v4.19 that supports all the
    above features. Start with basic sync up that brings in basic framework
    subsequent commits will bring in more features.

    Signed-off-by: Vignesh R
    Tested-by: Simon Goldschmidt
    Tested-by: Stefan Roese
    Tested-by: Horatiu Vultur
    Reviewed-by: Jagan Teki
    Tested-by: Jagan Teki #zynq-microzed

    Vignesh R
     
  • In arch/sandbox/include/asm/types.h we have
    Therefore for 32 bit Sandbox build BITS_PER_LONG turns out to be 32 as
    CONFIG_PHYS64 is not set

    This messes up the current logic of GENMASK macro due to mismatch b/w
    size of unsigned long (64 bit) and that of BITS_PER_LONG.
    Fix this by using CONFIG_SANDBOX_BITS_PER_LONG which is set to 64/32
    based on the host machine on which its being compiled.

    Without this patch:
    GENMASK(14,0) => 0x7fffffffffff
    After this patch:
    GENMASK(14,0) => 0x7fff

    Signed-off-by: Vignesh R
    Reviewed-by: Simon Glass

    Vignesh R
     

29 Dec, 2018

1 commit


15 Dec, 2018

1 commit


07 Dec, 2018

2 commits


06 Dec, 2018

5 commits

  • Minor sandbox enhancements / fixes
    tpm improvements to clear up v1/v2 support
    buildman toolchain fixes
    New serial options to set/get config

    Tom Rini
     
  • - Various MTD fixes from Boris
    - Zap various unused / legacy paths.
    - pxa3xx NAND update from Miquel

    Signed-off-by: Tom Rini

    Tom Rini
     
  • MTD partition creation code is a bit tricky. It tries to figure out
    when things have changed (either MTD dev list or mtdparts/mtdids vars)
    and when that happens it first deletes all the partitions that had been
    previously created and then creates the new ones based on the new
    mtdparts/mtdids values.
    But before deleting the old partitions, it ensures that none of the
    currently registered parts are being used and bails out when that's
    not the case. So, we end up in a situation where, if at least one MTD
    dev has one of its partitions used by someone (UBI for instance), the
    partitions update logic no longer works for other devs.

    Rework the code to relax the logic and allow updates of MTD parts on
    devices that are not being used (we still refuse to updates parts on
    devices who have at least one of their partitions used by someone).

    Fixes: 5db66b3aee6f ("cmd: mtd: add 'mtd' command")
    Signed-off-by: Boris Brezillon
    Tested-by: Heiko Schocher

    Boris Brezillon
     
  • If we don't do that, partitions might still be exposed while the
    underlying device is gone.

    Fixes: 2a74930da57f ("mtd: mtdpart: implement proper partition handling")
    Signed-off-by: Boris Brezillon
    Tested-by: Heiko Schocher

    Boris Brezillon
     
  • We need to parse mtdparts/mtids again everytime a device has been
    added/removed from the MTD list, but there's currently no way to know
    when such an update has been done.

    Add an ->updated field to the idr struct that we set to true every time
    a device is added/removed and expose a function returning the value
    of this field and resetting it to false.

    Signed-off-by: Boris Brezillon
    Tested-by: Heiko Schocher

    Boris Brezillon
     

05 Dec, 2018

2 commits

  • These constants are defined by stdint.h but not by kernel.h, which is
    its stand-in in U-Boot. Add the definitions so that libraries which expect
    stdint.h constants can work.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • The current function delays in one millisecond at a time. This does not
    work well on sandbox since it results in lots of calls to usleep(1000) in
    a tight loop. This makes the sleep duration quite variable since each call
    results in a sleep of *at least* 1000us, but possibly more. Depending on
    how busy the machine is, the sleep time can change quite a bit.

    We cannot fix this in general, but we can reduce the effect by doing a
    single sleep. The multiplication works fine with an unsigned long argument
    up until a sleep time of about 4m milliseconds. This is over an hour and
    we can be sure that delays of that length are not useful.

    Update the mdelay() function to call udelay() only once with the
    calculated delay value.

    Signed-off-by: Simon Glass

    Simon Glass
     

03 Dec, 2018

1 commit

  • When an operating system started via bootefi tries to reset or power off
    this is done by calling the EFI runtime ResetSystem(). On most ARMv8 system
    the actual reset relies on PSCI. Depending on whether the PSCI firmware
    resides the hypervisor (EL2) or in the secure monitor (EL3) either an HVC
    or an SMC command has to be issued.

    The current implementation always uses SMC. This results in crashes on
    systems where the PSCI firmware is implemented in the hypervisor, e.g.
    qemu-arm64_defconfig.

    The logic to decide which call is needed based on the device tree is
    already implemented in the PSCI firmware driver. During the EFI runtime
    the device driver model is not available. But we can minimize code
    duplication by merging the EFI runtime reset and poweroff code with
    the PSCI firmware driver.

    As the same HVC/SMC problem is also evident for the ARMv8 do_poweroff
    and reset_misc routines let's move them into the same code module.

    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Sumit Garg
    Tested-by: Sumit Garg
    Signed-off-by: Alexander Graf

    Heinrich Schuchardt
     

20 Nov, 2018

2 commits

  • The kernel added SZ_4G macro in commit f2b9ba871b (arm64/kernel: kaslr:
    reduce module randomization range to 4 GB).

    Include linux/const.h for the _AC macro.

    Drop a local SZ_4G definition in tegra code.

    Cc: Tom Warren
    Reviewed-by: Tom Rini
    Signed-off-by: Baruch Siach
    Signed-off-by: Stefan Roese

    Baruch Siach
     
  • Combine the uapi/linux/const.h header into the kernel linux/const.h. The
    next commit will use the _AC macro this header instead of the common.h
    definition.

    Based on Linux kernel version 4.19.

    Signed-off-by: Baruch Siach
    Reviewed-by: Tom Rini
    Signed-off-by: Stefan Roese

    Baruch Siach
     

15 Nov, 2018

1 commit


12 Oct, 2018

1 commit


11 Oct, 2018

2 commits

  • There are VLAN related macros defined in include/linux/if_vlan.h
    in Linux kernel, as well as some kernel useful structures and inline
    functions. Instead of a complete import from kernel, let's add these
    VLAN macros to U-Boot's include/linux/if_ether.h.

    Signed-off-by: Bin Meng
    Acked-by: Joe Hershberger

    Bin Meng
     
  • This imports include/uapi/linux/if_ether.h from Linux kernel v4.17.
    It can be very helpful When porting Linux ethernet driver to U-Boot.

    Note it is not exactly the same as the kernel one, as checkpatch
    issues are fixed.

    Signed-off-by: Bin Meng
    Acked-by: Joe Hershberger

    Bin Meng
     

10 Oct, 2018

3 commits


09 Oct, 2018

1 commit

  • At present ctags emits lines with unmatched quotes which means that the
    output file is invalid. This is with exuberant-ctags version 5.9~svn201103
    but I also see it with plain ctags. I am not sure that it is a bug though.

    Make a few minor changes in the source code to fix this problem.

    Signed-off-by: Simon Glass

    Simon Glass
     

04 Oct, 2018

1 commit

  • This patch adds support for Gigadevices SPI NAND device to the new SPI
    NAND infrastructure in U-Boot. Currently only the 128MiB GD5F1GQ4UC
    device is supported.

    Signed-off-by: Stefan Roese
    Cc: Miquel Raynal
    Cc: Boris Brezillon
    Cc: Jagan Teki
    Reviewed-by: Miquel Raynal
    Acked-by: Jagan Teki

    Stefan Roese
     

03 Oct, 2018

3 commits

  • Instead of collecting partitions in a flat list, create a hierarchy
    within the mtd_info structure: use a partitions list to keep track of
    the partitions of an MTD device (which might be itself a partition of
    another MTD device), a pointer to the parent device (NULL when the MTD
    device is the root one, not a partition).

    By also saving directly in mtd_info the offset of the partition, we
    can get rid of the mtd_part structure.

    Signed-off-by: Miquel Raynal
    Reviewed-by: Stefan Roese
    Reviewed-by: Boris Brezillon

    Miquel Raynal
     
  • Using an MTD device (resp. partition) name in mtdparts is simple and
    straightforward. However, for a long time already, another name was
    given in mtdparts to indicate a device (resp. partition) so the
    "mtdids" environment variable was created to do the match.

    Let's create a function that, from an MTD device (resp. partition)
    name, search for the equivalent name in the "mtdparts" environment
    variable thanks to the "mtdids" string.

    Signed-off-by: Miquel Raynal
    Reviewed-by: Stefan Roese
    Reviewed-by: Boris Brezillon

    Miquel Raynal
     
  • The current parser is very specific to U-Boot mtdparts implementation.
    It does not use MTD structures like mtd_info and mtd_partition. Copy
    and adapt the current parser in drivers/mtd/mtd-uclass.c (to not break
    the current use of mtdparts.c itself) and write some kind of a wrapper
    around the current implementation to allow other commands to benefit
    from this parsing in a user-friendly way.

    This new function will allocate an mtd_partition array for each
    successful call. This array must be freed after use by the caller.
    The given 'mtdparts' buffer pointer will be moved forward to the next
    MTD device (if any, it will point towards a '\0' character otherwise).

    Signed-off-by: Miquel Raynal
    Acked-by: Jagan Teki
    Reviewed-by: Stefan Roese
    Reviewed-by: Boris Brezillon

    Miquel Raynal
     

20 Sep, 2018

3 commits