]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
3 months agoMerge patch series "bootstd: Try again to resolve infinite-loop bug"
Tom Rini [Tue, 27 Aug 2024 16:09:11 +0000 (10:09 -0600)]
Merge patch series "bootstd: Try again to resolve infinite-loop bug"

Simon Glass <sjg@chromium.org> says:

This little series tries to resolve a problem found with an earlier
fix.

3 months agoMerge patch series "arch: arm: dts: ti: Add missing fss range"
Tom Rini [Tue, 27 Aug 2024 16:04:34 +0000 (10:04 -0600)]
Merge patch series "arch: arm: dts: ti: Add missing fss range"

Jonathan Humphreys <j-humphreys@ti.com> says:

Upstream DTS added explicit ranges to the fss node. It did not include
the 32 bit memory space needed by the R5 to access OSPI. With the
upstream DTS sync, OSPI boot no longer works.

Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, these patches can be removed.

Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream")
3 months agobootstd: Make bootdev_next_prio() continue after failure
Simon Glass [Thu, 15 Aug 2024 20:30:22 +0000 (14:30 -0600)]
bootstd: Make bootdev_next_prio() continue after failure

When a device fails to probe, the next device should be tried, until
either we find a suitable device or run out of devices. A device
should never be tried twice.

When we run out of devices of a particular priority, the hunter should
be used to generate devices of the next priority. Only if all attempts
fail should this function return an error.

Update the function to use the latent 'found' boolean to determine
whether another loop iteration is warranted, rather than setting 'dev'
to NULL, which creates confusion, suggesting that no devices have been
scanned and the whole process is starting from the beginning.

Note that the upcoming bootflow_efi() test is used to test this
behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/17
3 months agoRevert "bootdev: avoid infinite probe loop"
Simon Glass [Thu, 15 Aug 2024 20:30:21 +0000 (14:30 -0600)]
Revert "bootdev: avoid infinite probe loop"

This turns out to be insufficient to fix the problem, since when
bootdev_next_prio() exits, the caller has no idea that this really
is the end. Nor is it, since there may be other devices which should
be checked.

The caller iterates which calls iter_incr() which calls
bootdev_next_prio() again, which finds the same device and the loop
continues.

We never did create a test for this[1], which makes it hard to be
sure which problem was fixed.

The original code had the virtue of staying in the loop looking for a
bootdev, so let's go back to that and try to fix this another way.

A future patch will make bootdev_next_prio() continue after failure
which should provide same effect.

This reverts commit 9d92c418acfb7576e12e2bd53fed294bb9543724.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agoarch: arm: dts: k3-j721e-r5-sk: Add missing fss range
Jonathan Humphreys [Fri, 9 Aug 2024 23:01:57 +0000 (18:01 -0500)]
arch: arm: dts: k3-j721e-r5-sk: Add missing fss range

Upstream DTS added explicit ranges to the fss node.  It did not include the
32 bit memory space needed by the R5 to access OSPI.  With the upstream DTS
sync, OSPI boot no longer works.

Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed.  See
0c0e03ec22 (arm64: dts: ti: k3-j721e: Use exact ranges for FSS node)

Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream")
Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
3 months agoarch: arm: dts: k3-j721e-r5-evm: Add missing fss range
Jonathan Humphreys [Fri, 9 Aug 2024 23:01:56 +0000 (18:01 -0500)]
arch: arm: dts: k3-j721e-r5-evm: Add missing fss range

Upstream DTS added explicit ranges to the fss node.  It did not include the
32 bit memory space needed by the R5 to access OSPI.  With the upstream DTS
sync, OSPI boot no longer works.

Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed.  See
0c0e03ec22 (arm64: dts: ti: k3-j721e: Use exact ranges for FSS node)

Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream")
Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
3 months agoarch: arm: dts: k3-j7200-r5-evm: Add missing fss range
Jonathan Humphreys [Fri, 9 Aug 2024 23:01:55 +0000 (18:01 -0500)]
arch: arm: dts: k3-j7200-r5-evm: Add missing fss range

Upstream DTS added explicit ranges to the fss node.  It did not include the
32 bit memory space needed by the R5 to access OSPI.  With the upstream DTS
sync, OSPI boot no longer works.

Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed. See
f00e626085 (arm64: dts: ti: k3-j7200: Use exact ranges for FSS node)

Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream")
Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
Reviewed-by: Aniket Limaye <a-limaye@ti.com>
3 months agoarch: arm: dts: k3-am69-r5-sk: Add missing fss range
Jonathan Humphreys [Fri, 9 Aug 2024 23:01:54 +0000 (18:01 -0500)]
arch: arm: dts: k3-am69-r5-sk: Add missing fss range

