Commit graph

85275 commits

Author SHA1 Message Date
Simon Glass
041840eeeb efi: Split out table-listing code into a new file
This code is used with EFI_LOADER but is also useful (with some
modifications) for the EFI app and payload. Move it into a shared
file.

Show the address of the table so it can be examined if needed. Also show
the table name as unknown if necessary. Our list of GUIDs is fairly
small.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-25 11:07:22 +01:00
Simon Glass
30c9646eff doc: Add help for the efi command
This command currently has no help. Add some.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-25 11:07:22 +01:00
Simon Glass
4e5e49a3c7 efi: Include GUID names with EFI app and payload
These are currently only available when running with EFI_LOADER.
Expand this to include the app and payload, since it is useful to be
able to decode things there.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-25 11:07:22 +01:00
Simon Glass
ac93275d79 efi: Add another tranch of GUIDs
Provide information about the GUIDs supplied by QEMU, so far as it is
known.

These values are used in the 'efi table' command as well as the printf
format string %sU

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-25 11:07:22 +01:00
Simon Glass
a6d263f59e x86: Support zboot and bootm in the EFI app
These have been disabled due to the rudimentary support available. It is
a little better now, so enable these options.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2023-03-25 11:07:22 +01:00
Simon Glass
5a2a1d8093 x86: Exit EFI boot services before starting kernel
When running the EFI app, we need to exit boot services before jumping
to Linux.

At some point it may be possible to jump to Linux and pass on the system
table, and:

  * install the device-tree as configuration table
  * use LoadImage() to load the kernel image (e.g. from memory)
  * start the image with StartImage()

This should allow the Linux efistub to be used. For now, this is not
implemented.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-25 11:07:22 +01:00
Simon Glass
37c9f9cc86 x86: Support booting a 64-bit kernel from 64-bit U-Boot
Add the missing code to handle this. For a 64-bit kernel the entry
address is 0x200 bytes after the normal entry.

Rename the parameter to boot_linux_kernel() accordingly. Update the
comments to indicate that these are addresses, not pointers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-25 11:07:21 +01:00
Simon Glass
1404914ddd x86: Add return-value comment to cpu_jump_to_64bit()
This does not mention what it returns. Add the missing documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-25 11:07:21 +01:00
Simon Glass
90f2b5abb5 x86: Adjust bootparam.h to be more like linux
This likely came from Linux originally, so update it to match v6.2 more.
This has no functional change.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-25 11:07:21 +01:00
Simon Glass
edf35a3027 efi: Set RUN_64BIT correctly for the EFI app
The U-Boot EFI app can run as a 64-bit program, so set the Kconfig
correctly in that case. Make sure it doesn't build SPL, since there is
no need to switch from 32 to 64 bit when running.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-25 11:07:21 +01:00
Heinrich Schuchardt
bace47a59d efi_loader: simplify efi_str_to_u16()
Use efi_alloc() to allocate memory.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-25 11:06:35 +01:00
Heinrich Schuchardt
f606fab8da efi_loader: move dp_alloc() to efi_alloc()
The incumbent function efi_alloc() is unused.

Replace dp_alloc() by a new function efi_alloc() that we can use more
widely.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-03-25 11:06:34 +01:00
Heinrich Schuchardt
92b931b8ef efi_loader: move struct efi_device_path to efi.h
Avoid forward declaration of struct efi_device_path.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-03-25 11:06:03 +01:00
Heinrich Schuchardt
e472ef8a3d efi_loader: fix device-path for USB devices
EFI device paths for block devices must be unique. If a non-unique device
path is discovered, probing of the block device fails.

Currently we use UsbClass() device path nodes. As multiple devices may
have the same vendor and product id these are non-unique. Instead we
should use Usb() device path nodes. They include the USB port on the
parent hub. Hence they are unique.

A USB storage device may contain multiple logical units. These can be
modeled as Ctrl() nodes.

