]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
4 months agoi2c: Drop i2c_get_bus_num_fdt() and i2c_reset_port_fdt()
Simon Glass [Sun, 11 Aug 2024 14:50:45 +0000 (08:50 -0600)]
i2c: Drop i2c_get_bus_num_fdt() and i2c_reset_port_fdt()

These functions are 11 years old and are only used by one board. Drop
them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agoi2c: Drop CFG_SYS_MAX_I2C_BUS
Simon Glass [Sun, 11 Aug 2024 14:50:44 +0000 (08:50 -0600)]
i2c: Drop CFG_SYS_MAX_I2C_BUS

Only one board uses this option and it is very old. Let's drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agoi2c: Remove I2C_GET_BUS()
Simon Glass [Sun, 11 Aug 2024 14:50:43 +0000 (08:50 -0600)]
i2c: Remove I2C_GET_BUS()

This is very old, predating even the legacy I2C support, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agoi2c: Remove I2C_SET_BUS()
Simon Glass [Sun, 11 Aug 2024 14:50:42 +0000 (08:50 -0600)]
i2c: Remove I2C_SET_BUS()

This is very old, predating even the legacy I2C support, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agoocteon: Drop OCTEON_I2C_FDT dead code
Simon Glass [Sun, 11 Aug 2024 14:50:41 +0000 (08:50 -0600)]
octeon: Drop OCTEON_I2C_FDT dead code

This option is not defined by any board, so drop the code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agoi2c: Drop reference to SYS_I2C_INIT_BOARD
Simon Glass [Sun, 11 Aug 2024 14:50:40 +0000 (08:50 -0600)]
i2c: Drop reference to SYS_I2C_INIT_BOARD

This is not now used by any boards, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agofsl: mxc: Drop legacy I2c
Simon Glass [Sun, 11 Aug 2024 14:50:39 +0000 (08:50 -0600)]
fsl: mxc: Drop legacy I2c

Drop some old code from the mxc_i2c and ddr/fsl drivers. This will allow
removal of very old common I2C code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agodate: Drop the legacy I2C code
Simon Glass [Sun, 11 Aug 2024 14:50:38 +0000 (08:50 -0600)]
date: Drop the legacy I2C code

Drop two generations of old code in this command. All boards should use
driver model for I2C from 2021.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agortc: Drop CFG_SYS_RTC_BUS_NUM
Simon Glass [Sun, 11 Aug 2024 14:50:37 +0000 (08:50 -0600)]
rtc: Drop CFG_SYS_RTC_BUS_NUM

This option is very old and the migration deadline was years ago. Drop
it so that the I2C system can be simplified.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agoMPC837XERDB: ethernut5: work_92105: Drop CMD_DATE
Simon Glass [Sun, 11 Aug 2024 14:50:36 +0000 (08:50 -0600)]
MPC837XERDB: ethernut5: work_92105: Drop CMD_DATE

These use pre-driver model code and it is several years since the
migration deadline. Disable the 'date' command so that this old code can
be removed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agomx28 / mx51: Drop CMD_DATE
Simon Glass [Sun, 11 Aug 2024 14:50:35 +0000 (08:50 -0600)]
mx28 / mx51: Drop CMD_DATE

These use pre-driver model code and it is several years since the
migration deadline. Disable the 'date' command so that this old code can
be removed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agoarmv8: ls2085a: Drop CMD_DATE
Simon Glass [Sun, 11 Aug 2024 14:50:34 +0000 (08:50 -0600)]
armv8: ls2085a: Drop CMD_DATE

These boards use pre-driver model code and it is several years since the
migration deadline. Disable the 'date' command so that this old code can
be removed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agomips: malta: Drop CMD_DATE
Simon Glass [Sun, 11 Aug 2024 14:50:33 +0000 (08:50 -0600)]
mips: malta: Drop CMD_DATE

These boards use pre-driver model code and it is several years since the
migration deadline. Disable the 'date' command so that this old code can
be removed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agoi2c: Remove CFG_I2C_MULTI_BUS
Simon Glass [Sun, 11 Aug 2024 14:50:32 +0000 (08:50 -0600)]
i2c: Remove CFG_I2C_MULTI_BUS

This is used by a few boards but we are years past the migration date,
so let's drop it now.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agoi2c: Remove IC2_xxx enum
Simon Glass [Sun, 11 Aug 2024 14:50:31 +0000 (08:50 -0600)]
i2c: Remove IC2_xxx enum

This is only used by devkit3250 which is being removed. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agoi2c: Remove board_i2c_init()
Simon Glass [Sun, 11 Aug 2024 14:50:30 +0000 (08:50 -0600)]
i2c: Remove board_i2c_init()

