]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
9 months agotools/make_pip: Add mention of u_boot_pylib in tool list
Simon Glass [Sun, 19 Nov 2023 15:36:04 +0000 (08:36 -0700)] 
tools/make_pip: Add mention of u_boot_pylib in tool list

This is not a tool but it is handled by the script, so update the help
to include it.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agou_boot_pylib: Correct files used for pip release
Simon Glass [Sun, 19 Nov 2023 15:36:03 +0000 (08:36 -0700)] 
u_boot_pylib: Correct files used for pip release

The files list is incorrect and dates from a time when the script was
run from a different directory. Update it to match all the other tools.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agotools: Keep test_util and patman test files in the pip release
Simon Glass [Sun, 19 Nov 2023 15:36:02 +0000 (08:36 -0700)] 
tools: Keep test_util and patman test files in the pip release

The test_util module is actually imported by some tools, e.g. binman so
include it in the pip release.

The patman tool uses its test code when starting up, so keep that too.

Show a list of deleted files so it is clear what is happening.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agou_boot_pylib: Correct readme formatting
Simon Glass [Sun, 19 Nov 2023 15:36:01 +0000 (08:36 -0700)] 
u_boot_pylib: Correct readme formatting

Correct a heading which is too short in the readme.

Fixes: 75554dfac29 ("patman: Add support for building a u_boot_tools...")
Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agodoc: Update documentation URL
Simon Glass [Sun, 19 Nov 2023 15:36:00 +0000 (08:36 -0700)] 
doc: Update documentation URL

Update to use the new docs.u-boot.org URL for documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agotest: unit test for acpi_find_table()
Heinrich Schuchardt [Sat, 18 Nov 2023 21:57:27 +0000 (22:57 +0100)] 
test: unit test for acpi_find_table()

Provide a unit test for acpi_find_table()

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 months agoacpi: consider XSDT in acpi_find_table()
Heinrich Schuchardt [Sat, 18 Nov 2023 21:57:26 +0000 (22:57 +0100)] 
acpi: consider XSDT in acpi_find_table()

The RSDT table is deprecated and does not exist on all systems.

By preference scan XSDT for the table to find. If no XSDT table exists, try
to use the RSDT table.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
9 months agoacpi: simplify acpi_write_ssdt()
Heinrich Schuchardt [Sat, 18 Nov 2023 21:52:37 +0000 (22:52 +0100)] 
acpi: simplify acpi_write_ssdt()

* Converting to void * is superfluous when calling memset().
* acpi_fill_header() already fills oem_table_id.

Fixes: d953137526cc ("x86: Move SSDT table to a writer function")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 months agoacpi: cannot have RSDT above 4 GiB
Heinrich Schuchardt [Sun, 12 Nov 2023 23:53:56 +0000 (00:53 +0100)] 
acpi: cannot have RSDT above 4 GiB

The field RsdtAddress has only 32 bit. The RSDT table cannot be located
beyond 4 GiB.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 months agofdt: Move ft_verify_fdt() before the final fixups
Simon Glass [Sun, 12 Nov 2023 15:27:50 +0000 (08:27 -0700)] 
fdt: Move ft_verify_fdt() before the final fixups

Move this check before the FDT fixups so that we can use a livetree
after this point.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agofdt: Drop the confusing casts in lmb_free()
Simon Glass [Sun, 12 Nov 2023 15:27:49 +0000 (08:27 -0700)] 
fdt: Drop the confusing casts in lmb_free()

Just use map_to_sysmem() instead of all the casting.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agoboot: Move adding initrd earlier in image_setup_libfdt()
Simon Glass [Sun, 12 Nov 2023 15:27:48 +0000 (08:27 -0700)] 
boot: Move adding initrd earlier in image_setup_libfdt()

This may as well happen before the general event is emitted, so move it.
This will allow us to use the livetree for the event part, but the
flattree for the earlier part.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agofdt: ppc: Drop extra size for ramdisk
Simon Glass [Sun, 12 Nov 2023 15:27:47 +0000 (08:27 -0700)] 
fdt: ppc: Drop extra size for ramdisk

This code dates from around 2008:

   56844a22b76 powerpc: Fix bootm to boot up again with a Ramdisk

Since then we have added FDT relocation which provides enough space
for expansion. We have also added all sorts of fixups earlier in
image_setup_libfdt() which require more space, with ramdisk being the
least of them.

Therefore this extra hack for ramdisk seems unnecessary. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agofdt: Improve the comment for fdt_shrink_to_minimum()
Simon Glass [Sun, 12 Nov 2023 15:27:46 +0000 (08:27 -0700)] 
fdt: Improve the comment for fdt_shrink_to_minimum()

Add a bit more detail about what this function does.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agofdt: Check for a valid fdt in oftree_ensure()
Simon Glass [Sun, 12 Nov 2023 15:27:45 +0000 (08:27 -0700)] 
fdt: Check for a valid fdt in oftree_ensure()

Check the header before starting to use it, since this could provide
very confusing later, when ofnode calls start to fail.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agoboot: Drop size parameter from image_setup_libfdt()
Simon Glass [Sun, 12 Nov 2023 15:27:44 +0000 (08:27 -0700)] 
boot: Drop size parameter from image_setup_libfdt()

