]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years agopico-imx7d: add baseboard SD card boot detect
Benjamin Szőke [Wed, 13 Dec 2023 18:51:49 +0000 (15:51 -0300)] 
pico-imx7d: add baseboard SD card boot detect

Technexion PICO-IMX7 SoM is supporting USDHC3 (eMMC or micro SD on SoM)
and USDHC1 (SD on carrier board) to use on any carrier board like
PICO-NYMPH. Based on the U-Boot version from Technexion it adds
baseboard SD card boot detect to able to boot from selected USDHC1
or USDHC3 boot devices.

Signed-off-by: Benjamin Szőke <egyszeregy@freemail.hu>
Tested-by: Fabio Estevam <festevam@gmail.com>
2 years agoimx: imx-hab: Select SPL_DRIVERS_MISC in the SPL case
Fabio Estevam [Mon, 11 Dec 2023 13:46:17 +0000 (10:46 -0300)] 
imx: imx-hab: Select SPL_DRIVERS_MISC in the SPL case

Selecting CONFIG_IMX_HAB=y on a SPL target, such as apalis_imx6_defconfig,
for example, leads to the following build error:

/usr/bin/arm-linux-gnueabihf-ld.bfd: arch/arm/mach-imx/hab.o: in function `imx_hab_is_enabled':
arch/arm/mach-imx/hab.c:879: undefined reference to `fuse_read'