This function is not used, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agoMerge patch series "Universal Payload initial series"
Tom Rini [Fri, 9 Aug 2024 22:03:21 +0000 (16:03 -0600)]
Merge patch series "Universal Payload initial series"

Simon Glass <sjg@chromium.org> says:

Universal Payload (UPL) is an Industry Standard for firmware
components[1]. UPL is designed to improve interoperability within the
firmware industry, allowing mixing and matching of projects with less
friction and fewer project-specific implementations. UPL is
cross-platform, supporting ARM, x86 and RISC-V initially.

This series provides some initial support for this, targeting 0.9.1 and
sandbox only.

Features still to come include:
- Support for architectures
- FIT validation
- Handoff validation
- Interoperability tests

4 months agoupl: Add an end-to-end test
Simon Glass [Wed, 7 Aug 2024 22:47:39 +0000 (16:47 -0600)]
upl: Add an end-to-end test

Now that sandbox_vpl supports UPL, add a test that checks that the
payload can be loaded by SPL and the handoff information passed through
to U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agosandbox: Add an SPL loader for UPL
Simon Glass [Wed, 7 Aug 2024 22:47:38 +0000 (16:47 -0600)]
sandbox: Add an SPL loader for UPL

Add support for loading a UPL image from SPL. This uses the simple FIT
implementation, but also loads the full FIT just to permit more testing.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agosandbox: Add a flag to enable UPL
Simon Glass [Wed, 7 Aug 2024 22:47:37 +0000 (16:47 -0600)]
sandbox: Add a flag to enable UPL

UPL significantly alters the boot flow for sandbox. Add a flag to enable
this so that it can be enabled only on tests which need it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoupl: Add initial documentation
Simon Glass [Wed, 7 Aug 2024 22:47:36 +0000 (16:47 -0600)]
upl: Add initial documentation

Add some documentation to explain the basic concept along with a link
to the full spec.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agosandbox_vpl: Enable Universal Payload
Simon Glass [Wed, 7 Aug 2024 22:47:35 +0000 (16:47 -0600)]
sandbox_vpl: Enable Universal Payload

Use the sandbox_vpl build to test UPL since it supports a real devicetree
in SPL. The sandbox_spl build uses OF_PLATDATA.

Enable writing the UPL handoff in SPL and reading it in U-Boot proper.
Provide a test to check that this handoff works.

Note that the test uses the standard devicetree rather than the test one,
since it is a lot smaller and fits in the existing bloblist.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoupl: Plumb in universal payload to the init process
Simon Glass [Wed, 7 Aug 2024 22:47:34 +0000 (16:47 -0600)]
upl: Plumb in universal payload to the init process

Read the UPL early in boot so that it is available. For now none of the
information is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agospl: Plumb in the Universal Payload handoff
Simon Glass [Wed, 7 Aug 2024 22:47:33 +0000 (16:47 -0600)]
spl: Plumb in the Universal Payload handoff

Specify the FIT and include information about each loaded image, as
required by the UPL handoff.

Write the UPL handoff into the bloblist before jumping to the next phase.

Control this using a runtime flag to avoid conflicting with other
handoff mechanisms.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agospl: Set SPL_FIT_FOUND for full FIT also
Simon Glass [Wed, 7 Aug 2024 22:47:32 +0000 (16:47 -0600)]
spl: Set SPL_FIT_FOUND for full FIT also

This flag is set for simple FIT, so set it for full FIT too.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoupl: Add support for Universal Payload in SPL
Simon Glass [Wed, 7 Aug 2024 22:47:31 +0000 (16:47 -0600)]
upl: Add support for Universal Payload in SPL

Add the basic code to create a handoff structure in SPL, so it can be
passed to the next phase. For now this is not plumbed in.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoupl: Add a command
Simon Glass [Wed, 7 Aug 2024 22:47:30 +0000 (16:47 -0600)]
upl: Add a command

Add a 'upl' command to work with Universal Payload features. For now it
only supports reading and writing a handoff structure.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoupl: Add basic tests
Simon Glass [Wed, 7 Aug 2024 22:47:29 +0000 (16:47 -0600)]
upl: Add basic tests

Add some unit tests to check that we can write a UPL handoff and read it
back.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoupl: Add support for writing a upl handoff
Simon Glass [Wed, 7 Aug 2024 22:47:28 +0000 (16:47 -0600)]
upl: Add support for writing a upl handoff