The of_size parameter is not used, so remove it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agoacpi: move acpi_get_rsdp_addr() to acpi/acpi_table.h
Heinrich Schuchardt [Thu, 9 Nov 2023 17:23:02 +0000 (09:23 -0800)] 
acpi: move acpi_get_rsdp_addr() to acpi/acpi_table.h

Function acpi_get_rsdp_addr() is needed on all architectures which
write ACPI tables. Move the definition from the x86 include to an
architecture independent one.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 months agobootstd: Add a menu option to bootflow scan
Simon Glass [Mon, 2 Oct 2023 01:15:25 +0000 (19:15 -0600)] 
bootstd: Add a menu option to bootflow scan

Allow showing a menu and automatically booting, with 'bootflow scan'.
This is more convenient than using a script.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agosandbox: Add a dummy booti command
Simon Glass [Mon, 2 Oct 2023 01:15:24 +0000 (19:15 -0600)] 
sandbox: Add a dummy booti command

Add basic sandbox support for 'booti' so we can start to boot the test
ARMbian image. This is helpful in checking that it is parsed correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agovideo: Add a function to clear the display
Simon Glass [Mon, 2 Oct 2023 01:15:23 +0000 (19:15 -0600)] 
video: Add a function to clear the display

Move the code from the 'cls' command into the console file, so it can
be called from elsewhere.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agotest: print: Skip test on x86
Simon Glass [Mon, 2 Oct 2023 01:15:22 +0000 (19:15 -0600)] 
test: print: Skip test on x86

These tests cannot work on x86 machines as memory at address zero is
not writable. Add a condition to skip these.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agotest: lmb: Move tests into the lib suite
Simon Glass [Mon, 2 Oct 2023 01:15:21 +0000 (19:15 -0600)] 
test: lmb: Move tests into the lib suite

These tests are marked as driver model tests, but have nothing to do
with driver model. As a result, they are run as part of 'ut dm' which
only exists for sandbox.

Move them to the 'lib' suite and drop the requirement for initing
devices, since they don't use devices.

Also put the lib_test_lmb_max_regions() macro inside the same #ifdef
as its function, to avoid a build error if the condition is false.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agotest: event: Only run test_event_probe() on sandbox
Simon Glass [Mon, 2 Oct 2023 01:15:20 +0000 (19:15 -0600)] 
test: event: Only run test_event_probe() on sandbox

This needs test devices which are only present on sandbox. Add a check
for this and skip just this test if running on a real board.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agotest: font: Add dependencies on fonts
Simon Glass [Mon, 2 Oct 2023 01:15:19 +0000 (19:15 -0600)] 
test: font: Add dependencies on fonts

The font test needs two fonts. If one is not available, skip out early,
to avoid an error.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agotest: fdt: Add a special case for real boards
Simon Glass [Mon, 2 Oct 2023 01:15:18 +0000 (19:15 -0600)] 
test: fdt: Add a special case for real boards

The error that this test checks for is only shown on sandbox. For real
boards, there is normally no error. Add a special case to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agotest: bdinfo: Add missing asserts
Simon Glass [Mon, 2 Oct 2023 01:15:17 +0000 (19:15 -0600)] 
test: bdinfo: Add missing asserts

Calling into sub-test functions should be done using ut_assertok() so
that the test exits immediately on failure. Add those which are
missing.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agotest: Handle use of stack pointer in bdinfo
Simon Glass [Mon, 2 Oct 2023 01:15:16 +0000 (19:15 -0600)] 
test: Handle use of stack pointer in bdinfo

This test assumes that the stack pointer is the same across two calls
to lmb_init_and_reserve() but this is not the case on x86, for example.

Add a special case to handle this, along with a detailed comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agotest: Run bootstd tests only on sandbox
Simon Glass [Mon, 2 Oct 2023 01:15:15 +0000 (19:15 -0600)] 
test: Run bootstd tests only on sandbox

These make use of disk images which are not available on reak boards.
Add a new Kconfig to ensure these tests only run where they are valid.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agotest: Make UT_LIB_ASN1 depend on sandbox
Simon Glass [Mon, 2 Oct 2023 01:15:14 +0000 (19:15 -0600)] 
test: Make UT_LIB_ASN1 depend on sandbox

This doesn't seem to work on a real board, so use the test on sandbox
only.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agotest: Add helper to skip to partial console line
Simon Glass [Mon, 2 Oct 2023 01:15:13 +0000 (19:15 -0600)] 
test: Add helper to skip to partial console line

Sometimes we need to skip to a line but it includes addresses or other
information which can vary depending on the runtime conditions.

Add a new ut_assert_skip_to_linen() which is similar to the existing
ut_assert_skip_to_line() function but only checks that the console line
matches up to the length of the provided string.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agotest: Add a new suite for commands
Simon Glass [Mon, 2 Oct 2023 01:15:12 +0000 (19:15 -0600)] 
test: Add a new suite for commands

Add a new suite for 'cmd' tests, used for testing commands. These are
kept in the test/cmd directory.

For now it is empty, but it will be used for coreboot-command tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agoMerge patch series "bootm: Refactoring to reduce reliance on CMDLINE (part A)"
Tom Rini [Wed, 13 Dec 2023 16:51:53 +0000 (11:51 -0500)] 
Merge patch series "bootm: Refactoring to reduce reliance on CMDLINE (part A)"

