Commit graph

1637 commits

Author SHA1 Message Date
Patrice Chotard
088bbc1efa dtc: introduce label relative path references
Since introduction of OF_UPSTREAM flag, U-Boot's dtc must be able
to compile Kernel's device tree.

Since kernel commit 7de129f5389b ("ARM: dts: stm32: stm32mp151a-prtt1l:
Fix QSPI configuration"), label relative path references has been
introduced. These label relative path references is not supported
by current U-Boot dtc version 1.5.0: (see mailing list discussion [1]).

In order to support such label relative patch references
adds following commit from upstream DTC tree:

commit 651410e54cb9 ("util: introduce xstrndup helper")
commit ec7986e682cf ("dtc: introduce label relative path references")

[1] https://lore.kernel.org/all/20250115144428.GZ3476@bill-the-cat/T/

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-04-10 11:58:08 -06:00
Tom Rini
647cb87b5a Prepare v2025.04-rc5
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmfiDmUACgkQFHw5/5Y0
 tyx+qAv/X6EO1LJlIB55461gdvzua2SJni8inDjQBjrpmyyGiB1J5bZhQW1rrPqO
 5F6heLaErn5aSo1Vlyiwh/rajzMVP+fsVlt2uWNWfSzYxl4Dgv/3VpaDsAXgB0L7
 3RZVhiMihCXFb74E1NtxDeqtzYWH6JklG6Z6sqBk9turQnodysdafVX85KwmLrlH
 L+U5L1FY80bizAGAeQU0hnMtMC/5lcJmmIBHyRdit86Qe+OyZQnjw5EZeTOtybHk
 8Xd3MkX8jyE9ZM1jDtlp6RYctHnRiFSAU5DPYv65sd4ag8WkpwbWwPd0/s7Pbyx8
 QbAKNCIPJm2FrZTytklOIhU9YimLZTyPkmlLA9DG+GasfuB5KK7NF5RbtCSLj30i
 PNq+62o2P2k30ZHn4UneDmxVCKVzP+o4qGX+FbRvdjAg0VYHyCO9HNWf5kxetUAW
 LwudDidu2XUOjZZmbIhNBMIIuVpmbVDcFm2HVEN/ULK98rPAiy/4g2ZLuVXZCmky
 /Nc4ma4w
 =fu10
 -----END PGP SIGNATURE-----

Merge tag 'v2025.04-rc5' into next

Prepare v2025.04-rc5
2025-03-24 20:10:55 -06:00
Hendrik Donner
69fb899133 checkpatch.pl: Report an error for CONFIG_xPL_BUILD in device trees
The defines for the different build phases shouldn't be used in device
trees, currently they aren't even defined for device tree pre processing,
resulting in build errors.

Link: https://lists.denx.de/pipermail/u-boot/2025-March/582787.html
Signed-off-by: Hendrik Donner <hd@os-cillation.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-03-18 08:17:36 -06:00
Heinrich Schuchardt
2ac91756ad scripts: typos in event_dump.py
%s/even spies/event spies/
%s/EFL/ELF/

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-03-18 08:17:27 -06:00
Sam Edwards
7f2fe3dda4 scripts/Makefile.lib: efi: Preserve the .dynstr section as well
This section is required by .dynamic and llvm-objcopy will exit with a
fatal error if it is not also preserved in the output.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
2025-03-17 09:35:52 +01:00
Paul Barker
9805321dfd Kconfig: Introduce CONFIG_WERROR
Add a new config option under "General setup" to enable the -Werror flag
when building U-Boot. This is useful during development to help catch
mistakes.

This is based on a similar config option added to the Linux kernel by
Linus in 2021 - see Linux commit 3fe617ccafd6 ("Enable '-Werror' by
default for all kernel builds"). The modification of KBUILD_CFLAGS is
done in Makefile.extrawarn, matching where it was moved in the kernel by
Linux commit e88ca24319e4 ("kbuild: consolidate warning flags in
scripts/Makefile.extrawarn").

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
2025-03-13 14:23:11 -06:00
Tom Rini
0fd7ee0306 scripts/checkpatch.pl: Upgrade IS_ENABLED_CONFIG to error for U-Boot
A problem we have today is that some instances of IS_ENABLED(FOO) have
crept in to the code. This is in turn because with checkpatch.pl this is
only a warning and not an error, so they were overlooked. And looking
deeper, in the Linux kernel this pattern is allowed because
IS_ENABLED(DEFINED_FLAG) is allowed if discouraged and a quick skim of
the instances I saw in the current kernel follow this pattern. In U-Boot
however, this is not allowed, so bump to an error.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-03-05 12:14:49 -06:00
Tom Rini
a1e7dd7e14 Pull request efi-2025-04-rc1
Documentation:
 
 * Correct the defconfig name in the coolpi documentation
 
 UEFI:
 
 * Carve out the biggest part of the RISC-V and ARM linker scripts for EFI
   binary into a common include.
 * Correct the values of SizeOfCode and SizeOfInitializedData in generated
   EFI binaries for RISC-V and ARM.
 * Avoid gaps between sections in EFI binaries causing a failure in secure
   boot.
 * Makefile: let clean remove capsule_in.capsule*.efi-capsule
 * Refactor some of the code used for launching EFI binaries.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEK7wKXt3/btL6/yA+hO4vgnE3U0sFAmeLyu8ACgkQhO4vgnE3
 U0tLDA//TSLPk2ovu8bibonuptFZs/fB8/X7ZyIy154L65cNpyk69ZiR+1R77FRG
 9C8YhiF+XSABgckpGHTVqH8vPHZLRKawKgVhSi8CU31OrT9ahjfcDujvGuO8ZlsD
 LxrVL2T55711buRDX1kw6VzEqtSGvQxI2IDoNnkeoiBZ29D8lptHvmvzD3G8CCPC
 Z75Xxd4ly8euT3jDNznp10IoAu5eEp+rcmEEFC7UYJnDpFencuSWZjYcv3N1nKD6
 nTVQPqkWvx6jOA/tcNgK3ERrSD2Zhmc1TZrvfDxg/ecynho9DZrMyq/MINpHo4Fk
 OcDMZXG9C820qSYTkVdmaMnxklH4Sr+D6jyZDl523+GqCLiDD/lUOGt3qRAxhfwB
 j6IdFynB3djE2Mlu0ep9MQ556gvqJPUaXeR/K8dQ/rOXmNpwOMmerqy0eqK1mrxO
 IKXuyBVZWlRyMonnxQmDQAL4wXqlzhmSXevipaOupahHB0hSZKFT6z9mo6zKG7UH
 g2fDMGMpOZfvfmxV4EoD59mDHJESSY5Aorm/vfpLqYJsDsPfu3v9+tHKOEfm5rOS
 b0ykBQjhfVwda7JNpbwW+w1xVEpBEuWT41HbI6lijeGeFocJ8T6m7/eHlEYUvtmv
 1rQ2DhVwvoVha0YW8rNa+stLqpWjjiqLI5DaUhsexoaGmReaZ3o=
 =7RxC
 -----END PGP SIGNATURE-----

Merge tag 'efi-2025-04-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2025-04-rc1

Documentation:

* Correct the defconfig name in the coolpi documentation

UEFI:

* Carve out the biggest part of the RISC-V and ARM linker scripts for EFI
  binary into a common include.
* Correct the values of SizeOfCode and SizeOfInitializedData in generated
  EFI binaries for RISC-V and ARM.
* Avoid gaps between sections in EFI binaries causing a failure in secure
  boot.
* Makefile: let clean remove capsule_in.capsule*.efi-capsule
* Refactor some of the code used for launching EFI binaries.
2025-01-18 10:46:23 -06:00
Marek Vasut
37a777e128 Makefile: Make sure all linker input objects exist
In case the build system builds a directory with empty Makefile,
one which does not contain any obj-y entries, the build fails to
link due to missing built-in.o .

This happens because of this part of scripts/Makefile.build
 81 ifneq ($(strip $(obj-y) $(obj-m) $(obj-) $(subdir-m) $(lib-target)),)
 82 builtin-target := $(obj)/built-in.o
 83 endif
which does not assign builtin-target in case obj-y is empty. The
built-in target is then not built at all, and built-in.o is not
generated by this part of scripts/Makefile.build
 325 ifdef builtin-target
 326 quiet_cmd_link_o_target = AR      $@
 327 # If the list of objects to link is empty, just create an empty built-in.o
 ...
 335 targets += $(builtin-target)
 336 endif # builtin-target
This is the correct behavior.

The final link however expects the built-in.o to exist in every directory
included in the build, even in those where the aforementioned code skipped
generation of built-in.o . Make sure the built-in.o does exist for every
directory used in final link simply by doing touch on every built-in.o used
for the link, which will create empty built-in.o in case any built-in.o is
missing.

A possible alternative fix is the always define the builtin-target
and always generate built-in.o .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Tested-by: Quentin Schulz <quentin.schulz@cherry.de>
2025-01-18 08:28:16 -06:00
Heinrich Schuchardt
6384229dc3 scripts/Makefile.lib: add -L option to LD command for EFI binaries
The linker uses the path specified with -L to search for linker scripts
and for linker script includes.

For out-of-tree builds specify the build directory with -L instead of
the absolute path of the linker script. This allows using an INCLUDE
statement.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-01-17 20:31:25 +01:00
Heinrich Schuchardt
0be26928bf scripts: add volatge to spelling.txt
To avoid future misspells add volatge to spelling.txt.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-12-24 18:09:46 +01:00
Markus Volk
a63456b919 scripts/dtc/pylibfdt/libfdt.i_shipped: Use SWIG_AppendOutput
Swig has changed language specific AppendOutput functions. The helper
macro SWIG_AppendOutput remains unchanged. Use that instead
of SWIG_Python_AppendOutput, which would require an extra parameter
since swig 4.3.0.

/home/flk/poky/build-test/tmp/work/qemux86_64-poky-linux/u-boot/2024.10/git/arch/x86/cpu/u-boot-64.lds
| scripts/dtc/pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_next_node’:
| scripts/dtc/pylibfdt/libfdt_wrap.c:5581:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’
|  5581 |     resultobj = SWIG_Python_AppendOutput(resultobj, val);
|       |                 ^~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Markus Volk <f_l_k@t-online.de>
Reported-by: Rudi Heitbaum <rudi@heitbaum.com>
Link: https://github.com/dgibson/dtc/pull/154
2024-10-30 13:02:53 -06:00
Tom Rini
8ab2178de0 Merge tag 'u-boot-imx-master-20241018a' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/22796

- Switch to using upstream DT on DH i.MX8MP DHCOM PDK2/PDK3.
- Add ability to build fallback DTBOs from arch/$(ARCH)/dts.
- Remove fdt_high and initrd_high env variables from imx6-dhcom.
- Add dummy clk for imx8.
- Fix DT corruption in imx8_cpu.
- Improve DDR stability on pico-imx7d.
2024-10-18 09:05:04 -06:00
Marek Vasut
a55c4836f3 dts: Add ability to build fallback DTBOs from arch/$(ARCH)/dts
Currently the enablement of OF_UPSTREAM results on the build system
searching for DTs only in dts/upstream/ . There are platforms which
use U-Boot specific DTBOs applied on top of U-Boot control DT during
SPL stage, and source DTs for these are located in arch/$(ARCH)/dtb.

Add dedicated 'dtbos' target which builds only .dtbos and not .dtbs and
in case CONFIG_OF_UPSTREAM_INCLUDE_LOCAL_FALLBACK_DTBOS is enabled, build
this target for arch/$(ARCH)/dtb to generate local U-Boot specific DTBOs.

Adjust top level Makefile so binman would search for .dtb and .dtbo in
both OF_UPSTREAM specific paths and arch/$(ARCH)/dtb for the .dtbo case
in case CONFIG_OF_UPSTREAM_INCLUDE_LOCAL_FALLBACK_DTBOS is enabled.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Marek Vasut <marex@denx.de>
2024-10-18 09:41:09 -03:00
Jan Kiszka
3435486f36 Extend usage for OF_OVERLAY_LIST beyond SPL
Allow to use OF_OVERLAY_LIST also for the case that the overlays just
need be built, e.g. when they will be picked up by binman as artifacts
of the final U-Boot image. The IOT2050 boards have such a need when
switching to OF_UPSTREAM.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-10-17 15:01:01 -06:00
Marek Vasut
d2061828a4 dts: Deduplicate dtbs target
The dtbs: target is almost identical in all architecture Makefiles.
All architecture Makefiles include scripts/Makefile.dts . Deduplicate
the dtbs: target into scripts/Makefile.dts . No functional change.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Caleb Connolly <caleb.connolly@linaro.org> #qcom, OF_UPSTREAM
2024-10-14 19:32:04 -06:00
Simon Glass
5c10c8badf global: Rename SPL_TPL_ to PHASE_
Use PHASE_ as the symbol to select a particular XPL build. This means
that SPL_TPL_ is no-longer set.

Update the comment in bootstage to refer to this symbol, instead of
SPL_

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:48 -06:00
Simon Glass
c46760d596 global: Rename SPL_ to XPL_
Use XPL_ as the symbol to indicate an SPL build. This means that SPL_ is
no-longer set.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:48 -06:00
Simon Glass
9280a948b1 xpl: Define CONFIG_SPL_BUILD only for the SPL build
Make this define mean SPL only, not TPL, VPL, etc.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:48 -06:00
Simon Glass
1d6132e2a2 global: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Complete this rename for all directories outside arch/ board/ drivers/
and include/

Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:48 -06:00
Simon Glass
1daf5b839a scripts: Define CONFIG_XPL_BUILD for all xPL builds
The new name 'xPL' is intended to indicate a build of any phase which is
not U-Boot proper. Define it for all such phases.

Note that we also define CONFIG_SPL_BUILD for all xPL builds. This
preserves existing behaviour, but future patches will adjust that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
d90b3d9559 scripts: Add some comments about autoconf.mk
Now that the conversion of all CONFIG options to Kconfig is complete,
these files only contain the xPL_BUILD defines. Add a comment to make
this clear.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
c6efb7a42d scripts: Rename Makefile.spl to Makefile.xpl
Rename this file to indicate that it refers to any non-U-Boot-proper
phase, not just SPL, which is the phase immediately before U-Boot
proper.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Prasad Kummari
10de9b5a6a kbuild: cherry-pick kbuild fdtoverlay changes from linux
Linux commits:
15d16d6dadf6 kbuild: Add generic rule to apply fdtoverlay
44f87191d105 kbuild: parameterize the .o part of suffix-search

The Linux commit 15d16d6dadf6 adds a generic rule in Makefile.lib
to automatically apply fdtoverlay, so that each platform doesn't
need to include a complex rule. This also automatically appends
DTC_FLAGS_foo_base += -@ to all base files

The platform's Makefile only needs to have this now:

foo-dtbs := foo_base.dtb foo_overlay1.dtbo foo_overlay2.dtbo
dtb-y := foo.dtb

Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20240906070808.1045991-2-prasad.kummari@amd.com
2024-09-20 08:31:57 +02:00
Tom Rini
c17805e19b Merge patch series "Fix various bugs"
Simon Glass <sjg@chromium.org> says:

This series includes the patches needed to make make the EFI 'boot' test
work. That test has now been split off into a separate series along with
the EFI patches.

This series fixes these problems:
- sandbox memory-mapping conflict with PCI
- the fix for that causes the mbr test to crash as it sets up pointers
  instead of addresses for its 'mmc' commands
- the mmc and read commands which cast addresses to pointers
- a tricky bug to do with USB keyboard and stdio
- a few other minor things
2024-09-18 13:07:19 -06:00
Simon Glass
13a29ec40c scripts: Update pylint.base
There have been quite a few changes in the Python scripts, so update the
pylint baseline.

This was created using:

   make pylint
   cp pylint.cur scripts/pylint.base

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-09-18 13:00:59 -06:00
Tom Rini
19dbc09405 Prepare v2024.10-rc5
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmbomBcACgkQFHw5/5Y0
 tywNnAv/ZJ+EdFyNSPAWDnzFbuG5dnkkOHcgFofhqaoXCuswm3vLSO66v/MLGAgA
 LcHcwuF5IQ8RfEZOFXdhifuiEYqnEDyhK1UNXZUdhsgjbWslfSsJva1z2/3SjtOf
 WNOg6CCGeSlW0E/kW9smaxJ/sJmW2gphuNsUNa1sTlUQ+XFgtGwbcHZvdVfogwhN
 K3tmdHDNj3bFfrMON4OI9uu6qiZAmdYv42IxMxuw/1DuVzrJ/z+5ROA9wKKNOuxz
 6QwBITnUwSDs+nDIaGphjigMAHOhbK4HvTYZ0HcvmVxm44mTHgi0/PqXzbG58cM5
 jZydm4oGD1IZyXGrOrle4CfvF/vg0SvTwFlU5KqCQAmN1elqfG87Vce2OqJGW1Y8
 /HzoiiECWlC3ejj5tFg/0cr4xBT5GI8x4KeNJzT+VNwAbCUZY9JgxIABsVjEDeAF
 OKw/lYxlmBe1zn8X8Bc6BKH5ZOutCrqrRDTGq/yEWolRODKuLIyZkwH4sR0Wfm10
 W47S5AAu
 =c7Hz
 -----END PGP SIGNATURE-----

Merge tag 'v2024.10-rc5' into next

Prepare v2024.10-rc5
2024-09-16 14:48:13 -06:00
Rasmus Villemoes
5f04493241 scripts/Makefile.lib: do not include CONFIG_DEVICE_TREE_INCLUDES in dtsi_include_list
The commit mentioned in Fixes broke the
CONFIG_DEVICE_TREE_INCLUDES feature, with the result that any board
setting any non-empty value for that fails to build.

The parent of the mentioned commit refactoring a bit by introducing
the dtsi_include_list variable and changing cmd_dtc to loop over that
was fine.

However, the .dtsi files mentioned in CONFIG_DEVICE_TREE_INCLUDES are
not supposed to be generated via the build system. They are meant for
e.g. including a public key for verified boot (generated with the
key2dtsi script), or for injecting some stuff to the /config
node (say, a bootcmd or a load-environment setting or things like
that). The files can either live in-tree in a private branch or
completely outside, e.g. in some Yocto metadata.

But regardless, U-Boot's build system will never know anything about
them, so when the mentioned commit did

dtsi_include_list_deps = $(addprefix $(obj)/,$(subst $(quote),,$(dtsi_include_list)))

things broke, because if CONFIG_DEVICE_TREE_INCLUDES is for example
"/path/to/public_key.dtsi", this would add a dependency on
$(obj)//path/to/public_key.dtsi to each $(obj)/*.dtb target, yielding

make[3]: *** No rule to make target 'arch/arm/dts/imx6dl-aristainetos2c_7.dtb', needed by 'dtbs'.  Stop.

To fix that while preserving the introduced
CONFIG_EFI_CAPSULE_ESL_FILE behaviour, disentangle
CONFIG_DEVICE_TREE_INCLUDES from dtsi_include_list from which
dtsi_include_list_deps is built, and instead just add the items
directly to the $(foreach) loop.

Fixes: a958988b62 ("scripts/Makefile.lib: Add dtsi include files as deps for building DTB")
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Tested-by: Emil Kronborg <emil.kronborg@protonmail.com>
2024-09-10 11:31:54 -06:00
Hiago De Franco
1bf048f21b tools/scripts/Kconfig: Update references from kconfig-language.txt to rst
The Linux kernel documentation has transitioned from using
kconfig-language.txt to kconfig-language.rst. Therefore update all
occurrences of kconfig-language.txt.

Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
2024-08-27 18:01:32 -06:00
Heinrich Schuchardt
092ad77e05 scripts/decodecode: update from Linux v6.10
For decoding RISC-V dumps we need to update the script.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-08-15 11:51:26 -06:00
Tom Rini
c9860d7ac5 Merge patch series "Endian Kconfig improvements"
Jiaxun Yang <jiaxun.yang@flygoat.com> says:

This is a subset of my previous arm64_be work.

I wish this could be merged first so it would be easier to work
against xtensa and arm64 be support.
2024-07-31 11:18:43 -06:00
Jiaxun Yang
3911ff576e config: Use CONFIG_SYS_BIG_ENDIAN in code whenever possible
So CONFIG_SYS_BIG_ENDIAN is our cross architecture option for
selecting machine endian, while the old CONFIG_CPU_BIG_ENDIAN
is defined by Arc only.

Use it whenever possible to ensure big endian code path is enabled
for all possible big endian machines.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
2024-07-31 11:18:37 -06:00
Simon Glass
12ddbc1564 fixdep: Support VPL
Add VPL support in this tool.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: f86ca5ad8f ("Introduce Verifying Program Loader (VPL)")
2024-07-29 08:42:18 -06:00
Andrew Goodbody
bbef829f9d sandbox: Fix LTO to work with STACKPROTECTOR
Add the STACKPROTECTOR symbols to the script that generates the
symbols that should not be removed by the use of LTO when linking
a shared object. This prevents a fail to build due to link errors.

https://source.denx.de/u-boot/u-boot/-/issues/35

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Tom Rini
cbfd2c28a0 Merge patch series "finish using .dtso for overlay source files"
Rasmus Villemoes <rasmus.villemoes@prevas.dk> says:

This is a followup to the patches that landed in 2024.01 and nearly
made sure that source files for producing .dtbo files use the .dtso
extension. In the same release, a few new .dts files snuck in, and
there was also some test code involving .dtbo -> .dtbo.S -> .dtbo.o I
didn't really know how to handle at the time. This should finish the
job, bring us in sync with linux (at least in this respect), and drop
the .dts -> .dtbo build rule.
2024-07-18 17:03:47 -06:00
Rasmus Villemoes
e1ad98ed9b kbuild: Disallow DTB overlays to built from .dts named source files
[equivalent to linux commit 81d362732bac]

As a follow up to the series allowing DTB overlays to built from .dtso
files. Now that all overlays have been renamed, remove the ability to
build from overlays from .dts files to prevent any files with the old
name from accidental being added.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-07-18 13:51:07 -06:00
Rasmus Villemoes
06518fdf24 kbuild: Allow DTB overlays to built into .dtbo.S files
[linux commit 941214a512d8, modified for U-Boot by removing the
include of vmlinux.lds.h and replacing STRUCT_ALIGNMENT by 16.]

DTB files can be built into the kernel by converting them to assembly
files then assembling them into object files. We extend this here
for DTB overlays with the .dtso extensions.

We change the start and end delimiting tag prefix to make it clear that
this data came from overlay files.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-07-18 13:51:06 -06:00
Tom Rini
af3c2166d5 Merge patch series "api: Remove duplicate newlines"
This removes a number of duplicate newlines throughout the codebase.
2024-07-15 12:28:22 -06:00
Marek Vasut
10cb047b8b scripts: Remove duplicate newlines
Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-07-15 12:12:18 -06:00
Jonathan Humphreys
659f97eb1f scripts/Makefile.lib: EFI: Use capsule CRT instead of ESL file
The EFI Capsule ESL file (EFI Signature List File) used for authentication
is a binary generated from the EFI Capsule public key certificate. Instead
of including it in the source repo, automatically generate it from the
certificate file during the build process.

Currently, sandbox is the only device using this, so removed its ESL file
and set the (new) CONFIG_EFI_CAPSULE_CRT_FILE config to point to its public
key certificate.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
2024-07-14 09:56:24 +02:00
Jonathan Humphreys
809141812e scripts/Makefile.lib: fixes: Embed capsule public key in platform's dtb
The call to cmd_capsule_esl_gen was made directly rather than using the
"cmd,xxx" syntax.

Fixes: c7d4dfcd ("scripts/Makefile.lib: Embed capsule public key in
platform's dtb")

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
2024-07-14 09:56:24 +02:00
Quentin Schulz
4721d1cb8e scripts/Makefile.lib: remove bootph-some-ram property from VPL/TPL/SPL
The property isn't useful in VPL/SPL/TPL as it is only for U-Boot proper
pre-reloc, which has its own DTB.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-06-26 13:17:51 -06:00
Rasmus Villemoes
5c02350fa0 scripts/setlocalversion: sync with linux v6.9
The changes upstream since the last sync (2ed1b242ab
"scripts/setlocalversion: sync with linux 5.8") are

(5) 548b8b5168c9 scripts/setlocalversion: make git describe output more reliable
    77a88274dc1a kbuild: replace LANG=C with LC_ALL=C
    2a73cce2dad3 scripts/setlocalversion: remove mercurial, svn and git-svn supports
    a2be76a352f1 scripts/setlocalversion: remove workaround for old make-kpkg
    ffaf62a8050b scripts/setlocalversion: add more comments to -dirty flag detection
    630ff0faf84e scripts/setlocalversion: factor out 12-chars hash construction
    042da426f8eb scripts/setlocalversion: simplify the short version part
    5df99bec210a scripts/setlocalversion: fix a bug when LOCALVERSION is empty
(1) 7d153696e5db kbuild: do not include include/config/auto.conf from shell scripts
(2) 129ab0d2d9f3 kbuild: do not quote string values in include/config/auto.conf
    f6e09b07cc12 kbuild: do not put .scmversion into the source tarball
    992ebfab2a75 setlocalversion: simplify the construction of the short version
    75280bdf49b2 setlocalversion: make indentation shallower
(3) ec31f868ec67 setlocalversion: absorb $(KERNELVERSION)
    eed36d775177 setlocalversion: clean up the construction of version output
(4) 6ab7e1f95e96 setlocalversion: use only the correct release tag for git-describe
    05e96e96a315 kbuild: use git-archive for source package creation
    3354c64d4184 scripts/setlocalversion: clean up stale comment
    01e89a4acefc scripts/setlocalversion: also consider annotated tags of the form vx.y.z-${file_localversion}

The only thing U-Boot has been applying on top was to deal with not
sourcing include/config/auto.conf but instead using awk to extract the
right value. Commit (1) did a very similar thing upstream, so we no
longer need to do that. However, upstream then went a step further (2)
and changed the convention for what goes into auto.conf, so RHS no
longer contain double-quotes. That commit thus changed the sed pattern
to no longer match those quotes, but as U-Boot has not yet adopted
that change, we have to deal with that. In order to be a little
forward-compatible, I did that in a way that should work both ways:

 # version string from CONFIG_LOCALVERSION
-config_localversion=$(sed -n 's/^CONFIG_LOCALVERSION=\(.*\)$/\1/p' include/config/auto.conf)
+config_localversion=$(sed -n 's/^CONFIG_LOCALVERSION=\(.*\)$/\1/p' include/config/auto.conf | tr -d '"')

Furthermore, (3) now requires that there is an appropriate
KERNELVERSION environment variable set. One way to deal with that
would be to just modify the script to use UBOOTVERSION instead, but
for now I've instead opted to let the Makefile provide
KERNELVERSION=$(UBOOTVERSION) to keep the setlocalversion changes
minimal.

That variable is further put to use in (4). Note that the logic for
mapping *VERSION -> [upstream annotated tag to look for] works
unchanged in U-Boot for the current versioning scheme 20XX.YY(-rcN)?.

My motivation for wanting to do this sync is to get (4) and (5), in
order to get the setlocalversion output both more predictable and
consistent across different build environments, i.e. independent of
random local .gitconfig settings, total number of git objects and/or
existence of unrelated tags (possibly from some tracked fork).

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-05-21 16:09:36 -06:00
Caleb Connolly
830d83ec38 scripts: gen_compile_commands: fix invalid escape sequence warning
Since Python 3.12 unrecognised escape sequences trigger a SyntaxWarning.
Convert the '\#' string to a raw string so the backslash is correctly
used as a literal.

Ported from Linux commit dae4a0171e25 ("gen_compile_commands: fix invalid
escape sequence warning").

This updates the script to be in-line with Linux 6.9-rc6.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: João Marcos Costa <jmcosta944@gmail.com>
2024-05-13 16:51:14 -06:00
Tom Rini
47558a4fce common.h: Remove this file and all references
With all files that had included this file directly having been updated,
we can now remove this file.

Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-07 08:00:57 -06:00
Caleb Connolly
0525cb2ae0 dts: support building all dtb files for a specific vendor
This adjusts OF_UPSTREAM to behave more like the kernel by allowing for
all the devicetree files for a given vendor to be compiled. This is
useful for Qualcomm in particular as most boards are supported by a
single U-Boot build just provided with a different DT.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on Amlogic boards builds
2024-04-29 10:55:07 -06:00
Jonathan Humphreys
d31ff219a8 Makefile.lib: find capsule ESL dtsi file with CONFIG_OF_UPSTREAM
When CONFIG_OF_UPSTREAM is enabled, DTS files are in SOC subdirectories (vs the
top level dts directory), but when CONFIG_EFI_CAPSULE_AUTHENTICATE is enabled,
the dynamically created dtsi file containing the capsule ESL DT node is in the
parent directory. This results in a build failure because the #include inserted
in the DTS file is local to the current directory.  Update Makefile to have the
DT preprocessing of #includes search in the parent (dts top level) directory
too.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
2024-04-17 17:05:54 -06:00
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