]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
16 months agonet: ti: am65-cpsw-nuss: Add logic to support MDIO reset
Suman Anna [Wed, 2 Aug 2023 08:17:26 +0000 (13:47 +0530)]
net: ti: am65-cpsw-nuss: Add logic to support MDIO reset

Enhance the AM65 CPSW NUSS driver to perform a MDIO reset using a GPIO
line. Logic is also added to perform a pre and post delay around reset
using the optional 'reset-delay-us' and 'reset-post-delay-us' properties.
This is similar to the reset being performed in the Linux kernel. The
reset is done once when the CPSW MDIO bus is being initialized.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
16 months agonet: ti: am65-cpsw-nuss: Add support for SGMII mode
Siddharth Vadapalli [Wed, 2 Aug 2023 08:17:25 +0000 (13:47 +0530)]
net: ti: am65-cpsw-nuss: Add support for SGMII mode

Add support for configuring the CPSW Ethernet Switch in SGMII mode.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
16 months agodma: ti: Update J21E PSIL endpoint information for MAIN CPSW0
Suman Anna [Wed, 2 Aug 2023 08:17:24 +0000 (13:47 +0530)]
dma: ti: Update J21E PSIL endpoint information for MAIN CPSW0

The PSIL endpoint data for J721E currently covers only the MCU domain
CPSW0 instance. Add the data for the MAIN domain CPSW0 as well to allow
the MAIN domain Ethernet ports to be usable on any platform using J721E
SoC.

Additionally, since J721E's PSIL endpoint data is applicable to J7200
SoC as well, the MAIN CPSW0 instance on J7200 will also be usable now.

Signed-off-by: Suman Anna <s-anna@ti.com>
[s-vadapalli@ti.com: Update commit message indicating support for J7200]
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
16 months agoMerge branch '2023-08-14-assorted-general-updates' into next
Tom Rini [Tue, 15 Aug 2023 14:39:41 +0000 (10:39 -0400)]
Merge branch '2023-08-14-assorted-general-updates' into next

- Assorted PCI-related fixes, add Apple Type-C PHY support, semihosting
  updates, fix a FAT corner-case, update the help on the pxe cmd and
  clean up the gpio uclass slightly.

16 months agoMerge tag 'dm-next-14aug23' of https://source.denx.de/u-boot/custodians/u-boot-dm...
Tom Rini [Tue, 15 Aug 2023 01:39:08 +0000 (21:39 -0400)]
Merge tag 'dm-next-14aug23' of https://source.denx.de/u-boot/custodians/u-boot-dm into next

Enhance bootmeth_cros

16 months agogpio: Use separate bitfield array to indicate GPIO is claimed
Marek Vasut [Tue, 1 Aug 2023 23:26:02 +0000 (01:26 +0200)]
gpio: Use separate bitfield array to indicate GPIO is claimed

The current gpio-uclass design uses name field in struct gpio_dev_priv as
an indicator that GPIO is claimed by consumer. This overloads the function
of name field and does not work well for named pins not configured as GPIO
pins.

Introduce separate bitfield array as the claim indicator.

This unbreaks dual-purpose AF and GPIO operation on STM32MP since commit
2c38f7c31806 ("pinctrl: pinctrl_stm32: Populate uc_priv->name[] with pinmux node's name")
where any pin which has already been configured as AF could no longer be
claimed as dual-purpose GPIO. This is important for pins like STM32 MMCI
st,cmd-gpios .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agotest: unit test for semihosting
Heinrich Schuchardt [Mon, 31 Jul 2023 20:01:21 +0000 (22:01 +0200)]
test: unit test for semihosting

Provide a unit test for semihosting testing reading and writing a file.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
16 months agoconfigs: enable SEMIHOSTING on qemu_arm64_defconfig
Heinrich Schuchardt [Mon, 31 Jul 2023 20:01:20 +0000 (22:01 +0200)]
configs: enable SEMIHOSTING on qemu_arm64_defconfig

We need a platform on which we can test our semihosting code.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
16 months agocmd: pxe: Update the command help
Bin Meng [Mon, 31 Jul 2023 08:33:23 +0000 (16:33 +0800)]
cmd: pxe: Update the command help

Currently the "help" displays pxe command help text like this:

  => help
  ...
  printenv  - print environment variables
  pxe       - commands to get and boot from pxe files
  To use IPv6 add -ipv6 parameter
  qfw       - QEMU firmware interface
  ...

This does not read clearly. Remove the IPv6 stuff as it is in
the detailed help text so that it fits just a single line.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agopci: ftpci100: add new driver implementation
Sergei Antonov [Sun, 30 Jul 2023 18:17:09 +0000 (21:17 +0300)]
pci: ftpci100: add new driver implementation

Add a new DM driver supporting FTPCI100 IP used in SoC designs.
This implementation is not based on the old non-DM ftpci100 code
dropped from U-Boot.

Enable the driver in sandbox_defconfig to test compilability.

Signed-off-by: Sergei Antonov <saproj@gmail.com>
16 months agofs: fat: avoid multiplication overflow
Heinrich Schuchardt [Sun, 30 Jul 2023 14:44:04 +0000 (16:44 +0200)]
fs: fat: avoid multiplication overflow

The product of two 32 bit integers is a 32 bit integer. Hence
clustcount * bytesperclust may overflow on > 4 GiB devices.

Change the type of clustcount.

Fixes: cb8af8af5ba0 ("fs: fat: support write with non-zero offset")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
16 months agospl: add FIT support to semihosting boot method
Heinrich Schuchardt [Sat, 22 Jul 2023 19:27:48 +0000 (21:27 +0200)]
spl: add FIT support to semihosting boot method