Upstream DTS added explicit ranges to the fss node.  It did not include the
32 bit memory space needed by the R5 to access OSPI.  With the upstream DTS
sync, OSPI boot no longer works.

Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed. See
f062a015f4 (arm64: dts: ti: k3-j784s4: Use exact ranges for FSS node)

Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream")
Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
3 months agoarch: arm: dts: k3-j784s4-r5-evm: Add missing fss range
Jonathan Humphreys [Fri, 9 Aug 2024 23:01:53 +0000 (18:01 -0500)]
arch: arm: dts: k3-j784s4-r5-evm: Add missing fss range

Upstream DTS added explicit ranges to the fss node.  It did not include the
32 bit memory space needed by the R5 to access OSPI.  With the upstream DTS
sync, OSPI boot no longer works.

Adding the missing range here. It is also being added in the upstream DTS,
so after the next upstream DTS sync, this patch can be removed. See
f062a015f4 (arm64: dts: ti: k3-j784s4: Use exact ranges for FSS node)

Fixes: 5024a96db8e ("Subtree merge tag 'v6.10-dts' of devicetree-rebasing repo [1] into dts/upstream")
Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
4 months agoMerge patch series "Tidy up console recording in tests"
Tom Rini [Tue, 27 Aug 2024 00:52:18 +0000 (18:52 -0600)]
Merge patch series "Tidy up console recording in tests"

Simon Glass <sjg@chromium.org> says:

This series started as a small fix for checking for an empty line,
but in the process several other problems were found and fixed:

- fix tests which use console recording but don't set the flag
- drop unnecessary resetting of the console in tests
- drop unnecessary blank line before MMC output
- update the docs a little
- fix buildman test failure on newer Pythons
- a few other minor things

This series also renames the confusing flag names, so that they are
easier to remember - just a UTF_ (unit-test flags) prefix.

4 months agodoc: Add a few notes about how to use console checking
Simon Glass [Thu, 22 Aug 2024 13:58:04 +0000 (07:58 -0600)]
doc: Add a few notes about how to use console checking

Tidy up the existing docs in line with current conventions.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Tidy up checking for console end
Simon Glass [Thu, 22 Aug 2024 13:58:03 +0000 (07:58 -0600)]
test: Tidy up checking for console end

Use the ut_assert_console_end() function provided, rather than doing it
separately.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Use UTF_CONSOLE in remaining tests
Simon Glass [Thu, 22 Aug 2024 13:58:02 +0000 (07:58 -0600)]
test: Use UTF_CONSOLE in remaining tests

Set this flag rather than doing things manually in the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: log: Use UTF_CONSOLE in tests
Simon Glass [Thu, 22 Aug 2024 13:58:01 +0000 (07:58 -0600)]
test: log: Use UTF_CONSOLE in tests

Set this flag rather than doing things manually in the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: hush: Use UTF_CONSOLE in tests
Simon Glass [Thu, 22 Aug 2024 13:58:00 +0000 (07:58 -0600)]
test: hush: Use UTF_CONSOLE in tests

Set this flag rather than doing things manually in the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agotest: dm: Use UTF_CONSOLE in tests
Simon Glass [Thu, 22 Aug 2024 13:57:59 +0000 (07:57 -0600)]
test: dm: Use UTF_CONSOLE in tests

Set this flag rather than doing things manually in the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: cmd: Drop unnecessary console_record_reset_enable()
Simon Glass [Thu, 22 Aug 2024 13:57:58 +0000 (07:57 -0600)]
test: cmd: Drop unnecessary console_record_reset_enable()

It is seldom necessary to call this function. Drop its use in the
command tests.

Add a few extra checks to the wget test so that resetting is not
needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: cmd: Use UTF_CONSOLE in tests
Simon Glass [Thu, 22 Aug 2024 13:57:57 +0000 (07:57 -0600)]
test: cmd: Use UTF_CONSOLE in tests

Set this flag rather than doing things manually in the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: fdt: Move common code into the setup functions
Simon Glass [Thu, 22 Aug 2024 13:57:56 +0000 (07:57 -0600)]
test: fdt: Move common code into the setup functions

Quite a lot of tests have the same two lines of code at the start. Move
this into the two setup functions to reduce redundancy.

Add a line to check the output from set_working_fdt_addr() since this is
always emitted.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: fdt: Check internal-function return values
Simon Glass [Thu, 22 Aug 2024 13:57:55 +0000 (07:57 -0600)]
test: fdt: Check internal-function return values

Some functions are using asserts but the result of the functions
themselves is not checked. This means that if a test fails, the result
is not noticed until later, which can be confusing to debug.

Add the missing asserts.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: boot: Use UTF_CONSOLE in tests
Simon Glass [Thu, 22 Aug 2024 13:57:54 +0000 (07:57 -0600)]
test: boot: Use UTF_CONSOLE in tests