To quote the author:

It would be useful to be able to boot an OS when CONFIG_CMDLINE is
disabled. This could allow reduced code size.

Standard boot provides a way to handle programmatic boot, without
scripts, so such a feature is possible. The main impediment is the
inability to use the booting features of U-Boot without a command line.
So the solution is to avoid passing command arguments and the like to
code in boot/

A similar process has taken place with filesystems, for example, where
we have (somewhat) separate Kconfig options for the filesystem commands
and the filesystems themselves.

This series starts the process of refactoring the bootm logic so that
it can be called from standard boot without using the command line.
Mostly it removes the use of argc, argv and cmdtbl from the internal
logic.

Some limited tidy-up is included, but this is kept to smaller patches,
rather than trying to remove all #ifdefs etc. Some function comments
are added, however.

A simple programmatic boot is provided as a starting point.

This work will likely take many series, so this is just the start.

Size growth with this series for firefly-rk3288 (Thumb2) is:

       arm: (for 1/1 boards) all +23.0 rodata -49.0 text +72.0

This should be removed by:

   https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/11

but it is not included in this series as it is already large enough.

No functional change is intended in this series.

Changes in v3:
- Add a panic if programmatic boot fails
- Drop RFC tag

Changes in v2:
- Add new patch to adjust position of unmap_sysmem() in boot_get_kernel()
- Add new patch to obtain command arguments
- Fix 'boot_find_os' typo
- Pass in the command name
- Use the command table to provide the command name, instead of "bootm"

9 months agocommand: Introduce functions to obtain command arguments
Simon Glass [Sat, 18 Nov 2023 21:05:20 +0000 (14:05 -0700)] 
command: Introduce functions to obtain command arguments

Add some functions which provide an argument to a command, or NULL if
the argument does not exist.

Use the same numbering as argv[] since it seems less confusing than the
previous idea.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Tom Rini <trini@konsulko.com>
9 months agobootstd: Introduce programmatic boot
Simon Glass [Sat, 18 Nov 2023 21:05:19 +0000 (14:05 -0700)] 
bootstd: Introduce programmatic boot

At present bootstd requires CONFIG_CMDLINE to operate. Add a new
'programmatic' boot which can be used when no command line is available.
For now it does almost nothing, since most bootmeths require the
command line.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agobootm: Reduce arguments to bootm_find_other()
Simon Glass [Sat, 18 Nov 2023 21:05:18 +0000 (14:05 -0700)] 
bootm: Reduce arguments to bootm_find_other()

Rather than passing the full list of command arguments, pass only those
which are needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Add a function to check overlap
Simon Glass [Sat, 18 Nov 2023 21:05:17 +0000 (14:05 -0700)] 
bootm: Add a function to check overlap

Move this code into a function to reduce code size and make it easier
to understand. Drop the unnecessary 0x to help a little with code size.

Use this in bootm_find_images()

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Adjust the parameters of bootm_find_images()
Simon Glass [Sat, 18 Nov 2023 21:05:16 +0000 (14:05 -0700)] 
bootm: Adjust the parameters of bootm_find_images()

Rather than passing it all the command-line args, pass in the pieces
that it needs. These are the image address, the ramdisk address/name
and the FDT address/name.

Ultimately this will allow usage of this function without being called
from the command line.

Move the function comment to the header file and tidy it a little.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agobootm: optee: Drop special call to bootm_find_other()
Simon Glass [Sat, 18 Nov 2023 21:05:15 +0000 (14:05 -0700)] 
bootm: optee: Drop special call to bootm_find_other()

The normal bootm flow calls bootm_find_other() can call the
BOOTM_STATE_FINDOTHER state as part of its processing. Fix the
condition there so that this hack can be removed.

Also drop the confusing check for the OS type, since do_bootm_tee() is
only called if the condition is met - see bootm_os_get_boot_func()

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agobootm: efi: Drop special call to bootm_find_other()
Simon Glass [Sat, 18 Nov 2023 21:05:14 +0000 (14:05 -0700)] 
bootm: efi: Drop special call to bootm_find_other()

The normal bootm flow calls bootm_find_other() can call the
BOOTM_STATE_FINDOTHER state as part of its processing. Fix the
condition there so that this hack can be removed.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agobootm: Simplify Android ramdisk addr in bootm_find_images()
Simon Glass [Sat, 18 Nov 2023 21:05:13 +0000 (14:05 -0700)] 
bootm: Simplify Android ramdisk addr in bootm_find_images()

The Android mechanism uses the loadaddr envrionment-variable to get the
load address, if none is provided. This is equivalent to
image_load_addr so use that instead, converting it to a string as
needed.

This change will permit passing img_addr to this function, in a future
change.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Reduce arguments to boot_get_loadables()
Simon Glass [Sat, 18 Nov 2023 21:05:12 +0000 (14:05 -0700)] 
bootm: Reduce arguments to boot_get_loadables()

This function only uses two arguments. The 'arch' always has a constant
value, so drop it. This simplifies the function call.

Tidy up the function comment while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Reduce arguments to boot_get_fpga()
Simon Glass [Sat, 18 Nov 2023 21:05:11 +0000 (14:05 -0700)] 
bootm: Reduce arguments to boot_get_fpga()