Allow loading a FIT image via semihosting in SPL.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
16 months agopci: Fix device_find_first_child() return value handling
Marek Vasut [Sun, 16 Jul 2023 15:53:24 +0000 (17:53 +0200)]
pci: Fix device_find_first_child() return value handling

This function only ever returns 0, but may not assign the second
parameter. Same thing for device_find_next_child(). Do not assign
ret to stop proliferation of this misuse.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agophy: Add support for the Apple Type-C PHY
Mark Kettenis [Fri, 14 Jul 2023 20:21:42 +0000 (22:21 +0200)]
phy: Add support for the Apple Type-C PHY

This is merely a dummy driver that makes sure the DWC3 XHCI driver
finds its reset and PHY controllers.  We rely on iBoot to set up
the PHY for us.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
16 months agopci: apple: Enable CONFIG_SYS_PCI_64BIT
Mark Kettenis [Fri, 14 Jul 2023 19:15:16 +0000 (21:15 +0200)]
pci: apple: Enable CONFIG_SYS_PCI_64BIT

The Apple hardware supports 64-bit prefetchable memory windows so
enable CONFIG_SYS_PCI_64BIT. This fixes BAR assignments for the
Broadcom Ethernet controller used in some of the desktop machines.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
16 months agoMerge branch '2023-08-14-keep-fixed-gpio-regulator-count-in-balance' into next
Tom Rini [Mon, 14 Aug 2023 13:14:51 +0000 (09:14 -0400)]
Merge branch '2023-08-14-keep-fixed-gpio-regulator-count-in-balance' into next

To quote the author:

The commit 4fcba5d556b4 ("regulator: implement basic reference counter")
have made it more important to keep fixed/gpio regulators enable/disable
state in balance.

This series fixes an inbalance in the mmc_dw driver and changes to use
the more relaxed regulator_set_enable_if_allowed function for a few
other drivers.

The regulator_set_enable_if_allowed function is more relaxed and will
return ENOSYS if the provided regulator is NULL or when DM_REGULATOR
was disabled. Using the following call convention should be safe:

  ret = regulator_set_enable_if_allowed(<supply>, <true|false>);
  if (ret && ret != -ENOSYS)
          return ret;

16 months agommc: dw_mmc: Keep vqmmc-supply enable count in balance
Jonas Karlman [Wed, 19 Jul 2023 21:21:00 +0000 (21:21 +0000)]
mmc: dw_mmc: Keep vqmmc-supply enable count in balance

