platform/kernel/u-boot.git
17 months agoglobal: Remove unused CONFIG defines
Tom Rini [Tue, 10 Jan 2023 16:19:28 +0000 (11:19 -0500)]
global: Remove unused CONFIG defines

Remove some CONFIG symbols and related comments, etc, that are unused
within the code itself at this point.

Signed-off-by: Tom Rini <trini@konsulko.com>
17 months agoMerge tag 'tpm-20012023' of https://source.denx.de/u-boot/custodians/u-boot-tpm
Tom Rini [Fri, 20 Jan 2023 15:36:00 +0000 (10:36 -0500)]
Merge tag 'tpm-20012023' of https://source.denx.de/u-boot/custodians/u-boot-tpm

TPM fixes and state reporting

17 months agotee: optee: fix uuid comparisons on service discovery
Ilias Apalodimas [Thu, 19 Jan 2023 09:21:37 +0000 (11:21 +0200)]
tee: optee: fix uuid comparisons on service discovery

When comparing UUIDs for discovered services we only compare up to the
ptr size instead of the entire UUID

Fixes: 94ccfb78a4d61 ("drivers: tee: optee: discover OP-TEE services")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
17 months agotpm2: ftpm: add the device in the OP-TEE services list
Ilias Apalodimas [Thu, 19 Jan 2023 14:36:12 +0000 (16:36 +0200)]
tpm2: ftpm: add the device in the OP-TEE services list

commit fe8a4ed0111073 ("tee: optee: discover services dependent on tee-supplicant")
is trying to automatically scan and add TAs that are presented on pseudo
bus from the secure world.
In order to be able to list and compare the scanned devices the available drivers
have to register themselves on the op-tee service list.

Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
17 months agoMAINTAINERS: add a new entry on TEE MAINTAINERS
Ilias Apalodimas [Thu, 19 Jan 2023 15:10:57 +0000 (17:10 +0200)]
MAINTAINERS: add a new entry on TEE MAINTAINERS

Since I do have a look on TEE patches regardless and Jens doesn't have
his own tree, add myself as a co-maintainer.  I'll be carrying over the
TEE related patches from now on.  While at it add the maintenance tree
for TPM

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
17 months agotee: optee: fix a print error on rng probing
Ilias Apalodimas [Wed, 18 Jan 2023 15:38:21 +0000 (17:38 +0200)]
tee: optee: fix a print error on rng probing

If we fail to probe the optee-rng device, we print a wrong message
referring to the firmware tpm.

Fixes: 476a3d58dfeb ("tee: optee: don't fail probe because of optee-rng")
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
17 months agoMerge tag 'dm-pull-18jan23' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Thu, 19 Jan 2023 14:46:57 +0000 (09:46 -0500)]
Merge tag 'dm-pull-18jan23' of https://source.denx.de/u-boot/custodians/u-boot-dm

convert rockchip to use binman
patman fix for checkpatch
binman optional entries, improved support for ELF symbols
trace improvements
minor fdt refactoring

17 months agoMerge branch '2022-01-18-assorted-updates'
Tom Rini [Thu, 19 Jan 2023 14:41:54 +0000 (09:41 -0500)]
Merge branch '2022-01-18-assorted-updates'

- A few TI platform fixes, compression test cleanup and zstd update,
  npcm7xx update, add "part type" subcommand, VBE bugfix on some
  platforms, cleanup EVENT related Kconfig option logic (and fix some
  platforms), other minor cleanups.

17 months agoodroid: limit boot memory to lowmem
Joost van Zwieten [Sat, 14 Jan 2023 23:57:30 +0000 (00:57 +0100)]
odroid: limit boot memory to lowmem