This function only uses two arguments. The 'arch' always has a constant
value, so drop it. This simplifies the function call.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Reduce arguments to boot_get_fdt()
Simon Glass [Sat, 18 Nov 2023 21:05:10 +0000 (14:05 -0700)] 
bootm: Reduce arguments to boot_get_fdt()

This function only uses one argument from bootm (argv[2]) so pass it in
directly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Pass image buffer to boot_get_fdt()
Simon Glass [Sat, 18 Nov 2023 21:05:09 +0000 (14:05 -0700)] 
bootm: Pass image buffer to boot_get_fdt()

Rather than having boot_get_fdt() calculate this, move the calculation
into the caller. This removes the access to argv[0] in this function,
so we can later refactor it to just accept argv[2] instead of the whole
argv[].

Move the function comment to the header file and fix the u8 argument,
while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Drop #ifdef in bootm_find_images()
Simon Glass [Sat, 18 Nov 2023 21:05:08 +0000 (14:05 -0700)] 
bootm: Drop #ifdef in bootm_find_images()

The OF_LIBFDT #ifdef makes it harder to use a local variable for that
code block. Convert it to if() instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 months agofdt: Allow use of fdt_support inside if() statements
Simon Glass [Sat, 18 Nov 2023 21:05:07 +0000 (14:05 -0700)] 
fdt: Allow use of fdt_support inside if() statements

Most of the fdt_support.h header file is included only if OF_LIBFDT or
OF_CONTROL are enabled. This means that calling functions defined in
that file must happen inside an #ifdef

This is unnecessary, so reduce the condition to just !USE_HOSTCC

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Reduce arguments to boot_get_ramdisk()
Simon Glass [Sat, 18 Nov 2023 21:05:06 +0000 (14:05 -0700)] 
bootm: Reduce arguments to boot_get_ramdisk()

This function normally only uses one argument so pass it in directly.
Move comments to the header file so could one day include these
functions in API docs. Fix up the u8 argument while here, since it
avoids the compiler having to mask the value on some machines.

The Android case here is bit strange, since it can use argv[0], so deal
with that in the caller.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Reduce arguments to bootm_find_os()
Simon Glass [Sat, 18 Nov 2023 21:05:05 +0000 (14:05 -0700)] 
bootm: Reduce arguments to bootm_find_os()

This function only uses one argument so pass it in directly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Move error printing out of boot_get_kernel()
Simon Glass [Sat, 18 Nov 2023 21:05:04 +0000 (14:05 -0700)] 
bootm: Move error printing out of boot_get_kernel()

The same error message is printed in two places. Move it out to the
caller so we can avoid passing in the command name. Leave the bootstage
handling where it is.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootstage: Drop BOOTSTAGE_ID_FIT_KERNEL_INFO
Simon Glass [Sat, 18 Nov 2023 21:05:03 +0000 (14:05 -0700)] 
bootstage: Drop BOOTSTAGE_ID_FIT_KERNEL_INFO

This is a misnomer since we don't necessarily know that the image is a
FIT. Use the existing BOOTSTAGE_ID_CHECK_IMAGETYPE instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Use the error return from boot_get_kernel()
Simon Glass [Sat, 18 Nov 2023 21:05:02 +0000 (14:05 -0700)] 
bootm: Use the error return from boot_get_kernel()

Rather than looking for a zero-sized image, use the error code returned
to determine if things are OK.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Adjust position of unmap_sysmem() in boot_get_kernel()
Simon Glass [Sat, 18 Nov 2023 21:05:01 +0000 (14:05 -0700)] 
bootm: Adjust position of unmap_sysmem() in boot_get_kernel()

These unmaps should happen regardless of the return value. Move them
before the 'return' statement.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Adjust boot_get_kernel() to return an error
Simon Glass [Sat, 18 Nov 2023 21:05:00 +0000 (14:05 -0700)] 
bootm: Adjust boot_get_kernel() to return an error

This function obtains lots of error codes and then throws them away.
Update it to return the error, moving the image pointer to an
argument.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agoimage: Document error codes from fit_image_load()
Simon Glass [Sat, 18 Nov 2023 21:04:59 +0000 (14:04 -0700)] 
image: Document error codes from fit_image_load()

Put a list of these in the function documentation so it is easier to
decode what went wrong.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Reduce arguments to boot_get_kernel()
Simon Glass [Sat, 18 Nov 2023 21:04:58 +0000 (14:04 -0700)] 
bootm: Reduce arguments to boot_get_kernel()

This function only uses one argument and just needs to know the name of
the command which called it. Adjust the function to use only what it
needs. This will make it easier to call from a non-command context.

Tidy up the function comment while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agoimage: Tidy up genimg_get_kernel_addr_fit()
Simon Glass [Sat, 18 Nov 2023 21:04:57 +0000 (14:04 -0700)] 
image: Tidy up genimg_get_kernel_addr_fit()

This function does not modify its first argument, so mark it const. Also
move the comments to the header file and expand them to provide more
useful information.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Move boot_get_kernel() higher in the file
Simon Glass [Sat, 18 Nov 2023 21:04:56 +0000 (14:04 -0700)] 
bootm: Move boot_get_kernel() higher in the file