Universal Payload provides a standard way of handing off control between
two firmware phases. Add support for writing the handoff information from
a structure.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoupl: Add support for reading a upl handoff
Simon Glass [Wed, 7 Aug 2024 22:47:27 +0000 (16:47 -0600)]
upl: Add support for reading a upl handoff

Universal Payload provides a standard way of handing off control between
two firmware phases. Add support for reading the handoff information into
a structure.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agosandbox: Set up global_data earlier
Simon Glass [Wed, 7 Aug 2024 22:47:26 +0000 (16:47 -0600)]
sandbox: Set up global_data earlier

It is possible for U-Boot functions such as printf() to be called
within state_init(). This can end up checking gd->flags (e.g. in putc())
before global_data is set up.

Move the setup earlier to avoid this. This fixes the suppression of some
debug output in memory allocation (when enabled).

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agosandbox: Add ELF file to VPL u-boot.img
Simon Glass [Wed, 7 Aug 2024 22:47:25 +0000 (16:47 -0600)]
sandbox: Add ELF file to VPL u-boot.img

At present sandbox builds package up u-boot.bin in the .img file. This
cannot actually be executed, since it is not an ELF file.

For sandbox_vpl we want to be able to run the full boot flow.

Adjust the build rule for sandbox_vpl to package the ELF file and
thereby allow full testing of the sandbox transition from SPL to U-Boot
proper.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agosandbox: Return error code from read/write/seek
Simon Glass [Wed, 7 Aug 2024 22:47:24 +0000 (16:47 -0600)]
sandbox: Return error code from read/write/seek

The existing API for these functions is different from the rest of
U-Boot, in that any error code must be obtained from the errno variable
on failure. This variable is part of the C library, so accessing it
outside of the special 'sandbox' shim-functions is not ideal.

Adjust the API to return an error code, to avoid this. Update existing
uses to check for any negative value, rather than just -1.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agosandbox: fdt: Avoid overwriting an existing fdt
Simon Glass [Wed, 7 Aug 2024 22:47:23 +0000 (16:47 -0600)]
sandbox: fdt: Avoid overwriting an existing fdt

Since the removal of OF_HOSTFILE logic in board_fdt_blob_setup(), the
logic for obtaining the DT is handled in the OF_BOARD option. If a
devicetree comes from a bloblist it is immediately overwritten by this
function.

Fix this by skipping the function if a devicetree is already present.

This is sort-of a fix for e7fb7896 ("sandbox: Remove OF_HOSTFILE") but
it has only come to light since bloblist was added, so I have not added
a Fixes tag.

Unfortunately it is not possible to report the correct FDT source with
the current code. It might be best to use an error-return code for
board_fdt_blob_setup() so that an error can be reported if the board
does not provide the DT.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agofdt: Don't overwrite bloblist devicetree
Simon Glass [Wed, 7 Aug 2024 22:47:22 +0000 (16:47 -0600)]
fdt: Don't overwrite bloblist devicetree

When the devicetree comes from a bloblist, it is currently overwritten
by the appended one, if present. It should be preserved.

Adjust the logic to support this.

Fixes: 70fe2385943 ("fdt: Allow the devicetree to come from a bloblist")
Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Move some SPL-loading test-code into sandbox common
Simon Glass [Wed, 7 Aug 2024 22:47:21 +0000 (16:47 -0600)]
test: Move some SPL-loading test-code into sandbox common

This code is useful for loading an image in sandbox_spl so move it into
a place where it can be called as needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agosandbox: Fix a comment in os_find_u_boot()
Simon Glass [Wed, 7 Aug 2024 22:47:20 +0000 (16:47 -0600)]
sandbox: Fix a comment in os_find_u_boot()

Fix a missing dot in a comment, since '..' is confusing.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agosandbox: Use const in os_jump_to_file()
Simon Glass [Wed, 7 Aug 2024 22:47:19 +0000 (16:47 -0600)]
sandbox: Use const in os_jump_to_file()

The argument array is not changed by the callee, so mark it const.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agoMerge tag 'i2cupdates-for-v2024-10-next' of https://source.denx.de/u-boot/custodians...
Tom Rini [Fri, 9 Aug 2024 14:22:50 +0000 (08:22 -0600)]
Merge tag 'i2cupdates-for-v2024-10-next' of https://source.denx.de/u-boot/custodians/u-boot-i2c into next

i2c updates for v2024.10 next

- DM_I2C conversion for some remaining boards
  from Anatolij

4 months agoboard: vining_2000: convert to DM_I2C
Anatolij Gustschin [Wed, 7 Aug 2024 22:34:38 +0000 (00:34 +0200)]
board: vining_2000: convert to DM_I2C