In commit 4963f63fe61f ("image: Use gd->ram_base/_size in
env_get_bootm_size()") the size of the available memory for U-Boot to
use when relocating images, and not otherwise constrained, was changed
to include all known memory banks. In the case of this platform however,
all of the memory known to U-Boot is not also part of the Linux kernel
"lowmem" and so we must use CFG_SYS_BOOTMAPSZ to limit where we relocate
images to. We set a conservative limit of 256MB here to mirror the
previous behavior.

Signed-off-by: Joost van Zwieten <joost@diskos.nl>
[trini: Reword the commit messsage]
Signed-off-by: Tom Rini <trini@konsulko.com>
17 months agoconfigs: enable poweroff command on QEMU ARM platforms
Heinrich Schuchardt [Fri, 13 Jan 2023 19:02:28 +0000 (20:02 +0100)]
configs: enable poweroff command on QEMU ARM platforms

Enable the sysreset based poweroff command. It invokes PSCI.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agovbe: Allow probing the VBE bootmeth to fail in OS fixup
Simon Glass [Thu, 12 Jan 2023 23:48:54 +0000 (16:48 -0700)]
vbe: Allow probing the VBE bootmeth to fail in OS fixup

This device is created when there are no bootmeths defined in the device
tree. But it cannot be probed without a device tree node.

For now, ignore a probe failure.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Karsten Merker <merker@debian.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Fixes: a56f663f0707 ("vbe: Add info about the VBE device to the fwupd node")
Tested-by: Vagrant Cascadian <vagrant@debian.org>
Tested-by: Karsten Merker <merker@debian.org>
17 months agotest: compression: add zstd uncompression test
Brandon Maier [Thu, 12 Jan 2023 16:27:46 +0000 (10:27 -0600)]
test: compression: add zstd uncompression test

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
17 months agolib: zstd: update to latest Linux zstd 1.5.2
Brandon Maier [Thu, 12 Jan 2023 16:27:45 +0000 (10:27 -0600)]
lib: zstd: update to latest Linux zstd 1.5.2

Update the zstd implementation to match Linux zstd 1.5.2 from commit
2aa14b1ab2.

This was motivated by running into decompression corruption issues when
trying to uncompress files compressed with newer versions of zstd. zstd
users also claim significantly improved decompression times with newer
zstd versions which is a side benefit.

Original zstd code was copied from Linux commit 2aa14b1ab2 which is a
custom-built implementation based on zstd 1.3.1. Linux switched to an
implementation that is a copy of the upstream zstd code in Linux commit
e0c1b49f5b, this results in a large code diff. However this should make
future updates easier along with other benefits[1].

This commit is a straight mirror of the Linux zstd code, except to:
- update a few #include that do not translate cleanly
  - linux/swab.h -> asm/byteorder.h
  - linux/limits.h -> linux/kernel.h
  - linux/module.h -> linux/compat.h
- remove assert() from debug.h so it doesn't conflict with u-boot's
  assert()
- strip out the compressor code as was done in the previous u-boot zstd
- update existing zstd users to the new Linux zstd API
- change the #define for MEM_STATIC to use INLINE_KEYWORD for codesize
- add a new KConfig option that sets zstd build options to minify code
  based on zstd's ZSTD_LIB_MINIFY[2].

These changes were tested by booting a zstd 1.5.2 compressed kernel inside a
FIT. And the squashfs changes by loading a file from zstd compressed squashfs
with sqfsload. buildman was used to compile test other boards and check for
binary bloat, as follows:

> $ buildman -b zstd2 --boards dh_imx6,m53menlo,mvebu_espressobin-88f3720,sandbox,sandbox64,stm32mp15_dhcom_basic,stm32mp15_dhcor_basic,turris_mox,turris_omnia -sS
> Summary of 6 commits for 9 boards (8 threads, 1 job per thread)
> 01: Merge branch '2023-01-10-platform-updates'
>        arm:  w+   m53menlo dh_imx6
> 02: lib: zstd: update to latest Linux zstd 1.5.2
>    aarch64: (for 2/2 boards) all -3186.0 rodata +920.0 text -4106.0
>        arm: (for 5/5 boards) all +1254.4 rodata +940.0 text +314.4
>    sandbox: (for 2/2 boards) all -4452.0 data -16.0 rodata +640.0 text -5076.0

[1] https://github.com/torvalds/linux/commit/e0c1b49f5b674cca7b10549c53b3791d0bbc90a8
[2] https://github.com/facebook/zstd/blob/f302ad8811643c428c4e3498e28f53a0578020d3/lib/libzstd.mk#L31

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
[trini: Set ret to -EINVAL for the error of "failed to detect
compressed" to fix warning, drop ZSTD_SRCSIZEHINT_MAX for non-Linux host
tool builds]
Signed-off-by: Tom Rini <trini@konsulko.com>
17 months agopatman: symlink top level .checkpatch.conf
Maxim Cournoyer [Fri, 13 Jan 2023 13:50:50 +0000 (08:50 -0500)]
patman: symlink top level .checkpatch.conf

This makes it possible to run the patman test suite simply by invoking
'pytest' from the patman sub-directory:

  $ cd tools/patman
  $ pytest

Otherwise, the top level .checkpatch.conf would be ignored and
multiple test_checkpatch.py tests would fail.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoRevert "patman: invoke the checkpatch.pl script with '--u-boot' and '--strict'"
Maxim Cournoyer [Fri, 13 Jan 2023 13:50:49 +0000 (08:50 -0500)]
Revert "patman: invoke the checkpatch.pl script with '--u-boot' and '--strict'"

This reverts commit 648d8186dd7f9c444fb07f355090d275dcdd4de4, because
it broke usage of patman on Linux, whose check script doesn't know
about '--strict' or '--u-boot'.

Reported-by: Sjoerd Simons <sjoerd@collabora.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Sjoerd Simons <sjoerd@collabora.com>
17 months agobinman: Support positioning an entry by and ELF symbol
Simon Glass [Wed, 11 Jan 2023 23:10:19 +0000 (16:10 -0700)]
binman: Support positioning an entry by and ELF symbol

In some cases it is useful to position an entry over the top of a symbol
in an ELF file. For example, if the symbol holds a version string then it
allows the string to be accessed from the fdtmap.

Add support for this.

Suggested-by: Pali Rohár <pali@kernel.org>
Suggested-by: Keith Short <keithshort@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agodtoc: Add a way to read a phandle with params
Simon Glass [Wed, 11 Jan 2023 23:10:18 +0000 (16:10 -0700)]
dtoc: Add a way to read a phandle with params

Add a function to read a phandle and associated name and offset. This is
useful for binman.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agobinman: Provide general support for updating ELF symbols
Simon Glass [Wed, 11 Jan 2023 23:10:17 +0000 (16:10 -0700)]
binman: Provide general support for updating ELF symbols

The current support for updating variables in a binary is hard-coded to
work with U-Boot:

- It assumes the image starts at __image_copy_start
- It uses the existing U-Boot-specific entry types

It is useful for other projects to use these feature.

Add properties to enable writing symbols for any blob, a way of specifying
the base symbol and a way of providing the ELF filename to allow symbol
lookup to take place.

With this it is possible to update a Zephyr image, such as zephyr.bin
after it has been built.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agobinman: Support overlapping entries
Simon Glass [Wed, 11 Jan 2023 23:10:16 +0000 (16:10 -0700)]
binman: Support overlapping entries

In some cases it is useful to have an entry overlap with another in a
section, either to update the contents within a blob, or to add an entry
to the fdtmap that covers only part of the blob.

Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agobinman: Add a function to check for special section nodes
Simon Glass [Wed, 11 Jan 2023 23:10:15 +0000 (16:10 -0700)]
binman: Add a function to check for special section nodes

This appears in two places in the code. Use a shared function instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agobinman: Add a null entry
Simon Glass [Wed, 11 Jan 2023 23:10:14 +0000 (16:10 -0700)]
binman: Add a null entry

It is sometimes useful to define an entry which does not have its own
contents but does appear in the image. The contents are set by the section
which contains it, even though it appears as an entry in the fdtmap.

Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agobinman: Clarify use of False when obtaining data
Simon Glass [Wed, 11 Jan 2023 23:10:13 +0000 (16:10 -0700)]
binman: Clarify use of False when obtaining data

This means that the data is not yet available. Update some comments to
make this clearer.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agobinman: Add a test for an inner section with a size
Simon Glass [Wed, 11 Jan 2023 23:10:12 +0000 (16:10 -0700)]
binman: Add a test for an inner section with a size

This is a slightly different scenario from the existing testSections
tests. Add a new test for it.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agorockchip: Drop the FIT generator script
Simon Glass [Sat, 7 Jan 2023 21:07:20 +0000 (14:07 -0700)]
rockchip: Drop the FIT generator script

This is not used anymore. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agorockchip: Convert all boards to use binman
Simon Glass [Sat, 7 Jan 2023 21:07:19 +0000 (14:07 -0700)]
rockchip: Convert all boards to use binman

Instead of the bash script, use binman to generate the FIT for arm64.

For 32-bit boards, use binman for all images, dropping the intermediate
files.

With this change, only Zynq is now using SPL_FIT_GENERATOR so update the
Kconfig rule accordingly.

Clean up the Makefile to the extent possible. Unfortunately, two boards
do not use SPL_FRAMEWORK so don't enable the u-boot.img rule:

   evb-rk3036
   kylin-rk3036

So a small remnant remains.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agorockchip: Support building the all output files in binman
Simon Glass [Sat, 7 Jan 2023 21:07:18 +0000 (14:07 -0700)]
rockchip: Support building the all output files in binman

Add the required binman images to replace the Makefile rules which are
currently used. This includes subsuming:

   - tpl/u-boot-tpl-rockchip.bin if TPL is enabled
   - idbloader.img if either or both of SPL and TPL are enabled
   - u-boot.itb if SPL_FIT is enabled
   - u-boot-rockchip.bin if SPL is used, either using u-boot.itb when
     SPL_FIT is enabled or u-boot.img when it isn't

Note that the intermediate files are dropped with binman, since it
producing everything in one pass. This means that
tpl/u-boot-tpl-rockchip.bin is not created, for example.

Note that for some 32-bit rk3288 boards, rockchip-optee.dtsi is included.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agorockchip: Use multiple-images for rk3399
Simon Glass [Sat, 7 Jan 2023 21:07:17 +0000 (14:07 -0700)]
rockchip: Use multiple-images for rk3399

Enable multiple-images so we can generate more than one image. Also
add a comment for the end of the #if block.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agorockchip: evb-rk3288: Drop raw-image support
Simon Glass [Sat, 7 Jan 2023 21:07:16 +0000 (14:07 -0700)]
rockchip: evb-rk3288: Drop raw-image support

This boards uses SPL_FIT so does not need to support loading a raw image.
Drop it to avoid binman trying to insert a symbol which has no value.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agobinman: Support optional external blobs
Simon Glass [Sat, 7 Jan 2023 21:07:15 +0000 (14:07 -0700)]
binman: Support optional external blobs

Some blobs are actually not necessary for the board to work correctly. Add
a property to allow this to be indicated. Missing optional blobs do not
cause a build failure.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agobinman: Support new op-tee binary format
Simon Glass [Sat, 7 Jan 2023 21:07:14 +0000 (14:07 -0700)]
binman: Support new op-tee binary format

OP-TEE has a format with a binary header that can be used instead of the
ELF file. With newer versions of OP-TEE this may be required on some
platforms.

Add support for this in binman. First, add a method to obtain the ELF
sections from an entry, then use that in the FIT support. We then end up
with the ability to support both types of OP-TEE files, depending on which
one is passed in with the entry argument (TEE=xxx in the U-Boot build).

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agobinman: Add a way to check for a valid ELF file
Simon Glass [Sat, 7 Jan 2023 21:07:13 +0000 (14:07 -0700)]
binman: Add a way to check for a valid ELF file

Add a function which checks whether data is in ELF format or not. This
will be used by binman to check this for entries.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agobinman: Support optional entries
Simon Glass [Sat, 7 Jan 2023 21:07:12 +0000 (14:07 -0700)]
binman: Support optional entries

Support entries which can be optional depending on their contents. This
allows special entry types which appear in the image only when needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agobinman: Use a reference for binman symbols docs
Simon Glass [Sat, 7 Jan 2023 21:07:11 +0000 (14:07 -0700)]
binman: Use a reference for binman symbols docs

Several etypes have this reference in their documentation. Now that we are
using rST, link to the section directly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
17 months agobinman: Update entry docs
Simon Glass [Sat, 7 Jan 2023 21:07:10 +0000 (14:07 -0700)]
binman: Update entry docs

These have got out of data recently. Regenerate them.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agobinman: Tidy up comment in fit _gen_node
Simon Glass [Sat, 7 Jan 2023 21:07:09 +0000 (14:07 -0700)]
binman: Tidy up comment in fit _gen_node

Expand this comment to cover both cases that are supported.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agobinman: Allow writing section contents to a file
Simon Glass [Sat, 7 Jan 2023 21:07:08 +0000 (14:07 -0700)]
binman: Allow writing section contents to a file

At present only the image (which is a section) has a filename. Move this
implementation to the entry_Section class so that any section can have a
filename. With this, the section data is written to a file.

This allows parts of an image to be written, along with the entire image.

Make a note that this can be used to include the contents of a section in
one image in another (later) image.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agodm: pinctrl: Revert "pinctrl: probe pinctrl drivers during post-bind"
Simon Glass [Wed, 21 Dec 2022 14:27:39 +0000 (07:27 -0700)]
dm: pinctrl: Revert "pinctrl: probe pinctrl drivers during post-bind"

This breaks chromebook_coral and it is also not how things should work. If
a board needs to bind GPIOs as part of a pinctrl driver this can be done
during the bind step, if needed.

We cannot probe pinctrl devices when binding as a rule, since it cannot be
supported on some platforms.

The bind and probe steps are separate in U-Boot and they should remain
separate.

This reverts commit f9ec791b5e24378b71590877499f8683d5f54dac.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agoRevert "fdtdec: drop needlessly convoluted CONFIG_PHANDLE_CHECK_SEQ"
Simon Glass [Wed, 21 Dec 2022 23:08:28 +0000 (16:08 -0700)]
Revert "fdtdec: drop needlessly convoluted CONFIG_PHANDLE_CHECK_SEQ"

The fdt_path_offset() function is slow since it must scan the tree.
This substantial overhead now applies to all boards.

The original code may not be ideal but it is fit for purpose and is only
needed on a few boards.

Reverting this reduces time to set up driver model by about 30ms.

Before revert:

Accumulated time:
                47,170  dm_r
                53,237  dm_spl
               572,986  dm_f

Accumulated time:
                44,598  dm_r
                50,347  dm_spl
               549,133  dm_f

This reverts commit 26f981f295d00351b6f0c69b5317b254b2361cc0.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agorockchip: Enable bootstage on rockpro64
Simon Glass [Sat, 7 Jan 2023 21:57:30 +0000 (14:57 -0700)]
rockchip: Enable bootstage on rockpro64

This board is useful for benchmarking overall U-Boot performance. Enable
the bootstage feature so we get a report.

Since this returns to the boot rom before finishing executing
board_init_r() in SPL, add a few bootstage calls so that we can collect
timing from TPL.

For the stash region, use a portion of SRAM, 64KB below the stack top.
This allows the TPL image to be up to nearly 120KB (it is typically about
64KB). SPL normally runs from SDRAM at 0, so can use the same stash
region.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agotrace: Don't require TIMER_EARLY
Simon Glass [Wed, 21 Dec 2022 23:08:26 +0000 (16:08 -0700)]
trace: Don't require TIMER_EARLY

Some platforms cannot honour this and don't need trace before relocation.
Use 'imply' instead, so boards can disable this.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agotrace: Update trace-format generator for newer version
Simon Glass [Wed, 21 Dec 2022 23:08:25 +0000 (16:08 -0700)]
trace: Update trace-format generator for newer version

This now includes flags and the layout has changed slightly in recent
versions of Linux. Update the generator accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agotrace: Adjust flags in proftool
Simon Glass [Wed, 21 Dec 2022 23:08:24 +0000 (16:08 -0700)]
trace: Adjust flags in proftool

The flags in this tool don't match the comments or help. Also the variable
names are quite confusing. Update them for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agomkimage: Add a few more messages for FIT failures
Simon Glass [Wed, 21 Dec 2022 23:08:23 +0000 (16:08 -0700)]
mkimage: Add a few more messages for FIT failures

Add messages to make it clearer which part of the FIT creation is failing.
This can happen when an invalid 'algo' property is provided in the .its
file.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agotrace: Move trace pointer to data section
Simon Glass [Wed, 21 Dec 2022 23:08:22 +0000 (16:08 -0700)]
trace: Move trace pointer to data section

This can be written before relocation. Move it to the data section, since
accessing BSS before relocation is not permitted.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agofdt: Check for overlapping data and FDT
Simon Glass [Wed, 21 Dec 2022 23:08:21 +0000 (16:08 -0700)]
fdt: Check for overlapping data and FDT

If the FDT overlaps with the data region of the image, or with the stack,
it can become corrupted before relocation. Add a check for this, behind a
debug flag, as it can be very confusing and time-consuming to debug.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agofdt: Pass the device tree to fdtdec_prepare_fdt()
Simon Glass [Wed, 21 Dec 2022 23:08:20 +0000 (16:08 -0700)]
fdt: Pass the device tree to fdtdec_prepare_fdt()

This function uses gd->fdt_blob a lot and cannot be used to check any
other device tree. Use a parameter instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agofdt: Drop ifdefs in fdtdec_prepare_fdt()
Simon Glass [Wed, 21 Dec 2022 23:08:19 +0000 (16:08 -0700)]
fdt: Drop ifdefs in fdtdec_prepare_fdt()

This function is a bit messy with several #ifdefs. Convert them to use C
for the conditions.

Rewrite the function comment since most of it is stale.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agofdt: Avoid exporting fdtdec_prepare_fdt()
Simon Glass [Wed, 21 Dec 2022 23:08:18 +0000 (16:08 -0700)]
fdt: Avoid exporting fdtdec_prepare_fdt()

This function is not used outside this file. Make it static.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agotpm: Add a proper Kconfig option for crc8 in SPL
Simon Glass [Sat, 7 Jan 2023 21:57:20 +0000 (14:57 -0700)]
tpm: Add a proper Kconfig option for crc8 in SPL

The current approach is a bit of a hack and only works for the tpm
subsystem. Add a Kconfig so that crc8 can be enabled in SPL for other
purposes.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agoarm: Support trace on armv8
Simon Glass [Wed, 21 Dec 2022 23:08:16 +0000 (16:08 -0700)]
arm: Support trace on armv8

Use the notrace attribute so that timer functions can be used when
tracing. This is required to avoid infinite loops when recording a trace.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agotrace: Use notrace for short
Simon Glass [Wed, 21 Dec 2022 23:08:15 +0000 (16:08 -0700)]
trace: Use notrace for short

The attribute syntax is quite verbose. Use the macro provided for this
purpose.

Signed-off-by: Simon Glass <sjg@chromium.org>
17 months agoconfigs: Increase malloc size after relocation
Neha Malcom Francis [Wed, 11 Jan 2023 12:41:23 +0000 (18:11 +0530)]
configs: Increase malloc size after relocation

Current default size of 0x100000 is not capable of getting the FIT
buffer during boot when transitioning to using binman generated boot
images for certain K3 devices, so increase it to 0x400000. Since A72 SPL
is coming after relocation to DDR this should not be an issue for any K3
device, so make it default for all.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Acked-by: Andrew Davis <afd@ti.com>
17 months agoconfigs: remove SDL2 dependency in tools-only_defconfig
Heinrich Schuchardt [Wed, 11 Jan 2023 06:43:30 +0000 (07:43 +0100)]
configs: remove SDL2 dependency in tools-only_defconfig

When building tools only there is no point in requiring the SDL2 library.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
17 months agofirmware: ti_sci: fix typo in boot authentication message name
Jorge Ramirez-Ortiz [Tue, 10 Jan 2023 17:29:48 +0000 (18:29 +0100)]
firmware: ti_sci: fix typo in boot authentication message name

Fix AUTH_BOOT message identifier (s/IMIAGE/IMAGE)

Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Acked-by: Andrew Davis <afd@ti.com>
17 months agotest/py: gpt: add test for the gpt partition type GUID identifier
Enric Balletbo i Serra [Tue, 10 Jan 2023 16:19:35 +0000 (17:19 +0100)]
test/py: gpt: add test for the gpt partition type GUID identifier

Add sandbox test for the gpt partition type command, the test uses the
persistent data test_gpt_disk_image.bin to check that the first
partition type GUID that identifies the type of the partition has the
"Linux filesystem data" type ( 0FC63DAF-8483-4772-8E79-3D69D8477DE4 ).

Signed-off-by: Enric Balletbo i Serra <eballetbo@redhat.com>
17 months agocmd: part: Add partition-related type command
Enric Balletbo i Serra [Tue, 10 Jan 2023 16:19:34 +0000 (17:19 +0100)]
cmd: part: Add partition-related type command

This implements the following command:

    part type mmc 0:1
      -> print partition type UUID
    part type mmc 0:1 uuid
      -> set environment variable to partition type UUID

"part type" can be useful when writing a bootcmd which searches for a
specific partition type to enable automatic discovery of partitions and
their intended usage or mount point.

Signed-off-by: Enric Balletbo i Serra <eballetbo@redhat.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Fix when CONFIG_PARTITION_TYPE_GUID is disabled and have the
command check for "types" before "type"]
Signed-off-by: Tom Rini <trini@konsulko.com>
17 months agodoc/README.gpt: Fix typo 'a optionnal'
Enric Balletbo i Serra [Tue, 10 Jan 2023 16:19:33 +0000 (17:19 +0100)]
doc/README.gpt: Fix typo 'a optionnal'