fuse_read() comes from SPL_MXC_OCOTP, which depends on SPL_DRIVERS_MISC,
since commit 251a3053b1e6 ("misc: imx: remove DM dependency for ocotp
driver in SPL").

Select SPL_DRIVERS_MISC in the SPL case to fix this build issue.

Reported-by: Lisandro Pérez Meyer <lpmeyer@ics.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-by: Lisandro Pérez Meyer <lpmeyer@ics.com>
2 years agotools: mxsboot: pre-fill buffer with 0xff, not 0
Alessandro Rubini [Sun, 3 Dec 2023 17:08:26 +0000 (18:08 +0100)] 
tools: mxsboot: pre-fill buffer with 0xff, not 0

The tool works for me, with imx28 and NAND memory, but the resulting
blocks are reported as bad, both by u-boot and the kernel.

This makes it impossible to erase from Linux (for an upgrade without
console access, for example -- u-boot can "nand scrub" but linux can't).

pre-filling with 0xff creates a proper boot loader image, but no
bad-block marker is there when written to flash.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2 years agoarm: mxs: Clear CPSR V bit to activate low vectors
Marek Vasut [Wed, 18 Oct 2023 18:51:59 +0000 (20:51 +0200)] 
arm: mxs: Clear CPSR V bit to activate low vectors

The MXS starts with CPSR V bit set, which makes the CPU jump to high vectors
in case of an exception. Those high vectors are located at 0xffff0000, which
is where the BootROM exception table is located as well. U-Boot should handle
exceptions on its own using its own exception handling code, which is located
at 0x0, i.e. at low vectors. Clear the CPSR V bit, so that the CPU would jump
to low vectors on exception instead, and therefore run the U-Boot exception
handling code.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years 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"

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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.

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years agoclk: zynqmp: enable topsw_lsbus clock
Venkatesh Yadav Abbarapu [Mon, 4 Dec 2023 08:45:15 +0000 (14:15 +0530)] 
clk: zynqmp: enable topsw_lsbus clock

Display port is using topsw_lsbus clock, it is failing
while enabling the clock, so enable the topsw_lsbus clock.

Signed-off-by: Sreekanth Sunnam <sreekanth.sunnam@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20231204084515.9488-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agoMerge branch '2023-12-13-assorted-minor-fixes'
Tom Rini [Wed, 13 Dec 2023 14:57:28 +0000 (09:57 -0500)] 
Merge branch '2023-12-13-assorted-minor-fixes'

- A few MAINTAINERS updates and Kconfig wording fixes

2 years agomaintainers: rk3399: remove maintainer
Shantur Rathore [Fri, 24 Nov 2023 12:04:31 +0000 (12:04 +0000)] 
maintainers: rk3399: remove maintainer

Remove Akash Gajjar <akash@openedev.com> from
MAINTAINERS as email is bouncing.

Signed-off-by: Shantur Rathore <i@shantur.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agomaintainers: bcmns3: remove maintainer
Peter Robinson [Tue, 5 Dec 2023 09:12:22 +0000 (09:12 +0000)] 
maintainers: bcmns3: remove maintainer

Remove Bharat Gooty as a maintainer as his mail is
bouncing.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Cc: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
2 years agoMAINTAINERS: Fix ARCH_APPLE file paths
Moritz Fischer [Wed, 22 Nov 2023 16:21:14 +0000 (16:21 +0000)] 
MAINTAINERS: Fix ARCH_APPLE file paths

Fixes a filepath in MAINTAINERS file that wasn't updated when
renaming the files to match the new SoC name.

Fixes: a4bd5e4120d6 ('arm: apple: Change SoC name from "m1" into "apple"')
Signed-off-by: Moritz Fischer <moritzf@google.com>
2 years agodrivers: misc: Kconfig: Fix SPL_FS_LOADER prompt
Alexander Gendin [Mon, 20 Nov 2023 20:21:51 +0000 (20:21 +0000)] 
drivers: misc: Kconfig: Fix SPL_FS_LOADER prompt

Both FS_LOADER and SPL_FS_LOADER have the same menu prompt.
To avoid confusion, make prompt for SPL_FS_LOADER different.

Signed-off-by: Alexander Gendin <agendin@matrox.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agolib/Kconfig: Correct typo about SYSINFO_SMBIOS in help message
Tom Rini [Mon, 20 Nov 2023 20:17:23 +0000 (15:17 -0500)] 
lib/Kconfig: Correct typo about SYSINFO_SMBIOS in help message

The correct symbol to enable to have SMBIOS populate fields based on the
device tree is SYSINFO_SMBIOS and not SMBIOS_SYSINFO.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoclk: imx8mn: add pwm clocks
Nicolas Heemeryck [Mon, 11 Dec 2023 10:06:13 +0000 (11:06 +0100)] 
clk: imx8mn: add pwm clocks

Based on Linux kernel 6.7-rc4, add necessary clocks for the PWM
controllers.

Signed-off-by: Nicolas Heemeryck <nicolas.heemeryck@devialet.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoboard: apalis/colibri imx6/imx6ull/imx7: Add fastboot bootcmd support
Hiago De Franco [Thu, 9 Nov 2023 16:24:01 +0000 (13:24 -0300)] 
board: apalis/colibri imx6/imx6ull/imx7: Add fastboot bootcmd support

This commit adds support for Fastboot boot commands by checking both
CONFIG_CMD_USB_SDP and CONFIG_USB_FUNCTION_FASTBOOT. If either of these
configurations is set, it indicates that the board is in recovery mode
and can use either SDP or Fastboot.

The default option remains the SDP command, but if
CONFIG_CMD_FASTBOOT is set, it changes to 'fastboot usb 0' as
the boot command.

Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoapalis/colibri imx6/imx6ull/imx7: defconfig: Enable fastboot support
Hiago De Franco [Thu, 9 Nov 2023 16:24:00 +0000 (13:24 -0300)] 
apalis/colibri imx6/imx6ull/imx7: defconfig: Enable fastboot support

Add fastboot support for Apalis iMX6, Colibri iMX6, Colibri iMX6ULL and
Colibri iMX7 boards. Remove CONFIG_FASTBOOT_BUF_SIZE from
colibri_imx7_emmc_defconfig to get the default value of 0x7000000 instead
of 0x10000000, to make it consistent with the other boards.

Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoimx7d-pico-pi-u-boot.dtsi: Fix aliases indentation
Fabio Estevam [Fri, 3 Nov 2023 23:00:54 +0000 (20:00 -0300)] 
imx7d-pico-pi-u-boot.dtsi: Fix aliases indentation

The aliases are currently indented using spaces.

Fix it to use the standard tab indentation.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agopico-imx7d: Remove board_phy_config()
Fabio Estevam [Fri, 3 Nov 2023 22:47:33 +0000 (19:47 -0300)] 
pico-imx7d: Remove board_phy_config()

With Ethernet DM in place, there is no longer the need for having
the board_phy_config() anymore.

Remove it.

Tested on imx7d-pico-pi board:

=> setenv autoload no
=> dhcp
BOOTP broadcast 1
*** Unhandled DHCP Option in OFFER/ACK: 42
DHCP client bound to address 192.168.0.138 (138 ms)
=> tftp zImage
Using ethernet@30be0000 device
TFTP from server 192.168.0.16; our IP address is 192.168.0.138
Filename 'zImage'.
Load address: 0x80800000
Loading: #################################################################
....
 #################################################################
 ##########
 4.3 MiB/s
done
Bytes transferred = 9034120 (89d988 hex)

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agolibrem5: Add addresses for compressed kernel load
Arnaud Ferraris [Fri, 27 Oct 2023 13:40:45 +0000 (15:40 +0200)] 
librem5: Add addresses for compressed kernel load

The "booti" command to load arm64 Linux kernels supports automatic
decompression of zipped kernel images, but relies on some environment
variables to point to usable buffer RAM.

Add those variables and let them point to some default values, that
should cover most use-cases.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2 years agolibrem5: properly set the `fdtfile` env variable
Arnaud Ferraris [Fri, 27 Oct 2023 13:40:44 +0000 (15:40 +0200)] 
librem5: properly set the `fdtfile` env variable

In order to use the generic "distro boot" using an extlinux.conf file,
the `fdtfile` environment variable is mandatory. This commit ensure this
variable is properly constructed based on the detected board revision.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2 years agoconfigs: imx8mn_beacon: Disable the WDT autostart
Adam Ford [Wed, 25 Oct 2023 23:04:56 +0000 (18:04 -0500)] 
configs: imx8mn_beacon: Disable the WDT autostart

Auto-starting the WDT can cause false reboots when the user
is not intentionally trying to use the WDT, so leave it off until
it is requested.

Signed-off-by: Adam Ford <aford173@gmail.com>
2 years agoconfigs: imx8mn_beacon: Do not set SYS_CONSOLE_IS_IN_ENV
Adam Ford [Wed, 25 Oct 2023 23:04:55 +0000 (18:04 -0500)] 
configs: imx8mn_beacon: Do not set SYS_CONSOLE_IS_IN_ENV

The hardware only supports a specific console port, so  remove the
option to change the console location in the environment.

Signed-off-by: Adam Ford <aford173@gmail.com>
2 years agoconfigs: imx8mm_beacon: Disable the WDT autostart
Adam Ford [Wed, 25 Oct 2023 23:04:54 +0000 (18:04 -0500)] 
configs: imx8mm_beacon: Disable the WDT autostart

Auto-starting the WDT can cause false reboots when the user
is not intentionally trying to use the WDT, so leave it off until
it is requested.

Signed-off-by: Adam Ford <aford173@gmail.com>
2 years agoconfigs: imx8mm_beacon: Enable fastboot downloading
Adam Ford [Wed, 25 Oct 2023 23:04:53 +0000 (18:04 -0500)] 
configs: imx8mm_beacon: Enable fastboot downloading

Fastboot is necessary to use UUU enhanced functions, so enable it.

Signed-off-by: Adam Ford <aford173@gmail.com>
2 years agoconfigs: imx8mp_beacon: Do not set SYS_CONSOLE_IS_IN_ENV
Adam Ford [Wed, 25 Oct 2023 23:04:52 +0000 (18:04 -0500)] 
configs: imx8mp_beacon: Do not set SYS_CONSOLE_IS_IN_ENV

The hardware only supports a specific console port, so  remove the
option to change the console location in the environment.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoMAINTAINERS: Remove non-working address from MAINTAINERS
Hugo Villeneuve [Mon, 23 Oct 2023 15:26:28 +0000 (11:26 -0400)] 
MAINTAINERS: Remove non-working address from MAINTAINERS

The address ariel.dalessandro@collabora.com is no longer working:

  A message that you sent could not be delivered to one or more of its
  recipients. This is a permanent error. The following address(es) failed:

  ariel.dalessandro@collabora.com
    host mx.collabora.co.uk [46.235.227.165]
    SMTP error from remote mail server after RCPT TO:<ariel.dalessandro@collabora.com>:
    550 5.1.1 <ariel.dalessandro@collabora.com>: Recipient address rejected:
    undeliverable address: host mail.collabora.co.uk[46.235.227.172] said:
    550 5.1.1 <ariel.dalessandro@collabora.com>: Recipient address rejected:
    User unknown in local recipient table (in reply to RCPT TO command)

Remove this address from MAINTAINERS.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoimx8mn-var-som: Simplify FEC initialization
Hugo Villeneuve [Thu, 19 Oct 2023 19:43:23 +0000 (15:43 -0400)] 
imx8mn-var-som: Simplify FEC initialization

With DM enabled, there is no need for board code to initialize
the FEC interface.

The ethernet PHYs on the symphony carrier board have a dedicated
crystal/oscillator. If the SOM has the EC configuration option
(onboard ethernet PHY), it also has a dedicated crystal/oscillator.
So in all cases, there is no need to enable the RGMII TX clk output.

This follows a similar change introduced by Fabio Estevam:
Link: https://lore.kernel.org/u-boot/20231019170441.1610453-1-festevam@gmail.com/
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoimx8mn_var_som: Add myself to MAINTAINERS
Hugo Villeneuve [Thu, 19 Oct 2023 19:42:41 +0000 (15:42 -0400)] 
imx8mn_var_som: Add myself to MAINTAINERS

I would like to help maintaining the imx8mn_var_som symphony board.

Add myself to MAINTAINERS.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoclock_imx8mm: Add a stub for imx8mp_fec_interface_init()
Fabio Estevam [Fri, 20 Oct 2023 00:47:35 +0000 (21:47 -0300)] 
clock_imx8mm: Add a stub for imx8mp_fec_interface_init()

When CONFIG_DWC_ETH_QOS_IMX=y and CONFIG_FEC_MXC is not selected, the
following warning is seen:

arch/arm/mach-imx/imx8m/clock_imx8mm.c: In function 'board_interface_eth_init':
arch/arm/mach-imx/imx8m/clock_imx8mm.c:914:24: warning: implicit declaration of function 'imx8mp_fec_interface_init; did you mean 'imx8mp_eqos_interface_init'? [-Wimplicit-function-declaration]

Fix it by adding a stub for imx8mp_fec_interface_init() to handle this
case.

This follows the same approach done on imx8mp_eqos_interface_init().

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
2 years agoimx8mp_evk: Remove unneeded header files
Fabio Estevam [Thu, 19 Oct 2023 21:51:13 +0000 (18:51 -0300)] 
imx8mp_evk: Remove unneeded header files

Cleanup the file by removing unneeded header files.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
2 years agoimx8mp_evk: Simplify Ethernet initialization
Fabio Estevam [Thu, 19 Oct 2023 21:51:12 +0000 (18:51 -0300)] 
imx8mp_evk: Simplify Ethernet initialization

With DM enabled, there is no need for board code to initialize
the Ethernet interfaces.

The RTL8211FDI Ethernet PHYs have 25MHz oscillator, so there is no
need to enable the RGMII TX clk output.

Also, there is no need for describing the deprecated phy-reset FEC
properties, nor passing reset properties to the EQOS interface in
u-boot.dtsi.

Remove all these unneeded pieces.

Tested both Ethernet interfaces after these changes.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
2 years agophy: phy-imx8mq-usb: Remove .exit operation
Fabio Estevam [Thu, 19 Oct 2023 12:36:09 +0000 (09:36 -0300)] 
phy: phy-imx8mq-usb: Remove .exit operation

Currently, when running "ums 0 mmc 2" and breaking it via
CTRL + C, the following message is seen:

u-boot=> ums 0 mmc 1
UMS: LUN 0, dev mmc 1, hwpart 0, sector 0x0, count 0x1dacc00
CTRL+C - Operation aborted
clk usb_phy_root_clk already disabled

The USB PHY clock is disabled twice: first it gets disabled
inside imx8mq_usb_phy_power_off(), then it is disabled again
inside imx8mq_usb_phy_exit().

Let the USB PHY clock be disabled only once inside
imx8mq_usb_phy_power_off() by removing the .exit operation.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
2 years agoarm: dts: imx8mp: Sync with linux-next 20231019
Fabio Estevam [Thu, 19 Oct 2023 12:06:23 +0000 (09:06 -0300)] 
arm: dts: imx8mp: Sync with linux-next 20231019

Sync imx8mp.dtsi and imx8mp-clock.h with linux-next 20231019.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoarm: dts: imx8mn: Sync with linux-next 20231019
Fabio Estevam [Thu, 19 Oct 2023 12:06:22 +0000 (09:06 -0300)] 
arm: dts: imx8mn: Sync with linux-next 20231019

Sync imx8mn.dtsi with linux-next 20231019.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoarm: dts: imx8mm: Sync with linux-next 20231019
Fabio Estevam [Thu, 19 Oct 2023 12:06:21 +0000 (09:06 -0300)] 
arm: dts: imx8mm: Sync with linux-next 20231019

Sync imx8mm.dtsi with linux-next 20231019.

The motivation for doing this sync was a bug when doing "ums 0 mmc 1"
on imx8mm-evk. It worked well for the first time, but after doing
a CTRL+C and launching the ums again, the command did not work.

Adam Ford suggested to sync imx8mm.dtsi with the Linux dts, as there was
a recent USB power domain reorganization there.

After syncing the imx8mm.dtsi with Linux, the ums command works without
problem after a CTRL+C.

Suggested-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Tim Harvey <tharvey@gateworks.com>
2 years agoimx8mp_evk: Add myself to MAINTAINERS
Fabio Estevam [Wed, 18 Oct 2023 19:17:42 +0000 (16:17 -0300)] 
imx8mp_evk: Add myself to MAINTAINERS

I would like to help maintaining the imx8mp_evk board.

Add myself to MAINTAINERS.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx8mp_evk: Convert to DM_PMIC
Fabio Estevam [Wed, 18 Oct 2023 19:17:41 +0000 (16:17 -0300)] 
imx8mp_evk: Convert to DM_PMIC

Currently, the imx8mp_evk uses the non-DM code to initialize the PMIC.

Convert to DM_PMIC, which is the recommended way to access the PMIC.

While at it, fix multi-line comments style.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 years agoarm: dts: imx8mp-venice-gw73xx: add TPM device
Tim Harvey [Wed, 18 Oct 2023 18:33:52 +0000 (11:33 -0700)] 
arm: dts: imx8mp-venice-gw73xx: add TPM device

Add the TPM device found on the GW73xx revision F PCB.

This hangs off of SPI2, uses gpio1_10 as a CS and gpio1_11 as RST#.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoarm: dts: imx8mm-venice-gw73xx: add TPM device
Tim Harvey [Wed, 18 Oct 2023 18:33:38 +0000 (11:33 -0700)] 
arm: dts: imx8mm-venice-gw73xx: add TPM device

Add the TPM device found on the GW73xx revision F PCB.

This hangs off of SPI2, uses gpio1_10 as a CS and gpio1_11 as RST#.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoimx8mn-var-som: add manufacturer to target description
Hugo Villeneuve [Tue, 17 Oct 2023 14:25:00 +0000 (10:25 -0400)] 
imx8mn-var-som: add manufacturer to target description

Add Variscite manufacturer to the IMX8MN_VAR_SOM target menu label as
the majority of targets include the manufacturer as part of their menu
description/label and it helps when looking for a particular
manufacturer/board.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoarm: dts: imx93-evk: remove wrong eqos compatible string
Sébastien Szymanski [Tue, 17 Oct 2023 09:45:01 +0000 (11:45 +0200)] 
arm: dts: imx93-evk: remove wrong eqos compatible string

The correct compatible string for i.MX93 variant of DWC EQoS MAC is now
"nxp,imx93-dwmac-eqos".

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
2 years agonet: phy: realtek: Add support for RTL8211F(D)(I)-VD-CG
Sébastien Szymanski [Tue, 17 Oct 2023 09:45:00 +0000 (11:45 +0200)] 
net: phy: realtek: Add support for RTL8211F(D)(I)-VD-CG

Add support for the RTL8211F(D)(I)-VD-CG PHY present on the i.MX93 EVK
board.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
2 years agonet: dwc_eth_qos: Add board_interface_eth_init() for i.MX93
Sébastien Szymanski [Tue, 17 Oct 2023 09:44:59 +0000 (11:44 +0200)] 
net: dwc_eth_qos: Add board_interface_eth_init() for i.MX93

Add a common board_interface_eth_init() called by the DWC MAC driver to
setup the MAC <-> PHY interface according to the PHY mode obtained from
DT.
Remove the board-side configuration in the i.MX93 EVK files.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
2 years agonet: dwc_eth_qos: add i.MX93 support
Sébastien Szymanski [Tue, 17 Oct 2023 09:44:58 +0000 (11:44 +0200)] 
net: dwc_eth_qos: add i.MX93 support

Add support for DWC EQoS MAC on i.MX93.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoARM: imx8ulp: support env in fat and ext4
Ricardo Salveti [Fri, 25 Aug 2023 14:44:14 +0000 (17:44 +0300)] 
ARM: imx8ulp: support env in fat and ext4

Change boot device logic to also allow environment stored in fat and
in ext4 when booting from SD or eMMC.

As the boot device check for SD and for eMMC was depending on
ENV_IS_IN_MMC being defined, change the ifdef blocks at
env_get_location to use IS_ENABLED instead for all modes, returning
NOWHERE when no valid mode is found.

Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
Co-developed-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
2 years agoimx: imx8: ahab: refactor do_ahab_close command
Igor Opaniuk [Mon, 21 Aug 2023 19:33:41 +0000 (22:33 +0300)] 
imx: imx8: ahab: refactor do_ahab_close command

Move an OEM closing logic to ahab_close() function to be able to use
it directly without calling a u-boot command.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Co-developed-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
2 years agoarm: mxs: Fix ICOLL macro name typo
Marek Vasut [Sat, 29 Jul 2023 13:29:41 +0000 (15:29 +0200)] 
arm: mxs: Fix ICOLL macro name typo

The interrupt collector macro name for i.MX23 is MXS_ICOLL_BASE,
this is correct and matches the documentation of both i.MX23 and
i.MX28. Align the i.MX28 macro accordingly. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
2 years agoarm: dts: imx8mm-phyboard-polis-rdk: Sync dts files with kernel
Cem Tenruh [Fri, 14 Jul 2023 08:23:26 +0000 (10:23 +0200)] 
arm: dts: imx8mm-phyboard-polis-rdk: Sync dts files with kernel

Sync the devicetree files used in the kernel for the imx8mm-phyboard-polis
with the corresponding devicetree files in U-Boot.
Replaced phycore-imx8mm.dts with kernel dts imx8mm-phyboard-polis-rdk.dts

Synced with kernel 6.5.0-rc1 commit
e752a4f9589c (arm64: dts: freescale: imx8mm-phyboard: Add I2C4 pinmuxing)

Signed-off-by: Cem Tenruh <c.tenruh@phytec.de>
2 years agoimx7d-sdb: Sync devicetree with kernel 6.5-rc1
Fabio Estevam [Wed, 13 Dec 2023 12:37:08 +0000 (09:37 -0300)] 
imx7d-sdb: Sync devicetree with kernel 6.5-rc1

Commit 0aea5dda2928 ("ARM: dts: imx7d-sdb-u-boot: Fix usdhc1 UHS
operation") did a temporary workaround by addng the usdhc1 fix
inside the -u-boot.dtsi file.

The imx7d-sdb.dts from kernel 6.5-rc1 contains the proper UHS
fix, so sync the devicetree tree and remove the previous fix
from -u-boot.dtsi.

Also, adjust the PMIC node name inside pmic_get() to match
the devicetree update.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 years agoimx: imx8mp: Add support for Polyhex Debix Model A SBC
Gilles Talis [Wed, 13 Dec 2023 12:29:40 +0000 (09:29 -0300)] 
imx: imx8mp: Add support for Polyhex Debix Model A SBC

Add support for the Polyhex Debix Model A SBC board.
It is an industrial grade single board computer based on
NXP's i.MX 8M Plus.
Currently supported interfaces are:
- Serial console
- Micro SD
- eQOS and FEC Ethernet

imx8mp-debix-model-a.dts is taken from Linux 6.3.

Signed-off-by: Gilles Talis <gilles.talis@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 years agoimx8qm_dmsse20a1: Improve SPL memory configuration
Fabio Estevam [Wed, 13 Dec 2023 12:16:12 +0000 (09:16 -0300)] 
imx8qm_dmsse20a1: Improve SPL memory configuration

Currently, building imx8qm_dmsse20a1_defconfig leads to the following
warning:

aarch64-linux-ld.bfd: invalid origin for memory region .sdram

Fix it by using the same SPL memory layout as done in the imx8mq_evk.

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-by: Oliver Graute <oliver.graute@kococonnector.com>
2 years agoddr: imx: Save the FW loading if it hasn't changed
Shawn Guo [Mon, 2 Jan 2023 12:20:34 +0000 (20:20 +0800)] 
ddr: imx: Save the FW loading if it hasn't changed

Function ddr_load_train_firmware() is called 4 times in a loop by
ddr_cfg_phy(). The first 3 calls are all '1D' type and just loading the
same FWs.  Let's add a type check and save 2 of them.  This helps to
reduce DDRPHY training time from 269 ms down to 212 ms, and thus speed
up boot time ~ 50 ms.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agodts: zynqmp: add missing destination mailbox compatible
Tanmay Shah [Mon, 4 Dec 2023 21:56:20 +0000 (13:56 -0800)] 
dts: zynqmp: add missing destination mailbox compatible

The commit in linux kernel 81186dc16101 ("dt-bindings: zynqmp: add
destination mailbox compatible") make compatible string for child nodes
mandatory that's why add it.

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Link: https://lore.kernel.org/r/20231204215620.63334-5-tanmay.shah@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agomailbox: zynqmp: support mulitple mboxes via device-tree
Tanmay Shah [Mon, 4 Dec 2023 21:56:19 +0000 (13:56 -0800)] 
mailbox: zynqmp: support mulitple mboxes via device-tree

As of now only one mailbox agent is supported by mailbox driver.
On zynqmp platform there are about 7 mailbox agents which can communicate
over same IPI channel to U-Boot. This patch series introduces new
"zynqmp_ipi_dest" driver which adds one to multi-channel mailbox
support.

Following format in device-tree is expected as per latest bindings:
zynqmp-ipi {
compatible = "xlnx,zynqmp-ipi-mailbox";

mbox_1: mailbox@1 {
/* New compatible for child node */
compatible = "xlnx,zynqmp-ipi-dest-mailbox";
...
};

...

mbox_n: mailbox@n {
compatible = "xlnx,zynqmp-ipi-dest-mailbox";
...
}
};

Then mailbox client uses child mailbox node as following:

ipi-dest-1 {
...
mboxes = <mbox_1 0>, <mbox_1 1>;
mbox-names = "tx", "rx";
...
};

New "zynqmp_ipi_dest" driver is for devices with
"xlnx,zynqmp-ipi-dest-mailbox" compatible string. This driver will take care
of mailbox send recv ops and it replaces previous "zynqmp_ipi" driver.
Now "zynqmp_ipi" driver simply binds each child device with "zynqmp_ipi_dest"
driver.

However, its important to maintain backward comaptibility with previous
bindings where child node does not have compatible string. In such case, new
driver isn't probed by U-Boot during boot and system fails to boot. To
resolve this issue firmware-zynqmp.c driver probes all the IPI parent node
driver which binds each child node device with "zynqmp_ipi_dest" driver.

This makes sure corresponding child driver will be
probed when requested using mbox_get_by_name or mbox_get_by_idx
framework calls.

This way multiple mailbox agents are supported in device-tree without breaking
previous binding support.

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Link: https://lore.kernel.org/r/20231204215620.63334-4-tanmay.shah@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agomailbox: add el3 support only for zynqmp platform
Tanmay Shah [Mon, 4 Dec 2023 21:56:18 +0000 (13:56 -0800)] 
mailbox: add el3 support only for zynqmp platform

If U-Boot is running in Exception Level 3 then use hardcode
register values for mailbox message passing with PMU.
This is only supported for zynqmp platform.

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Link: https://lore.kernel.org/r/20231204215620.63334-3-tanmay.shah@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agomailbox: zynqmp: support smc calls to TF-A
Tanmay Shah [Mon, 4 Dec 2023 21:56:17 +0000 (13:56 -0800)] 
mailbox: zynqmp: support smc calls to TF-A

Use SMC calls to TF-A to operate IPI for execution level below 3. For
EL3 use hardcode IPI registers as TF-A isn't available in EL3.
Hence, in EL3 remote and local IPI ids retrieved using xlnx,ipi-id
property are unused.

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Link: https://lore.kernel.org/r/20231204215620.63334-2-tanmay.shah@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agoARM: zynq: Remove deprecated device_type property
Michal Simek [Fri, 24 Nov 2023 13:16:49 +0000 (14:16 +0100)] 
ARM: zynq: Remove deprecated device_type property

Based on DT specification device_type property is deprecated and should be
used only for cpu and memory nodes. That's why remove other usage. In this
case ethernet-phy.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/70201ca4ad49ace6f7c27015af9df58a335d2a1f.1700831800.git.michal.simek@amd.com