Conversion to DM_I2C is mandatory, enable DM_I2C
to disable board removal warning.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
4 months agoboard: cm_fx6: convert to DM_I2C
Anatolij Gustschin [Wed, 7 Aug 2024 13:09:33 +0000 (15:09 +0200)]
board: cm_fx6: convert to DM_I2C

Conversion to DM_I2C is mandatory, enable DM_I2C to fix board
removal warning. Convert EEPROM access to use DM_I2C API.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
4 months agoboard: vf610twr: convert to DM_I2C
Anatolij Gustschin [Sat, 3 Aug 2024 16:15:13 +0000 (18:15 +0200)]
board: vf610twr: convert to DM_I2C

Conversion to DM_I2C is mandatory, enable DM_I2C
to disable board removal warning.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
4 months agoboard: novena: convert to DM_I2C
Anatolij Gustschin [Sat, 3 Aug 2024 16:15:09 +0000 (18:15 +0200)]
board: novena: convert to DM_I2C

Conversion to DM_I2C is mandatory, enable DM_I2C
to disable board removal warning. Convert EEPROM
and IT6251 access to use DM_I2C API.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
4 months agoboard: rut: convert to DM_I2C
Anatolij Gustschin [Sat, 3 Aug 2024 16:15:08 +0000 (18:15 +0200)]
board: rut: convert to DM_I2C

Conversion to DM_I2C is mandatory, enable DM_I2C
to disable board removal warning.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
4 months agoboard: sl50: convert to DM_I2C
Anatolij Gustschin [Sat, 3 Aug 2024 16:15:07 +0000 (18:15 +0200)]
board: sl50: convert to DM_I2C

Conversion to DM_I2C is mandatory, enable DM_I2C
to disable board removal warning.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
4 months agoboard: igep003x: convert to DM_I2C
Anatolij Gustschin [Sat, 3 Aug 2024 16:15:06 +0000 (18:15 +0200)]
board: igep003x: convert to DM_I2C

Conversion to DM_I2C is mandatory, enable DM_I2C
to disable board removal warning.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
4 months agoboard: cm-t43: convert to DM_I2C
Anatolij Gustschin [Sat, 3 Aug 2024 16:15:05 +0000 (18:15 +0200)]
board: cm-t43: convert to DM_I2C

Conversion to DM_I2C is mandatory, enable DM_I2C
to disable board removal warning.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
4 months agoboard: chiliboard: convert to DM_I2C
Anatolij Gustschin [Sat, 3 Aug 2024 16:15:04 +0000 (18:15 +0200)]
board: chiliboard: convert to DM_I2C

Conversion to DM_I2C is mandatory, enable DM_I2C
to disable board removal warning.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
4 months agoboard: shc: convert to DM_I2C
Anatolij Gustschin [Sat, 3 Aug 2024 16:15:03 +0000 (18:15 +0200)]
board: shc: convert to DM_I2C

Conversion to DM_I2C is mandatory, rework to remove
use of legacy I2C API.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
4 months agoMerge patch series "alist: Implement a pointer list / array of structs"
Tom Rini [Wed, 7 Aug 2024 14:49:18 +0000 (08:49 -0600)]
Merge patch series "alist: Implement a pointer list / array of structs"

Simon Glass <sjg@chromium.org> says:

This data structure provides a list of pointers / array of structures.
I was planning to use it for the lmb restructure, to allow it to
support any number of entries, but then I gave up on it.

There are quite a few places in U-Boot where such a list would be
useful, since it supports growing the array.

[...]
Example:

 struct my_struct obj;
 struct my_struct *ptr = alist_add(&lst, &obj, struct my_struct);

 // now ptr is in the list

[trini: Reword the cover letter slightly, do not merge the RFC portion]

4 months agoalist: Add support for an allocated pointer list
Simon Glass [Tue, 30 Jul 2024 14:39:37 +0000 (08:39 -0600)]
alist: Add support for an allocated pointer list

In various places it is useful to have an array of structures, but allow
it to grow. In some cases we work around it by setting maximum number of
entries, using a Kconfig option. In other places we use a linked list,
which does not provide for random access and can complicate the code.

Introduce a new data structure, which is a variable-sized list of structs
each of the same, pre-set size. It provides O(1) access and is reasonably
efficient at expanding linearly, since it doubles in size when it runs out
of space.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agolib: Handle a special case with str_to_list()
Simon Glass [Tue, 30 Jul 2024 14:39:36 +0000 (08:39 -0600)]
lib: Handle a special case with str_to_list()

The current implementation can return an extra result at the end when
the string ends with a space. Fix this by adding a special case.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agomalloc: Support testing with realloc()
Simon Glass [Tue, 30 Jul 2024 14:39:35 +0000 (08:39 -0600)]
malloc: Support testing with realloc()