Move this code and image_get_kernel() higher in the file to avoid the
need for a forward declaration.

No attempt is made to remove #ifdefs or adjust the code in any other
way.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Simplify arguments for bootm_pre_load()
Simon Glass [Sat, 18 Nov 2023 21:04:55 +0000 (14:04 -0700)] 
bootm: Simplify arguments for bootm_pre_load()

Move the argument decoding to the caller, to avoid needing to pass the
command-line arguments.

Add a function comment while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
9 months agobootm: Drop arguments from bootm_start()
Simon Glass [Sat, 18 Nov 2023 21:04:54 +0000 (14:04 -0700)] 
bootm: Drop arguments from bootm_start()

This function does not use its arguments. Drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
9 months agobootstd: Add missing header file from bootdev.h
Simon Glass [Sat, 18 Nov 2023 21:04:53 +0000 (14:04 -0700)] 
bootstd: Add missing header file from bootdev.h

Add a dm/uclass-id.h to the bootdev header file, since it uses
enum uclass_id

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
9 months agotreewide: Tidy up semicolon after command macros
Simon Glass [Sat, 18 Nov 2023 21:04:52 +0000 (14:04 -0700)] 
treewide: Tidy up semicolon after command macros

The U_BOOT_CMD_COMPLETE() macro has a semicolon at the end, perhaps
inadvertently. Some code has taken advantage of this.

Tidy this up by dropping the semicolon from the macro and adding it to
macro invocations as required.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
9 months agommc: env: Unify the U_BOOT_ENV_LOCATION conditions
Simon Glass [Sat, 18 Nov 2023 21:04:51 +0000 (14:04 -0700)] 
mmc: env: Unify the U_BOOT_ENV_LOCATION conditions

The declaration of U_BOOT_ENV_LOCATION() uses a different #ifdef
condition from the code it calls. Use the same condition to avoid a
build warning if CONFIG_CMD_SAVEENV is disabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
9 months agoREADME: Correct docs for CONFIG_SPL_BUILD
Simon Glass [Sat, 18 Nov 2023 21:04:50 +0000 (14:04 -0700)] 
README: Correct docs for CONFIG_SPL_BUILD

This option is defined in both SPL and TPL builds, so correct the docs
related to this. Also point to spl_phase() which is normally a better
option. Mention VPL as well.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
9 months agoarm: x86: Drop discarding of command linker-lists
Simon Glass [Sat, 18 Nov 2023 21:04:49 +0000 (14:04 -0700)] 
arm: x86: Drop discarding of command linker-lists

Since we can now cleanly disable CMDLINE when needed, drop the rules
which discard the command code.  It will not be built in the first
place.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
9 months agoMerge patch series "some LED patches"
Tom Rini [Wed, 13 Dec 2023 16:25:18 +0000 (11:25 -0500)] 
Merge patch series "some LED patches"

To quote the author:

I wanted to add support for ti,lp5562, and found an old submission
from Doug. While trying to modify that to work in current U-Boot, I
found a problem with the "move label handling to core" patches.

Patch 1 is a prerequisite for the ti,lp5562 driver, which turned out
to be needed by Christian as well.

Patch 2 is an attempt at (quick-)fixing the mentioned "move label
handling to core" problem. The real fix consists of changing remaining
drivers to not bind the same driver to the top node as to the child
nodes, but I can't test those other drivers.

Patch 3 introduces a helper which should allow removing some
boilerplate in most individual drivers, and 4,5 apply that in the gpio
and pwm drivers. Converting remaining drivers is trivial, but left out
for now.

Finally patch 6 is the reworked lp5562 driver. While I've changed it
to match existing DT bindings (with the goal of making it work with
our .dts that is known to work with the linux driver), most of the
logic is unchanged from Doug's original patch, so he is still listed
as author.

Changes in v2: Interchange order of patches 1 and 2, add a few R-bs,
and try to trim down the commit message in patch 2.

9 months agoled: add TI LP5562 LED driver
Doug Zobel [Fri, 17 Nov 2023 11:38:11 +0000 (12:38 +0100)] 
led: add TI LP5562 LED driver

Driver for the TI LP5562 4 channel LED controller. Supports
independent on/off control of all 4 channels. Supports LED_BLINK on 3
independent channels: blue/green/red. The white channel can blink, but
shares the blue channel blink rate.

Heavily based on patch originally from Doug Zobel [1].

I have modified it so it matches the DT bindings in the linux tree,
and also follows the linux driver implementation more closely. This
should address Tom's concerns, and also matches my goal of making the
U-Boot driver work with our existing .dts which is known to work in
linux.

As our boards only have the R,G,B outputs connected, I have not
actually tested how the white channel behaves, but the R,G,B work
exactly as expected.

[1] https://lore.kernel.org/u-boot/1547150757-1561-1-git-send-email-douglas.zobel@climate.com/

Cc: Doug Zobel <douglas.zobel@climate.com>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
9 months agoled: led_pwm: use led_bind_generic() helper
Rasmus Villemoes [Fri, 17 Nov 2023 11:38:10 +0000 (12:38 +0100)] 
led: led_pwm: use led_bind_generic() helper