Change the string 'a optionnal' to 'an optional'.

Signed-off-by: Enric Balletbo i Serra <eballetbo@redhat.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agodoc: man-page for the part command
Enric Balletbo i Serra [Tue, 10 Jan 2023 16:19:32 +0000 (17:19 +0100)]
doc: man-page for the part command

Provide a man-page for the part command.

Signed-off-by: Enric Balletbo i Serra <eballetbo@redhat.com>
17 months agoARM: configs: npcm7xx: add full function for nuvoton npcm750
Jim Liu [Tue, 10 Jan 2023 03:04:12 +0000 (11:04 +0800)]
ARM: configs: npcm7xx: add full function for nuvoton npcm750

Add add full function config for nuvoton npcm750

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
17 months agotest: compression: use sizeof() instead of magic numbers
Brandon Maier [Mon, 9 Jan 2023 18:42:58 +0000 (12:42 -0600)]
test: compression: use sizeof() instead of magic numbers

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
17 months agomusb-new: omap2430: fix compiling in DM_USB_GADGET config
Andreas Kemnade [Mon, 9 Jan 2023 07:13:31 +0000 (08:13 +0100)]
musb-new: omap2430: fix compiling in DM_USB_GADGET config

Add the separate IRQ handling function and change the registration.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
17 months agomusb-new: omap2430: no host data access in gadget mode
Andreas Kemnade [Mon, 9 Jan 2023 07:13:30 +0000 (08:13 +0100)]
musb-new: omap2430: no host data access in gadget mode