At present in tests it is possible to cause an out-of-memory condition
with malloc() but not realloc(). Add support to realloc() too, so code
which uses that function can be tested.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoomap3: sniper: Convert to device-tree control and DM I2C
Paul Kocialkowski [Mon, 29 Jul 2024 20:44:39 +0000 (22:44 +0200)]
omap3: sniper: Convert to device-tree control and DM I2C

This converts the sniper board (LG P970) to device-tree control
and DM I2C, both for SPL and U-Boot.

Note that we lose the call to board_mmc_power_init to enable power
for MMC2. This is now expected to take place through proper
regulators, which are not yet available with the twl4030 driver.
The call to twl4030_power_mmc_init is moved to spl_board_init for now.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
4 months agoam33xx: Use regular spl_board_init instead of am33xx_spl_board_init
Paul Kocialkowski [Mon, 29 Jul 2024 20:44:38 +0000 (22:44 +0200)]
am33xx: Use regular spl_board_init instead of am33xx_spl_board_init

The am33xx_spl_board_init function was introduced as a way to add
board-specific SPL init for AM33xx devices since the spl_board_init
function was already used for SoC-specific init.

Now that the SoC-specific SPL init was moved to spl_soc_init, we can
use spl_board_init for this purpose and get rid of
am33xx_spl_board_init.

Rename the function in board files and enable the related config
option for concerned boards.

Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 months agoomap: Use spl_soc_init instead of spl_board_init
Paul Kocialkowski [Mon, 29 Jul 2024 20:44:37 +0000 (22:44 +0200)]
omap: Use spl_soc_init instead of spl_board_init

Both spl_board_init and spl_soc_init are available as ways to run
specific code in the SPL's board_init_r. Use the former for init
code that is specific to the SoC and leave spl_board_init available
for boards to use.

Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 months agoMerge patch series "omap configuration cleanups"
Tom Rini [Wed, 7 Aug 2024 00:33:08 +0000 (18:33 -0600)]
Merge patch series "omap configuration cleanups"

Paul Kocialkowski <paulk@sys-base.io> says:

Here is a bunch of configuration cleanups for OMAP boards, mostly
unifying and moving common configuration from board-specific defconfigs
to Kconfig definitions.

There's also a cleanup of the sniper (LG Optimus Black) defconfig,
prior to migrating it to DM/DT in a future follow-up series.

4 months agoomap3: sniper: Streamline defconfig
Paul Kocialkowski [Sun, 28 Jul 2024 20:25:01 +0000 (22:25 +0200)]
omap3: sniper: Streamline defconfig

Remove custom config options that are not particularly necessary.
Align them with OMAP3 defaults used on other boards (especially for
memory locations).

Also enable Thumb build to reduce the SPL size and remove the custom
prompt text.

This makes the config a lot more minimalistic, maintainable and easier
to read.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
4 months agodra7xx: Remove explicit DRAM banks number from defconfigs
Paul Kocialkowski [Sun, 28 Jul 2024 20:25:00 +0000 (22:25 +0200)]
dra7xx: Remove explicit DRAM banks number from defconfigs

The common EMIF init code used for DRA7xx does not explicitly fill
the gd->bd->bi_dram entries (like OMAP3 does), so there is no reason
to set an explicit number of DRAM banks which doesn't correspond to
anything in particular.

Remove the CONFIG_NR_DRAM_BANKS option from the concerned defconfigs.
The dram_init_banksize default implementation will be fine with the
default value for the config option.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
4 months agoomap3: Define DRAM banks number in Kconfig instead of defconfigs
Paul Kocialkowski [Sun, 28 Jul 2024 20:24:59 +0000 (22:24 +0200)]
omap3: Define DRAM banks number in Kconfig instead of defconfigs

The number of DRAM banks was defined to the same value in each OMAP3
board defconfig, which is expected and hardcoded in the code. Move the
common definition to the Kconfig option declaration instead.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
4 months agoomap3: Define maximum SPL size in Kconfig instead of defconfigs
Paul Kocialkowski [Sun, 28 Jul 2024 20:24:58 +0000 (22:24 +0200)]
omap3: Define maximum SPL size in Kconfig instead of defconfigs

The maximum SPL size was defined to the same value in each OMAP3
board defconfig. Move the common definition to the Kconfig option
declaration instead.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
4 months agoomap3: Define maximum U-Boot size in Kconfig instead of defconfigs
Paul Kocialkowski [Sun, 28 Jul 2024 20:24:57 +0000 (22:24 +0200)]
omap3: Define maximum U-Boot size in Kconfig instead of defconfigs