Set this flag rather than doing things manually in the test.

Drop unnecessary calls to console_record_reset_enable()

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agotest: bloblist: Use UTF_CONSOLE in tests
Simon Glass [Thu, 22 Aug 2024 13:57:53 +0000 (07:57 -0600)]
test: bloblist: Use UTF_CONSOLE in tests

Set this flag rather than doing things manually in the test.

Drop the code which is now unnecessary.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Update NAND test to avoid extra macros
Simon Glass [Thu, 22 Aug 2024 13:57:52 +0000 (07:57 -0600)]
test: Update NAND test to avoid extra macros

Write out the tests in full to allow the test to be found more easily
when there is a failure. We could use a single test function with a
for() loop but this would stop at the first failure, and some variations
might while other pass.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agommc: Drop the blank line before accesses
Simon Glass [Thu, 22 Aug 2024 13:57:51 +0000 (07:57 -0600)]
mmc: Drop the blank line before accesses

Several mmc subcommand print a blank line before starting and after
finishing. It isn't necessary to do both, so drop the first one.

It is questionable whether these command should produce any output at
all, but leave it for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Rename UTF_CONSOLE_REC to UTF_CONSOLE
Simon Glass [Thu, 22 Aug 2024 13:57:50 +0000 (07:57 -0600)]
test: Rename UTF_CONSOLE_REC to UTF_CONSOLE

The _REC suffix doesn't add much. Really what we want to know is whether
the test uses the console, so rename this flag.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agotest: Drop the blank line before test macros
Simon Glass [Thu, 22 Aug 2024 13:57:49 +0000 (07:57 -0600)]
test: Drop the blank line before test macros

Most tests don't have this. It helps to keep the test declaration
clearly associated with the function it relates to, rather than the next
one in the file. Remove the extra blank line and mention this in the
docs.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Rename unit-test flags
Simon Glass [Thu, 22 Aug 2024 13:57:48 +0000 (07:57 -0600)]
test: Rename unit-test flags

The UT_TESTF_ macros read as 'unit test test flags' which is not right.
Rename to UTF ('unit test flags').

This has the benefit of being shorter, which helps keep UNIT_TEST()
declarations on a single line.

Give the enum a name and reference it from the UNIT_TEST() macros while
we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Fail when an empty line is expected but not present
Simon Glass [Thu, 22 Aug 2024 13:57:47 +0000 (07:57 -0600)]
test: Fail when an empty line is expected but not present

The existing implementation of ut_assert_nextline_empty() cannot
distinguish between an empty line and no line at all. It can in fact be
called at the end of the recorded output and will happily return
success.

Adjust the logic so that this condition is detected. Show a failure
message in this case.

Fix the one test which falls foul of this fix.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 400175b0a7d ("test: Add a way to check each line of console...")
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agobuildman: Make test_process_limit handle time.monotonic()
Simon Glass [Thu, 22 Aug 2024 13:57:46 +0000 (07:57 -0600)]
buildman: Make test_process_limit handle time.monotonic()

Newer versions of filelock use time.monotonic() instead of time.time().
Update the test the handle this.

It would be better if filelock had support for writing unit tests which
use locking.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoMerge patch series "global_data: Reduce size of struct global_data"
Tom Rini [Mon, 26 Aug 2024 20:06:16 +0000 (14:06 -0600)]
Merge patch series "global_data: Reduce size of struct global_data"

Simon Glass <sjg@chromium.org> says:

The global data structure has grown quite a lot over the years, being
the best place to put an important pointer or something that must be
accessed before and after relocation.

This series attempts to reduce the size a little, by moving some things
out and shrinking and aligning some fields.

Some fields are needed during init but not afterwards. To deal with this
a new 'boardf' structure is created, which sits on the stack and is only
present during board_init_f(). It is possible that more fields could
move to this struct, but for now only 4 are moved.

An assumption is made that an int is 32-bits wide on all architectures,
which seems to be true, but maintainers should be able to confirm.

Mostly the code-size impact is neutral, but the patch
'Use less space for environment fields' does increase U-Boot's size by
about 30 bytes on aarch64.

For firefly-rk3399 (64-bit) the size of global reduces from 456 to 368
bytes. For SPL it reduces from 416 to 272 bytes.

There are other things which could be attempted, for example:
- Using hlist instead of list for some lists
- Checking that only necessary fields are present in SPL

4 months agodoc: Add some guidelines about global data
Simon Glass [Wed, 21 Aug 2024 16:19:27 +0000 (10:19 -0600)]
doc: Add some guidelines about global data

Update the documentation to provide a bit more information about how to
use global data.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agodoc: Move generic-board documentation into rst
Simon Glass [Wed, 21 Aug 2024 16:19:26 +0000 (10:19 -0600)]
doc: Move generic-board documentation into rst