Reported-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-25 11:05:42 +01:00
Heinrich Schuchardt
c5cc6da855 efi_loader: support for Ctrl() device path node
* Add the definitions for Ctrl() device path nodes.
* Implement Ctrl() nodes in the device path to text protocol.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-03-25 11:05:42 +01:00
Tom Rini
884d626d83 Merge branch '2023-03-22-assorted-minor-code-cleanups' into next
- Minor code cleanups based on problems found by clang or enabling LTO.
2023-03-22 20:57:39 -04:00
Tom Rini
486930bd7f purism: librem5: Fix a function declaration in spl.c
Here we implement usb_gadget_handle_interrupts() but did not include
<linux/usb/gadget.h> so did not have the declaration correct. Fix this
and add the missing include.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-03-22 15:22:48 -04:00
Tom Rini
332f48022f examples: Don't use LTO for hello_world
If we're building U-Boot with LTO, we don't want to use that for
examples as it's more work than required.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-22 15:22:48 -04:00
Tom Rini
16d82d7bfa spl: Add function prototype for spl_mmc_get_uboot_raw_sector
We did not add a prototype for spl_mmc_get_uboot_raw_sector to
include/spl.h before, so add and document one now. Correct the incorrect
prototype in board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c and
ensure that we have spl.h where we define a non-weak
spl_mmc_get_uboot_raw_sector as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-03-22 15:22:48 -04:00
Tom Rini
f5131e80fc arm: Correct cpu_reset function prototype on some platforms
Some platforms were not including <cpu_func.h> which sets the prototype
for reset_cpu, and in turn had it set wrong. Correct these cases.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-03-22 15:22:48 -04:00
Tom Rini
d9ab69d736 proftool: Remove unused variables in make_flame_tree
With clang-15 we now get reported that in the make_flame_tree function,
neither the missing_count nor depth variables are used, only
incremenete/decremented. Remove these.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-22 15:22:48 -04:00
Tom Rini
a6b8dd8a12 imx8image: Remove unused cont_img_count variable
With clang-15, it is now reported that cont_img_count is unused. This is
true as the code will increment / reset this counter, but never
functionally use it. Remove it.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2023-03-22 15:22:48 -04:00
Tom Rini
99de38a109 zlib: trees.c: Fix a warning with clang-15
With clang-15 we now will get warnings such as:

warning: a function declaration without a prototype is deprecated in all
versions of C [-Wstrict-prototypes]

And it is easy enough to address this warning here, even if we would
like to stay in sync more with upstream as it's a single location.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-22 15:22:48 -04:00
Tom Rini
fbfcb614e0 libavb: Fix a warning with clang-15
With clang-15 we now will get warnings such as:

warning: a function declaration without a prototype is deprecated in all
versions of C [-Wstrict-prototypes]

And it is easy enough to address this warning here, as we aren't
concerned with re-syncing with an upstream.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-22 15:22:48 -04:00
Tom Rini
f88d48cc74 dlmalloc: Fix a warning with clang-15
With clang-15 we now will get warnings such as:

warning: a function declaration without a prototype is deprecated in all
versions of C [-Wstrict-prototypes]

And it is easy enough to address this warning here, as we aren't
concerned with re-syncing with an upstream.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-22 15:22:48 -04:00
Tom Rini
52ee1a0294 global: Disable deprecated-non-prototype warning with clang
We have a number of places in the code which use the following syntax:

void func(a, b, c)
    int a; /* Does a */
    something_t *b; /* Pointer to b */
    int c; /* Does c */
{
...
}

Which while not what we document as our coding style, this is also code
which we have imported from other projects, and would like to re-sync
with in the future. While the biggest example of this is the zlib code,
there are other places as well. For now, we will silence this warning.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-22 15:22:48 -04:00
Tom Rini
12340b122b Merge branch '2023-03-21-assorted-CI-updates' into next
- Assorted improvements to our GitLab and Azure infrastructure.
2023-03-22 10:35:58 -04:00
Peter Hoyes
74bcbb13c4 CI: Allow a mirror to be specified for Docker Hub
To conserve bandwidth and potentially avoid rate limits, allow a local
mirror of Docker Hub to be specified globally. The default value is
unchanged.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-03-21 21:04:09 -04:00
Peter Hoyes
8b0b50170d CI: Allow job tag to be optionally set globally
The default behavior of Gitlab runners is to only run jobs which match
the configured tag, although there is an option to run untagged jobs
[1].

To support running the CI in more complex environments where different
types of runners may be present that support different tags, allow the
DEFAULT_TAG for all jobs in the pipeline to be set globally using an
environment variable. An empty default value is provided to retain
support for untagged runners.