Use the helper led_bind_generic() to reduce code duplication.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
9 months agoled: led_gpio: use led_bind_generic() helper
Rasmus Villemoes [Fri, 17 Nov 2023 11:38:09 +0000 (12:38 +0100)] 
led: led_gpio: use led_bind_generic() helper

Use the helper led_bind_generic() to reduce code duplication.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
9 months agoled: introduce led_bind_generic()
Rasmus Villemoes [Fri, 17 Nov 2023 11:38:08 +0000 (12:38 +0100)] 
led: introduce led_bind_generic()

All existing drivers in drivers/led/ contain a .bind method that does
exactly the same thing, with just the actual driver name
differing. Create a helper so all those individual methods can be
changed to one-liners.

Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
9 months agoled-uclass: do not create fallback label for top-level node
Rasmus Villemoes [Fri, 17 Nov 2023 11:38:07 +0000 (12:38 +0100)] 
led-uclass: do not create fallback label for top-level node

Many existing drivers, and led-uclass itself, rely on uc_plat->label
being NULL for the device representing the top node, as opposed to the
child nodes representing individual LEDs. This means that the drivers
whose .probe methods rely on this were broken by commit 83c63f0d1185
("led: Move OF "label" property parsing to core"), and also that the top
node wrongly shows up with 'led list'.