This information is useful for people looking at how U-Boot has changed
over the years and the design decisions which led to it. Move it into
doc/ in an 'historical' section.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Remove environment members if not used
Simon Glass [Wed, 21 Aug 2024 16:19:25 +0000 (10:19 -0600)]
global_data: Remove environment members if not used

If the environment is not enabled we don't need these fields in
global_data. Make them conditional.

Make these fields conditional. Move env_buf up one so it can share
an #ifdef.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Remove jump table in SPL
Simon Glass [Wed, 21 Aug 2024 16:19:24 +0000 (10:19 -0600)]
global_data: Remove jump table in SPL

SPL builds don't use the jump table since they cannot run apps. Drop
it, moving it together with boardf.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Move pointer members together
Simon Glass [Wed, 21 Aug 2024 16:19:23 +0000 (10:19 -0600)]
global_data: Move pointer members together

Collect the pointer members near the top of global_data to help with
alignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Move ulong fields together
Simon Glass [Wed, 21 Aug 2024 16:19:22 +0000 (10:19 -0600)]
global_data: Move ulong fields together

Move all the always-present ulong fields next to the others at the top
of global_data

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Put phys_addr fields near the top
Simon Glass [Wed, 21 Aug 2024 16:19:21 +0000 (10:19 -0600)]
global_data: Put phys_addr fields near the top

Put these fields near the top and together, since they have the same
alignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Move env_addr field higher
Simon Glass [Wed, 21 Aug 2024 16:19:20 +0000 (10:19 -0600)]
global_data: Move env_addr field higher

Move this field to be with others of the same alignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Move baud_rate field lower
Simon Glass [Wed, 21 Aug 2024 16:19:19 +0000 (10:19 -0600)]
global_data: Move baud_rate field lower

Move this field to be with others of the same alignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Reduce size of early-malloc vars
Simon Glass [Fri, 23 Aug 2024 20:27:04 +0000 (14:27 -0600)]
global_data: Reduce size of early-malloc vars

The early malloc region is normally quite small and is certainly less
than 4GB, so use a 32-bit value for the limit and pointer. Update the
comments for clarity while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: log: Reorder and shrink fields
Simon Glass [Wed, 21 Aug 2024 16:19:17 +0000 (10:19 -0600)]
global_data: log: Reorder and shrink fields

Some of the logging fields are larger than they need to be. Shrink them
and adjust the ordering to improve alignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Reduce the size of mon_len
Simon Glass [Wed, 21 Aug 2024 16:19:16 +0000 (10:19 -0600)]
global_data: Reduce the size of mon_len

This is the length of the U-Boot binary, which is typically 200-800KB
and certainly not larger than 4GB. Use a 32-bit value to save space in
global_data and move it up to be with fields of the same alignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Reduce the size of bus_clk and mem_clk
Simon Glass [Wed, 21 Aug 2024 16:19:15 +0000 (10:19 -0600)]
global_data: Reduce the size of bus_clk and mem_clk

The bus clock and memory clock are unlikely to go above 4GHz for now, so
reduce the field size to 32 bits.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Collect common fields at the top
Simon Glass [Wed, 21 Aug 2024 16:19:14 +0000 (10:19 -0600)]
global_data: Collect common fields at the top

Move all the fields which are always present to the top of the struct,
so we can potentially save some space by taking note of alignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Drop spl_handoff
Simon Glass [Wed, 21 Aug 2024 16:19:13 +0000 (10:19 -0600)]
global_data: Drop spl_handoff

Provide a function to locate this information, rather than doing it
automatically on startup, to save space in global_data.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoboard_f: Move new_bloblist to boardf
Simon Glass [Wed, 21 Aug 2024 16:19:12 +0000 (10:19 -0600)]
board_f: Move new_bloblist to boardf

This value is only used before relocation. Move it to the new boardf
struct.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoboard_f: Move new_bootstage to boardf
Simon Glass [Wed, 21 Aug 2024 16:19:11 +0000 (10:19 -0600)]
board_f: Move new_bootstage to boardf

This value is only used before relocation. Move it to the new boardf
struct.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoboard_f: Move fdt_size to board
Simon Glass [Wed, 21 Aug 2024 16:19:10 +0000 (10:19 -0600)]
board_f: Move fdt_size to board

This value is only really used before relocation. There is not much use
to showing its value in bdinfo, so drop it. Move it to the new boardf
struct.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoboard_f: Add a new struct to hold pre-relocation info
Simon Glass [Wed, 21 Aug 2024 16:19:09 +0000 (10:19 -0600)]
board_f: Add a new struct to hold pre-relocation info

Quite a few of the members of struct global_data are only used before
reloction, or have little meaning afterwards, yet they hang around in
struct global_data for the lifetime of U-Boot. This uses up precious
pre-relocation SRAM on many boards.

