History log of /rk3399_rockchip-uboot/drivers/usb/gadget/composite.c (Results 1 – 25 of 35)
Revision Date Author Comments
# 36c87911 19-Oct-2023 william.wu <william.wu@rock-chips.com>

usb: rockusb: Add support for usb3 download

This patch improve the usb gadget drivers and the usb
dwc3 controller drivers to support rockusb usb3 download
images.

With this patch, it can support:
1

usb: rockusb: Add support for usb3 download

This patch improve the usb gadget drivers and the usb
dwc3 controller drivers to support rockusb usb3 download
images.

With this patch, it can support:
1. Maskrom usbplug usb2 switch to usb3 automatically
if the boards and the upgrade tool support usb3.

2. Loader enter usb3 automatically if the boards support usb3.

3. Force Maskrom/Loader usb fall back to usb2 if wait
for usb3 enumeration time out.

Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
Signed-off-by: william.wu <william.wu@rock-chips.com>
Change-Id: I9ad13fb42ae59cc9075545e22627f237f0eb1f32

show more ...


# 1a4f6af8 02-Mar-2020 Joseph Chen <chenjh@rock-chips.com>

Merge branch 'next-dev' into thunder-boot


# bafc57b2 21-Nov-2019 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>

UPSTREAM: usb: composite: fix possible alignment issues

Since upgrading to gcc9, warnings are issued:
"taking address of packed member of ‘...’ may result in an unaligned
pointer value"

Fix this by

UPSTREAM: usb: composite: fix possible alignment issues

Since upgrading to gcc9, warnings are issued:
"taking address of packed member of ‘...’ may result in an unaligned
pointer value"

Fix this by converting two functions to use unaligned access since packed
structures may be on an unaligned address, depending on USB hardware.

Conflicts:
drivers/usb/gadget/composite.c

Change-Id: I9a42dcd3ca1a633204396e2a2699069a88df0890
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 616ebd8b9cb455c5949bd94c47283835eba1954a)

show more ...


# 204f1379 13-Dec-2018 Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>

UPSTREAM: usb: composite: Fix max packet size for USB3.0

For USB3.0, the max packetsize for GET_DESCRIPTOR should be
sent as exponent value for 2. This means for 512, max packet
size should be fille

UPSTREAM: usb: composite: Fix max packet size for USB3.0

For USB3.0, the max packetsize for GET_DESCRIPTOR should be
sent as exponent value for 2. This means for 512, max packet
size should be filled with 9(2^9=512). Also, fill the USB
version field with 3.0 if speed is negotiated to Superspeed.
This fixes the issue of DFU gadget download failure with
superspeed. Without this patch, the max packet size is
overflowed to zero as the bMaxPacketsize is of u8 and hence
host is not able to detect this device.

Conflicts:
drivers/usb/gadget/composite.c

Change-Id: I6aff8e97637d788f309273f0c0afb49dbb71001d
Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
(cherry picked from commit 771e76515ed5abe7eff73a54ccb0c9ae55f34388)

show more ...


# 43156a85 30-Apr-2018 Bryan O'Donoghue <pure.logic@nexus-software.ie>

UPSTREAM: usb: composite convert __set_bit to generic_set_bit

Compiling the f_mass_storage driver for an x86 target results in a
compilation error as set_bit and clear_bit are provided by bitops.h

UPSTREAM: usb: composite convert __set_bit to generic_set_bit

Compiling the f_mass_storage driver for an x86 target results in a
compilation error as set_bit and clear_bit are provided by bitops.h

To address that situation we discussed on the list moving to
genetic_set_bit() instead.

Doing a quick grep for similar situations in drivers/usb shows that the
composite device is using __set_bit().

This patch switches over to generic_set_bit to maintain consistency between
the two gadget drivers.

Change-Id: I2716277c00dd9309d2fe57e4aa68c18ada82ef1a
Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 31dd8efeb661c8dbffff9175a09cf2bab090906a)

show more ...


# dd2dbc26 18-Mar-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

UPSTREAM: usb: gadget: remove duplicate assignment.

