Commit Graph

1590 Commits

Author SHA1 Message Date
Greg Malysa
bcdd02328e build: Revive and update LDR format support
LDR format files are used primarily by Analog Devices processors but may
be of interest to other vendors. Previously support existed for this
format as part of the U-Boot build, but it has been unmaintained and
unused for a long time. In preparation for adding support for modern ADI
processors that use LDR, modernize the LDR support:

- Introduce CONFIG_LDR_CPU as the CPU string recognized by the LDR tool
  may not be the same as CONFIG_CPU
- Add an SPL target that repackages u-boot-spl inside an LDR file

An almost identical target for packaging u-boot into an LDR file already
exists and did not need to be created.

Co-developed-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Signed-off-by: Ian Roberts <ian.roberts@timesys.com>
Signed-off-by: Greg Malysa <greg.malysa@timesys.com>
2024-04-10 09:34:53 -06:00
Tom Rini
e8ff287595 scripts/Makefile.spl: Use 'sort' in SHRUNK_ARCH_DTB rule
With configs such as "am64x_evm_a53" or "imx8mp_venice" which list
multiple device trees to build we get a warning such as:
scripts/Makefile.spl:578: target 'spl/dts/freescale/' given more than once in the same rule

If we sort this list first the warning goes away.

Tested-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-04-10 09:34:53 -06:00
Sam Protsenko
56041aa545 Makefile: Improve generated_defconfig file handling
Commit 2027e99e61 ("Makefile: Run defconfig files through the C
preprocessor") adds `generated_defconfig' file, but fails to clean that
up. It might be useful to have that file around after `make' is done,
but it's better to clean that up on `make clean'. Also we probably want
to hide it in `git status' list. This patch makes the described changes,
and also adds `-P' parameter to the CPP command that produces the
`generated_defconfig' to avoid generating linemarkers.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Fixes: 2027e99e61 ("Makefile: Run defconfig files through the C preprocessor")
Acked-by: Andrew Davis <afd@ti.com>
2024-03-13 18:47:11 -04:00
Tom Rini
20a0ce574d Prepare v2024.04-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmXvO2YACgkQFHw5/5Y0
 tyxRagwAtLBR/yehfOY5Zw3dKf8kREedas500ueg7nSwV+V2CZO+cwFLrtSVJhXu
 p6dtX0QZxCYidTfaoUOfGLwgvrJoXD/iY6ws8dzVMa9IX2ez3uZDlsPmQG/y2U4i
 rtDn9YgV8oAnLk4hFaaE5vhWfUmtSy6SvJ/foFeQT0B9Er14ep5AII8L/nUcP53w
 FbJ8UVF92i44+zG/0EjpG2pZeftztnVP4YVhU+mbmLLKP49sbrVwFRlo5t+VlB/j
 Q1/RCgxGMPsUG3iNWqIl6rA3VElcZbUm8+YcAy6GqTLOXPxydwBnZVS5UgYapg7y
 Yqu3IMm0LGdXp4klYcdz0tesuFHWan+j227Tme9OLmHgBYBo1WO6zDCITOW1uNVe
 tf3QjIVlrMV4/zglHP/2iceBO1sS49TuzjctCdEBKXb7vZISxgxS7QwmGVVHeigw
 zF4tw0uuzldi+e1yv9rleTIJBN+OuPqUhsyda2Fxq5a2hKW90hv33zzb7ZN5ZvVm
 GlEzhZ6c
 =CqvA
 -----END PGP SIGNATURE-----

Merge tag 'v2024.04-rc4' into next

Prepare v2024.04-rc4
2024-03-11 15:27:20 -04:00
Tom Rini
bd465ada0e Merge branch '2024-03-02-assorted-updates' into next
- Assorted MediaTek, ASPEED, xenguest, s5p4418 and qemu-arm fixes
- Assorted test fixes/updates/additions.
- A few bootstd/related fixes.
- Remove common.h from some files
- Drop reiserfs
- A few other assorted fixes throughout the tree.
2024-03-04 10:25:47 -05:00
Bryan Brattlof
bdbbf1d7b5 Makefile: remove hardcoded device tree source directory
Some boards that choose to utilize the OF_UPSTREAM directory for their
device tree files will need to specify that directory instead of the
traditional arch/$(ARCH)/dts/* path.

Include the correct path to the board's dtbs depending on if OF_UPSTREAM
is selected or not.

Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Fabio Estevam <festevam@gmail.com>
2024-03-04 09:01:27 -05:00
Dragan Simic
5b3f9698c1 scripts: dtc-version: Don't show error messages
Prevent the error messages produced by which(1), such as the one quoted
below, from being visible in the build outputs.

    which: no dtc in (./scripts/dtc)

This makes the build outputs look a tiny bit cleaner.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2024-03-02 12:25:20 -05:00
Florian Schmaus
d4c84d7062 pylibfdt: Fix "invalid escape sequence '\w'" in setup.py
Once u-boot's build system invokes

python3 scripts/dtc/pylibfdt/setup.py --quiet build_ext --inplace

it may fail with

scripts/dtc/pylibfdt/setup.py:40: SyntaxWarning: invalid escape sequence '\w'
  RE_KEY_VALUE = re.compile('(?P<key>\w+) *(?P<plus>[+])?= *(?P<value>.*)$')

depending on the used Python version.

Explicitly mark the regex string as raw string to avoid the warning.

Signed-off-by: Florian Schmaus <flo@geekplace.eu>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-03-01 09:53:47 -05:00
Sumit Garg
3a4e5944c9 Makefile: Allow upstream DT subtree to provide DT includes
Allow platforms to reuse DT headers and dtsi includes directly form
upstream DT subtree which will be frequently synced with Linux kernel.
This will further allow us to drop corresponding DT includes copy from
U-Boot tree.

Also, since the DT includes from upstream DT subtree are done after DT
includes from U-Boot tree, so it shouldn't cause any conflicts.

Tested-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29 22:24:05 -05:00
Sumit Garg
df6fb77c98 scripts/Makefile.lib: Statically define *-u-boot.dtsi files location
Allow u-boot to build DTB from a different directory tree such that
*-u-boot.dtsi files can be included from a common location. Currently
that location is arch/$(ARCH)/dts/, so statically define that common
location.

This is needed for platform owners to start building DTB files from
devicetree-rebasing directory but still being able to include
*-u-boot.dtsi files.

Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29 22:24:05 -05:00
Sumit Garg
4be3fe9d80 Makefile: Add support for DT bindings schema checks
This adds the build infrastructure for checking DT binding schema
documents and validating dtb files using the binding schema. Here we use
devicetree-rebasing subtree to provide the DT bindings. Along with that
adapt dts/upstream/Bindings/Makefile to align with old U-Boot Kbuild
infrastructure.

Dependency:
-----------

The DT schema project must be installed in order to validate the DT schema
binding documents and validate DTS files using the DT schema. The DT schema
project can be installed with pip::

    pip3 install dtschema

Note that 'dtschema' installation requires 'swig' and Python development
files installed first. On Debian/Ubuntu systems::

    apt install swig python3-dev

Testing:
--------

Build dts files and check using DT binding schema:
$ make dtbs_check

Optionally, DT_SCHEMA_FILES can be passed in with a schema file(s) to
use for validation. This makes it easier to find and fix errors
generated by a specific schema.

Note, at this point dtbs_check is an optional build target as there are
many warnings generated due to custom DT properties used by many
platforms in u-boot. It is expected with these checks that compliance
with DT bindings to take place. Once that's done it can be added to CI
builds to remain compliant with DT bindings.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-02-29 22:24:05 -05:00
Tom Rini
bcd8bce57c kbuild: Allow for CONFIG_SYS_CONFIG_NAME to be unset
It is possible to have a platform which does not require a board.h file
to build, but today we need an empty one for our generated config.h file
to be valid. Allow for omitting this file if CONFIG_SYS_CONFIG_NAME is
not set.

Signed-off-by: Tom Rini <trini@konsulko.com>
2024-02-27 14:18:30 -05:00
Brandon Maier
cb6f4d6510 scripts/gen_compile_commands: update to Linux v6.7
Adds support for assembly files and updates the LINE_PATTERN so it
supports both "cmd" and "savedcmd", which allows reverting the U-Boot
modification in commit 97fbb2eb01 ("scripts/gen_compile_commands.py:
adapt _LINE_PATTERN").

Upstream commits:

- 880946158b011 gen_compile_commands.py: fix path resolve with symlinks in it
- 9e56d3be4bfd2 gen_compile_commands: Sort output compile commands by file name
- 52c15e7e79285 gen_compile_commands: Allow the line prefix to still be cmd_
- 1c67921444bf6 gen_compile_commands: add assembly files to compilation database

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
Cc: Joao Marcos Costa <jmcosta944@gmail.com>
2024-02-06 16:31:06 -05:00
Anthony Loiseau
46371f2699 get_maintainer.pl: slightly modify penguin_chief
Penguin chiefs are actually stripped out from get_maintainer results unless
--git-chief-penguins is provided, which appends them to all results instead.

This is a issue for U-Boot since Tom Rini (penguin chief) is also maintainer
of some sub-trees ("ARM", "ARM TI" and "THE REST").

Hopefully, this match is performed case-senditive over name and email,
therefore upper-casing Tom Rini last name workarounds the issue.

Important note: This also fixes "THE REST" catch all section resulting
in Tom Rini listed as (maintainer:THE REST) for all files. Hope there is not
too much developers scripting their patch email header from get_maintainer.pl
output, otherwise Tom Rini may be flooded.

Cc: Tom Rini <trini@konsulko.com>
Signed-off-by: Anthony Loiseau <anthony.loiseau@allcircuits.com>
2024-01-18 20:24:13 -05:00
Andrew Davis
2027e99e61 Makefile: Run defconfig files through the C preprocessor
This allows us to use some of the normal preprocessor directives inside
defconfig files. Such as #define and #include.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
2024-01-12 08:34:19 -05:00
Simon Glass
aca95282c1 Makefile: Use the fdtgrep -u flag
Use this flag so that the bootph binding is obeyed correctly.

Add a comment about what is going on.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/12
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-12-31 07:21:02 -07:00
Simon Glass
0b2e47be2c sandbox: Correct SPL condition for building devicetree
With sandbox, CONFIG_SANDBOX is y so the current rule ends up building
the devicetree for only those SPL builds where it is unwanted.

Correct the condition. This allows sandbox_vpl to produce a
u-boot-vpl.dtb file.

Fixes: e7fb789612 ("sandbox: Remove OF_HOSTFILE")

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-12-31 07:21:02 -07:00
Tom Rini
1373ffde52 Prepare v2024.01-rc5
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmWARagACgkQFHw5/5Y0
 tyyB/gv9HPhYpvmGi8GcqmlQ2Y2fDr5c5Tti0BUMtMzLGM/J8CEcfSF4oPmdPy3f
 NHHWlCTzO8HHtoCZg1h5NknbrFaYVFdrKAV/Vy7JDH9J+/uEd39i6UJUO3TkIcpr
 Ykb6eXL1OdTnjVFOs3VPcLc93No3Rb3chC1aqb447r1rgWc+uqyZcQrdDMyko6sh
 e0l+JRlpi0xprwF5/THKbNdnU4XrryRtienpFclzSwrAzz3vuoUteqRwQY7auttz
 RQMlTQooV1D73bOc2kZjLKH5xXdjU3bT9PetR/mHkzCDa6xbNy/OWxnpS8b4+dVh
 cjTpeHcgDIRjtOv9kmi4fZPt4865KxJ5jk8WCCfOwPRlgUe0q3tJgEQMBy3fEgNw
 BmnzLVqpHAAMQZDx93D8RxdzyiInGATIMfdFFPQ04R/UqNCO3XmSnHno4CZ/lm4w
 fjiP7NgwKe7rnXNbhCdBEmZqfwb7MA5RQ5/zxsdbeIuk5tOIMi7nBa+CNLUGD7bh
 6QGsTrYf
 =lS+J
 -----END PGP SIGNATURE-----

Merge tag 'v2024.01-rc5' into next

Prepare v2024.01-rc5
2023-12-18 09:55:32 -05:00
Simon Glass
01feeec559 tools/make_pip: Add mention of u_boot_pylib in tool list
This is not a tool but it is handled by the script, so update the help
to include it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-12-13 18:39:06 -05:00
Simon Glass
f12465ce91 tools: Keep test_util and patman test files in the pip release
The test_util module is actually imported by some tools, e.g. binman so
include it in the pip release.

The patman tool uses its test code when starting up, so keep that too.

Show a list of deleted files so it is clear what is happening.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-12-13 18:39:06 -05:00
Masahisa Kojima
f32fee0359 scripts/Makefile.lib: print error when no public key is specified
The current build system embeds the EFI Signature List(ESL)
into the dtb to be used in the EFI capsule authentication.
This ESL file is specified through the CONFIG_EFI_CAPSULE_ESL_FILE
Kconfig option. If CONFIG_EFI_CAPSULE_ESL_FILE is not specified,
U-boot build ends up with failure but the cause of failure is not
easily understandable. Current error message is as follows.

FATAL ERROR: Error reading file into data: Is a directoryCheck /home/ubuntu/src/ledge/u-boot/arch/arm/dts/.synquacer-sc2a11-developerbox.dtb.pre.tmp for errors
make[2]: *** [scripts/Makefile.lib:355: arch/arm/dts/synquacer-sc2a11-developerbox.dtb] Error 1
make[1]: *** [dts/Makefile:44: arch-dtbs] Error 2
make: *** [Makefile:1165: dts/dt.dtb] Error 2
make: *** Waiting for unfinished jobs....

This commit shows the error message that CONFIG_EFI_CAPSULE_ESL_FILE
must be specified when the EFI capsule authentication is enabled, then
terminate the build with error.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Weizhao Ouyang <o451686892@gmail.com>
2023-12-05 01:38:56 +01:00
Nishanth Menon
a94a4071d4 tree-wide: Replace http:// link with https:// link for ti.com
Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-10 11:01:50 -05:00
Tom Rini
9f33914004 get_maintainer.pl: update from Linux kernel v6.5
Update U-Boot's version of scripts/get_maintainer.pl to sync it up with
the latest changes to the Linux kernel's version of the same script.

The last sync was with Linux kernel version v5.13-rc6. The commits to
the kernel's get_maintainer.pl since then (starting with the most
recent) are:
        11fb48961e52 get_maintainer: Honor mailmap for in file emails
        26d98e9f78da get_maintainer: don't remind about no git repo when --nogit is used

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-10-30 15:32:49 -04:00
Tom Rini
a8384f8da1 checkpatch.pl: Make common.h check boarder
At this point in time we should not add common.h to any new files, so
make checkpatch.pl complain.

Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2023-10-24 16:34:45 -04:00
Joao Marcos Costa
311df90b3e scripts/gen_compile_commands: fix usage message
Replace mentions to 'kernel' by 'U-Boot' to avoid confusion.

Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com>
Tested-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2023-10-11 13:24:55 -04:00
Joao Marcos Costa
3a83960b76 doc: add documentation for gen_compile_commands.py
This documentation briefly explains what is a compilation database,
and how to use the script to generate one.

This is not a portage, as there was no original documentation in the
Linux sources.

Acknowledge the documentation in the script's header and in doc/build
index.

Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com>
Tested-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2023-10-11 13:24:55 -04:00
Joao Marcos Costa
6aacad2d53 scripts/gen_compile_commands.py: add acknowledgments
Add acknowledgments for porting and modifying the script. Of course, the
license, author, and copyright notice remain the same as in the original
script.

Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com>
Tested-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2023-10-11 13:24:23 -04:00
Joao Marcos Costa
0972675dfb scripts/gen_compile_commands.py: fix docstring
The referred tool is now in U-Boot. Replace "the Linux kernel" by
"U-Boot" to make the docstring coherent.

Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com>
Tested-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2023-10-11 13:24:23 -04:00
Joao Marcos Costa
97fbb2eb01 scripts/gen_compile_commands.py: adapt _LINE_PATTERN
For U-Boot's context, the regular expression defined by _LINE_PATTERN
should be adapted. Replace 'savedcmd' by 'cmd'.

Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com>
Tested-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2023-10-11 13:24:23 -04:00
Joao Marcos Costa
c852f2e74c scripts: Port Linux's gen_compile_commands.py to U-Boot
This script generates a database of compiler flags, namely
compile_commands.json. It is quite useful for text editors that use
clangd LSP (e.g. Vim, Neovim).

It was ported from Linux's sources:
- tag: v6.4
- revision 6995e2de6891c724bfeb2db33d7b87775f913ad1

Modifications for U-Boot compatibility will be added in a follow-up
commit.

Signed-off-by: Joao Marcos Costa <jmcosta944@gmail.com>
Tested-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2023-10-11 13:24:23 -04:00
Lars Feyaerts
814774c076 checkpatch: skip fdtdec_* check for tools
Have checkpatch.pl skip warnings for use of fdtdec_* functions in
ooling; livetree isn't used there.

Signed-off-by: Lars Feyaerts <lars@bitbiz.be>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-11 10:35:24 -04:00
Tom Rini
521ca0fa78 Makefile: Allow for board directories to not have a Makefile
It is entirely possible at this point to have platforms in U-Boot that
do not have board-specific C code (just Kconfig or environment) and so
make it optional to have to descend in to and then build in the board
directory.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-10-09 15:24:31 -04:00
Simon Glass
48bf738e36 Allow Python packages to be dropped
When building in a portage chroot, we do not have the environment needed
to build pylibfdt. It is instead build as a separate package.

Provide a build option to tell U-Boot to skip this part of the build. We
still need it to use binman, etc. but don't need it to build its
dependencies.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
[s/build bytes/builds bytes in tools.rst]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2023-09-22 06:03:46 +08:00
Simon Glass
ba5e3e1ed0 event: Support a simple spy record
The current event spy is always passed the event context and the event.
The context is always NULL for a static spy. The event is not often used.

Introduce a 'simple' spy which takes no arguments. This allows us to drop
the adaptation code that many of these spy records use.

Update the event script to find these in the image.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31 13:16:54 -04:00
Sughosh Ganu
c7d4dfcd14 scripts/Makefile.lib: Embed capsule public key in platform's dtb
The EFI capsule authentication logic in u-boot expects the public key
in the form of an EFI Signature List(ESL) to be provided as part of
the platform's dtb. Currently, the embedding of the ESL file into the
dtb needs to be done manually.

Add a target for generating a dtsi file which contains the signature
node with the ESL file included as a property under the signature
node. Include the dtsi file in the dtb. This brings the embedding of
the ESL in the dtb into the U-Boot build flow.

The path to the ESL file is specified through the
CONFIG_EFI_CAPSULE_ESL_FILE symbol.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-08-29 13:38:55 -04:00
Sughosh Ganu
a958988b62 scripts/Makefile.lib: Add dtsi include files as deps for building DTB
At the time of building the DTB, some dtsi files can be selected for
inclusion. Have these dtsi files as dependencies for the DTB
target. This also ensures generation or updating the dtsi files if
need be.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-08-29 13:37:55 -04:00
Sughosh Ganu
1fee487567 scripts/Makefile.lib: Collate all dtsi files for inclusion
At the time of building a device-tree file, all the *u-boot.dtsi files
are looked for, in a particular order, and the first file found is
included. Then, the list of files specified in the
CONFIG_DEVICE_TREE_INCLUDES symbol are included.

Combine these files that are to be included into a variable, and then
include all these files in one go.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-08-29 13:37:55 -04:00
Jason Kacines
06b51f77f5 scripts: kconfig: Add config fragment support in board/../
Add support to config fragments (.config) located in the /board
directory. This will allow only base defconfigs to live in /configs and
all fragments to live in their respective device directory in /board/..

Signed-off-by: Jason Kacines <j-kacines@ti.com>
2023-08-09 09:21:42 -04:00
Rasmus Villemoes
2f27405902 scripts/Makefile.lib: change spelling of $(srctree)/arch/$(ARCH)/dts in dtc_cpp_flags
Currently, all in-tree .dts files (apart from some under test/ and
tools/), reside in arch/$ARCH/dts. However, in the linux kernel tree,
dts files for arm64 boards, and probably in the not too distant
future [1], arm boards as well, live in subdirectories of that.

For private forks, using a vendor or project subdirectory is also more
convenient to clearly separate private code from upstream - in the
same way that code under board/ is also split and easy to maintain.

In order to prepare for us to follow suit and do the splitting of the
in-tree .dts files, and to make life a little easier for private forks
that already place dts files not directly in arch/$ARCH/dts, change
the $(srctree)/arch/$(ARCH)/dts path to instead refer to the directory of
the .dts file being compiled. This should be a no-op for all existing
cases.

[1] https://lore.kernel.org/lkml/20220328000915.15041-1-ansuelsmth@gmail.com/

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2023-05-31 17:23:01 -04:00
Rasmus Villemoes
a0f9a77912 kbuild: Allow DTB overlays to built from .dtso named source files
[Linux commit 363547d2191c]

Currently DTB Overlays (.dtbo) are build from source files with the same
extension (.dts) as the base DTs (.dtb). This may become confusing and
even lead to wrong results. For example, a composite DTB (created from a
base DTB and a set of overlays) might have the same name as one of the
overlays that create it.

Different files should be generated from differently named sources.
 .dtb  <-> .dts
 .dtbo <-> .dtso

We do not remove the ability to compile DTBO files from .dts files here,
only add a new rule allowing the .dtso file name. The current .dts named
overlays can be renamed with time. After all have been renamed we can
remove the other rule.

[Import notes: Adapt to U-Boot by using the cmd_dtco function instead
of cmd_dtc just like the current .dts -> .dtbo rule.]

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-05-15 14:08:45 -04:00
Rasmus Villemoes
d50af66343 kbuild: add dtc as dependency on .dtb files
[Linux commit b8fc5b2157b1]

If dtc is rebuilt, we should rebuild .dtb files with the new dtc.

[Import notes: Back then there was no .dtbo rule in Linux's
Makefile.lib, but the current .dtbo rules in Linux also have the
$(DTC) dependency, so also add it to our .dtbo rule.]

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-05-15 14:08:45 -04:00
Rasmus Villemoes
6923f49d3a scripts/Makefile.dts: tweak logic for deciding which dtbs to build
The idea in 3609e1dc5f (dts: automatically build necessary .dtb
files) was fine, but the implementation was suboptimal due to some
misunderstandings on my part (and possibly defects in some defconfig
files):

- Sometimes DEFAULT_DEVICE_TREE is not included in OF_LIST or
  SPL_OF_LIST

- SPL_OF_LIST is not always a subset of OF_LIST

- While SPL_OF_LIST governs the list of dtbs relevant to SPL (i.e.,
  may be built into an
  SPL-with-bunch-of-dtbs-to-choose-between-at-runtime), those dtbs are
  not actually _built_ during the SPL build phase, i.e. when $(SPL_)
  would expand to SPL_. fdtgrep runs on the artifacts produced during
  the ordinary U-Boot build.

Tweak the logic so that we simply add the union of all dtbs mentioned
in either DEFAULT_DEVICE_TREE, OF_LIST and SPL_OF_LIST to dtb-y. That
should, for real, ensure that we always build all the dtbs that is
relevant to the current board, and should in turn enable us to
massively simplify arch/*/dts/Makefile.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Tested-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-05-15 14:08:44 -04:00
Martin Hundebøll
f07381529b scripts: dtc-version: support git version strings too
Building dtc from git causes the version number to start with a 'v'
(e.g. v1.7.0). printf then fails to parse 'v1' as a decimal value, and
prints '000700' instead of '010700'. Subsequently, the build fails,
because '000700' is less than the required '010400' version.

Signed-off-by: Martin Hundebøll <martin@geanix.com>
2023-05-15 14:08:44 -04:00
Simon Glass
ed10008bab efI: Allow packaging a kernel in the debugging script
Add an option to package a kernel into the debugging script used for
EFI.

The name of the kernel must be added to the script. By default it is
assumed that the kernel is built in the /tmp/kernel directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-25 11:07:22 +01:00
Tom Rini
a5faa4a9eb Prepare v2023.04-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmQPxXsACgkQFHw5/5Y0
 tyzRWgwAlpwF0u0Xtfs+isnwy/2wb1uMKSeZTiMWkP8he48DX/+db1LHyxnb5apX
 5ULLLKnxZGDviFNw6F/Vuq/BlL8aK+K6wJm+HxdN4Df+sQZgP0kZVnZH1DcDGyJ7
 2I5mYxXCQiRfl3lG8uHdfQyGT5BOm1ZYTIBgXPzpdp/PS6Es74aIHfHS4UdsnpZ2
 dw5APUHnXsSeycbvgiZZEAQphRGplTgSmEDLZTCHD6+oIFoyJVMRr4QWc+KjYPR8
 MgfykqaITO7xKg1V2GwEWJA7LpU4L3HrK+8upSjdx0kfKw4jZoBTU5LE3dnk+6fz
 rgisMfyDGZ+w467uk9BSAO9smRRRI7GFMSkvi+kMQtVCFWCSaddkfYPlpFu1PND7
 nHfxkzoIjxeEOG8yIFF8P199w2lEorKTxlXuNBStfozvAz1wfhgq3o3WQGpvDmqF
 E+FoC7t73qVu6DVMiCXCOyUYNyI7d1tFlUhlbZPVCelVL8RX3JjMF/0uhLsOSDMc
 s4z/6fVq
 =xK+J
 -----END PGP SIGNATURE-----

Merge tag 'v2023.04-rc4' into next

Prepare v2023.04-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-03-14 12:06:35 -04:00
Simon Glass
1f0cf89227 efi: Adjust script to show pre-relocation output on terminal
When running with video enabled, the pre-relocation output of U-Boot is
currently lost. Add a -serial flag to show it on the terminal.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-13 13:53:01 +01:00
Simon Glass
cd5f997a9c script: Add a script to build a PyPi package
Create a script which can package a tool for use with PyPi and the 'pip'
tool. This involves quite a few steps so is best automated. Future work
will enable use of this for some of the tools in U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08 11:40:49 -08:00
Simon Glass
4583c00236 patman: Move library functions into a library directory
The patman directory has a number of modules which are used by other tools
in U-Boot. This makes it hard to package the tools using pypi since the
common files must be copied along with the tool that uses them.

To address this, move these files into a new u_boot_pylib library. This
can be packaged separately and listed as a dependency of each tool.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08 11:40:49 -08:00
Simon Glass
9fb3d7a7c5 RFC: tools: Add a camel-case conversion script
This is only for posterity, since once the conversion is done, the script
is of no use.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-01 11:22:27 -07:00
Simon Glass
48be546b70 checkpatch: Add a warning for pre-schema driver model tags
Help ensure that these don't creep into development by adding a check in
checkpatch for them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-14 09:43:27 -07:00