To help with this, start a new struct which exists only before
relocation. Move new_fdt into this new struct. Drop the display of it
in the 'bdinfo' command as it is probably not very useful.

Note that the field does not exist in SPL builds.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Use less space for environment fields
Simon Glass [Wed, 21 Aug 2024 16:19:08 +0000 (10:19 -0600)]
global_data: Use less space for environment fields

Use shorter types for some of these fields to save space. Reorder to put
fields with like alignment together.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Drop pci_bootdelay
Simon Glass [Wed, 21 Aug 2024 16:19:07 +0000 (10:19 -0600)]
global_data: Drop pci_bootdelay

This is not used. Drop the field and the environment code which uses it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Drop global_data hose
Simon Glass [Wed, 21 Aug 2024 16:19:06 +0000 (10:19 -0600)]
global_data: Drop global_data hose

This is set on one x86 boards, but is not used anymore. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Remove pci_ram_top
Simon Glass [Wed, 21 Aug 2024 16:19:05 +0000 (10:19 -0600)]
global_data: Remove pci_ram_top

This field is set but not used. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Convert have_console into a flag
Simon Glass [Wed, 21 Aug 2024 16:19:04 +0000 (10:19 -0600)]
global_data: Convert have_console into a flag

We don't need a full word for this boolean value. Convert it into a flag
to save space in global_data.

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Drop fb_base
Simon Glass [Wed, 21 Aug 2024 16:19:03 +0000 (10:19 -0600)]
global_data: Drop fb_base

This value mirrors information recorded by driver model video drivers,
so can be removed to save space. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agovideo: Avoid setting global_data fb_base in video setup
Simon Glass [Wed, 21 Aug 2024 16:19:02 +0000 (10:19 -0600)]
video: Avoid setting global_data fb_base in video setup

This field is not used, so don't set it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agovideo: Avoid setting global_data fb_base from SPL handoff
Simon Glass [Wed, 21 Aug 2024 16:19:01 +0000 (10:19 -0600)]
video: Avoid setting global_data fb_base from SPL handoff

This field is not used, so don't set it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agozynqmp: Avoid setting the framebuffer address
Simon Glass [Wed, 21 Aug 2024 16:19:00 +0000 (10:19 -0600)]
zynqmp: Avoid setting the framebuffer address

This is handled by driver model so this driver should not be setting the
framebuffer address. Drop the assignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoarm: ronetix: Avoid accessing global_data fb_base
Simon Glass [Wed, 21 Aug 2024 16:18:59 +0000 (10:18 -0600)]
arm: ronetix: Avoid accessing global_data fb_base

Use the new video function to get the framebuffer base.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoarm: friendlyarm: Avoid accessing global_data fb_base
Simon Glass [Wed, 21 Aug 2024 16:18:58 +0000 (10:18 -0600)]
arm: friendlyarm: Avoid accessing global_data fb_base

Use the new video function to get the framebuffer base.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agovideo: mxs: Avoid setting global_data fb_base
Simon Glass [Wed, 21 Aug 2024 16:18:57 +0000 (10:18 -0600)]
video: mxs: Avoid setting global_data fb_base

This is not used, so don't set it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agovideo: mxc: Avoid setting global_data fb_base
Simon Glass [Wed, 21 Aug 2024 16:18:56 +0000 (10:18 -0600)]
video: mxc: Avoid setting global_data fb_base

This is not used, so don't set it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agovideo: Add a function to obtain the framebuffer address
Simon Glass [Wed, 21 Aug 2024 16:18:55 +0000 (10:18 -0600)]
video: Add a function to obtain the framebuffer address

Add a new function which returns the framebuffer address of the first
video device. This will allow the global_data field top be dropped.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agox86: Drop use of global_data fb_base
Simon Glass [Wed, 21 Aug 2024 16:18:54 +0000 (10:18 -0600)]
x86: Drop use of global_data fb_base

This value is set by not used on x86 so there is no point in setting it.
Drop the assignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoglobal_data: Move pci_clk to m68k and powerpc
Simon Glass [Wed, 21 Aug 2024 16:18:53 +0000 (10:18 -0600)]
global_data: Move pci_clk to m68k and powerpc

Only m68k and powerpc use this field, so move it to the arch-specific
info, to reduce the size for other archs.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoMerge patch series "test/overlay: Make this depend on SANDBOX"
Tom Rini [Fri, 23 Aug 2024 21:59:44 +0000 (15:59 -0600)]
Merge patch series "test/overlay: Make this depend on SANDBOX"

Tom Rini <trini@konsulko.com> says:

Update a few things so that CONFIG_UNIT_TEST will compile for more
hardware platforms.

