| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Move the usbgadget parse() function to file_list and rename it to
file_list_parse_null() which will return a NULL pointer instead of an
error. Also adjust the callers in the usbgadget code.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Link: https://lore.barebox.org/20210810052928.101783-1-r.czerwinski@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This driver is based on the f_mass_storage drivers in Linux v5.11 and
U-Boot v2021.01.
Unlike the U-Boot version, it runs asynchronously without blocking the
bootloader from doing other tasks, like exporting other USB gadgets at
the same time or enabling shell access.
With pollers and workqueues, enabling this would need a large rework
of the code to be completely callback based, whenever the original
Linux code sleeps waiting for events. With the new bthread support,
we can actually sleep and handover control to other bthreads until
there is actual work to do.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210622082617.18011-9-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
usbgadget_register currently takes 6 arguments. Instead of increasing
them to 8 to support the new usb mass storage gadget, rewrite it to
accept a pointer to a struct with all the options instead.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210622082617.18011-8-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the new system partitions infrastructure to have fastboot and DFU
fall back to using the same partitions if the global.usbgadget.dfu_function
and global.fastboot_partitions are not set, respectively.
No functional change intended for configurations that have
SYSTEM_PARTITIONS disabled.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210503114901.13095-13-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the commit, one upon a time the fastboot client tool
did not support a device that exports DFU as well. It does nowadays,
and while dfu-util 0.9 doesn't, it might some day.
Because these host tools are outside of barebox' control, allow both to
coexist and just throw a warning that dfu-util might not work.
With the new system partitions support, enabled fastboot and DFU mean
that autostart would start both as part of the same multi-gadget. This
would've failed, but would now just emit a warning.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210503114901.13095-11-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The setter for usbgadget.autostart evaluates other device paramaters, so
it must happen postenvironment, otherwise it could run too early and not
see the device parameters it depends on. This was observed with
usbgadget.dfu_function, which wasn't loaded from the environment early
enough, but it now does.
While at it, remove some more wonkyness:
- usbgadget_autostart_set is only ever called when the
IS_ENABLED(CONFIG_USB_GADGET_AUTOSTART), so drop the check
- There is no need to make usbgadget.acm specific to autostart.
It's behavior now is counter intuitive (enable Kconfig symbol,
but don't set global variable and it will have an effect.
Disable CONFIG_USB_GADGET_AUTOSTART, which looks completely
unrelated and it no longer works.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210503114901.13095-10-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For all files in common/ that already have a license text:
- Replace with appropriate SPDX-License-Identifier
- Remove empty comment lines around replacement
- remove comment completely if only thing remaining is name
of file without description
Reviewed-by: Roland Hieber <rhi@pengutronix.de>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
nvvar_add results in two calls to dev_set_param:
- once when the existing global variable is found and set
- once more when setting the nv variable
This results in an annoying but ultimately harmless message on startup:
ERROR: USB multi gadget already registered
ERROR: failed to create nv variable usbgadget.autostart: Device or
resource busy
Avoid this by ignoring usbgadget.autostart=1 after it succeeded once.
This issue should only affect $global.usbgadget.autostart, because all
other global variables are "simple" meaning that they have no setters
triggered.
Fixes: 5a5c5178e7dc ("usbgadget: autostart: support delayed usbgadget.autostart=1")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
So far, global.usbgadget.autostart=1 from the shell was without effect,
because the variable is only evaluated once at postenvironment_initcall.
Use the new globalvar_add_bool() to allow acting on the variable being
true at any time. This is necessary for scripts that want to enable
the usbgadget autostart functionality selectively without themselves
hardcoding the particularities of what is exported.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ \
| |_|/
|/| | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
strerrorp() is only used along with printf. We now have a format
specifier for printing error pointers directly, so use that and
remove strerrorp.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
| |
BAREBOX_MAGICVAR now generates a unique identifier automatically,
so we can convert users of BAREBOX_MAGICVAR_NAMED to the simpler
BAREBOX_MAGICVAR macro.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is nothing USB-specific in the defined usbgadget.fastboot_*
variables. Rename them to be usable also for the UDP fastboot transport.
The usbgadget.fastboot_function variable is used to define the files and
devices accessible with the erase and flash commands. Since "function" is
a term from the USB specification and the Fastboot specification uses the
term "partition", we rename that variable to "fastboot.partitions".
Signed-off-by: Daniel Glöckner <dg@emlix.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
Use global variable dfu_function to autostart DFU. As similar code
is used to start multifunction gadget using command, move common
code to common/usbgadget.c and consolidate it.
It turned out that '-s' option of usbgadget command does nothing,
so remove its help text and make it function as '-a'.
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|