The maximum U-Boot size was defined to the same value in each OMAP3
board defconfig. Move the common definition to the Kconfig option
declaration instead.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
4 months agodra7xx: Define common init stack pointer address in Kconfig
Paul Kocialkowski [Sun, 28 Jul 2024 20:24:56 +0000 (22:24 +0200)]
dra7xx: Define common init stack pointer address in Kconfig

The init stack pointer was defined to the same value in each DRA7xx
board defconfig. Move the common definition to the Kconfig option
declaration instead.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
4 months agodra7xx: Unify init stack pointer address across boards
Paul Kocialkowski [Sun, 28 Jul 2024 20:24:55 +0000 (22:24 +0200)]
dra7xx: Unify init stack pointer address across boards

The DRA7xx EVM board use a slightly different init stack pointer
address compared to the AM57xx EVM board, for no particular reason.

Align the address with the AM57xx EVM board (which matches the usual
offset to the end of SRAM used by other OMAP devices) prior to removing
it as a per-board option in a later commit.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
4 months agoam43xx: Define common init stack pointer address in Kconfig
Paul Kocialkowski [Sun, 28 Jul 2024 20:24:54 +0000 (22:24 +0200)]
am43xx: Define common init stack pointer address in Kconfig

The init stack pointer was defined to the same value in each AM43xx
board defconfig. Move the common definition to the Kconfig option
declaration instead.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
4 months agoam33xx: Define common init stack pointer address in Kconfig
Paul Kocialkowski [Sun, 28 Jul 2024 20:24:53 +0000 (22:24 +0200)]
am33xx: Define common init stack pointer address in Kconfig

The init stack pointer was defined to the same value in each AM33xx
board defconfig. Move the common definition to the Kconfig option
declaration instead.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
4 months agoam33xx: Unify init stack pointer address across boards
Paul Kocialkowski [Sun, 28 Jul 2024 20:24:52 +0000 (22:24 +0200)]
am33xx: Unify init stack pointer address across boards

The AM33xx chiliboard and guardian boards use a slightly different
init stack pointer address compared to other AM33xx boards, for no
particular reason.

Align the address with other AM33xx boards prior to removing it as a
per-board option in a later commit.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
4 months agoomap3: Define common init stack pointer address in Kconfig
Paul Kocialkowski [Sun, 28 Jul 2024 20:24:51 +0000 (22:24 +0200)]
omap3: Define common init stack pointer address in Kconfig

The init stack pointer was defined to the same value in each OMAP3
board defconfig. Move the common definition to the Kconfig option
declaration instead.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
4 months agoomap3: Define common SPL text base in Kconfig instead of defconfigs
Paul Kocialkowski [Sun, 28 Jul 2024 20:24:50 +0000 (22:24 +0200)]
omap3: Define common SPL text base in Kconfig instead of defconfigs

The SPL text base was defined to the same value in each OMAP3 board
defconfig. Move the common definition to the Kconfig option
declaration instead.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Tested-by: Adam Ford <aford173@gmail.com> #am3517-evm
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
4 months agoPrepare v2024.10-rc2
Tom Rini [Tue, 6 Aug 2024 00:13:42 +0000 (18:13 -0600)]
Prepare v2024.10-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 5 Aug 2024 18:21:23 +0000 (12:21 -0600)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agoMerge patch series "Bug-fixes for a few boards"
Tom Rini [Mon, 5 Aug 2024 18:15:44 +0000 (12:15 -0600)]
Merge patch series "Bug-fixes for a few boards"

Simon Glass <sjg@chromium.org> says:

This series includes fixes to get some rockchip and nvidia boards
working again. It also drops the broken Beaglebone Black config and
provides a devicetree fix for coral (x86).

4 months agorockchip: Avoid #ifdefs in RK3399 SPL
Simon Glass [Thu, 1 Aug 2024 12:47:23 +0000 (06:47 -0600)]
rockchip: Avoid #ifdefs in RK3399 SPL

The code here is confusing due to large blocks which are #ifdefed out.
Add a function phase_sdram_init() which returns whether SDRAM init
should happen in the current phase, using that as needed to control the
code flow.

This increases code size by about 500 bytes in SPL when the cache is on,
since it must call the rather large rockchip_sdram_size() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agorockchip: Ensure memory size is available in RK3399 SPL
Simon Glass [Thu, 1 Aug 2024 12:47:22 +0000 (06:47 -0600)]
rockchip: Ensure memory size is available in RK3399 SPL