4 months agotest/cmd: Move wget test to under a sandbox guard
Tom Rini [Fri, 16 Aug 2024 03:49:05 +0000 (21:49 -0600)]
test/cmd: Move wget test to under a sandbox guard

This test is sandbox-centric, so guard it so.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agotest/boot: Make BOOTSTD tests depend on UT_BOOTSTD
Tom Rini [Fri, 16 Aug 2024 03:49:04 +0000 (21:49 -0600)]
test/boot: Make BOOTSTD tests depend on UT_BOOTSTD

While we have a symbol for controlling if we will be testing BOOTSTD or
not, and it depends on SANDBOX, we do not control the building of
test/boot/ content correctly. Guard the current bootstd tests with
a check for UT_BOOTSTD and leave the measurement test available.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agotest/overlay: Make this depend on SANDBOX
Tom Rini [Fri, 16 Aug 2024 03:49:03 +0000 (21:49 -0600)]
test/overlay: Make this depend on SANDBOX

As the overlays are sandbox specific, mark the whole test as depending
on sandbox.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agoMerge patch series "spl: mmc: Some tweaks for SPL, particularly with MMC"
Tom Rini [Fri, 23 Aug 2024 21:59:03 +0000 (15:59 -0600)]
Merge patch series "spl: mmc: Some tweaks for SPL, particularly with MMC"

Simon Glass <sjg@chromium.org> says:

This series includes various minor fixes and tweaks found when trying
to reduce the size of MMC code in SPL.

4 months agoblk: Correct comment for blk_get_devnum_by_uclass_idname()
Simon Glass [Thu, 22 Aug 2024 13:55:03 +0000 (07:55 -0600)]
blk: Correct comment for blk_get_devnum_by_uclass_idname()

Update the comment to match the function. Fix the indentation while we
are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
4 months agospl: Create a function to init spl_load_info
Simon Glass [Thu, 22 Aug 2024 13:55:02 +0000 (07:55 -0600)]
spl: Create a function to init spl_load_info

Rather than having every caller set this up individually, create a
common init function. This allows new fields to be added without the
risk of them being left uninited.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
4 months agospl: Use unified inline functions for spl_load_info
Simon Glass [Thu, 22 Aug 2024 13:55:01 +0000 (07:55 -0600)]
spl: Use unified inline functions for spl_load_info

Rather than declaring completely separate functions, put the code for
each case into the same function. This makes it easier to read.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
4 months agospl: mmc: Try to clean up raw-mode options
Simon Glass [Thu, 22 Aug 2024 13:55:00 +0000 (07:55 -0600)]
spl: mmc: Try to clean up raw-mode options

Make the raw-mode options depend on SPL_SYS_MMCSD_RAW_MODE in a more
direct way. This makes it easier to understand the options with
'make menuconfig'.

There are three different ways of specifying the offset:

- sector offset
- partition number
- partition type

So make these a choice, so it is more obvious what is going on.

Update existing boards to enable SPL_SYS_MMCSD_RAW_MODE where needed.

Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agospl: mmc: Adjust args of spl_mmc_find_device()
Simon Glass [Thu, 22 Aug 2024 13:54:59 +0000 (07:54 -0600)]
spl: mmc: Adjust args of spl_mmc_find_device()

At present spl_mmc_load() is the only caller of this function, passing
it a boot_device, an index into the available MMC devices. Pass the
device number instead, since it is known by the caller and simplifies
the code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
4 months agospl: mmc: Handle error codes consistently
Simon Glass [Thu, 22 Aug 2024 13:54:58 +0000 (07:54 -0600)]
spl: mmc: Handle error codes consistently

Use 'ret' as the return code, since it may not be an error and this is
the common name in U-Boot. Make sure to return the error code when
given, rather than transforming it into -1 (-EPERM).

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agospl: mmc: Drop checks for CONFIG_SPL_LIBCOMMON_SUPPORT
Simon Glass [Thu, 22 Aug 2024 13:54:57 +0000 (07:54 -0600)]
spl: mmc: Drop checks for CONFIG_SPL_LIBCOMMON_SUPPORT

This check is not needed now, since printf() resolved to nothing if not
available. Drop the #ifdefs

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
4 months agolog: Avoid including function names by default
Simon Glass [Thu, 22 Aug 2024 13:54:56 +0000 (07:54 -0600)]
log: Avoid including function names by default

Unless function names are requested, the logging system should not
compile these into the code. Adjust the macros to handle this.

This means that turning on function names at runtime won't work unless
CONFIG_LOGF_FUNC is enabled. We could perhaps split this into a
separate option if that is a problem.

Enable CONFIG_LOGF_FUNC logging for sandbox since the tests expect the
function names to be included. Fix up the pinmux test which checks a
logging statement.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
4 months agommc: Use logging instead of pr_err()
Simon Glass [Thu, 22 Aug 2024 13:54:55 +0000 (07:54 -0600)]
mmc: Use logging instead of pr_err()