Binding the same driver to the top node as to the individual child
nodes is arguably wrong, and the approach of using a UCLASS_NOP driver
for the top node is probably better - this has for example been done in
commit 01074697801b ("led: gpio: Use NOP uclass driver for top-level
node") and commit 910b01c27c04 ("drivers: led: bcm6753: do not use null
label to find the top")

Until remaining affected drivers are fixed, we can use a heuristic
that only sets the label to the fallback value derived from the node
name if the node does not have a "compatible" property - i.e., if it
has been bound to the LED driver explicitly via
device_bind_driver_to_node(). This is similar to what commit
e3aa76644c2a ("led: gpio: Check device compatible string to determine
the top level node") did for gpio_led, but that fix was then supplanted
by commit 01074697801b ("led: gpio: Use NOP uclass driver for top-level
node")

Fixes: 83c63f0d1185 ("led: Move OF "label" property parsing to core")
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
9 months agoled-uclass: honour ->label field populated by driver's own .bind
Rasmus Villemoes [Fri, 17 Nov 2023 11:38:06 +0000 (12:38 +0100)] 
led-uclass: honour ->label field populated by driver's own .bind

If the driver's own .bind method has populated uc_plat->label, don't
override that. This is necessary for an upcoming driver for ti,lp5562,
where the DT binding unfortunately says to use "chan-name" and not
"label".

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
9 months agotest: bdinfo: Handle systems without getopt
Marek Vasut [Sun, 10 Dec 2023 15:01:56 +0000 (16:01 +0100)] 
test: bdinfo: Handle systems without getopt

Systems without getopt support fall back to plain full bdinfo print,
handle such a case, which occurs e.g. with sandbox_flattree_defconfig .

Fixes: 8827a3871452 ("test: bdinfo: Test bdinfo -h")
Fixes: 2696f3ab8101 ("test: bdinfo: Test bdinfo -m")
Fixes: 3ff2d796a6f2 ("test: bdinfo: Test bdinfo -e")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agotest/py: Disable error E0611 in two cases for pylint
Tom Rini [Sat, 9 Dec 2023 19:52:46 +0000 (14:52 -0500)] 
test/py: Disable error E0611 in two cases for pylint

Recently pylint has started to complain about:
No name 'fs_helper' in module 'tests' (no-name-in-module)

Due to:
from tests import fs_helper

However, we have:
test/py/tests/fs_helper.py

And since we do not want to add a dummy test/py/tests/__init__.py to
silence this warning we instead just disable it as needed.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
9 months agoMerge patch series "cmd: bdinfo: Optionally use getopt and implement bdinfo -a"
Tom Rini [Sat, 9 Dec 2023 13:42:49 +0000 (08:42 -0500)] 
Merge patch series "cmd: bdinfo: Optionally use getopt and implement bdinfo -a"

Clean up our bdinfo command a bit and introduce "bdinfo -a"

9 months agotest: bdinfo: Test bdinfo -e
Marek Vasut [Sat, 7 Oct 2023 21:41:06 +0000 (23:41 +0200)] 
test: bdinfo: Test bdinfo -e

The bdinfo -e should print only the board ethernet settings.
Test the expected output.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agotest: bdinfo: Test bdinfo -m
Marek Vasut [Sat, 7 Oct 2023 21:41:05 +0000 (23:41 +0200)] 
test: bdinfo: Test bdinfo -m

The bdinfo -m should print only the board memory layout.
Test the expected output.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
9 months agotest: bdinfo: Test bdinfo -h
Marek Vasut [Sat, 7 Oct 2023 21:41:04 +0000 (23:41 +0200)] 
test: bdinfo: Test bdinfo -h

The bdinfo -h should print error message that -h is an unknown
parameter and then command help text. Test the expected output.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agotest: bdinfo: Test both bdinfo and bdinfo -a
Marek Vasut [Sat, 7 Oct 2023 21:41:03 +0000 (23:41 +0200)] 
test: bdinfo: Test both bdinfo and bdinfo -a

Factor out the core of test for all bdinfo output into bdinfo_test_all()
and then reuse it to verify that both 'bdinfo' and 'bdinfo -a' print all
the bdinfo output.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agotest: bdinfo: Rename bdinfo_test_move() to bdinfo_test_full()
Marek Vasut [Sat, 7 Oct 2023 21:41:02 +0000 (23:41 +0200)] 
test: bdinfo: Rename bdinfo_test_move() to bdinfo_test_full()

Rename bdinfo_test_move() to bdinfo_test_full(). The former is a
remnant of deriving this test from another test. No functional
change.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agoconfigs: sandbox: Enable GETOPT for sandbox and sandbox64 target
Marek Vasut [Sat, 7 Oct 2023 21:41:01 +0000 (23:41 +0200)] 
configs: sandbox: Enable GETOPT for sandbox and sandbox64 target

Enable GETOPT so that 'bdinfo' command with getopt() support can be
tested in CI.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agocmd: bdinfo: Implement support for printing ethernet settings via bdinfo -e
Marek Vasut [Sat, 7 Oct 2023 21:41:00 +0000 (23:41 +0200)] 
cmd: bdinfo: Implement support for printing ethernet settings via bdinfo -e

Add support for printing ethernet settings only via 'bdinfo -e' .

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agocmd: bdinfo: Implement support for printing memory layout via bdinfo -m
Marek Vasut [Sat, 7 Oct 2023 21:40:59 +0000 (23:40 +0200)] 
cmd: bdinfo: Implement support for printing memory layout via bdinfo -m

Add support for printing memory layout only via 'bdinfo -m' .

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agocmd: bdinfo: Optionally use getopt and implement bdinfo -a
Marek Vasut [Sat, 7 Oct 2023 21:40:58 +0000 (23:40 +0200)] 
cmd: bdinfo: Optionally use getopt and implement bdinfo -a

Add optional support for getopt() and in case this is enabled via
GETOPT configuration option, implement support for 'bdinfo -a'.
The 'bdinfo -a' behaves exactly like bdinfo and prints 'all' the
bdinfo information. This is implemented in preparation for other
more fine-grained options.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agoMerge tag 'v2024.01-rc4' into next
Tom Rini [Tue, 5 Dec 2023 02:39:57 +0000 (21:39 -0500)] 
Merge tag 'v2024.01-rc4' into next

Prepare v2024.01-rc4

# -----BEGIN PGP SIGNATURE-----
#
# iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmVuHrwACgkQFHw5/5Y0
# tyy3Tgv+LB/X0ZR3IHnu1mvQ7kpOFvAjjKr0BUpcEEzsrDZeJnS6sy06m+REez2E
# UmuLeKFj5NUCYXNKtxn2+gVnJt8Tk6ftxhMTiZHmR4Y4NVc5aPtqYmVsv6Q29j0U
# mcg7AGcZTniu9/naNM+ZcDeHzLDAB0whmE9eVfixXVgyitILoLHNdFiQ7W4oR7Kh
# /mBgdMDBS3rqiRi6CuqKUnl4ADX8T3AXaSfi3hqOC5Pj+HPkZSUfyWx31mu9mN1D
# wXTHASZX06Dop25fm/ZSdWk1blBw29WqRiJBdwNatvyC5pqMsotTvAfH2AcHBEYg
# tpoper+WDOBAipt6b6Y1B7q4VPvJ97L9dFCAYqN0nGCe+rkdi+k+cly7M6Ye9xLt
# e7rVUfnKgIMP8jkLcVBYoWkFY5FiJ82O5qjoF5N3dAuHeWacDFsB5TugDTOQvblH
# LWCmcIyU1N9Ma/Ib0rTvNduvpBUYBKXYlD1+rjPZUbTUnfc79mf+ReFpcoW6Kxh+
# bkz81p8P
# =ebIZ
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 04 Dec 2023 01:47:24 PM EST
# gpg:                using RSA key 1A3C7F70E08FAB1707809BBF147C39FF9634B72C
# gpg: Good signature from "Thomas Rini <trini@konsulko.com>" [ultimate]

9 months agoPrepare v2024.01-rc4 v2024.01-rc4
Tom Rini [Mon, 4 Dec 2023 18:46:56 +0000 (13:46 -0500)] 
Prepare v2024.01-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
9 months agoefi_loader: generated SMBIOS table below 4 GiB
Heinrich Schuchardt [Mon, 20 Nov 2023 22:25:58 +0000 (23:25 +0100)] 
efi_loader: generated SMBIOS table below 4 GiB

We currently use an outdated format 32-bit format for SMBIOS tables.
So we must allocate SMBIOS tables below 4 GiB.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
9 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-watchdog
Tom Rini [Mon, 4 Dec 2023 18:37:18 +0000 (13:37 -0500)] 
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-watchdog

- Correct watchdog timeout print message (Chanho Park)

9 months agowatchdog: Correct watchdog timeout print message
Chanho Park [Sun, 3 Dec 2023 08:30:40 +0000 (17:30 +0900)] 
watchdog: Correct watchdog timeout print message

The wdt_start function takes timeout_ms as a parameter and starts the
watchdog with this value. However, when you output the message, it shows
the default timeout value for the watchdog device.
So this patch fixes that part to output the correct timeout value.

Before -->
StarFive # wdt start 3000
WDT:   Started watchdog@13070000 without servicing  (60s timeout)

After -->
StarFive # wdt start 3000
WDT:   Started watchdog@13070000 without servicing  (3s timeout)

Fixes: c2fd0ca1a822 ("watchdog: Integrate watchdog triggering into the cyclic framework")
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Stefan Roese <sr@denx.de>
9 months agoMerge branch 'master-rpc-off' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Sun, 3 Dec 2023 21:30:32 +0000 (16:30 -0500)] 
Merge branch 'master-rpc-off' of https://source.denx.de/u-boot/custodians/u-boot-sh

9 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Sat, 2 Dec 2023 18:37:27 +0000 (13:37 -0500)] 
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usb

- USB XHCI fixes

9 months agoARM: dts: renesas: Disable RPC driver on R8A779G0 V4H White Hawk board
Cong Dang [Mon, 19 Jun 2023 22:41:50 +0000 (00:41 +0200)] 
ARM: dts: renesas: Disable RPC driver on R8A779G0 V4H White Hawk board

As requirement of CR side, QSPI Flash usage via RPC driver shall
be disabled and leaving the control of this module to CR side.
Perform DT modification to disable the RPC SPI.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Do not modify defconfig, modify the DT instead, this way
        the RPC SPI can be enabled without recompiling the U-Boot
itself. Update commit message accordingly.]