At present gd->ram_size is 0 in SPL, meaning that it is not possible to
enable the cache. Correct this by always populating the RAM size
correctly.

This increases code size by about 500 bytes in SPL, since it must call
the rather large rockchip_sdram_size() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
4 months agofdt: Correct condition for bloblist existing
Simon Glass [Wed, 31 Jul 2024 14:49:05 +0000 (08:49 -0600)]
fdt: Correct condition for bloblist existing

On some boards, the bloblist is created in SPL once SDRAM is ready. It
cannot be accessed until that point, so is not available early in SPL.

Add a condition to avoid a hang in this case.

This fixes a hang in chromebook_coral

Fixes: 70fe2385943 ("fdt: Allow the devicetree to come from a bloblist")
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Raymond Mao <raymond.mao@linaro.org>
4 months agobinman: Keep the efi_capsule input file
Simon Glass [Wed, 31 Jul 2024 14:49:04 +0000 (08:49 -0600)]
binman: Keep the efi_capsule input file

There is no need to remove input files. It makes it harder to diagnose
failures. Keep the payload file.

There is no test for this condition, but one could be added.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
4 months agobinman: Return failure when a usage() message is generated
Simon Glass [Wed, 31 Jul 2024 14:49:03 +0000 (08:49 -0600)]
binman: Return failure when a usage() message is generated

The tool must return an error code when invalid arguments are provided,
otherwise binman has no way of knowing that anything went wrong.

Correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: fab430be2f4 ("tools: add mkeficapsule command for UEFI...")
4 months agobinman: Deal with mkeficapsule being missing
Simon Glass [Wed, 31 Jul 2024 14:49:02 +0000 (08:49 -0600)]
binman: Deal with mkeficapsule being missing

Tools cannot be assumed to be present. Add a check for this with the
mkeficpasule tool.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: b617611b27a ("binman: capsule: Add support for generating...")
4 months agobinman: Collect the version number for mkeficapsule
Simon Glass [Wed, 31 Jul 2024 14:49:01 +0000 (08:49 -0600)]
binman: Collect the version number for mkeficapsule

Now that this tool has a version number, collect it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agomkeficapsule: Add a --version argument
Simon Glass [Wed, 31 Jul 2024 14:49:00 +0000 (08:49 -0600)]
mkeficapsule: Add a --version argument

Tools should have an option to obtain the version, so add this to the
mkeficapsule tool.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 months agoMerge tag 'u-boot-imx-master-20240802' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Fri, 2 Aug 2024 20:40:59 +0000 (14:40 -0600)]
Merge tag 'u-boot-imx-master-20240802' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/21846

- Convert warp7 to OF_UPSTREAM.
- Add 'cpu' command to imx8m and imx93.
- Enable CMD_ERASEENV for imx8mm/mp Phytec boards.

4 months agoconfig: Adjust Phytec imx8mm module config to support NVME disk
Lukasz Majewski [Fri, 2 Aug 2024 18:12:00 +0000 (15:12 -0300)]
config: Adjust Phytec imx8mm module config to support NVME disk

This change adds support for PCIe connected nvme disk - phyBOARD-Polis
base board.

One needs to call following commands in u-boot:
> pci enum
> nvme scan
> nvme info

And then ones to access proper file system (like fat[ls|load|write],
ext4[ls|load|write]).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
4 months agoconfigs: imx93: enable the 'cpu' command
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:59 +0000 (11:59 +0800)]
configs: imx93: enable the 'cpu' command

Enable the 'cpu' command to display the CPU info and release CPU core to
run baremetal or RTOS applications.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
4 months agoconfigs: imx8m: enable the 'cpu' command
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:58 +0000 (11:59 +0800)]
configs: imx8m: enable the 'cpu' command

Enable the 'cpu' command and the depended imx CPU driver to
display the CPU info and release CPU core to run baremetal
or RTOS applications.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
4 months agoMAINTAINERS: add entry for cpu command
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:57 +0000 (11:59 +0800)]
MAINTAINERS: add entry for cpu command

Added the original author Simon and myself.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agodoc: cmd: add documentation for cpu command
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:56 +0000 (11:59 +0800)]
doc: cmd: add documentation for cpu command

Add documentation for the 'cpu' command, taking NXP i.MX 8M Plus
as a example.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agocmd: cpu: add release subcommand
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:55 +0000 (11:59 +0800)]
cmd: cpu: add release subcommand

Add a new subcommand 'release' to bring up a core to run baremetal
and RTOS applications.