Use the log subsystem instead of dev, to avoid including function names
in the code.

The CONFIG_LOGF_FUNC option can be used to enable the function name.

Update 'enhanced size' to use hex since this is the U-Boot default and
more natural for the large numbers involved.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
4 months agommc: Use logging instead of printf()
Simon Glass [Thu, 22 Aug 2024 13:54:54 +0000 (07:54 -0600)]
mmc: Use logging instead of printf()

The code makes quite a few uses of __func__ which puts the function
name into the resulting SPL image. Use the log subsystem instead, to
reduce size.

The CONFIG_LOGF_FUNC option can be used to enable the function name.

Use lower-case hex for the status output in sdhci_transfer_data(), to
match sdhci_send_command()

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
4 months agospl: Remove remaining #ifdef in spl_parse_image_header()
Simon Glass [Thu, 22 Aug 2024 13:54:53 +0000 (07:54 -0600)]
spl: Remove remaining #ifdef in spl_parse_image_header()

Define spl_set_header_raw_uboot() always so we can drop the last #ifdef
in this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
4 months agospl: Remove some #ifdefs in spl_parse_image_header()
Simon Glass [Thu, 22 Aug 2024 13:54:52 +0000 (07:54 -0600)]
spl: Remove some #ifdefs in spl_parse_image_header()

This function has a number of unnecessary #ifdefs so remove them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
4 months agospl: Correct use of CMD_BOOTI and CMD_BOOTZ
Simon Glass [Thu, 22 Aug 2024 13:54:51 +0000 (07:54 -0600)]
spl: Correct use of CMD_BOOTI and CMD_BOOTZ

These should have a CONFIG_ prefix. Add it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 7a0d88076b9 ("Add in the ability to load and boot an uncompr...")
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
4 months agorockchip: Move the default timer init to a common file
Simon Glass [Thu, 22 Aug 2024 13:54:50 +0000 (07:54 -0600)]
rockchip: Move the default timer init to a common file

Rather than repeating the same code in two files (SPL and TPL), move it
to a shared filed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
4 months agoMerge tag 'u-boot-imx-next-20240823' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Fri, 23 Aug 2024 21:00:29 +0000 (15:00 -0600)]
Merge tag 'u-boot-imx-next-20240823' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next

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

- Add BOOTAUX support for apalis and colibri imx8 boards.
- Cleanup tqma6 board by removing unneeded board code.
- Add support for booting from ecspi3 via bmode command on imx6.
- Add a script to ease updating flash.bin on imx8mm phytec board.
- Enable cat and xxd commands on Data Modul i.MX8M Mini/Plus eDM SBC and
  use USB SDPS as fallback option.
- Fix critical temperature on imx9.
- Add Cortex M and bootaux support for phycore-imx8mp.

4 months agoARM: imx: Enable cat and xxd commands on Data Modul i.MX8M Mini/Plus eDM SBC
Marek Vasut [Wed, 21 Aug 2024 21:03:33 +0000 (23:03 +0200)]
ARM: imx: Enable cat and xxd commands on Data Modul i.MX8M Mini/Plus eDM SBC

Enable 'cat' command to print file from filesystem to stdout.
Enable 'xxd' command to hexdump file from filesystem to stdout.

Signed-off-by: Marek Vasut <marex@denx.de>
4 months agoARM: imx: Use USB SDPS as fallback option on Data Modul i.MX8M Plus eDM SBC
Marek Vasut [Wed, 21 Aug 2024 21:01:16 +0000 (23:01 +0200)]
ARM: imx: Use USB SDPS as fallback option on Data Modul i.MX8M Plus eDM SBC

The Data Modul i.MX8M Plus eDM SBC does have USB gadget capable port
accessible via USB A-A cable plugged into the bottom USB 3.0 port.
Use USB SDPS as the fallback boot device, so USB SDPS loading can
be performed using e.g. uuu tool.

Signed-off-by: Marek Vasut <marex@denx.de>
4 months agoconfigs: phycore-imx8mp_defconfig: Enabled bootaux command
Yashwanth Varakala [Tue, 20 Aug 2024 15:46:30 +0000 (17:46 +0200)]
configs: phycore-imx8mp_defconfig: Enabled bootaux command

To start the mcore binary from u-boot, bootaux command is
needed.

Signed-off-by: Yashwanth Varakala <y.varakala@phytec.de>
4 months agoboard: phytec: phycore_imx8mp: Add mcore support
Yashwanth Varakala [Tue, 20 Aug 2024 15:46:29 +0000 (17:46 +0200)]
board: phytec: phycore_imx8mp: Add mcore support

