09 Aug, 2019
1 commit
-
Since the orginal way to call interrupts handle function of DM usb
gadget driver is through dm_usb_gadget_handle_interrupts(), when we want
to use two or more different gadget drivers at the same time, it will
cause error of duplicate names.So here add a handle_interrupts function pointer instead of driectly
call dm_usb_gadget_handle_interrupts(), then the error can be avoided.Signed-off-by: Sherry Sun
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) -
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) -
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) -
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) -
change the maximum oob size to 1872 for the MT29F128G08CBCCB raw NAND
chip on i.MX8QXPSigned-off-by: Han Xu
(cherry picked from commit 58dee6ac965000f93693c36c93fb3d453293c43f)
(cherry picked from commit d297f33f4719502aa415dc7c7002c437a6af6c28) -
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) -
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)
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 frameworkSigned-off-by: Vignesh R
Reviewed-by: Jagan Teki
Tested-by: Jagan Teki #zynq-microzed -
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 -
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 setThis 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) => 0x7fffSigned-off-by: Vignesh R
Reviewed-by: Simon Glass
29 Dec, 2018
1 commit
-
Copied from Linux v4.20-rc7.
Signed-off-by: Masahiro Yamada
15 Dec, 2018
1 commit
-
The BITMAP related operations can now be moved to ./include/linux/bitmap.h
file to mimic the Linux kernel directory tree.This change also allows to remove the lin_gadget_compat.h header file
(which is a legacy code only for composite U-boot layer).
It was also possible to remove #includes from several USB gadget drivers.Signed-off-by: Lukasz Majewski
Reviewed-by: Stefan Agner
07 Dec, 2018
2 commits
-
When DM_USB_GADGET the platform code for the USB device must be replaced by
calls to a USB device driver.usb_gadget_initialize() probes the USB device driver.
usb_gadget_release() removes the USB device driver.Signed-off-by: Jean-Jacques Hiblot
Reviewed-by: Lukasz Majewski -
Add 2 functions to wrap the calls to board_usb_init() and
board_usb_cleanup().
This is a preparatory work for DM support for UDC drivers (DM_USB_GADGET).Signed-off-by: Jean-Jacques Hiblot
Reviewed-by: Lukasz Majewski
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 -
- Various MTD fixes from Boris
- Zap various unused / legacy paths.
- pxa3xx NAND update from MiquelSigned-off-by: 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 -
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 -
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
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
-
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
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
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 -
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
15 Nov, 2018
1 commit
-
Introduce a new Kconfig option for architecture codes to control
whether it provides io{read,write}{8,16,32} I/O accessor functions.Signed-off-by: Bin Meng
Reviewed-by: Simon Glass
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 -
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
10 Oct, 2018
3 commits
-
Currently there are two ethernet drivers (mvneta.c and mvpp2.c) that
has netdev_### (eg: netdev_dbg) log macros defined in its own driver
file. This adds these log macros in a common place linux/compat.h.Signed-off-by: Bin Meng
Acked-by: Joe Hershberger -
This syncs U-Boot's include/linux/mdio.h with Linux kernel v4.17
include/uapi/linux/mdio.h.Signed-off-by: Bin Meng
Acked-by: Joe Hershberger -
This syncs U-Boot's include/linux/mii.h with Linux kernel v4.17
include/uapi/linux/mii.h.While we are here, this also fixes some style issues.
Signed-off-by: Bin Meng
Acked-by: Joe Hershberger
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
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
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 -
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 -
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
20 Sep, 2018
3 commits
-
Add minimal support for the MX35LF1GE4AB SPI NAND chip.
Signed-off-by: Boris Brezillon
Acked-by: Jagan Teki -
Add support for the W25M02GV chip.
Signed-off-by: Frieder Schrempf
Signed-off-by: Boris Brezillon
Signed-off-by: Miquel Raynal
Acked-by: Jagan Teki -
Add a basic driver for Micron SPI NANDs. Only one device is supported
right now, but the driver will be extended to support more devices
afterwards.Signed-off-by: Peter Pan
Signed-off-by: Boris Brezillon
Signed-off-by: Miquel Raynal
Acked-by: Jagan Teki