[1] https://docs.gitlab.com/ee/ci/runners/configure_runners.html#use-tags-to-control-which-jobs-a-runner-can-run

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-03-21 21:04:09 -04:00
Marek Vasut
e567073018 CI: gitlab: Collect pytest artifacts
Copy build artifacts for all test.py tests, so they show up in
artifacts storage for later inspection. The test.py tests output
in CI is basically useless, but it is far more useful in the html
output for analysis and debugging.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-21 21:04:09 -04:00
Tom Rini
542ae5234e Azure CI: Be explicit about pytest cache directory
The default pytest cache directory is in a read-only directory in Azure,
which results in a warning on the build page. Use the pytest command
line option to set the cache dir to somewhere writable.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-21 21:04:09 -04:00
Tom Rini
be566abd0f Azure CI: Save pytest output automatically
Enable use of the python-azurepipelines package which provides automatic
formatting and uploading of the pytest output.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-21 21:04:09 -04:00
Tom Rini
e3059db90b Dockerfile: Update to latest "Jammy" tag
Update to using the latest "Jammy" tag as our base.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-03-21 21:04:09 -04:00
Tom Rini
3854706f0f Dockerfile: Add m68k-softmmu to qemu
Given efforts to add an m68k target to CI, build qemu for it.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-21 21:04:05 -04:00
Tom Rini
1a4f2cc55a Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sh into next 2023-03-20 17:51:10 -04:00
Tom Rini
95e0f9ac09 Merge branch '2023-03-17-improve-read-command-add-write-command' into next
To quote the author:
The first patch simplies do_read somewhat by making use of an existing
helper instead of parsing the dev_part string manually. As a bonus
(and my actual motivation), it now understands dev#partname syntax -
hard-coded partition numbers are so last decade.

I also need the symmetrical operation, being able to write to a named
raw partition, and fortunately it doesn't require that many lines of
code to implement that.

There's a very minor change in the error reporting due to using
cmdtp->name to generate the new messages, but I don't think "Error
reading blocks" offers much that "read error" doesn't.

New in v2: the last three patches add documentation, ensure CMD_WRITE
is set for sandbox and adds some basic test cases for the various ways
of accessing the partitions (by number, name, or as raw offset within
the whole disk).

v3: Add Simon's R-b to patches 2, 4, 5, fixup whitespace in patch 5.

I don't want to duplicate the documentation, but I can see the value
in 'write' having its own entry in the TOC, so I added a stub
write.rst that just refers to the read.rst, which then explicitly
documents both.
2023-03-20 16:31:52 -04:00
Marek Vasut
6254c5f7e1 serial: sh: Make indent consistent
Make the indent of these macro elements consistent with the
rest of this table. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-18 12:04:02 +01:00
Marek Vasut
836d1bfffa serial: sh: Add DEBUG_UART support
Add support for debug output very early during boot using the DEBUG_UART
mechanism. This uses a static fixed UART port configuration selected via
Kconfig options and dedicated print functions from debug_uart.h. This is
useful e.g. when debugging problems so early during boot, that not even
the DM is initialized at that point, and thus DM_SERIAL is not available
either.

This functionality is disabled by default. To activate it, define the
following Kconfig options and select SCIF type using CFG_SCI/CFG_SCIF_A/
CFG_HSCIF/<nothing for regular SCIF>:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_SCIF=y
CONFIG_DEBUG_UART_BASE=0xe6540000
CONFIG_DEBUG_UART_CLOCK=24000000

The later two options define the SCIF physical base address and SCIF
input clock in Hz. Optionally, to validate DEBUG_UART works, enable
the following as well to get early serial output message by default:

