Commit graph

95279 commits

Author SHA1 Message Date
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
f38956a687 include: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
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
371dc068bb drivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
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
dac3ce976a board: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
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
bef9fdbed2 arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
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:47 -06:00
Simon Glass
ac644df9a4 doc: Update init docs for the xPL changes
Update the documentation here to cover the meaning of xPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
64746bfdff doc: Move init-related things out of README
Move this section to rst, changing it just enough so that it builds.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
8651eb1f25 README: Drop SoC-specific comment about SPL
This should not be in the generic README file, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
e16bfd9e58 doc: Update SPL docs for the xPL changes
Update the various references to SPL in this document. Make sure to
refer to 'phases' instead of 'stages', which is not a U-Boot term.

Fix a few U-boot typos and try to improve grammar a little while we are
here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
a64e7d73d6 log: global: Rename warn_non_spl()
This should now refer to xPL rather than SPL, so update it throughout
the tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
80580cd981 xpl: Rename spl_phase_prefix() and spl_phase_name()
Use simpler names for these functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
6c49fc5882 xpl: Rename spl_next_phase() and spl_prev_phase()
Rename this to use the xpl prefix.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
44a4c8e93f xpl: Add a function to indicate when in xPL
Add the opposite function to not_xpl() for completeness.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
f86580fc70 xpl: Rename spl_in_proper() to not_xpl()
Give this function a slightly easier name.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
456bdb70de xpl: Rename spl_phase() to xpl_phase()
Rename this function to indicate that it refers to any xPL phase.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
41ea75aa00 xpl: Rename spl_phase to xpl_phase_t
This name fits better with the new naming scheme, so update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
713bfc58f9 xpl: Rename u_boot_first_phase to xpl_is_first_phase()
This is a better name for this function, so update it.

Tidy up the function comment to mention VPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
90fb55e042 qconfig: Add XPL_BUILD to ignored symbols
This now appears in the code base, so add it to the list of ignored
symbols in qconfig

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -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
Simon Glass
d7f1672cf7 stdio: Make use of the SERIAL define
This is always enabled for U-Boot proper, so simplify the condition
in the common Makefile.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2024-10-11 11:44:47 -06:00
Simon Glass
47bd48048f serial: Make use of the SERIAL define
This is always enabled for U-Boot proper, so simplify the condition
in the common Makefile.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
09eaa406f6 net: freescale: Drop use of SPL_BUILD dependency
SPL_BUILD is not a Kconfig symbol. Perhaps the intent here is to use
SPL instead. However, this causes build errors, e.g. with T1024RDB_NAND

So drop the dependency on !SPL_BUILD since it does nothing.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:46 -06:00
Simon Glass
0e01334fc1 tegra: Drop dependency on SPL_BUILD
SPL_BUILD is not a Kconfig symbol so perhaps the intent here is to
use SPL instead. But that changes the output size.

So drop the dependency on !SPL_BUILD since it does nothing.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:46 -06:00
Simon Glass
95a720e054 boot: Drop unnecessary ifdef for LOAD_FIT
Use the normal SPL_TPL_ approach for this option.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2024-10-11 11:44:46 -06:00
Simon Glass
01ab644ebc Makefile: Add a u-boot.cfg file for VPL
Create this file for VPL as well, for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2024-10-11 11:44:46 -06:00
Padmarao Begari
067e029480 board: xilinx: Remove conditional check for Microblaze
U-Boot is not picking boot.scr script address from device tree
rather it's using default address for Microblaze platform,
and it's picking for other platforms. Remove conditional check
for Microblaze platform, so that u-boot pick up boot.scr script
address for all platforms from device tree.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20240913093231.2343528-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-09-20 15:31:19 +02:00
Padmarao Begari
bde2e728ce mmc: zynq_sdhci: Remove device_is_compatible() function
There are lot of device_is_compatible() present in the driver.
Remove them and replace with a variables "SDHCI_COMPATIBLE_SDHCI_89A"
and "SDHCI_COMPATIBLE_VERSAL_NET_EMMC" with match data.
This change saves the space and reduce the execution time.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20240913093157.2343476-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-09-20 15:31:19 +02:00
Prasad Kummari
290385f374 arm64: zynqmp: Remove overlays and add new dtb entries for ZynqMP
Remove device tree overlay (DTBO) entries for the ZynqMP target
from the Makefile. Add new device tree binaries (DTBs) for the
zynqmp-sm-k24-revA and zynqmp-smk-k24-revA configurations.

Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20240906070808.1045991-3-prasad.kummari@amd.com
2024-09-20 08:31:57 +02: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
Michal Simek
a268b53be0 arm64: zynqmp: Add missing vc7_xin fixed clock to sc-vpk180-revA
Add missing vc7_xin fixed clock as clock input for some clock generators.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/4904f5e0aab8a0b0c2fcc1912be493d4185e6173.1725881047.git.michal.simek@amd.com
2024-09-20 08:31:57 +02:00
Sean Anderson
afe2df3157 arm: zynqmp: Enable non-invasive CCI-400 PMU debug
Set NIDEN, enabling non-invasive debug for the CCI-400 PMU. Otherwise,
the PMU is effectively disabled.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20240905171833.325548-3-sean.anderson@linux.dev
Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-09-20 08:31:57 +02:00
Sean Anderson
35142be560 zynqmp: Disable secure access for boot devices
Boot devices (QSPI, MMC, NAND, and Ethernet) use secure access for DMA
by default. As this causes problems when using the SMMU [1], configure
them for normal access instead.

