summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* fastboot: add command to select the default emmc hwpart for bootPatrick Delaunay2021-02-072-0/+43
| | | | | | | | | | | | | | Add fastboot command oem partconf which executes the command ``mmc partconf <id> <arg> 0`` on the current <id> mmc device to configure the eMMC boot partition with <arg>: boot_ack boot_partition, so the command is: $> fastboot oem partconf:<boot_ack> <boot_partition> The partition_access argument is forced to 0 (userdata) Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> [lukma - Kconfig adjustments after merging this patch]
* fastboot: mmc: extend flash/erase for both emmc hwpart 1 and 2Patrick Delaunay2021-02-072-24/+49
| | | | | | | | | | | | | Update the code and the configs for eMMC boot and userdata partitions acces - FASTBOOT_MMC_BOOT_SUPPORT: boot partition 1 and 2 (erase/write) - FASTBOOT_MMC_BOOT1_NAME: boot partition 1, default name="mmc0boot0" - FASTBOOT_MMC_BOOT2_NAME: boot partition 2, default name="mmc0boot1" This patch also removes the unnecessary dependency with ARCH_MEDIATEK and EFI_PARTITION. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
* fastboot: mmc: Add CONFIG_FASTBOOT_MMC_USER_SUPPORTPatrick Delaunay2021-02-072-8/+23
| | | | | | | | | | | | | | Split userdata and boot partition support for eMMC update and correct the description (update is supported). The new configuration CONFIG_FASTBOOT_MMC_USER_SUPPORT allows to activate support of userdata partition update, based on target name=CONFIG_FASTBOOT_MMC_USER_NAME This patch also removes the unnecessary dependency with ARCH_MEDIATEK and EFI_PARTITION. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
* fastboot: Implement generic fastboot_set_reboot_flagRoman Kovalivskyi2021-02-071-1/+15
| | | | | | | | | | | | It is possible to implement fastboot_set_reboot_flag in a generic way if BCB commands are turned on for a target. Using bcb_set_reboot_reason allows to do this by simply passing string with correct reboot reason that should be handled during next boot process. If BCB are turned off, then bcb_set_reboot_reason would simply return error, so it won't introduce any new behaviour for such targets. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
* Revert "fastboot: Add default fastboot_set_reboot_flag implementation"Roman Kovalivskyi2021-02-073-56/+0
| | | | | | | | | | | | | | This reverts commit 0ebf9842e56c5b8cb7cb1f990bb452cc14af6225. Current generic implementation of fastboot_set_reboot_flag is somewhat messy and requires some additional configuration option to be enabled besides CMD_BCB, so it reverts that implementtion in order to bring a new cleaner one. Next commit introduces new generic implementation of fastboot_set_reboot_flag. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
* dfu: dfu_sf: use correct print codeHeinrich Schuchardt2021-02-071-1/+1
| | | | | | For printing unsigned int %u has to be used. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* Merge tag 'ti-v2021.04-rc2' of ↵Tom Rini2021-02-054-112/+376
|\ | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-ti - Sync DTS from Linux kernel for all K3 platforms - Add MMC higher speed nodes for AM65x, J721e, J7200 - Convert Nokia RX-51 to use CONFIG_DM_MMC - Minor fixes for LEGO MINDSTORMS
| * mmc: am654_sdhci: Use sdhci_set_control_reg()Faiz Abbas2021-02-041-16/+2
| | | | | | | | | | | | | | | | | | Use the generic sdhci_set_control_reg() instead of duplicating in platform driver. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * mmc: am654_sdhci: Fix HISPD bit configuration in some lower speed modesFaiz Abbas2021-02-042-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the AM654x Data Manual[1], the setup timing in lower speed modes can only be met if the controller uses a falling edge data launch. To ensure this, the HIGH_SPEED_ENA (HOST_CONTROL[2]) bit should be cleared in default speed, SD high speed, MMC high speed, SDR12 and SDR25 speed modes. Use the sdhci writeb callback to implement this condition. [1] http://www.ti.com/lit/gpn/am6546 Section 5.10.5.16.1 Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * mmc: am654_sdhci: Add support for software tuningFaiz Abbas2021-02-041-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the new SW tuning App note[1], a custom tuning algorithm is required for eMMC HS200, HS400 and SD card UHS modes. The algorithm involves running through the 32 possible input tap delay values and sending the appropriate tuning command (CMD19/21) for each of them to get a fail or pass result for each of the values. Typically, the range will have a small contiguous failing window. Considering the tuning range as a circular buffer, the algorithm then sets a final tuned value directly opposite to the failing window. [1] https://www.ti.com/lit/pdf/spract9 Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * mmc: am654_sdhci: Add support for writing to clkbuf_selFaiz Abbas2021-02-041-0/+11
| | | | | | | | | | | | | | | | | | Add support for writing new clock buffer select property for both the am654x and j721e 4 bit IPs Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * mmc: am654_sdhci: Add support for input tap delayFaiz Abbas2021-02-041-80/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DLL need only be enabled for speed modes and clock frequencies at or above 50 MHz. For speed modes that don't enable the DLL, we need to configure a static input delay value. This involves reading an optional itap-del-sel-* value from the device tree and configuring it for the appropriate speed mode. Therefore, move all dll configurations to their own functions and gate it with 50 MHz speed and a minimum mode. If both these conditions are not satisfied then configure delay chain modes. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * mmc: am654_sdhci: Add support for AM65x SR2.0Faiz Abbas2021-02-041-0/+30
| | | | | | | | | | | | | | | | | | Add Support for AM65x PG2.0. Use the SoC bus framework to fixup the platform data and do DLL calibration if the revision is 1.0 Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * mmc: am654_sdhci: Add flag for PHY calibrationFaiz Abbas2021-02-041-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | Not all controllers need calibration for the PHY DLL. Add a DLL_CALIB flag to indicate the same. Also move the write of trm_icp and driver strength to the set_clock() function to match the kernel configuration flow. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * mmc: am654_sdhci: Convert flag fields to BIT macroFaiz Abbas2021-02-041-4/+4
| | | | | | | | | | | | | | | | Convert the flags field defines to use the BIT() macro. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * mmc: am654_sdhci: Unconditionally switch off DLL in the beginning of ios_post()Faiz Abbas2021-02-041-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | There are some speed modes that work without switching the dll on. Unconditionally switch off the DLL before setting clock frequency to support this case. The software will automatically enable DLL for speed modes that require it. This also means the dll_on priv data member is no longer required. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * mmc: sdhci: Add helper functions for UHS modesFaiz Abbas2021-02-041-0/+95
| | | | | | | | | | | | | | | | | | Add a set_voltage() function which handles the switch from 3.3V to 1.8V for SD card UHS modes. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * remoteproc: k3_r5: Sync to upstreamed kernel DT property namesSuman Anna2021-02-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The K3 R5F remoteproc driver in U-Boot was upstreamed prior to the equivalent remoteproc driver in the Linux kernel. Some of the DT properties used in U-Boot got upstreamed using different names in Linux kernel. The modified property names include the R5F cluster mode configuration property "lockstep-mode"; and three different individual R5F core config properties - "atcm-enable", "btcm-enable" and "loczrama". The property names were updated as follows: lockstep-mode => ti,cluster-mode atcm-enable => ti,atcm-enable btcm-enable => ti,btcm-enable loczrama => ti,loczrama Update the K3 R5F remoteproc driver, the corresponding binding, and all the existing usage in AM65x, J721E and J7200 dts files all at once to use the new properties and to not break any bisectability. Signed-off-by: Suman Anna <s-anna@ti.com>
* | firmware: smci: possible NULL dereferenceHeinrich Schuchardt2021-02-031-0/+3
| | | | | | | | | | | | | | | | | | | | sandbox_scmi_devices_ctx() may return NULL. We should not dereference this value in sandbox_scmi_devices_remove(). The problem was indicated by 'gcc-11 -fanalyzer'. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* | net: ftmac100: Cast priv->iobase with uintptr_tBin Meng2021-02-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | priv->iobase was declared as phys_addr_t which is now a 64-bit address. In a 32-bit build, this causes the following warning seen when building ftmac100.c: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Cast priv->iobase with uintptr_t. Signed-off-by: Bin Meng <bin.meng@windriver.com>
* | serial: sifive: Cast dev_read_addr() with uintptr_tBin Meng2021-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | dev_read_addr() returns fdt_addr_t which is now a 64-bit address. In a 32-bit build, this causes the following warning seen when building serial_sifive.c: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Cast the return value with uintptr_t. Signed-off-by: Bin Meng <bin.meng@windriver.com>
* | dm: core: Add late driver remove optionMarek Vasut2021-02-032-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add another flag to the DM core which could be assigned to drivers and which makes those drivers call their remove callbacks last, just before booting OS and after all the other drivers finished with their remove callbacks. This is necessary for things like clock drivers, where the other drivers might depend on the clock driver in their remove callbacks. Prime example is the mmc subsystem, which can reconfigure a card from HS mode to slower modes in the remove callback and for that it needs to reconfigure the controller clock. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: core: Avoid partially removing devicesSimon Glass2021-02-031-19/+40
| | | | | | | | | | | | | | | | At present if device_remove() decides that the device should not actually be removed, it still calls the uclass pre_remove() method and powers the device down. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: core: Remove children before advising uclassSimon Glass2021-02-031-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | At present the uclass pre-remove method is called before the children are removed. But the children may refused to be removed, in whch case the uclass is in a tricky situation. At present we handle this by calling the uclass' post_probe() method. But it seems better to avoid doing anything with the uclass in this case. Switch the ordering so that we make sure the children can be removed before advising the uclass. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: pci: Correct use of wrong flag nameSimon Glass2021-02-031-1/+1
| | | | | | | | | | | | | | Update a driver that uses the incorrect flag. Add a comment to hopefully prevent furture mistakes. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: Rename DM_FLAG_REMOVE_WITH_PD_ONSimon Glass2021-02-033-3/+3
| | | | | | | | | | | | | | | | This flag has the word 'REMOVE' in it which means it conflicts with the DM_REMOVE flags. Rename it to DM_FLAG_LEAVE_PD_ON which seems to indicate its purpose well enough. Signed-off-by: Simon Glass <sjg@chromium.org>
* | nand: brcmnand: Don't use -EPROBE_DEFERSimon Glass2021-02-031-4/+1
| | | | | | | | | | | | | | | | | | This has no useful meaning in U-Boot and will never be returned. We want to reserve this flag for internal driver model use. Drop the code. Signed-off-by: Simon Glass <sjg@chromium.org>
* | smem: Don't use -EPROBE_DEFERSimon Glass2021-02-031-3/+3
|/ | | | | | | | This has no useful meaning in U-Boot. Use -ENOMEM since that appears to be what has gone wrong in this case. We want to reserve this flag for internal driver model use. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86Tom Rini2021-02-011-1/+1
|\ | | | | | | | | | | | | | | - Fix CMD_ACPI dependency in Kconfig - Correct overflow in __udelay() in TSC timer driver - Add a devicetree node for eMMC for Coral - Minor improvements on image loading - Reduce size of Samus image
| * x86: tsc_timer: Correct overflow in __udelay()Simon Glass2021-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | At present long delays such as msleep(2000) can cause an overflow in this function. There is no need for this, since it already uses a 64-bit int. Add a cast to correct this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* | Merge https://gitlab.denx.de/u-boot/custodians/u-boot-sunxiTom Rini2021-01-312-30/+37
|\ \ | |/ |/| | | | | - Allwinner H616 Ethernet support - sunxi ata debug fix
| * ata: sunxi: fix debug messagesDario Binacchi2021-01-311-4/+4
| | | | | | | | | | | | | | | | | | | | It is useless and misleading to print the ret variable that is not set by the dev_read_addr routine. Also, move the '\n' character after the round bracket that contains the error code. Signed-off-by: Dario Binacchi <dariobin@libero.it> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
| * net: sun8i-emac: Determine pinmux based on SoC, not EMAC typeAndre Przywara2021-01-311-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The pinmux choice for the RMII/RGMII pins the EMAC is connected to is not dependent on the EMAC IP, but on the SoC it is integrated in. Deriving the pinmux from the DT compatible string (as we do at the moment) will thus cause problems with certain EMAC IP / SoC combinations. To avoid this exact issue with the H616, let's use our Kconfig MACH symbols to choose the correct pinmux setup. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Tested-by: Jernej Skrabec <jernej.skrabec@siol.net> Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net>
| * net: sun8i-emac: Always clear syscon EPHY registerAndre Przywara2021-01-311-18/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment we only consider the EPHY register for those SoCs were we actually have an internal PHY to configure. However even other SoCs have this register, an expect the EPHY select bit to be cleared for proper operation with an external PHY. Rework sun8i_emac_set_syscon_ephy() to be called regardless of the EMAC model, and clear the H3_EPHY_SELECT bit if no internal PHY is used. We get away without it so far because SoCs like the A64 clear this bit on reset, but we need to explicitly clear it on the H616, for instance. The Linux driver does so as well. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Tested-by: Jernej Skrabec <jernej.skrabec@siol.net> Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net>
* | Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usbTom Rini2021-01-3115-162/+692
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Assorted gadget changes including: - dfu: Fix handling of UBI partitions in MTD backend - gadget: f_thor: fix wrong file size cast - Extend cmd: bcb - Fixes for fastboot and rockchip gadgets - dfu: Add SCRIPT and SKIP entities - dfu/thor: Add `dfu_alt_info` reinitialization from flashed script - u-boot: Reduce size of u-boot as usbd_device_* arrays are not exported
| * | usb: gaget: ci: set ep's desc when enable epLi Jun2021-01-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | As we need standard usb_ep's desc, so set it when enable ep. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: gadget: fastboot: use correct max packet sizeLi Jun2021-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Change to use wMaxPacketSize of current speed EP desc for request length wrap up. Reviewed-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: udc: ci: update speed handlingLi Jun2021-01-311-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the gadget driver speed check, and set its max_speed to be USB_SPEED_HIGH. Reviewed-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peter Chen <peter.chen@nxp.com> Tested-by: faqiang.zhu <faqiang.zhu@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: composite: force gadget to be USB2 for HS only functionLi Jun2021-01-311-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <ye.li@nxp.com> Reviewed-by: Peter Chen <peter.chen@nxp.com> Tested-by: faqiang.zhu <faqiang.zhu@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: gadget: dnl: set dnl to be super speedLi Jun2021-01-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set its max_speed to be super speed. Reviewed-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peter Chen <peter.chen@nxp.com> Tested-by: faqiang.zhu <faqiang.zhu@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: fastboot: add super speed supportLi Jun2021-01-311-3/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add super speed EP config. Reviewed-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peter Chen <peter.chen@nxp.com> Tested-by: faqiang.zhu <faqiang.zhu@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: gadget: add super speed supportLi Jun2021-01-311-25/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <ye.li@nxp.com> Reviewed-by: Peter Chen <peter.chen@nxp.com> Tested-by: faqiang.zhu <faqiang.zhu@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: gadget: update os_desc_config when add configJun Li2021-01-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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 <jun.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: gadget: set correct usb_configuration for os_desc_configJun Li2021-01-311-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <ye.li@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: gadget: fastboot: add ext properties for WCIDLi Jun2021-01-311-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | Add device interface GUID for Microsoft Extended Properties Feature Descriptor. Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: gadget: add WCID support for mfgtoolLi Jun2021-01-311-0/+20
| | | | | | | | | | | | | | | | | | | | | Enable WCID(Microsoft Compatible ID Feature Descriptor) for mfgtool. Signed-off-by: Li Jun <jun.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: gadget: OS Feature Descriptors supportLi Jun2021-01-312-1/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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鈥檚 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 <jun.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: gadget: add Kconfig for OS descriptorsPeng Fan2021-01-311-0/+9
| | | | | | | | | | | | | | | | | | Add Kconfig for OS descriptors Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: gadget: move utf8_to_utf16le to header fileLi Jun2021-01-311-73/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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 <jun.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * | usb: gadget: OS String supportLi Jun2021-01-311-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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鈥檚 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 <jun.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>