CONFIG_DEBUG_UART_ANNOUNCE=y

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-18 12:04:02 +01:00
Marek Vasut
5e12d7d00b serial: sh: Rename CONFIG_SCI and CONFIG_SCIF_USE_EXT_CLK to CFG_ variants
Both CONFIG_SCI and CONFIG_SCIF_USE_EXT_CLK options do not have a
matching Kconfig entry because they are internal to the SCIF driver.
Change their prefix to CFG_, i.e. CFG_SCIF_USE_EXT_CLK and CFG_SCI,
to reflect that and avoid interferring with Kconfig symbols. Since
neither of those options are defined elsewhere, no functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-18 12:04:02 +01:00
Marek Vasut
517f8e8aee pinctrl: renesas: Replace ifdeffery with IS_ENABLED()
Switch ifdef in sh_gpio_get_value() to IS_ENABLED() macro.
The CONFIG_RCAR_GEN3 will never have SPL counterpart, so
the IS_ENABLED() macro is the right one here. No functional
change, except for improved build test coverage.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-18 12:02:38 +01:00
Mikhail Lappo
d797a8ccb2 net: ravb: Support fixed PHY in R-Car
Calling old U-Boot API doesn't allow to use fixed PHY.
Searching by mask is the part of new function, after
scanning FDT for a fixed PHY definition

Fixes: e821a7bdb1 ("net: ravb: Detect PHY correctly")
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Mikhail Lappo <mikhail.lappo@esrlabs.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
[Hai Pham: Drop phy_connect_dev since it's called in phy_connect]
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Use mask -1 instead of 0 to reinstate the search behavior
        over all PHY addresses. Add Fixes tag, sort the tag list.]
2023-03-18 12:02:38 +01:00
Marek Vasut
495211a489 i2c: rcar_i2c: Sort Kconfig depends list ascending
Sort the list of "depends" symbols in ascending order.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
2023-03-18 12:02:38 +01:00
Marek Vasut
61eb551f3a i2c: rcar_iic: Sort Kconfig depends list ascending
Sort the list of "depends" symbols in ascending order.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
2023-03-18 12:02:38 +01:00
Marek Vasut
99c7e03119 clk: renesas: rcar-gen3: Replace SSCG caching with MDSEL/PE caching
Do not cache the single CPG MODE register bit 12, instead cache the
entire register value, and only pick the matching bit from the cached
value when core clock of type MDSEL or PE are used. Both MDSEL and PE
clock type currently define .offset field as 12 on Gen3, which means
this code will use bit 12 on Gen3 again, however there are additional
clock on Gen4 which use different bits, and having this flexibility
in place now will be useful when adding Gen4.

No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-18 12:02:38 +01:00
Marek Vasut
f54eb0bad6 ARM: rmobile: Split R-Car Gen3 into separate Kconfig from common 64bit options
There are multiple shared Kconfig options between R-Car Gen3 and Gen4.
Keep the common options in Kconfig.64 and move the R-Car Gen3 specific
options into separate Kconfig.rcar3 . The Kconfig.rcar3 contains SoC
and board list, which is limited to R-Car Gen3.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-18 12:02:38 +01:00
Marek Vasut
ef72c1ef29 ARM: rmobile: Introduce CONFIG_RCAR_64 symbol
Introduce common Kconfig symbol for 64bit R-Car platforms and move
common configuration options into it. This is preparatory patch to
prevent duplication of Kconfig lists later on, when Gen4 is added.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-18 12:02:38 +01:00
Marek Vasut
dec699bea7 ARM: rmobile: Factor out SYS_SOC Kconfig option
Pull the SYS_SOC Kconfig option to avoid duplication of this option
in Kconfig.{32,64,rza1} . The default value is the same, so just set
it in one location.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-18 12:02:38 +01:00
Marek Vasut
6f152a713c ARM: rmobile: Sort R-Car Gen3 Kconfig lists
Sort the 'imply' and 'select' lists in R-Car Gen3 Kconfig options.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-18 12:02:38 +01:00
Marek Vasut
7fe9d7d1ba ARM: rmobile: Convert ifdef in rmobile_get_prr() to IS_ENABLED()
Switch ifdef in rmobile_get_prr() to IS_ENABLED() macro.
The CONFIG_RCAR_GEN3 will never have SPL counterpart, so
the IS_ENABLED() macro is the right one here. No functional
change, except for improved build test coverage.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-18 12:02:38 +01:00
Hai Pham
33c3ec22d4 ARM: renesas: falcon: Enable RWDT reset for V3U Falcon
Enable RWDT reset on Reset Controller so that it can be used as
reset trigger source for V3U Falcon.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # Use one current_el() in board_init
2023-03-18 11:59:45 +01:00