[1] https://support.xilinx.com/s/article/72164

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Link: https://lore.kernel.org/r/20240905171833.325548-2-sean.anderson@linux.dev
Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-09-20 08:31:57 +02:00
Michal Simek
8ef2deefc5 xilinx: Enable SIMPLE_PM_BUS
Enable simple-pm-bus driver to handle case where axi bus coming between PS
(fixed) part to PL (programmable) part has own clock or power domain.
That's why enable driver to be ready for this configuration.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/b9f4bb85be502616edf3be2b79e52a0e2c03e821.1725349691.git.michal.simek@amd.com
2024-09-20 08:31:57 +02:00
Prasad Kummari
fc001432e5 arm64: zynqmp: Add u-boot command to boot into recovery image
To boot into the firmware recovery tool, the user currently
needs to press a button on the board while powering the
system up. To simplify this process, a U-Boot command
was added to allow booting directly into the recovery tool.

For example:
ZynqMP> zynqmp reboot <multiboot offset in hex>

Co-develop-by: Prasad Kummari <prasad.kummari@amd.com>
Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Co-develop-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20240827115529.2931334-1-prasad.kummari@amd.com
2024-09-20 08:31:56 +02:00
Prasad Kummari
76197b6abb xilinx: versal-net: fix no previous prototype for function warning.
Included the SPI header to resolve the no previous prototypes
for function. Removed unused mode variable.
sparse warnings
warning: no previous prototype for 'spi_get_env_dev'
[-Wmissing-prototypes]
warning: variable 'mode' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Link: https://lore.kernel.org/r/20240905115758.999936-1-prasad.kummari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-09-20 08:31:56 +02:00
Venkatesh Yadav Abbarapu
948616894c mtd: spi-nor: scale up timeout for full-chip erase
This patch fixes timeout issues seen on large NOR flash.
For full-chip erase, where we use the SPINOR_OP_CHIP_ERASE (0xc7)
opcode. Use a different timeout for full-chip erase than for other
commands.

 [Ported from Linux kernel commit
                09b6a377687b ("mtd: spi-nor: scale up timeout for
                               full-chip erase") ]

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
2024-09-19 16:42:31 -06:00
Tom Rini
146be6f036 Merge tag 'u-boot-imx-next-20240919' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/22363

- Several updates to i.MX9 SOC and i.MX93 EVK.
- Power domain fixes.
- TRDC cleanup and update.
- MAC address layout update.
- Add support for the i.MX9301/9302 variants.
- Add runtime detection of voltage mode.
- Generalize some code for i.MX8M and i.MX9.
- Add support for Comvetia imx6q-lxr board.
2024-09-19 11:26:18 -06:00
Tom Rini
2ac0a302ad This PR contains various improvements in the A/B update logic for EFI
- Read both copies of metadata, in case one of the is corrupted
 - Check the metadata version against the running firmware to make sure it's
   allowed
 - Limit the use of a revert capsule if the board is on a trial state and
   make sure it's not applied if the max counter has expired
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEgWII69YpahbL5iK5gS8AYozs+qIFAmbr2bAACgkQgS8AYozs
 +qKpPA/7BYSmVkUtdvMiSDVAzGz2Y4V9u8LXluUUkSOs5yDWuXszWPLlPYyNGTzd
 5B+UIvvA7xFag0/+2Ywuxi3Xht08QWyv9803EathupScnwiUFd2H2M/+PEhBZCDs
 2+JSp77J/cKBGjp8x0qY+IRDX/oVDqWjJo7B0SXM2HCvS8+z3eVBONCqwLJEPqfz
 fVFyazBcSsVosWyJkbxU94Coh8LZX0fBH5nYCsNc7zTqeh8D1GNV3REMZTn6+C4Y
 mJbmf3/toVvBFiLpi2fegqLgFgU4ngPlwuFEJJQZL/hUyeynXCjV4+BZ/P3n+hKC
 lSPLcHeEkDh9iRxmXmVrhPEwnC00zvsYvuvlQ3ziEcUdIIVm6UJLkoyVsoBs/vUD
 o+Iz6Kwu1/LW2rK+qpTGVupb4FUM00Xbs5LueHQhHS4QaIaHRwUx5qyPP/A/Ftcy
 bS4Ljv5VW0fTK8H/B28c6H/HZcxzWTX8wkLEKEWgep7sWhSlcdoZ76FBM6hGeISO
 62J9xyjsBtPqdR7rL6wQcvpjPK8mxconH7hsrRx3TkRpforjF5yfDLZsvLJqBEFo
 ZP+nUzO2qC47Oy6lCvYQF31KWcfTKnrRw0YWf43A/zMsosEJ7O+iCaLpCNXQMIgJ
 RCjEzPgQC/lqw8a7byjNvcDnWgThPf+LXM64uTln9D8kBcBEud0=
 =wdyO
 -----END PGP SIGNATURE-----

Merge tag 'fwu-next-19092024' of https://source.denx.de/u-boot/custodians/u-boot-tpm into next

This PR contains various improvements in the A/B update logic for EFI

- Read both copies of metadata, in case one of the is corrupted
- Check the metadata version against the running firmware to make sure it's
  allowed
- Limit the use of a revert capsule if the board is on a trial state and
  make sure it's not applied if the max counter has expired
2024-09-19 11:25:26 -06:00
Sughosh Ganu
6f933aa963 fwu: print a message if empty capsule checks fail
When dealing with processing of the empty capsule, the capsule gets
applied only when the checks for the empty capsule pass. Print a
message to highlight if empty capsule checks fail, and return an error
value, similar to the normal capsules.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Tested-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-09-19 10:52:50 +03:00
Sughosh Ganu
be281eccb0 fwu: do not allow capsule processing on exceeding Trial Counter threshold
When in Trial State, the platform keeps a count of the number of times
it has booted in the Trial State. Once the threshold of the maximum
allowed count exceeds, the platform reverts to boot from a different
bank on subsequent boot, thus coming out of the Trial State. It is
expected that all the updated images would be accepted or rejected
while the platform is in Trial State. Put in checks so that it is not
possible to apply an empty capsule once the max Trial Count exceeds.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Tested-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-09-19 10:52:50 +03:00
Sughosh Ganu
1049dc7e91 fwu: add dependency checks for selecting FWU metadata version
The FWU code supports both versions of the FWU metadata, i.e. v1 and
v2. A platform can then select one of the two versions through a
config symbol. Put a dependency in the FWU metadata version selection
config symbol to ensure that both versions of the metadata cannot be
enabled.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-09-19 10:52:50 +03:00
Sughosh Ganu
03392f1eb8 fwu: check all images for transitioning out of Trial State
The platform transitions out of Trial State into the Regular State
only when all the images in the update bank have been accepted. Check
for this condition before transitioning out of Trial State.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Tested-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-09-19 10:52:50 +03:00
Sughosh Ganu
36811ff827 fwu: v1: do a version check for the metadata
Do a sanity check that the version of the FWU metadata that has been
read aligns with the version enabled in the image. This allows to
indicate an early failure as part of the FWU module initialisation.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Tested-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-09-19 10:52:50 +03:00
Sughosh Ganu
5e9feeed8a fwu: v2: try reading both copies of metadata
In the version 2 of the FWU metadata, the metadata is broken into two
parts, a top-level structure, which provides information on the total
size of the structure among other things. Try reading the primary
partition first, and if that fails, try reading the secondary
partition. This will help in the scenario where the primary metadata
partition has been corrupted, but the secondary partition is intact.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Tested-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-09-19 10:52:50 +03:00
Fabio Estevam
effe934e50 imx6q-lxr: Add board support
Add support for the Comvetia i.MX6Q LXR2 board, which is
uses the Phytec PFLA02 SoM.

Based on the original work from Stefano Babic <sbabic@denx.de>.

The Phytec PFLA02 devicetrees are taken from kernel 6.11-rc7.

The imx6q-lxr.dts has been submitted upstream:

https://lore.kernel.org/linux-devicetree/20240913200906.1753458-3-festevam@gmail.com/

After it gets accepted in mainline (most likely in kernel 6.13),
the lxr2 board can then be switched to OF_UPSTREAM and these device trees
can be removed from U-Boot.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2024-09-19 00:13:20 -03:00
Peng Fan
29b053216f imx93_evk: add back Low drive mode ddr timing file
Add back low drive mode 1866mts ddr timing file, no need
CONFIG_IMX9_LOW_DRIVE_MODE anymore, using runtime selection.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-09-19 00:12:42 -03:00
Peng Fan
c9efcad237 imx93_evk: Remove CONFIG_IMX9_LOW_DRIVE_MODE and ld defconfig
Remove unused CONFIG_IMX9_LOW_DRIVE_MODE kconfig and
imx93_11x11_evk_ld_defconfig.
Remove the ld timing file.
The LD mode support will be added back with runtime detection later.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-09-19 00:12:42 -03:00
Peng Fan
1d0d257043 imx93_evk: spl: update pmic settings
1. Use runtime voltage selection for LD/OD/ND mode.
2. According to latest PE/TE report, the voltages of VDD_SOC for
   LD and ND mode need add 50mv margin, so LD voltage is 0.75v->0.8v,
   ND voltage is 0.8v->0.85v.
3. Use TOFF_DEB to differentiate new trimmed pmic and old pmic

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-09-19 00:12:42 -03:00