We should not make the same assignement twice.

Change-Id: Ic68e484297b575ff965b3dc21a9a2d7ce06bc08c
Signed-off-by: Heinrich Schuchardt <xypron.gl

UPSTREAM: usb: gadget: remove duplicate assignment.

We should not make the same assignement twice.

Change-Id: Ic68e484297b575ff965b3dc21a9a2d7ce06bc08c
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit fa9da8ee60a7387b9e9b0358bd73ef5dbc73736c)

show more ...


# 088d8eb9 15-Mar-2018 Christophe Kerello <christophe.kerello@st.com>

UPSTREAM: usb: gadget: composite: fix NULL pointer when a non standard request is received

In case usb configuration is unknown (cdev->config == NULL), non standard
request should not be processed.

UPSTREAM: usb: gadget: composite: fix NULL pointer when a non standard request is received

In case usb configuration is unknown (cdev->config == NULL), non standard
request should not be processed.
Remove also the cdev->config check below which will never happen.

This issue was seen using ums feature.

Change-Id: I6930deeceadf0eff8e4bfbfb6fdfb254d47a4c83
Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit d57ed4d9f2cb6abc9438104f321b4fe3bc829d57)

show more ...


# 1bca07a1 28-Jun-2019 Frank Wang <frank.wang@rock-chips.com>

usb: gadget: composite: add null pointer check

The cdev->config means the currently active configuration and
it might be null, fix it by adding null pointer check.

Change-Id: I18261653436186c342b44

usb: gadget: composite: add null pointer check

The cdev->config means the currently active configuration and
it might be null, fix it by adding null pointer check.

Change-Id: I18261653436186c342b447c24ef46a8acc42825f
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>

show more ...


# 26dd3474 29-Sep-2018 William Wu <william.wu@rock-chips.com>

usb: gadget: add SuperSpeed support to the Gadget Framework

This patch implements the Binary Device Object Store (BOS)
Descriptor for SuperSpeed. It also add SuperSpeed Endpoint
Descriptors for fast

usb: gadget: add SuperSpeed support to the Gadget Framework

This patch implements the Binary Device Object Store (BOS)
Descriptor for SuperSpeed. It also add SuperSpeed Endpoint
Descriptors for fastboot and rockusb gadget.

Change-Id: I7d858e1b5117d403919f5fdacb40072a5fad336f
Signed-off-by: William Wu <william.wu@rock-chips.com>

show more ...


# e290ced6 02-Apr-2018 Frank Wang <frank.wang@rock-chips.com>

usb: gadget: skip receipent setup if usb config has not been set

We found the following errors were reported when the rockusb
command is executed.

=============================
RKUSB: LUN 0, dev 0,

usb: gadget: skip receipent setup if usb config has not been set

We found the following errors were reported when the rockusb
command is executed.

=============================
RKUSB: LUN 0, dev 0, hwpart 0, sector 0x0, count 0xe90000
"Synchronous Abort" handler, esr 0x96000010
ELR: 22e5e4
LR: 22e5dc
x0 : 0000000000000000 x1 : 0000000000000064
x2 : 0000000000000000 x3 : 00000000ff0c0000
x4 : 0000000000000000 x5 : 0000000000000037
x6 : 000000000000000a x7 : 0000000000000007
x8 : 0000000000000008 x9 : 0000000000000008
...

Resetting CPU ...

It is caused by the null pointer in bmRequestType.Receipent.Device
setup, theoretically, Receipent.Device setup should be handled after
the set_configuration request was finished, so skip it if the usb
configuration has not been set.

Change-Id: I42caf375e8d842ad626d85a6a2a21dfb07fb557a
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>

show more ...


# 912bc5c1 11-Feb-2018 Frank Wang <frank.wang@rock-chips.com>

usb: gadget: fix bos descriptor for rockusb

A GetDescriptor(BOS) request always requires the Device Capability
descriptors as part of the BOS information. This patch adds a generic
Device Capability

usb: gadget: fix bos descriptor for rockusb