Avoid accessing structures (usb_bus_priv) only present when musb is
in host mode.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
17 months agoevent: Correct dependencies on the EVENT framework
Tom Rini [Mon, 16 Jan 2023 20:46:49 +0000 (15:46 -0500)]
event: Correct dependencies on the EVENT framework

The event framework is just that, a framework. Enabling it by itself
does nothing, so we shouldn't ask the user about it. Reword (and correct
typos) around this the option and help text. This also applies to
DM_EVENT and EVENT_DYNAMIC. Only EVENT_DEBUG and CMD_EVENT should be
visible to the user to select, when EVENT is selected.

With this, it's time to address the larger problems. When functionality
uses events, typically via EVENT_SPY, the appropriate framework then
must be select'd and NOT imply'd. As the functionality will cease to
work (and so, platforms will fail to boot) this is non-optional and
where select is appropriate. Audit the current users of EVENT_SPY to
have a more fine-grained approach to select'ing the framework where
used. Also ensure the current users of event_register and also select
EVENT_DYNAMIC.

Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reported-by: Oliver Graute <Oliver.Graute@kococonnector.com>
Reported-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
Fixes: 42fdcebf859f ("event: Convert misc_init_f() to use events")
Fixes: c5ef2025579e ("dm: fix DM_EVENT dependencies")
Signed-off-by: Tom Rini <trini@konsulko.com>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Fabio Estevam <festevam@denx.de>
17 months agox86: Fix saying arch_cpu_init_dm in debug/docs
Tom Rini [Sat, 14 Jan 2023 20:49:35 +0000 (15:49 -0500)]
x86: Fix saying arch_cpu_init_dm in debug/docs