Added m7 core support in uboot for imx8mp by adding
the boot variable prepare_mcore.

Based on commit 0ed32cc8568a ("LF-6555 imx8m[m/n/p/q]_evk: add
bootargs to support mcore")

Signed-off-by: Yashwanth Varakala <y.varakala@phytec.de>
4 months agomx6: Expand bmode to support ecspi3 boot
Fabio Estevam [Sat, 17 Aug 2024 19:13:13 +0000 (16:13 -0300)]
mx6: Expand bmode to support ecspi3 boot

Currently, the bmode command only supports booting from ecspi1.

Expand it to also support booting from ecspi3.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Peng Fan <peng.fan@nxp.com>
4 months agogw_ventana: Remove unneeded comments
Fabio Estevam [Fri, 16 Aug 2024 03:22:17 +0000 (00:22 -0300)]
gw_ventana: Remove unneeded comments

Remove several comments that do not apply anymore to
the current file content.

While at it, write 'PMIC' into a single line for consistency.

Signed-off-by: Fabio Estevam <festevam@denx.de>
4 months agotqma6_mba6: Remove UART board code
Fabio Estevam [Wed, 14 Aug 2024 18:28:45 +0000 (15:28 -0300)]
tqma6_mba6: Remove UART board code

With DM_SERIAL in place, there is no need to setup the UART pins
in the board code.

The UART pins are setup via devicetree, thanks to DM.

Remove the unneeded code.

Signed-off-by: Fabio Estevam <festevam@denx.de>
4 months agotqma6_mba6: Remove unused defines
Fabio Estevam [Wed, 14 Aug 2024 18:28:44 +0000 (15:28 -0300)]
tqma6_mba6: Remove unused defines

The PAD_CTRL definitions are not used anywhere.

Remove them to make the code cleaner.

Signed-off-by: Fabio Estevam <festevam@denx.de>
4 months agotqma6: Remove non-DM board code
Fabio Estevam [Wed, 14 Aug 2024 18:28:43 +0000 (15:28 -0300)]
tqma6: Remove non-DM board code

CONFIG_DM_MMC and CONFIG_DM_SPI are alway selected so the mmc
and spi board code can be safely removed.

Remove it to make the code cleaner.

Signed-off-by: Fabio Estevam <festevam@denx.de>
4 months agoimx: imx9: Set correct critical temperature
Primoz Fiser [Tue, 13 Aug 2024 12:12:17 +0000 (14:12 +0200)]
imx: imx9: Set correct critical temperature

Commit 3233349fa6e2 ("imx: imx9: fixup thermal trips from fuses")
wrongly set critical temperature to (maxc - 5) instead of maxc.

Fixes: 3233349fa6e2 ("imx: imx9: fixup thermal trips from fuses")
Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
4 months agoconfig: Add 'update_bootimg' command to update flash.bin on Phytec's imx8mm
Lukasz Majewski [Fri, 9 Aug 2024 16:53:32 +0000 (18:53 +0200)]
config: Add 'update_bootimg' command to update flash.bin on Phytec's imx8mm

This command allows easy update on SD card or eMMC of the flash.bin
generated (with binman) during u-boot build.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Benjamin Hahn <B.Hahn@phytec.de>
Tested-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
4 months agocolibri-imx8x: enable i.MX specific SNVS configuration
Andrejs Cainikovs [Wed, 7 Aug 2024 14:16:20 +0000 (16:16 +0200)]
colibri-imx8x: enable i.MX specific SNVS configuration

commit 242d1cd69b9f ("imx8: Configure SNVS")
implemented IMX_SNVS_SEC_SC. Enable it.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
4 months agocolibri-imx8x: enable i.MX specific BOOTAUX
Andrejs Cainikovs [Wed, 7 Aug 2024 14:16:19 +0000 (16:16 +0200)]
colibri-imx8x: enable i.MX specific BOOTAUX

commit e8cd1f60d964 ("imx: imx8: bootaux: Add i.MX8 M4 boot support")
implemented IMX_BOOTAUX. Enable it.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
4 months agoapalis-imx8: enable i.MX specific BOOTAUX
Andrejs Cainikovs [Wed, 7 Aug 2024 14:16:18 +0000 (16:16 +0200)]
apalis-imx8: enable i.MX specific BOOTAUX

commit e8cd1f60d964 ("imx: imx8: bootaux: Add i.MX8 M4 boot support")
implemented IMX_BOOTAUX. Enable it.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
4 months agoboard: apalis-imx8: add reset code
Andrejs Cainikovs [Wed, 7 Aug 2024 14:16:17 +0000 (16:16 +0200)]
board: apalis-imx8: add reset code

With commit 922d4504bcab ("imx: scu_api: update to version 1.16 and
add more APIs") added the reboot API.

Add the board code to use that.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>