With the commit 4fcba5d556b4 ("regulator: implement basic reference
counter"), keeping regulator enablement in balance become more important.

Disable vqmmc-supply before signal voltage is changed to keep regulator
enable counter in balance.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
16 months agommc: Use regulator_set_enable_if_allowed
Jonas Karlman [Wed, 19 Jul 2023 21:20:59 +0000 (21:20 +0000)]
mmc: Use regulator_set_enable_if_allowed

With the commit 4fcba5d556b4 ("regulator: implement basic reference
counter") the return value of regulator_set_enable may be EALREADY or
EBUSY for fixed/gpio regulators.

Change to use the more relaxed regulator_set_enable_if_allowed to
continue if regulator already was enabled or disabled.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # P895 Tegra 3;
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> # rockpro64-rk3399
16 months agousb: ehci-generic: Use regulator_set_enable_if_allowed
Jonas Karlman [Wed, 19 Jul 2023 21:20:57 +0000 (21:20 +0000)]
usb: ehci-generic: Use regulator_set_enable_if_allowed

With the commit 4fcba5d556b4 ("regulator: implement basic reference
counter") the return value of regulator_set_enable may be EALREADY or
EBUSY for fixed/gpio regulators.

Change to use the more relaxed regulator_set_enable_if_allowed to
continue if regulator already was enabled or disabled.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Marek Vasut <marex@denx.de>
16 months agousb: dwc2: Use regulator_set_enable_if_allowed
Jonas Karlman [Wed, 19 Jul 2023 21:20:56 +0000 (21:20 +0000)]
usb: dwc2: Use regulator_set_enable_if_allowed

With the commit 4fcba5d556b4 ("regulator: implement basic reference
counter") the return value of regulator_set_enable may be EALREADY or
EBUSY for fixed/gpio regulators.

Change to use the more relaxed regulator_set_enable_if_allowed to
continue if regulator already was enabled or disabled.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> # rockpro64-rk3399
Reviewed-by: Marek Vasut <marex@denx.de>
16 months agoadc: Use regulator_set_enable_if_allowed
Jonas Karlman [Wed, 19 Jul 2023 21:20:55 +0000 (21:20 +0000)]
adc: Use regulator_set_enable_if_allowed

With the commit 4fcba5d556b4 ("regulator: implement basic reference
counter") the return value of regulator_set_enable may be EALREADY or
EBUSY for fixed/gpio regulators.

Change to use the more relaxed regulator_set_enable_if_allowed to
continue if regulator already was enabled or disabled.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> # rockpro64-rk3399
16 months agobootstd: cros: Add ARM support
Simon Glass [Sun, 30 Jul 2023 17:17:02 +0000 (11:17 -0600)]
bootstd: cros: Add ARM support

Support booting ChromiumOS on ARM devices using FIT. Add an entry into the
boot implementation which does not require a command line. This can be
expanded over time as the bootm code is refactored.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: Add a command to read all files for a bootflow
Simon Glass [Fri, 11 Aug 2023 01:33:18 +0000 (19:33 -0600)]
bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: Allow display of the x86 setup information
Simon Glass [Sun, 30 Jul 2023 17:17:00 +0000 (11:17 -0600)]
bootstd: Allow display of the x86 setup information

Provide an option to dump this information if available.

Move the funciion prototype to the common x86 header. Allow the command
line to be left out since 'bootflow info' show this itself and it is
not in the correct place in memory until the kernel is actually booted.

Fix a badly aligned heading while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Split up reading info and kernel
Simon Glass [Sun, 30 Jul 2023 17:16:59 +0000 (11:16 -0600)]
bootstd: cros: Split up reading info and kernel

Use the two new functions to separate reading of the ChromiumOS info from
the partition from actually reading the kernel and booting it.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Add a function to read a kernel
Simon Glass [Sun, 30 Jul 2023 17:16:58 +0000 (11:16 -0600)]
bootstd: cros: Add a function to read a kernel

The code to read the ChromiumOS information from the partition is
currently all in one function.

Create a new function which reads the kernel, assuming that the metadata
has been parsed.

For now this function is not used. Future work will plumb it in.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Add a function to read info from partition
Simon Glass [Sun, 30 Jul 2023 17:16:57 +0000 (11:16 -0600)]
bootstd: cros: Add a function to read info from partition

The code to read the ChromiumOS information from the partition is
currently all in one function. It reads the entire kernel, which is
unnecessary unless it is to be booted.

Create a new function which reads just the minimum required data from the
disk, then obtains what it needs from there.

For now this function is not used. Future work will plumb it in.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: Add private bootmeth data to the bootflow
Simon Glass [Sun, 30 Jul 2023 17:16:56 +0000 (11:16 -0600)]
bootstd: Add private bootmeth data to the bootflow

Some bootmeths need to store their own information related to the
bootflow, in addition to the generic information in struct bootflow.
Add a pointer for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Add private info for ChromiumOS
Simon Glass [Sun, 30 Jul 2023 17:16:55 +0000 (11:16 -0600)]
bootstd: cros: Add private info for ChromiumOS

Create a new private structure to hold information gleaned from the disk.
This will allow separation between reading of the bootflow information and
(later) reading the whole kernel.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Add docs for the kernel layout
Simon Glass [Sun, 30 Jul 2023 17:16:54 +0000 (11:16 -0600)]
bootstd: cros: Add docs for the kernel layout

Provide brief documentation about the ChromiumOS kernel layout.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: Move common zimage functions to bootm.h
Simon Glass [Sun, 30 Jul 2023 17:16:53 +0000 (11:16 -0600)]
bootstd: Move common zimage functions to bootm.h

We want to avoid using #ifdefs around header files and in the code. It
makes sense to collect the various functions used for loading images into
a single header which can be included by all architectures. The best place
for this is the arch-neutral bootm.h header, so use that.

Move some zimage functions into this bootm.h header.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Simplify setup and cmdline expressions
Simon Glass [Sun, 30 Jul 2023 17:16:52 +0000 (11:16 -0600)]
bootstd: cros: Simplify setup and cmdline expressions

Create a common base from which the other parts are offset and make all
of the offsets related to that. This makes the code a little easier to
read.

Use X86_ prefixes for the two values which are x86-specific.

Drop OFFSET_BASE since it is available in a header field.

Drop the unnecessary 'start' variable too.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Decode some kernel preamble fields
Simon Glass [Sun, 30 Jul 2023 17:16:51 +0000 (11:16 -0600)]
bootstd: cros: Decode some kernel preamble fields

Decode the kernel start and size using the structures provided. This
accesses the same data, just in a cleaner way.

Add some logging for some of the fields in the kernel preamble.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Support a kernel on either partition
Simon Glass [Sun, 30 Jul 2023 17:16:50 +0000 (11:16 -0600)]
bootstd: cros: Support a kernel on either partition

ChromiumOS allows a kernel to be on either partition 2 or 4. Add support
for scanning both and using the first one we find with a suitable
signature.

Record the partition which is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Bring in some ChromiumOS structures
Simon Glass [Sun, 30 Jul 2023 17:16:49 +0000 (11:16 -0600)]
bootstd: cros: Bring in some ChromiumOS structures

Add a header file with structures for booting ChromiumOS, taken from the
vboot tree. Using these makes it easier to understand the code.

Note that the code style has not been updated for U-Boot, with use of
uint64_t,  __attribute__((packed)) and one comment-style nit. This should
make it easier to keep the code in sync. It was taken from commit:

   5b8596ce ("2sha256_arm: Fix data abort issue")

Update the CHROMEOS string to use the defined values.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Move partition reading into a function
Simon Glass [Sun, 30 Jul 2023 17:16:48 +0000 (11:16 -0600)]
bootstd: cros: Move partition reading into a function

Move the code which reads a partition into its own function. Add a
constant for the number of bytes to 'probe' at the start of the partition.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: cros: Correct reporting of I/O errors
Simon Glass [Sun, 30 Jul 2023 17:16:47 +0000 (11:16 -0600)]
bootstd: cros: Correct reporting of I/O errors

Return -EIO when the read failed, rather than the number of blocks read.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoMerge branch '2023-08-09-misc-cleanups' into next
Tom Rini [Wed, 9 Aug 2023 17:15:51 +0000 (13:15 -0400)]
Merge branch '2023-08-09-misc-cleanups' into next

- Rework the arch linker scripts to be consistent for all, support
  Kconfig fragments in the board directory and fix some Kconfig options
  that were hex-type by default of 0 not 0x0.

16 months agoscripts: kconfig: Add config fragment support in board/../
Jason Kacines [Tue, 11 Jul 2023 21:20:46 +0000 (16:20 -0500)]
scripts: kconfig: Add config fragment support in board/../

Add support to config fragments (.config) located in the /board
directory. This will allow only base defconfigs to live in /configs and
all fragments to live in their respective device directory in /board/..

Signed-off-by: Jason Kacines <j-kacines@ti.com>
16 months agotreewide: unify the linker symbol reference format
Shiji Yang [Thu, 3 Aug 2023 01:47:17 +0000 (09:47 +0800)]
treewide: unify the linker symbol reference format

Now all linker symbols are declared as type char[]. Though we can
reference the address via both the array name 'var' and its address
'&var'. It's better to unify them to avoid confusing developers.
This patch converts all '&var' linker symbol refrences to the most
commonly used format 'var'.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agotreewide: rework linker symbol declarations in sections header
Shiji Yang [Thu, 3 Aug 2023 01:47:16 +0000 (09:47 +0800)]
treewide: rework linker symbol declarations in sections header

1. Convert all linker symbols to char[] type so that we can get the
   corresponding address by calling array name 'var' or its address
   '&var'. In this way, we can avoid some potential issues[1].
2. Remove unused symbol '_TEXT_BASE'. It has been abandoned and has
   not been referenced by any source code.
3. Move '__data_end' to the arch x86's own sections header as it's
   only used by x86 arch.
4. Remove some duplicate declared linker symbols. Now we use the
   standard header file to declare them.

[1] This patch fixes the boot failure on MIPS target. Error log:
SPL: Image overlaps SPL

Fixes: 1b8a1be1a1f1 ("spl: spl_legacy: Fix spl_end address")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agoKconfigs: Correct default of "0" on hex type entries
Tom Rini [Wed, 2 Aug 2023 15:09:43 +0000 (11:09 -0400)]
Kconfigs: Correct default of "0" on hex type entries

It is not a parse error to have a default value of "0" for a "hex" type
entry, instead of "0x0".  However, "0" and "0x0" are not treated the
same even by the tools themselves. Correct this by changing the default
value from "0" to "0x0" for all hex type questions that had the
incorrect default. Fix one instance (in two configs) of a default of "0"
being used on a hex question to be "0x0". Remove the cases where a
defconfig had set a value of "0x0" to be used as the default had been
"0".

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoMerge branch '2023-08-08-assorted-code-corrections' into next
Tom Rini [Wed, 9 Aug 2023 01:38:05 +0000 (21:38 -0400)]
Merge branch '2023-08-08-assorted-code-corrections' into next

- A number of code corrections caught by Smatch and a few others as
  well.

16 months agopci: correct function name in message
Heinrich Schuchardt [Thu, 27 Jul 2023 16:50:14 +0000 (18:50 +0200)]
pci: correct function name in message

If an error message contains a function name, it should match the name of
the function throwing the message.

Fixes: 7739d93d8288 ("pci: Match region flags using a mask")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoboard_f: Cosmetic style fix
Bin Meng [Fri, 21 Jul 2023 16:15:21 +0000 (00:15 +0800)]
board_f: Cosmetic style fix

Some coding convention fixes for print_resetinfo().

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agocrc32: Drop duplicates crc header includes
Ilya Lukin [Fri, 14 Jul 2023 14:39:32 +0000 (17:39 +0300)]
crc32: Drop duplicates crc header includes

Fixes: 3db711085752 ("crc32: Use the crc.h header for crc functions")
Signed-off-by: Ilya Lukin <4.shket@gmail.com>
16 months agobtrfs: fix some error checking for btrfs_decompress()
Dan Carpenter [Thu, 3 Aug 2023 10:29:34 +0000 (13:29 +0300)]
btrfs: fix some error checking for btrfs_decompress()

The btrfs_decompress() function mostly (u32)-1 on error but it can
also return -EPERM or other kernel error codes from zstd_decompress().
The "ret" variable is an int, so we could just check for negatives.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Qu Wenruo <wqu@suse.com>
16 months agotest: fix a couple NULL vs IS_ERR() checks
Dan Carpenter [Mon, 31 Jul 2023 14:08:41 +0000 (17:08 +0300)]
test: fix a couple NULL vs IS_ERR() checks

The x509_cert_parse() and pkcs7_parse_message() functions return error
pointers.  They don't return NULL.  Update the checks accordingly.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoexpo: allocate correct amount of memory
Dan Carpenter [Mon, 31 Jul 2023 14:08:29 +0000 (17:08 +0300)]
expo: allocate correct amount of memory

This should be allocating the memory for "item" instead of "menu".
The item struct is 48 bytes instead of 96 (assuming a 64bit system)
so this saves a little memory.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agocmd: improve string matching for hex
Dan Carpenter [Mon, 31 Jul 2023 14:03:59 +0000 (17:03 +0300)]
cmd: improve string matching for hex

Match the "=0x" instead of just "=0".

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Heinrich.Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
16 months agocramfs: clean up some error messages
Dan Carpenter [Thu, 27 Jul 2023 07:16:03 +0000 (10:16 +0300)]
cramfs: clean up some error messages

This line break is not done correctly.  We don't want to have all those
tabs in the printed output.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agotest: unicode: fix a sizeof() vs ARRAY_SIZE() bug
Dan Carpenter [Thu, 27 Jul 2023 07:12:58 +0000 (10:12 +0300)]
test: unicode: fix a sizeof() vs ARRAY_SIZE() bug

The u16_strlcat() is in units of u16 not bytes.  So the limit needs to
be ARRAY_SIZE() instead of sizeof().

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
16 months agocmd: pxe_utils: add some missing tabs
Dan Carpenter [Thu, 27 Jul 2023 07:12:39 +0000 (10:12 +0300)]
cmd: pxe_utils: add some missing tabs

These lines are supposed to be indented one more tab.  Otherwise it's
confusing to read.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
16 months agoremoteproc: uclass: Clean up a return
Dan Carpenter [Wed, 26 Jul 2023 07:00:33 +0000 (10:00 +0300)]
remoteproc: uclass: Clean up a return

We know that "pa" is non-NULL so it's nicer to just return zero instead
of return !pa.  This has no effect on runtime behavior.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agofdt: off by one in ofnode_lookup_fdt()
Dan Carpenter [Wed, 26 Jul 2023 06:59:52 +0000 (09:59 +0300)]
fdt: off by one in ofnode_lookup_fdt()

The "oftree_count" is the number of entries which have been set in
the oftree_list[] array.  If all the entries have been initialized then
this off by one would result in reading one element beyond the end
of the array.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agofs: btrfs: Prevent error pointer dereference in list_subvolums()
Dan Carpenter [Wed, 26 Jul 2023 06:59:04 +0000 (09:59 +0300)]
fs: btrfs: Prevent error pointer dereference in list_subvolums()

If btrfs_read_fs_root() fails with -ENOENT, then we go to the next
entry.  Fine.  But if it fails for a different reason then we need
to clean up and return an error code.  In the current code it
doesn't clean up but instead dereferences "root" and crashes.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Qu Wenruo <wqu@suse.com>
16 months agocros_ec: Fix an error code is cros_ec_get_sku_id()
Dan Carpenter [Wed, 26 Jul 2023 06:58:34 +0000 (09:58 +0300)]
cros_ec: Fix an error code is cros_ec_get_sku_id()

The ec_command_inptr() function returns negative error codes or
the number of bytes that it was able to read.  The cros_ec_get_sku_id()
function should return negative error codes.  Right now it returns
positive error codes or negative byte counts.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agovideo: Add parentheses around VNBYTES() macro
Dan Carpenter [Wed, 26 Jul 2023 06:54:08 +0000 (09:54 +0300)]
video: Add parentheses around VNBYTES() macro

The VNBYTES() macro needs to have parentheses to prevent some (harmless)
macro expansion bugs.  The VNBYTES() macro is used like this:

VID_TO_PIXEL(x) * VNBYTES(vid_priv->bpix)

The * operation is done before the / operation.  It still ends up with
the same results, but it's not ideal.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agocmd: Fix a size parameter in test_readonly()
Dan Carpenter [Tue, 25 Jul 2023 06:50:26 +0000 (09:50 +0300)]
cmd: Fix a size parameter in test_readonly()

The parentheses are in the wrong place so this passes the number of
bytes to write as "sizeof(index_0) != TPM_SUCCESS" when just
"sizeof(index_0)" was intended.  (1 byte vs 4 bytes).

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
16 months agocmd: Fix an error code in cmd_mux_find()
Dan Carpenter [Tue, 25 Jul 2023 06:50:08 +0000 (09:50 +0300)]
cmd: Fix an error code in cmd_mux_find()

This returns the wrong variable.  It ends up returning NULL when it was
suppose to return an error pointer.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
16 months agolib/charset: fix u16_strlcat() return value
Matthias Schiffer [Fri, 14 Jul 2023 11:24:51 +0000 (13:24 +0200)]
lib/charset: fix u16_strlcat() return value

strlcat returns min(strlen(dest), count)+strlen(src). Make u16_strlcat's
behaviour the same for consistency.

Fixes: eca08ce94ceb ("lib/charset: add u16_strlcat() function")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
16 months agoRevert "lib: string: Fix strlcpy return value", fix callers
Matthias Schiffer [Fri, 14 Jul 2023 11:24:50 +0000 (13:24 +0200)]
Revert "lib: string: Fix strlcpy return value", fix callers

Both the Linux kernel and libbsd agree that strlcpy() should always
return strlen(src) and not include the NUL termination. The incorrect
U-Boot implementation makes it impossible to check the return value for
truncation, and breaks code written with the usual implementation in
mind (for example, fdtdec_add_reserved_memory() was subtly broken).

I reviewed all callers of strlcpy() and strlcat() and fixed them
according to my understanding of the intended function.

This reverts commit d3358ecc54be0bc3b4dd11f7a63eab0a2842f772 and adds
related fixes.

Fixes: d3358ecc54be ("lib: string: Fix strlcpy return value")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
16 months agoPrepare v2023.10-rc2
Tom Rini [Mon, 7 Aug 2023 19:26:50 +0000 (15:26 -0400)]
Prepare v2023.10-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 7 Aug 2023 19:17:12 +0000 (15:17 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoMerge branch '2023-08-07-assorted-fixes'
Tom Rini [Mon, 7 Aug 2023 19:11:17 +0000 (15:11 -0400)]
Merge branch '2023-08-07-assorted-fixes'

- Update Azure jobs again, a few MAINTAINERS updates, a few Kconfig
  fixes, an erofs fix and a fix for the recent ten64 updates.

16 months agofs/erofs: Remove an unnecessary assertion
Yifan Zhao [Wed, 26 Jul 2023 04:56:04 +0000 (12:56 +0800)]
fs/erofs: Remove an unnecessary assertion

In [1] Sam points out an assertion does not hold true for 32-bit
platforms, which only impacts Large File Support (LFS) API usage
in erofs-utils according to Xiang [2]. We don't think these APIs
are used in u-boot and this restriction could be safely removed.

[1] https://lists.denx.de/pipermail/u-boot/2023-July/524679.html
[2] https://lists.denx.de/pipermail/u-boot/2023-July/524727.html

Fixes: 3a21e92fc255 ("fs/erofs: Introduce new features including ztailpacking, fragments and dedupe")
Signed-off-by: Yifan Zhao <zhaoyifan@sjtu.edu.cn>
Tested-by: Sam Edwards <CFSworks@gmail.com>
16 months agocommon: Drop duplicate space in SPL_BMP description
Marek Vasut [Sat, 29 Jul 2023 13:34:51 +0000 (15:34 +0200)]
common: Drop duplicate space in SPL_BMP description

Drop duplicate space in Kconfig symbol description.

Signed-off-by: Marek Vasut <marex@denx.de>
16 months agocommon: fix detection of SYS_MALLOC_F_LEN=0x0
Heinrich Schuchardt [Tue, 1 Aug 2023 13:33:41 +0000 (15:33 +0200)]
common: fix detection of SYS_MALLOC_F_LEN=0x0

CONFIG_$(SPL_TPL_)SYS_MALLOC_F_LEN is defined as hex. If set to zero
manually, .config contains '0x0' and not '0' as value.

The default value for CONFIG_SPL_SYS_MALLOC_F_LEN should not be set to 0
but to 0x0 if CONFIG_SPL_FRAMEWORK=n to match a manually set value.

Fixes: c0126bd862a0 ("spl: Support bootstage, log, hash and early malloc in TPL")
Fixes: b61694705217 ("SPL: Do not enable SPL_SYS_MALLOC_SIMPLE without SPL_FRAMEWORK by default")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agospl: move SPL_CRC32 option to lib/Kconfig
Oleksandr Suvorov [Thu, 3 Aug 2023 16:05:40 +0000 (19:05 +0300)]
spl: move SPL_CRC32 option to lib/Kconfig

All SPL hash algorithm options are collected in lib/Kconfig. Move
SPL_CRC32 there as well.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agospl: remove duplicate SPL_MD5 option
Oleksandr Suvorov [Thu, 3 Aug 2023 16:05:39 +0000 (19:05 +0300)]
spl: remove duplicate SPL_MD5 option

There is another SPL_MD5 option defined in lib/Kconfig.
Renaming SPL_MD5_SUPPORT introduced duplicate option with
different description. As for now FIT and hash algorithm options
are not related to each others, removing a duplicate option seems OK.

Fixes: 4b00fd1a84c ("Kconfig: Rename SPL_MD5_SUPPORT to SPL_MD5")
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
16 months agobloblist: Enforce CRC32
Tom Rini [Mon, 7 Aug 2023 16:32:19 +0000 (12:32 -0400)]
bloblist: Enforce CRC32

In the common bloblist code we call crc32 to get a checksum for the
data.  Ensure we will have the CRC32 code via select.

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoMAINTAINERS: Update rockchip platform maintain files
Kever Yang [Mon, 7 Aug 2023 07:52:47 +0000 (15:52 +0800)]
MAINTAINERS: Update rockchip platform maintain files

Add px30, rv1126 soc, and rockchip soc based boards.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
16 months agoMAINTAINERS: add DT/bindings files to at91 entry
Eugen Hristev [Mon, 7 Aug 2023 07:22:03 +0000 (10:22 +0300)]
MAINTAINERS: add DT/bindings files to at91 entry

With this change the DT and binding files are under the at91 tree
maintainer, and get_maintainer.pl correctly reports the entry.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
16 months agoboard: ten64: add missing error checks for retimer power on
Mathew McBride [Mon, 7 Aug 2023 01:41:08 +0000 (01:41 +0000)]
board: ten64: add missing error checks for retimer power on

The retimer reset/power on logic was changed in a recent commit,
however, it neglected to check if the commands sent to the
board microcontroller (to control power to the retimer chip)
actually completed.

Add return checks for these operations so any failures will
be reported to the user.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Fixes: 7a041fea2 ("board: traverse: ten64: ensure retimer reset
is done on new board revisions")

16 months agoARM: renesas: Update MAINTAINERS file
Marek Vasut [Sun, 6 Aug 2023 18:57:34 +0000 (20:57 +0200)]
ARM: renesas: Update MAINTAINERS file

Update MAINTAINERS file. Add missing MAINTAINERS file for Spider,
Whitehawk and V3HSK boards. Update mail addresses. Add file globs
to match on DT and driver files related to these boards.

The GRPEACH and R2DPLUS are special in that they are not R-Car
and have their own set of specialized drivers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agoget_maintainer.pl: Add an ignore list for git history
Tom Rini [Mon, 7 Aug 2023 13:20:53 +0000 (09:20 -0400)]
get_maintainer.pl: Add an ignore list for git history

As Pali Rohár has asked to not be copied on changes to files he is not
a specific maintainer of, add his address to .get_maintainer.ignore.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
16 months agoAzure: Squash a number of jobs and re-order slightly
Tom Rini [Fri, 4 Aug 2023 21:07:44 +0000 (17:07 -0400)]
Azure: Squash a number of jobs and re-order slightly

To reduce overall job time, move a number of smaller jobs together.
These should still be safely under 1 hour total time, but reducing the
overall number of jobs should help with the queue slightly.

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoAzure: Rework Rockchip jobs again
Tom Rini [Fri, 4 Aug 2023 20:46:15 +0000 (16:46 -0400)]
Azure: Rework Rockchip jobs again

The job for rockchip vendor platforms has again gotten close to or
exceeded one hour.  Rework things such that we move the 32bit platforms
back to the general 32bit ARM job (as there's time there) and make these
build only the 64bit platforms.

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoMerge tag 'dm-pull-5aug23' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Sun, 6 Aug 2023 02:11:04 +0000 (22:11 -0400)]
Merge tag 'dm-pull-5aug23' of https://source.denx.de/u-boot/custodians/u-boot-dm

binman support for Xilinx signing
buildman minor fixes

16 months agobuildman: Drop warning about orphaned defconfigs
Simon Glass [Thu, 3 Aug 2023 18:51:37 +0000 (12:51 -0600)]
buildman: Drop warning about orphaned defconfigs

Some boards use a MAINTAINERS entry to specify common files without
referencing any defconfigs. This is allowed and should not result in a
warning.

Drop the warning in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobuildman: Exit after reading toolchain
Simon Glass [Thu, 3 Aug 2023 18:51:36 +0000 (12:51 -0600)]
buildman: Exit after reading toolchain

Recent refactoring changed buildman to continue operation after fetching
a toolchain. Fix this.

Fixes: b8680646521 ("bulidman: Move toolchain handling to a function")
Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoevent: Fix a wrong type_name from dm_post_init to dm_post_init_f
Jaehoon Chung [Tue, 1 Aug 2023 10:17:00 +0000 (19:17 +0900)]
event: Fix a wrong type_name from dm_post_init to dm_post_init_f

DM_POST_INIT was changed to DM_POST_INIT_F.
To debug correct message, change type_name from dm_post_init to
dm_post_init_f.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
s/an/a/ :
Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobinman: ftest: Add test for xilinx-bootgen etype
Lukas Funke [Thu, 3 Aug 2023 15:22:14 +0000 (17:22 +0200)]
binman: ftest: Add test for xilinx-bootgen etype

Add test for the 'xilinx-bootgen' etype

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Allow missing bootgen tool; comment testXilinxBootgenMissing() comment:
Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobinman: etype: Add xilinx-bootgen etype
Lukas Funke [Thu, 3 Aug 2023 15:22:15 +0000 (17:22 +0200)]
binman: etype: Add xilinx-bootgen etype

This adds a new etype 'xilinx-bootgen'. By using this etype it is
possible to created an signed SPL (FSBL in Xilinx terms) for
ZynqMP boards.

The etype uses Xilinx Bootgen tools in order to transform the SPL into
a bootable image and sign the image with a given primary and secondary
public key. For more information to signing the FSBL please refer to the
Xilinx Bootgen documentation.

Here is an example of the etype in use:

    spl {
        filename = "boot.signed.bin";

        xilinx-bootgen {
            pmufw-filename = "pmu-firmware.elf";
            psk-key-name-hint = "psk0";
            ssk-key-name-hint = "ssk0";
            auth-params = "ppk_select=0", "spk_id=0x00000000";

            u-boot-spl-nodtb {
            };
            u-boot-spl-dtb {
            };
        };
    };

For this to work the hash of the primary public key has to be fused
into the ZynqMP device and authentication (RSA_EN) has to be set.

For testing purposes: if ppk hash check should be skipped one can add
the property 'fsbl_config = "bh_auth_enable";' to the etype. However,
this should only be used for testing(!).

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agobinman: btool: Add Xilinx Bootgen btool
Lukas Funke [Thu, 3 Aug 2023 15:22:13 +0000 (17:22 +0200)]
binman: btool: Add Xilinx Bootgen btool

Add the Xilinx Bootgen as bintool. Xilinx Bootgen is used to create
bootable SPL (FSBL in Xilinx terms) images for Zynq/ZynqMP devices. The
btool creates a signed version of the SPL. Additionally to signing the
key source for the decryption engine can be passend to the boot image.

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
16 months agobinman: Renumber 291 and 292 test files
Simon Glass [Thu, 3 Aug 2023 23:23:58 +0000 (17:23 -0600)]
binman: Renumber 291 and 292 test files

These have ended up with the same numbers as earlier files. Fix them.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Sat, 5 Aug 2023 16:24:33 +0000 (12:24 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

- Fix some issues with usb gadget ethernet.  A small set of updates for
  docs, etc, is still pending

16 months agocmd: Enable BIND by default if we have USB_ETHER
Tom Rini [Fri, 4 Aug 2023 16:06:21 +0000 (12:06 -0400)]
cmd: Enable BIND by default if we have USB_ETHER

The nature of the network stack means that if we are going to use the
gadget mode USB network driver there's no easy path to implicitly
bind/unbind the driver. Enable the "bind" command by default here so
that we can bind/unbind this as needed.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
16 months agousb: gadget: ether: Handle gadget driver registration in probe and remove
Marek Vasut [Fri, 4 Aug 2023 15:41:11 +0000 (17:41 +0200)]
usb: gadget: ether: Handle gadget driver registration in probe and remove

Move the ethernet gadget driver registration and removal from ethernet
bind and unbind callbacks into driver DM probe and remove callbacks.
This way, when the driver is bound, which is triggered deliberately
using 'bind' command, the USB ethernet gadget driver is instantiated
and bound to the matching UDC. In reverse, when the driver is unbound,
which is again triggered deliberately using 'unbind' command, the USB
ethernet gadget driver instance is removed.

Effectively, this now behaves like running either 'ums' or 'dfu' or
any other commands utilizing USB gadget functionality.

This also drops use of usb_gadget_release() and moves the use of
usb_gadget_initialize() into usb_ether_init() used only by legacy
platforms that do not use 'bind' command properly yet. Those have
no place in drivers.

Signed-off-by: Marek Vasut <marex@denx.de>
Tested-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agousb: gadget: ether: Move probe function above driver structure
Marek Vasut [Fri, 4 Aug 2023 15:41:10 +0000 (17:41 +0200)]
usb: gadget: ether: Move probe function above driver structure

Move the driver probe function above the driver structure, so it
can be placed alongside other related functions, like upcoming
remove function. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Tested-by: Tom Rini <trini@konsulko.com>
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agousb: gadget: ether: Inline functions used once
Marek Vasut [Fri, 4 Aug 2023 15:41:09 +0000 (17:41 +0200)]
usb: gadget: ether: Inline functions used once

These functions here are only ever called once since drop of non-DM
networking code. Inline them. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Tested-by: Tom Rini <trini@konsulko.com>
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agoMerge branch '2023-08-04-toradex-platform-updates'
Tom Rini [Fri, 4 Aug 2023 20:04:11 +0000 (16:04 -0400)]
Merge branch '2023-08-04-toradex-platform-updates'

Two Toradex platform series.  First, to quote Andrejs:

This series adds Yavia Carrier board name string to the known
Toradex carrier board list, and reworks carrier board and display
adapter name handling.

And then to quote Marcel:
This series adds initial support for the Toradex Verdin AM62 SoM.
The first commit adds resp. PID4s to the ConfigBlock, the second one
fixes an early clocking issue confirmed to be a weird bug in TI's
scripting, the third one fixes some binman labeling issue. And last but
not least support for the Toradex Verdin AM62 is added.

16 months agoboard: toradex: add verdin am62 support
Marcel Ziswiler [Fri, 4 Aug 2023 10:08:08 +0000 (12:08 +0200)]
board: toradex: add verdin am62 support

This adds initial support for the Toradex Verdin AM62 Quad 1GB WB IT
V1.0A module and subsequent V1.1 launch configuration SKUs. They are
strapped to boot from their on-module eMMC. U-Boot supports booting
from the on-module eMMC only, DFU support is disabled for now due to
missing AM62x USB support.

The device trees were taken straight from Linux v6.5-rc1.

Boot sequence is:
SYSFW ---> R5 SPL (both in tiboot3.bin) ---> ATF (TF-A) ---> OP-TEE
  ---> A53 SPL (part of tispl.bin) ---> U-boot proper (u-boot.img)

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
16 months agoarm: dts: k3-binman: fix rcfg_yaml and pcfg_yaml labels
Marcel Ziswiler [Fri, 4 Aug 2023 10:08:07 +0000 (12:08 +0200)]
arm: dts: k3-binman: fix rcfg_yaml and pcfg_yaml labels

Fix rcfg_yaml to really point to rm-cfg.yaml and pcfg_yaml to really
point to pm-cfg.yaml which likely is the intention.

While at it also add labels for the remaining items like custmpk_pem,
dkey_pem, bcfg_yaml_sysfw, scfg_yaml_sysfw, pcfg_yaml_sysfw and
rcfg_yaml_sysfw.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
16 months agoarm: mach-k3: am62: fix 2nd mux option of clkout0
Marcel Ziswiler [Fri, 4 Aug 2023 10:08:06 +0000 (12:08 +0200)]
arm: mach-k3: am62: fix 2nd mux option of clkout0

Fix second mux option of clkout0 which should really be
DEV_BOARD0_CLKOUT0_IN_PARENT_HSDIV4_16FFT_MAIN_2_HSDIVOUT1_CLK10
rather than twice the same according to [1].

[1] https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/am62x/clocks.html#clocks-for-board0-device

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
16 months agotoradex: tdx-cfg-block: add verdin am62 skus
Marcel Ziswiler [Fri, 4 Aug 2023 10:08:05 +0000 (12:08 +0200)]
toradex: tdx-cfg-block: add verdin am62 skus

Add initial Verdin AM62 Quad 1GB WB IT prototype and launch
configuration SKUs to ConfigBlock handling.

0069: Verdin AM62 Quad 1GB WB IT
0071: Verdin AM62 Solo 512MB
0072: Verdin AM62 Solo 512MB WB IT
0073: Verdin AM62 Dual 1GB ET
0074: Verdin AM62 Dual 1GB IT
0075: Verdin AM62 Dual 1GB WB IT
0076: Verdin AM62 Quad 2GB WB IT

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
16 months agotoradex: tdx-cfg-block: rework display adapter name handling
Max Krummenacher [Tue, 18 Jul 2023 09:07:34 +0000 (11:07 +0200)]
toradex: tdx-cfg-block: rework display adapter name handling

Rework the rather big array of zero length strings with 4 entries of
actual display adapter names to a array of structs which ties a pid4
to its correspondent human readable string.
Provide an accessor to get the string for a given PID4.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
16 months agotoradex: tdx-cfg-block: rework carrier board name handling
Max Krummenacher [Tue, 18 Jul 2023 09:07:33 +0000 (11:07 +0200)]
toradex: tdx-cfg-block: rework carrier board name handling

Rework the rather big array of zero length strings with 4 entries of
actual carrier board names to a array of structs which ties a pid4
to its correspondent human readable string.
Provide an accessor to get the string for a given PID4.
Rework the user of the information to use the accessor.

Note that check_pid8_sanity() is used for early samples of Dahlia and
the development board. Yavia isn't affected.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
16 months agotoradex: tdx-cfg-block: add yavia carrier cfg block info
Max Krummenacher [Tue, 18 Jul 2023 09:07:32 +0000 (11:07 +0200)]
toradex: tdx-cfg-block: add yavia carrier cfg block info

Add the Yavia Carrier board name string to the known carrier
board list.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
16 months agoMerge branch '2023-08-03-assorted-fixes'
Tom Rini [Thu, 3 Aug 2023 21:45:38 +0000 (17:45 -0400)]
Merge branch '2023-08-03-assorted-fixes'

- More MAINTAINERS file updates, bootstd fixes, a fat fix and debug
  message fix