9 months agoARM: dts: renesas: Clean up R8A779G0 V4H RPC SPI DT node
Marek Vasut [Mon, 19 Jun 2023 22:41:49 +0000 (00:41 +0200)] 
ARM: dts: renesas: Clean up R8A779G0 V4H RPC SPI DT node

Use the phandle reference to &rpc node in arch/arm/dts/r8a779g0.dtsi
and remove properties which are already in arch/arm/dts/r8a779g0.dtsi.
No functional change and no resulting DT change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
9 months agousb: USB_XHCI_PCI depends on PCI
Heinrich Schuchardt [Mon, 20 Nov 2023 14:56:36 +0000 (15:56 +0100)] 
usb: USB_XHCI_PCI depends on PCI

Compiling with CONFIG_USB_XHCI_PCI and CONFIG_PCI=n results in

    usb/host/xhci-pci.c:48:(.text.xhci_pci_probe+0x44):
    undefined reference to `dm_pci_write_config32

Add the missing Kconfig dependency.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Marek Vasut <marex@denx.de>
9 months agousb: dwc3-generic: Use combined glue and ctrl node for RK3588
Jonas Karlman [Sun, 12 Nov 2023 15:25:25 +0000 (15:25 +0000)] 
usb: dwc3-generic: Use combined glue and ctrl node for RK3588

Like Rockchip RK3328 and RK3568, the RK3588 also have a single node to
represent the glue and ctrl for USB 3.0.

Use rk_ops as driver data to select correct ctrl node for RK3588 DWC3.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Marek Vasut <marex@denx.de>
9 months agousb: storage: Use the correct CBW lengths
Hector Martin [Sun, 29 Oct 2023 07:23:30 +0000 (16:23 +0900)] 
usb: storage: Use the correct CBW lengths

USB UFI uses fixed 12-byte commands (as does RBC, which is not
supported), but SCSI does not have this limitation. Use the correct
command block lengths depending on the subclass.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
9 months agousb: hub: Add missing reset recovery delay
Hector Martin [Sun, 29 Oct 2023 07:09:09 +0000 (16:09 +0900)] 
usb: hub: Add missing reset recovery delay

Some devices like YubiKeys need more time before SET_ADDRESS. The spec
says we need to wait 10ms.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
9 months agousb: xhci: Fix DMA address calculation in queue_trb
Hector Martin [Sun, 29 Oct 2023 06:37:44 +0000 (15:37 +0900)] 
usb: xhci: Fix DMA address calculation in queue_trb

We need to get the DMA address before incrementing the pointer, as that
might move us onto another segment.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
9 months agousb: xhci: Do not panic on event timeouts
Hector Martin [Sun, 29 Oct 2023 06:37:43 +0000 (15:37 +0900)] 
usb: xhci: Do not panic on event timeouts

Now that we always check the return value, just return NULL on timeouts.
We can still log the error since this is a problem, but it's not reason
to panic.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
9 months agousb: xhci: Fail on attempt to queue TRBs to a halted endpoint
Hector Martin [Sun, 29 Oct 2023 06:37:42 +0000 (15:37 +0900)] 
usb: xhci: Fail on attempt to queue TRBs to a halted endpoint

This isn't going to work, don't pretend it will and then end up timing
out.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>
9 months agousb: xhci: Recover from halted bulk endpoints
Hector Martin [Sun, 29 Oct 2023 06:37:41 +0000 (15:37 +0900)] 
usb: xhci: Recover from halted bulk endpoints

There is currently no codepath to recover from this case. In principle
we could require that the upper layer do this explicitly, but let's just
do it in xHCI when the next bulk transfer is started, since that
reasonably implies whatever caused the problem has been dealt with.

Signed-off-by: Hector Martin <marcan@marcan.st>
Reviewed-by: Marek Vasut <marex@denx.de>