A GetDescriptor(BOS) request always requires the Device Capability
descriptors as part of the BOS information. This patch adds a generic
Device Capability descriptor header to fix it.

Fixes: 8ddd5824c ("usb: gadget: add bos descriptor response for rockusb command")
Change-Id: I6b5976c6f13a6991a7d00c8221ece2a740032a07
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>

show more ...


# 8ddd5824 16-Nov-2017 Frank Wang <frank.wang@rock-chips.com>

usb: gadget: add bos descriptor response for rockusb command

Rockchip upgrade tool use bcdUSB (0x0201) field distinguishing maskrom
or loader device at present. Unfortunately, it conflict with Windo

usb: gadget: add bos descriptor response for rockusb command

Rockchip upgrade tool use bcdUSB (0x0201) field distinguishing maskrom
or loader device at present. Unfortunately, it conflict with Windows 8
and beyond which request BOS descriptor in this case that bcdUSB is set
to 0x0201. This patch adds the HACK codes to fix it.

Change-Id: I6a186139f79ba27f5d9e099493e9e742a29bbe40
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>

show more ...


# 08b24722 05-Mar-2016 Tom Rini <trini@konsulko.com>

Merge branch 'master' of git://git.denx.de/u-boot-usb


# 8038f6d2 16-Feb-2016 Sam Protsenko <semen.protsenko@linaro.org>

usb: gadget: composite: Correct recovery path for register

In case when usb_composite_register() failed once (for whatever reason),
it will fail further even if all conditions are correct. Example:

usb: gadget: composite: Correct recovery path for register

In case when usb_composite_register() failed once (for whatever reason),
it will fail further even if all conditions are correct. Example:

=> fastboot 2
Invalid Controller Index
couldn't find an available UDC
g_dnl_register: failed!, error: -19
exit not allowed from main input shell.

=> fastboot 0
g_dnl_register: failed!, error: -22
exit not allowed from main input shell.

Despite that 0 is correct index for USB controller, "fastboot 0" command
will fail, because "composite" structure wasn't cleared properly on
previous fail (on "fastboot 2" command).

This patch fixes that erroneous behavior, allowing us to use composite
even after previous failure.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>

show more ...


# 57dc53a7 08-Feb-2016 Tom Rini <trini@konsulko.com>

Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-staging


# a187559e 06-Feb-2016 Bin Meng <bmeng.cn@gmail.com>

Use correct spelling of "U-Boot"

Correct spelling of "U-Boot" shall be used in all written text
(documentation, comments in source files etc.).

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed

Use correct spelling of "U-Boot"

Correct spelling of "U-Boot" shall be used in all written text
(documentation, comments in source files etc.).

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>

show more ...


# 13a39725 14-Oct-2015 Albert ARIBAUD <albert.u.boot@aribaud.net>

Merge remote-tracking branch 'u-boot/master'


# 44bfb43f 05-Sep-2015 Stephen Warren <swarren@nvidia.com>

usb: gadget: don't leak configs when unbinding

By the time g_dnl_unbind() is run, cdev->config has been set to NULL,
so the free() there does nothing, and the config struct is leaked.
Equally, struc

usb: gadget: don't leak configs when unbinding

By the time g_dnl_unbind() is run, cdev->config has been set to NULL,
so the free() there does nothing, and the config struct is leaked.
Equally, struct usb_gadget contains a linked list of config structs, so
the code should iterate over them all and free each one, rather than
freeing one particular config struct.

composite_unbind() already iterates over the list of config structs, and
unlinks each from the linked list. Fix this loop to free() each struct as
it's unlinked and otherwise forgotten.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>

show more ...


# 6d691732 03-Mar-2015 Lukasz Majewski <l.majewski@samsung.com>

usb: composite: Add .reset callback to usb_gadget_driver structure

DWC3 UDC driver requires presence of .reset callback in a composite driver.
This setting is similar to the one nowadays present in

usb: composite: Add .reset callback to usb_gadget_driver structure

DWC3 UDC driver requires presence of .reset callback in a composite driver.
This setting is similar to the one nowadays present in linux kernel.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>

show more ...