The function arch_cpu_init_dm was renamed to fsp_setup_pinctrl in these
cases, so rename debug / docs to match.

Cc: Simon Glass <sjg@chromium.org>
Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agocmd: event: Remove additional event description
Michal Simek [Tue, 17 Jan 2023 10:44:45 +0000 (11:44 +0100)]
cmd: event: Remove additional event description

The first name is taken from command name that's why shouldn't be listed in
help. The similar change was also done by commit a84d3b6c5634 ("cmd: pwm:
Remove additional pwm description").
Also remove additional spaces in help message.

Before:
event event list   - list event spies

After:
event list   - list event spies

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months ago.mailmap: update e-mail address for Eugen Hristev
Eugen Hristev [Wed, 18 Jan 2023 15:54:44 +0000 (17:54 +0200)]
.mailmap: update e-mail address for Eugen Hristev

Update e-mail address.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
18 months agoMerge branch '2022-01-16-bootstd-updates'
Tom Rini [Tue, 17 Jan 2023 13:55:40 +0000 (08:55 -0500)]
Merge branch '2022-01-16-bootstd-updates'

To quote the author:
So far standard boot lacks a boot menu, although it is possible to create
a rudimentary one using the existing 'bootmenu' command.

Even then, this text-based menu offer only basic functionality and does
not take full advantage of the displays which are common on many devices.

This series provides a 'bootflow menu' command which allows the user to
select from the available bootflows. An attempt is made to show the name
of the available operating systems, by reading more information into the
bootflow. A logo can be read also, where supported, so that this can be
presented to the user when an option is highlighted.

Full use is made of TrueType fonts, if enabled. For cases where only a
serial console is available, it falls back to a simple text-based menu.

All of this is implementing using a new 'expo' construct, a collection of
scenes (like menu screens) which can be navigated by the user to view
information and select options. This is fairly general and should be able
to cope with a wider array of use cases, with less hacking of the menu
code, such as is currently needed for CMD_BOOTEFI_BOOTMGR.

Of course it would be possible to enhance the existing menu rather than
creating a new setup. Instead it seems better to make the existing menu
use expo, if code space permits. It avoids the event-loop problem and
should be more extensible, given its loosely coupled components and use of
IDs instead of pointers. Further motivation is provided in the
documentation.

For now the CLI keypress-decoding code is split out to be used by the new
menu. The key codes defined by menu.h are reused also.

This is of course just a starting point. Some ideas for future work are
included in the documentation.

18 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Tue, 17 Jan 2023 13:10:56 +0000 (08:10 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- kirkwood: Convert to DM Serial for various Kirkwood boards (Tony)
- orion-timer: Fix problem in early_init_done() (Stefan)

18 months agoarm: kirkwood: Convert to DM Serial for various Kirkwood boards
Tony Dinh [Fri, 30 Dec 2022 05:45:57 +0000 (21:45 -0800)]
arm: kirkwood: Convert to DM Serial for various Kirkwood boards

For Kirkwood boards, it is necessary to have early malloc in DRAM area
when Driver Model for Serial is enabled. Please see Michael's patch here:
https://lore.kernel.org/u-boot/20220817193809.1059688-20-michael@walle.cc/

This patch enables the early malloc in DRAM for all Kirkwood boards.
Note that this will work for boards that have either non-DM serial
and DM_SERIAL. Also, add the CONFIG_KIRKWOOD_COMMON option to enable
DM_SERIAL as a common option for boards that have been tested.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
18 months agotimer: orion-timer: Fix problem in early_init_done()
Stefan Roese [Mon, 16 Jan 2023 08:01:48 +0000 (09:01 +0100)]
timer: orion-timer: Fix problem in early_init_done()

It was noticed that Clearfog is currently broken with this newly
introduced early_init_done() function. Apparently the timer is enabled
here when U-Boot is run but not configured - at least not correctly.
Resulting in a hangup in the timer reading functions.

To fix this, also read the value of the reload register and check it's
value with the one written to by U-Boot. Only if this matches, the
init has already been done.

Fixes: 5387b093cb79 ("timer: orion-timer: Fix problem with early static variable")
Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Pali Rohár <pali@kernel.org>
Cc: Martin Rowe <martin.p.rowe@gmail.com>
Cc: Tony Dinh <mibodhi@gmail.com>
Cc: Pali Rohár <pali@kernel.org>
Cc: Michael Walle <michael@walle.cc>
18 months agoMerge tag 'u-boot-rockchip-20230117' of https://source.denx.de/u-boot/custodians...
Tom Rini [Tue, 17 Jan 2023 01:58:37 +0000 (20:58 -0500)]
Merge tag 'u-boot-rockchip-20230117' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- Add support for rv1126 soc and rv1126 neu2 io board;
- Add support for rk3399 pine64 pinephone pro board;
- dts sync from linux for rk3399 and px30;
- Add support for PX30 Ringneck SoM board;

18 months agoexpo: Add documentation
Simon Glass [Fri, 6 Jan 2023 14:52:43 +0000 (08:52 -0600)]
expo: Add documentation

Add some documentation for the expo feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agobootstd: Support setting a theme for the menu
Simon Glass [Fri, 6 Jan 2023 14:52:42 +0000 (08:52 -0600)]
bootstd: Support setting a theme for the menu

Allow a theme to be set. For now this is very simple, just a default font
size to use for all elements.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agobootstd: Add a test for the bootstd menu
Simon Glass [Fri, 6 Jan 2023 14:52:41 +0000 (08:52 -0600)]
bootstd: Add a test for the bootstd menu

Add a test which checks that two operating systems can be displayed in a
menu, allowing one to be selected.

Enable a few things on snow so that the unit tests build.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agobootstd: Support creating a boot menu
Simon Glass [Fri, 6 Jan 2023 14:52:40 +0000 (08:52 -0600)]
bootstd: Support creating a boot menu

Create an expo to handle the boot menu. For now this is quite simple, with
just a header, some menu items and a pointer to show the current one.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoexpo: Add basic tests
Simon Glass [Fri, 6 Jan 2023 14:52:39 +0000 (08:52 -0600)]
expo: Add basic tests

Add some tests for the expo, including setting up and rendering an expo.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoexpo: Add support for scene menus
Simon Glass [Fri, 6 Jan 2023 14:52:38 +0000 (08:52 -0600)]
expo: Add support for scene menus

A menu is a key part of the expo design. It consists of a number of items
which the user can select from.

Add the initial implementation of this.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoexpo: Add support for scenes
Simon Glass [Fri, 6 Jan 2023 14:52:37 +0000 (08:52 -0600)]
expo: Add support for scenes

A scene is a single screen within an expo. It is possible to move between
scenes but only one can be displayed at once.

Add a basic implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoexpo: Add basic implementation
Simon Glass [Fri, 6 Jan 2023 14:52:36 +0000 (08:52 -0600)]
expo: Add basic implementation

An expo is a way of presenting and collecting information from the
user. It consists of a collection of 'scenes' of which only one is
presented at a time. An expo is typically used to show a boot menu
and allow settings to be changed.

One created, the same expo can be automatically presented in graphical
form using a vidconsole, or in text form on a serial console.

Add an initial implementation of the expo itself. Supports for scenes
and objects is provided later.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agomenu: Factor out menu-keypress decoding
Simon Glass [Fri, 6 Jan 2023 14:52:35 +0000 (08:52 -0600)]
menu: Factor out menu-keypress decoding

Move this code into a separate function so that it can be used in the new
VBE menu.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agobootstd: Allow reading a logo for the OS
Simon Glass [Fri, 6 Jan 2023 14:52:34 +0000 (08:52 -0600)]
bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agobootstd: Read the Operating System name for distro/scripts
Simon Glass [Fri, 6 Jan 2023 14:52:33 +0000 (08:52 -0600)]
bootstd: Read the Operating System name for distro/scripts

Add the concept of an OS name to the bootflow. This typically includes the
OS name, version and kernel version.

Implement this for the distro and script bootmeths so that it works with
Armbian and older version of Fedora.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agovideo: Add font functions to the vidconsole API
Simon Glass [Fri, 6 Jan 2023 14:52:32 +0000 (08:52 -0600)]
video: Add font functions to the vidconsole API

Support for fonts currently depends on the type of vidconsole in use. Add
two new methods to enumerate fonts and to set the font.

Fix a few other method comments while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agovideo: Fix unchnaged typo
Simon Glass [Fri, 6 Jan 2023 14:52:31 +0000 (08:52 -0600)]
video: Fix unchnaged typo

Fix this typo in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
18 months agovideo: truetype: Rename the metrics function
Simon Glass [Fri, 6 Jan 2023 14:52:30 +0000 (08:52 -0600)]
video: truetype: Rename the metrics function

This should really have a 'truetype' prefix. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agovideo: Enable VIDEO_ANSI by default only with EFI
Simon Glass [Fri, 6 Jan 2023 14:52:29 +0000 (08:52 -0600)]
video: Enable VIDEO_ANSI by default only with EFI

This is not generally needed unless EFI_LOADER is used. Adjust the default
setting to reduce the size of the U-Boot build.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoimage: Move common image code to image_board and command
Simon Glass [Fri, 6 Jan 2023 14:52:28 +0000 (08:52 -0600)]
image: Move common image code to image_board and command

We should use the cmd/ directory for commands rather than for common code
used elsewhere in U-Boot. Move the common 'source' code into
image-board.c to achieve this.

The image_source_script() function needs to call run_command_list()  so
seems to belong better in the command library. Move and rename it.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agoimage: Add a function to find a script in an image
Simon Glass [Fri, 6 Jan 2023 14:52:27 +0000 (08:52 -0600)]
image: Add a function to find a script in an image

Split this functionality out of the 'source' command so it can be used
from another place. For now leave it where it is, but a future patch will
move it out of cmd/

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agomenu: Make use of CLI character processing
Simon Glass [Fri, 6 Jan 2023 14:52:26 +0000 (08:52 -0600)]
menu: Make use of CLI character processing

Avoid duplicating some of the escape-sequence processing here and use the
CLI function instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agomenu: Use a switch statement
Simon Glass [Fri, 6 Jan 2023 14:52:25 +0000 (08:52 -0600)]
menu: Use a switch statement

Convert the long line of if() statements to a switch() since this makes
better use of the C language.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agomenu: Update bootmenu_loop() to return the code
Simon Glass [Fri, 6 Jan 2023 14:52:24 +0000 (08:52 -0600)]
menu: Update bootmenu_loop() to return the code

Use the return value to save having to pass around a pointer. This also
resolves any ambiguity about what *key contains when the function is
called.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agomenu: Update bootmenu_autoboot_loop() to return the code
Simon Glass [Fri, 6 Jan 2023 14:52:23 +0000 (08:52 -0600)]
menu: Update bootmenu_autoboot_loop() to return the code

Use the return value to save having to pass around a pointer. This also
resolves any ambiguity about what *key contains when the function is
called.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agomenu: Rename KEY_... to BKEY_...
Simon Glass [Fri, 6 Jan 2023 14:52:22 +0000 (08:52 -0600)]
menu: Rename KEY_... to BKEY_...

This enum values conflict with linux/input.h so rename them.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agobootmenu: Add a few comments
Simon Glass [Fri, 6 Jan 2023 14:52:21 +0000 (08:52 -0600)]
bootmenu: Add a few comments

The behaviour of these two functions is completely undocumented. Add some
notes so the poor, suffering dev can figure out what is going on.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agocli: Move readline character-processing to a state machine
Simon Glass [Fri, 6 Jan 2023 14:52:20 +0000 (08:52 -0600)]
cli: Move readline character-processing to a state machine

The current cread_line() function is very long. It handles the escape
processing inline. The menu command does similar processing but at the
character level, so there is some duplication.

Split the character processing into a new function cli_ch_process() which
processes individual characters and returns the resulting input character,
taking account of escape sequences. It requires the caller to set up and
maintain its state.

Update cread_line() to use this new function.

The only intended functional change is that an invalid escape sequence
does not add invalid/control characters into the input buffer, but instead
discards these.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agosandbox: Enable mmc command and legacy images
Simon Glass [Fri, 6 Jan 2023 14:52:19 +0000 (08:52 -0600)]
sandbox: Enable mmc command and legacy images

The mmc command is useful for testing mmc disk images in sandbox, so
enable it. We also need to enable legacy images so that we can run tests
which use them.

Disable it for a few avb tests since MMC is not implemented there yet.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agorockchip: add support for PX30 Ringneck SoM on Haikou Devkit
Quentin Schulz [Mon, 9 Jan 2023 10:36:45 +0000 (11:36 +0100)]
rockchip: add support for PX30 Ringneck SoM on Haikou Devkit

The PX30-µQ7 (Ringneck) is a system-on-module featuring the Rockchip
PX30 in a micro Qseven-compatible form-factor.

PX30-µQ7 features:
        * CPU: quad-core Cortex-A35
        * DRAM: 2GB dual-channel
        * eMMC: onboard eMMC
        * SD/MMC
        * TI DP83825I 10/100Mbps PHY
        * USB:
                * USB2.0 dual role port
                * 3x USB2.0 host via onboard USB2.0 hub
        * Display: MIPI-DSI
        * Camera: MIPI-CSI
        * onboard 2.4GHz WiFi + Bluetooth module
        * Companion Controller: on-board additional microcontroller
  (STM32 Cortex-M0 or ATtiny):
                * RTC
                * fan controller
                * CAN (only STM32)

The non-U-Boot DTS files are imported from Linux v6.2-rc2.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
18 months agoarm64: dts: rockchip: sync px30 DTSI with Linux kernel v6.1
Quentin Schulz [Mon, 9 Jan 2023 10:36:44 +0000 (11:36 +0100)]
arm64: dts: rockchip: sync px30 DTSI with Linux kernel v6.1

Sync the px30 dtsi from Linux kernel v6.1.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
18 months agorockchip: px30: insert u-boot, spl-boot-device into U-Boot device tree
Quentin Schulz [Mon, 9 Jan 2023 10:36:43 +0000 (11:36 +0100)]
rockchip: px30: insert u-boot, spl-boot-device into U-Boot device tree

It is possible to boot U-Boot proper from a different storage medium
than the one used by the BOOTROM to load the SPL. This information is
stored in the u-boot,spl-boot-device Device Tree property and is
accessible from U-Boot proper so that it has knowledge at runtime where
it was loaded from.

Let's add support for this feature for px30.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
18 months agorockchip: px30: list possible SPL boot devices
Quentin Schulz [Mon, 9 Jan 2023 10:36:42 +0000 (11:36 +0100)]
rockchip: px30: list possible SPL boot devices

BOOTROM sets a bit in a CPU register so that the software can know from
where the first stage bootloader was booted. One use case for this is to
specify the default loading medium for U-Boot proper to match the one
used by the BOOTROM to load the SPL (same-as-spl in
u-boot,spl-boot-order).

Let's create the mapping between BOOTROM value and Device Tree node
names for MMC devices.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>