For example on i.MX8M Plus EVK, release the LAST core to run a RTOS
application, passing the sequence number of the CPU core to release,
here it is 3:
    u-boot=> cpu list
      0: cpu@0      NXP i.MX8MP Rev1.1 A53 at 1200 MHz at 31C
      1: cpu@1      NXP i.MX8MP Rev1.1 A53 at 1200 MHz at 30C
      2: cpu@2      NXP i.MX8MP Rev1.1 A53 at 1200 MHz at 31C
      3: cpu@3      NXP i.MX8MP Rev1.1 A53 at 1200 MHz at 31C

    u-boot=> load mmc 1:2 c0000000 /hello_world.bin
    66008 bytes read in 5 ms (12.6 MiB/s)
    u-boot=> dcache flush; icache flush
    u-boot=> cpu release 3 c0000000
    Released CPU core (mpidr: 0x3) to address 0xc0000000

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agocpu: imx: implement release_core callback
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:54 +0000 (11:59 +0800)]
cpu: imx: implement release_core callback

Release the secondary cores through the PSCI request.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
4 months agocpu: imx: Add i.MX 8M series SoCs
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:53 +0000 (11:59 +0800)]
cpu: imx: Add i.MX 8M series SoCs

Add i.MX 8M Mini, Nano and Plus SoCs support.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
4 months agocpu: imx: removed the tail '\n' of the CPU description
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:52 +0000 (11:59 +0800)]
cpu: imx: removed the tail '\n' of the CPU description

Return CPU description string without newline character in the end.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
4 months agocpu: imx: fix the CPU type field width
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:51 +0000 (11:59 +0800)]
cpu: imx: fix the CPU type field width

Increase one more bit to cover all CPU types. Otherwise it shows
wrong CPU info on some platforms, such as i.MX8M Plus:

    U-Boot 2024.04+g674440bc73e+p0 (Jun 06 2024 - 10:05:34 +0000)

    CPU:   NXP i.MX8MM Rev1.1 A53 at 4154504685 MHz at 30C

    Model: NXP i.MX8MPlus LPDDR4 EVK board

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
4 months agocpu: imx: fix the CPU frequency in cpu_imx_get_info()
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:50 +0000 (11:59 +0800)]
cpu: imx: fix the CPU frequency in cpu_imx_get_info()

The cpu_freq stores the current CPU frequency in Hz.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
4 months agotest: cpu: add test for release CPU core.
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:49 +0000 (11:59 +0800)]
test: cpu: add test for release CPU core.

Add test for API cpu_release_core().

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agocpu: sandbox: implement release_core callback
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:48 +0000 (11:59 +0800)]
cpu: sandbox: implement release_core callback

Add empty release CPU core function for testing.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agocpu: add release_core callback
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:47 +0000 (11:59 +0800)]
cpu: add release_core callback

Add a new callback release_core to the cpu_ops, which is used to
release a CPU core to run baremetal or RTOS application on a SoC
with multiple CPU cores.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agoclk: imx8m: register ARM A53 core clock
Hou Zhiqiang [Thu, 1 Aug 2024 03:59:46 +0000 (11:59 +0800)]
clk: imx8m: register ARM A53 core clock

Register ARM A53 core clock for i.MX 8M Mini, Nano and Plus, preparing
for enabling the 'cpu' command, which depends on this to print CPU core
frequency.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
4 months agoconfigs: phycore-imx8mp_defconfig: enable CMD_ERASEENV
Yannic Moog [Wed, 31 Jul 2024 12:53:03 +0000 (09:53 -0300)]
configs: phycore-imx8mp_defconfig: enable CMD_ERASEENV

Enable erasing environment with eraseenv command.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
4 months agoconfigs: phycore-imx8mm_defconfig: enable CMD_ERASEENV
Yannic Moog [Wed, 31 Jul 2024 07:23:00 +0000 (09:23 +0200)]
configs: phycore-imx8mm_defconfig: enable CMD_ERASEENV

Enable erasing environment with eraseenv command.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
4 months agoconfigs: imx8mm-phygate-tauri-l_defconfig: enable CMD_ERASEENV
Yannic Moog [Wed, 31 Jul 2024 07:22:59 +0000 (09:22 +0200)]
configs: imx8mm-phygate-tauri-l_defconfig: enable CMD_ERASEENV

Enable erasing environment with eraseenv command.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
4 months agowarp7: Convert to OF_UPSTREAM
Fabio Estevam [Mon, 22 Jul 2024 17:59:35 +0000 (14:59 -0300)]
warp7: Convert to OF_UPSTREAM

Instead of using the local imx7s-warp devicetree copies from U-Boot,
convert the imx7s-warp board to OF_UPSTREAM so that the upstream
kernel devicetree can be used instead.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>