# 04afd5b5 23-Feb-2015 Kishon Vijay Abraham I <kishon@ti.com>

usb: gadget: defer setting maxpacket till ->setup()

Taken from linux kernel with commit
commit 765f5b830e547229bb752e7b232ee83e2b3d49d5
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date

usb: gadget: defer setting maxpacket till ->setup()

Taken from linux kernel with commit
commit 765f5b830e547229bb752e7b232ee83e2b3d49d5
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu Jun 23 14:26:11 2011 +0200

usb: gadget: defer setting maxpacket till ->setup()

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>

show more ...


# e72d3443 13-Feb-2015 Stefano Babic <sbabic@denx.de>

Merge branch 'master' of git://git.denx.de/u-boot


# b44a4149 20-Jan-2015 Tom Rini <trini@ti.com>

Merge branch 'master' of git://git.denx.de/u-boot-usb


# 87ed6b10 09-Jan-2015 Stefan Roese <sr@denx.de>

usb: gadget: composite: Fix NULL pointer crash in USB compliance test

On the DXR2 board (AM335x using MUSB) the USB compliance test suite
(USB 2.0 Command Verifier) will cause the board to crash and

usb: gadget: composite: Fix NULL pointer crash in USB compliance test

On the DXR2 board (AM335x using MUSB) the USB compliance test suite
(USB 2.0 Command Verifier) will cause the board to crash and reset
upon the "BOS Descriptor Test - Addressed state". Here the output
from the DRX2 while running this test:

GADGET DRIVER: usb_dnl_dfu
musb-hdrc: peripheral reset irq lost!
composite_setup (776)
data abort
pc : [<87f693ac>] lr : [<87f6911c>]
sp : 86f33a58 ip : 00000000 fp : 86f3bbac
r10: 00000f00 r9 : 86f33ef4 r8 : 86f37da8
r7 : 00000005 r6 : 86f33a90 r5 : 00000000 r4 : 86f37e30
r3 : 00000000 r2 : 00000000 r1 : 87f9c888 r0 : 00000016
Flags: Nzcv IRQs off FIQs on Mode SVC_32
Resetting CPU ...

resetting ...

By adding the case statement for USB_DT_BOS and therefore not running
into the default case (jump to unkown label) this crash is fixed.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Roger Meier <r.meier@siemens.com>
Cc: Samuel Egli <samuel.egli@siemens.com>
Cc: Enrico Leto <enrico.leto@siemens.com>
Acked-by: Heiko Schocher <hs@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>

show more ...


# b4141195 06-Nov-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

linux/kernel.h: sync min, max, min3, max3 macros with Linux

U-Boot has never cared about the type when we get max/min of two
values, but Linux Kernel does. This commit gets min, max, min3, max3
mac

linux/kernel.h: sync min, max, min3, max3 macros with Linux

U-Boot has never cared about the type when we get max/min of two
values, but Linux Kernel does. This commit gets min, max, min3, max3
macros synced with the kernel introducing type checks.

Many of references of those macros must be fixed to suppress warnings.
We have two options:
- Use min, max, min3, max3 only when the arguments have the same type
(or add casts to the arguments)
- Use min_t/max_t instead with the appropriate type for the first
argument

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Pavel Machek <pavel@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
[trini: Fixup arch/blackfin/lib/string.c]
Signed-off-by: Tom Rini <trini@ti.com>

show more ...


# 326ea986 31-Jul-2013 Stefano Babic <sbabic@denx.de>

Merge git://git.denx.de/u-boot-arm

Conflicts:
board/freescale/mx6qsabrelite/Makefile
board/freescale/mx6qsabrelite/mx6qsabrelite.c
include/configs/mx6qsabrelite.h

Signed-off-by: Stefano Babic <s

Merge git://git.denx.de/u-boot-arm

Conflicts:
board/freescale/mx6qsabrelite/Makefile
board/freescale/mx6qsabrelite/mx6qsabrelite.c
include/configs/mx6qsabrelite.h

Signed-off-by: Stefano Babic <sbabic@denx.de>

show more ...


12