Commit graph

26124 commits

Author SHA1 Message Date
Joao Paulo Goncalves
5ed961094d arm: mach-k3: am625: Fixup a53 cpu frequency by speed grade
The maximum frequency of the A53 CPU on the AM62 depends on the speed
grade of the SoC. However, this value is hardcoded in the DT for all
AM62 variants, potentially causing specifications to be exceeded. Moreover,
setting a common lower frequency for all variants increases boot time.
To prevent these issues, modify the DT at runtime from the R5 core to
adjust the A53 CPU frequency based on its speed grade.

Suggested-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2024-04-11 15:50:56 -06:00
Joao Paulo Goncalves
ba26524cad arm: mach-k3: am62: Get a53 max cpu frequency by speed grade
AM62 SoC has multiple speed grades. Add function to return max A53 CPU
frequency based on grade. Fastest grade's max frequency also depends on
PMIC voltage, to simplify implementation use the smaller value.

Suggested-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
2024-04-11 15:50:56 -06:00
Tom Rini
a691594241 Merge patch series "Resolve issues with booting distros on x86"
Simon Glass <sjg@chromium.org> says:

This little series reprises the EFI-video fix, fixes a USB problem and
enables a boot script for coreboot.

It also moves to truetype fonts for coreboot and qemu-x86, since the
menus look much better and there are no strong size constraints.

With these changes it is possible to boot a Linux distro automatically
with U-Boot on x86, including when U-Boot is the second-stage
bootloader.
2024-04-10 20:01:42 -06:00
Simon Glass
2343d89ae9 x86: coreboot: Enable truetype fonts
Truetype fonts look better in the menu, so enable them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 20:01:33 -06:00
Simon Glass
5716be53d3 x86: Enable SSE in 64-bit mode
This is needed to support Truetype fonts. In any case, the compiler
expects SSE to be available in 64-bit mode. Provide an option to enable
SSE so that hardware floating-point arithmetic works.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Suggested-by: Bin Meng <bmeng.cn@gmail.com>
2024-04-10 20:01:33 -06:00
Tom Rini
777c284609 Merge patch series "pxe: Allow extlinux booting without CMDLINE enabled"
Simon Glass <sjg@chromium.org> says:

This series is the culmanation of the current line of refactoring
series. It adjusts pxe to call the booting functionality directly
rather than going through the command-line interface.

With this is is possible to boot using the extlinux bootmeth without
the command line enabled.

It also updates fastboot to do a similar thing.
2024-04-10 17:06:27 -06:00
Simon Glass
cf70f75447 x86: Drop message about features being missing with 64-bit
At this point most things work, including booting a distro, so drop
this message.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 17:04:25 -06:00
Simon Glass
6be5ec948b treewide: Make arch-specific bootm code depend on BOOTM
Allow these functions to be compiled in when CONFIG_BOOTM is enabled,
even if CONFIG_CMD_BOOTM is not.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Angelo Dureghello <angelo@kernel-space.org>
2024-04-10 17:04:25 -06:00
Tom Rini
ab3453e7b1 Merge patch series "Complete decoupling of zboot logic from commands"
Simon Glass <sjg@chromium.org> says:

This series refactors the zboot code to allow it to be used with
CONFIG_COMMAND disabled.

A new zboot_run() function is used to boot a zimage.
2024-04-10 13:49:35 -06:00
Simon Glass
39f7045252 x86: zboot: Use zboot_start() in zboot_run()
Now that we have a function to start the process of booting a zimage,
use it in zboot_run() to avoid duplicated logic.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 13:49:16 -06:00
Simon Glass
9ad5fdf1a8 x86: zboot: Separate logic functions from commands
Move zboot_start() and zboot_info() in with the other logic functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2024-04-10 13:49:16 -06:00
Simon Glass
d2c485a032 x86: zboot: Rename zboot_start() to zboot_run()
The term 'start' is used withint bootm and zboot to indicate the first
phase of booting an image.

Since zboot_start() does the whole boot, rename it to zboot_run() to
align with bootm_run() etc.

Fix a log message while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 13:49:16 -06:00
Simon Glass
db0c6f47c3 x86: zboot: Move environment setting into zboot_load()
The only difference between the command and the underlying logic is the
setting of envrionment variables. Move this out of the command
processing since it needs to be done in any case.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 13:49:16 -06:00
Simon Glass
80d4c98757 x86: zboot: Create a separate ZBOOT option for zboot logic
Most of the functionality of zboot is contained in the logic which
handles a zimage. Create a separate Kconfig for the logic so that it can
(later) be used without the command itself being enabled.

Enable ZBOOT by default on x86, with the command depending on that. The
existing 'imply' can therefore be removed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2024-04-10 13:49:15 -06:00
Simon Glass
bade0ac04b x86: zboot: Move command code into its own file
Much of the code in zimage.c deals with the zboot command. Move it into
a sepatate zboot.c file within the cmd/ directory. This will eventually
allow use of the zimage logic without the command being enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 13:49:15 -06:00
Simon Glass
e4255f45c9 x86: zboot: Move zimage definitions to the header file
In preparation for splitting the zboot-command code into a separate
file, move the definitions into the header file.

While we are here, mention when load_address and base_ptr are set up
and explain bzimage_addr better. Make cmdline const since it cannot be
changed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-04-10 13:49:15 -06:00
Tom Rini
843143303c Xilinx changes for v2024.07-rc1
xilinx:
 - Do not call env_get_location when !ENV_IS_NOWHERE
 - Add FDT_FIXUP_PARTITIONS support
 - Fix legacy format MAC decoding
 
 zynqmp:
 - Enable semihosting SPL support
 - DT updates
 - Kconfig resort/cleanup
 - Don't describe second image/capsule if !SPL
 - Add support for dfu/capsule description via MTD
 - Support JTAG as alternative boot mode
 - Add support for TEG soc variant
 
 zynqmp-kria:
 - Wire usb4 boot device
 - Update SDIO tristate pin configuration
 - Disable SPI_FLASH_BAR to avoid issue with SPI after update
 
 mbv:
 - Enable SPL and binman
 - Small platform changes
 
 zynqmp-nand:
 - Error out in case of unsupported SW ECC
 - Clean error path
 
 versal-net:
 - Support multiple locations for variables
 -----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCZhaRdgAKCRDKSWXLKUoM
 IS6LAKCdXJaEtlNLSC5IxeRJGmSTN4xPsACfdVL3mMzOZ1gw2+17uW1kHzzOgM4=
 =vDHW
 -----END PGP SIGNATURE-----

Merge tag 'xilinx-for-v2024.07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx changes for v2024.07-rc1

xilinx:
- Do not call env_get_location when !ENV_IS_NOWHERE
- Add FDT_FIXUP_PARTITIONS support
- Fix legacy format MAC decoding

zynqmp:
- Enable semihosting SPL support
- DT updates
- Kconfig resort/cleanup
- Don't describe second image/capsule if !SPL
- Add support for dfu/capsule description via MTD
- Support JTAG as alternative boot mode
- Add support for TEG soc variant

zynqmp-kria:
- Wire usb4 boot device
- Update SDIO tristate pin configuration
- Disable SPI_FLASH_BAR to avoid issue with SPI after update

mbv:
- Enable SPL and binman
- Small platform changes

zynqmp-nand:
- Error out in case of unsupported SW ECC
- Clean error path

versal-net:
- Support multiple locations for variables
2024-04-10 11:51:58 -06:00
Pierre-Clément Tosi
4b36f01201 arm64: Fix map_range() not splitting mapped blocks
The implementation of map_range() creates the requested mapping by
walking the page tables, iterating over multiple PTEs and/or descending
into existing table mappings as needed. When doing so, it assumes any
pre-existing valid PTE to be a table mapping. This assumption is wrong
if the platform code attempts to successively map two overlapping ranges
where the latter intersects a block mapping created for the former.

As a result, map_range() treats the existing block mapping as a table
mapping and descends into it i.e. starts interpreting the
previously-mapped range as an array of PTEs, writing to them and
potentially even descending further (extra fun with MMIO ranges!).

Instead, pass any valid non-table mapping to split_block(), which
ensures that it actually was a block mapping (calls panic() otherwise)
before splitting it.

Fixes: 41e2787f5e ("arm64: Reduce add_map() complexity")
Signed-off-by: Pierre-Clément Tosi <ptosi@google.com>
Tested-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Hiago De Franco <hiago.franco@toradex.com> # Toradex Verdin AM62
Reviewed-by: Marc Zyngier <maz@kernel.org>
2024-04-10 08:41:00 -06:00
Heinrich Schuchardt
90e9dcd709 eeprom: starfive: function get_product_id_from_eeprom()
Export a function get_product_id_from_eeprom() to read the product ID.
This value can be used for fixing up the device-tree on JH7110 based
products.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09 11:30:37 +08:00
Heinrich Schuchardt
0ba23d3daf riscv: starfive: MMC card detect
The VisionFive 2 board uses GPIO 41 as card detect as documented in
https://doc-en.rvspace.org/VisionFive2/PDF/SCH_RV002_V1.2A_20221216.pdf.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Minda Chen <minda.chen@starfivetech.com>
2024-04-09 11:30:29 +08:00
Łukasz Stelmach
c532ddded9 riscv: Move virtio scan to board_late_init()
When virtio_init() gets called from board_init() PCI isn't ready. Thus,
virtio-over-PCI (e.g. network interfaces) devices can't be detected and
used without additional `virtio scan` scan in the shell or a script.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09 11:30:24 +08:00
Conor Dooley
f39b1b77d8 riscv: support extension probing using riscv, isa-extensions
A new property has been added, with an extensive rationale at [1], that
can be used in place of "riscv,isa" to indicate what extensions are
supported by a given platform that is a list of strings rather than a
single string. There are some differences between the new property,
"riscv,isa-extensions" and the incumbent "riscv,isa" - chief among them
for the sake of parsing being the list of strings, as opposed to a
string. Another advantage is strictly defined meanings for each string
in a dt-binding, rather than deriving meaning from RVI standards. This
will likely to some divergence over time, but U-Boot's current use of
extension detection is very limited - there are just four callsites of
supports_extension() in mainline U-Boot.

These checks are limited to two checks for FPU support and two checks
for "s" and "u". "s" and "u" are not supported by the new property, but
they were also not permitted in "riscv,isa". These checks are only
meaningful (or run) in M-Mode, in which case supports_extension() does
not parse the devicetree anyway.

Add support for the new property in U-Boot, prioritising it, before
falling back to the, now deprecated, "riscv,isa" property if it is not
present.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09 11:30:17 +08:00
Conor Dooley
b90edde701 riscv: don't read riscv, isa in the riscv cpu's get_desc()
cpu_get_desc() for the RISC-V CPU currently reads "riscv,isa" to get
the description, but it is no longer a required property and cannot be
assummed to always be present, as the new "riscv,isa-extensions" and
"riscv,isa-base" properties may be present instead.

On RISC-V, cpu_get_desc() has two main uses - firstly providing an
informational name for the CPU for smbios or at boot with
DISPLAY_CPUINFO etc and secondly it forms the basis of ISA extension
detection in supports_extension() as it returns (a portion of) an ISA
string.

cpu_get_desc() returns a string, which aligned with "riscv,isa" but
the new property is a list of strings. Rather than add support for
the list of strings property, which would require creating an isa
string from "riscv,isa-extensions", modify the RISC-V CPU's
implementaion of cpu_get_desc() return the first compatible as the
cpu description instead. This may be fine for the informational cases,
but it would break extension dtection, given supports_extension()
expects cpu_get_desc() to return an ISA string.

Call dev_read_string() directly in supports_extension() to get the
contents of "riscv,isa" so that extension detection remains functional.
As a knock-on affect of this change, extension detection is no longer
broken for long ISA strings. Previously if the ISA string exceeded the
32 element array that supports_extension() passed to cpu_get_desc(),
it would return ENOSPC and no extensions would be detected.
This bug probably had no impact as U-Boot does not currently do anything
meaningful with the results of supports_extension() and most SoCs
supported by U-Boot don't have anywhere near that complex of an ISA
string. The QEMU virt machine's CPUs do however, so extension detection
doesn't work there.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09 11:30:17 +08:00
Kongyang Liu
b0a09b21e9 riscv: dts: sophgo: Add clk node and sdhci node
Add clk node and sdhci node for cv18xx SoCs according to patches from Linux
kernel.

clk: https://lore.kernel.org/all/IA1PR20MB4953F9AD6792013B54636F05BB4F2@IA1PR20MB4953.namprd20.prod.outlook.com/
sdhci: https://lore.kernel.org/all/20240217144826.3944-1-jszhang@kernel.org/

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09 11:30:10 +08:00
Kongyang Liu
c21dfcb556 riscv: cache: Implement dcache for cv1800b
Add dcache operations invalidate_dcache_range and flush_dcache_range for
cv1800b.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09 11:30:02 +08:00
Kongyang Liu
ae800aa79a riscv: cpu: cv1800b: Add support for cv1800b SoC
Add Sophgo cv1800b SoC to support RISC-V arch.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09 11:30:02 +08:00
Ben Dooks
e4f69492ad riscv: add backtrace support
When debugging, it is useful to have a backtrace to find
out what is in the call stack as the previous function (RA)
may not have been the culprit.

Since this adds size to the build, do not add it by default
and avoid putting it in the SPL build if not needed.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Tested-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-04-09 11:29:38 +08:00
Heinrich Schuchardt
a0a749787a efi_loader: move HOST_ARCH to version_autogenerated.h
efi_default_filename.h requires HOST_ARCH to be defined. Up to now we
defined it via a CFLAGS. This does not scale. Add the symbol to
version_autogenerated.h instead.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-04-08 13:04:48 +02:00
Sughosh Ganu
d350b79e6d sandbox: capsule: binman: generate some capsules as part of build
Currently, all the capsules for the sandbox platform are generated at
the time of running the capsule tests. To showcase generation of
capsules through binman, generate all raw(non FIT payload) capsules
needed for the sandbox platform as part of the build. This acts as an
illustrative example for generating capsules as part of a platform's
build.

Make corresponding change in the capsule test's configuration to get
these capsules from the build directory.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2024-04-08 12:59:31 +02:00
Tom Rini
9cba29b19f Merge tag 'u-boot-imx-master-20240405' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/20228

- Convert imx8mp-beacon and verdin-imx8mm/verdin-imx8mp to OF_UPSTREAM.
- Enable PCIe NVMe support on imx8mp_beacon.
- Fix Ethernet and board detection on mx6cuboxi.
- Fix signature_block_hdr struct fields.
- Fix imx9_probe_mu prototype and make it to get called in
  EVT_DM_POST_INIT_R.
- Test whether ethernet node is enabled before reading MAC EEPROM on
  DHSOM SoMs.
2024-04-05 17:23:58 -04:00
Tom Rini
eff62097f6 Merge tag 'qcom-next-2024Apr04' of https://source.denx.de/u-boot/custodians/u-boot-snapdragon
- Ethernet, i2c, and USB support are now enabled by default
- The clock driver gets some bug fixes and cleanup
- Invalid FDTs are now properly detected in board_fdt_blob_setup().
- The pinctrl driver gains preparatory support for per-pin function
  muxes.
- Support is added for two generations of Qualcomm HighSpeed USB PHY
- A power domain driver is added for the Globall Distributed Switch
  Controllers on the GCC hardware block.
- SDM845 gains USB host mode support.
- OF_LIVE is enabled by default for Qualcomm platforms
- Some U-Boot devicetree compatibility fixups are added during init to
  improve compatbility with upstream DT.
2024-04-05 17:23:13 -04:00
Tom Rini
0465f8d689 - jethubj100: fix config, MAINTAINERS & update docs
- Switch GXL, GXM, AXG, G12A, G12B & SM1 to using upstream DT
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPVPGJshWBf4d9CyLd9zb2sjISdEFAmYO2kwACgkQd9zb2sjI
 SdG9Og/+N/clBq7jyyLWBZrqmMrFWvLcSeZ/3pK/Suzz32kkFl6l1snl4IxeSctT
 3wnhmy/mMPdZay7R09n1nkGxB+J13zRwW3+uMZ5+DKgltbsZrXL+tzpYIuxrwia3
 gNuyjQjakBAtJe3NbA3kKXRrZwuVTK7EMY0fVSBTba6QdsItxFvFkzpRWFCZarMx
 +IWiafT6QeTw1l0i5hEcQlwY54SnccC2fUC6VbdylrUX7wLLbT+RC/Ern/ilahT2
 1pMzDe8PABWx7mpHtESuz7nL8/zZLbWDcmgP40vPDZmhnYr7KDx6f+0f8oicFFox
 6eaeD6l1vWKN3aSLSh6snKI2wkFJDaDAxnjPUOT4VNYG0vEu0CNJZMvw8ahZasDw
 3VrgpSomRO8PE8+plFwyPJgJpwVLqGj/lAfKLLLE8tcUF5P7pbN5You5bGGyPUqw
 6GWTCS2psqNOpmI6zrAppBfw538tkldIAoH+ESsOZ3U9RxCPz6yYQxtKR8OUiHq0
 PHpk3J7Y+SxRlvhQiV7tKKWt6+64yeNhhtEM7wnisHNCukgdG9vGTZNHwW19VLCt
 DxWeznR83IeLa80+IjB/b1UYx3AQAd3NRIWidn1FTXaLGK41c5YHrhG4jdDlCryy
 7xwjELjER9oeoWF0NTY2gx9Smagdy/KJxAQ2PAavQHkPvqJUGg4=
 =Mldi
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-amlogic-20240404' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- jethubj100: fix config, MAINTAINERS & update docs
- Switch GXL, GXM, AXG, G12A, G12B & SM1 to using upstream DT
2024-04-05 17:22:28 -04:00
Marcel Ziswiler
23fe2def1e verdin-imx8mm/verdin-imx8mp: move imx verdins to OF_UPSTREAM
Move verdin-imx8mm and verdin-imx8mp to OF_UPSTREAM:
- handle the fact that dtbs now have a 'freescale/' prefix
- imply OF_UPSTREAM
- remove redundant files from arch/arm/dts leaving only the
  *-u-boot.dtsi files
- update MAINTAINERS files

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
2024-04-05 09:39:01 -03:00
Ye Li
ffb0a930ce arm: imx9: Call imx9_probe_mu for DM post in board_r
This event callback imx9_probe_mu needs to be called in board_r
as well, because many ELE APIs depending on this MU probed

Signed-off-by: Ye Li <ye.li@nxp.com>
2024-04-05 09:38:46 -03:00
Ye Li
2513bf3f1b arm: imx9: Correct imx9_probe_mu prototype
Since the event callback imx9_probe_mu is re-defined, update
its prototype.

Signed-off-by: Ye Li <ye.li@nxp.com>
2024-04-05 09:38:30 -03:00
Josua Mayer
6970f4a6cd mx6cuboxi: Fix Ethernet after DT sync with Linux
The i.MX6 Cubox-i and HummingBoards can have different PHYs at varying
addresses. U-Boot needs to auto-detect which phy is actually present,
and at which address it is responding.

Auto-detection from multiple phy nodes specified in device-tree does not
currently work correct. As a work-around merge all three possible phys
into one node with the special address 0xffffffff which indicates to the
generic phy driver to probe all addresses.

Signed-off-by: Josua Mayer <josua@solid-run.com>
[fabio: Added the changes to imx6qdl-sr-som-u-boot.dtsi.]
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Christian Gmeiner <cgmeiner@igalia.com>
Tested-by: Christian Gmeiner <cgmeiner@igalia.com>
2024-04-05 09:38:12 -03:00
Adam Ford
a64feb974f arm64: imx: imx8mn-beacon: Migrate to OF_UPSTREAM
The imx8mn-beacon boards can migrate to OF_UPSTREAM which also
allows for the removal the device tree files.

Signed-off-by: Adam Ford <aford173@gmail.com>
2024-04-05 09:36:49 -03:00
Adam Ford
f5585124c9 arm64: imx: imx8mm-beacon: Migrate to OF_UPSTREAM
The imx8mm-beacon boards can migrate to OF_UPSTREAM which also
allows for the removal the device tree files.

Signed-off-by: Adam Ford <aford173@gmail.com>
2024-04-05 09:36:03 -03:00
Adam Ford
a8671bd9c5 arm64: imx: imx8mp-beacon: Migrate to OF_UPSTREAM
The imx8mp-beacon boards can migrate to OF_UPSTREAM which also
allows for the removal the device tree files.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
2024-04-05 09:12:37 -03:00
Neil Armstrong
114df8b533 dts: meson: Drop redundant G12A, G12B & SM1 devicetree files
Since meson G12A, G12B & SM1 based boards switched to using upstream DT,
so drop redundant files from arch/arm/dts directory. Only *-u-boot.dtsi files
kept in arch/arm/dts directory for these boards.

Cc: Sumit Garg <sumit.garg@linaro.org>
Acked-by: Viacheslav Bocharov <adeep@lexina.in>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # khadas-vim3_android
Link: https://lore.kernel.org/r/20240329-u-boot-of-upstream-v2-5-2512ad3eb63d@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2024-04-04 18:48:46 +02:00
Neil Armstrong
834e7c8136 dts: meson-g12a: Switch to using upstream DT
Enable OF_UPSTREAM to use upstream DT and add amlogic/ prefix to the
DEFAULT_DEVICE_TREE. And thereby directly build DTB from dts/upstream/src/
including *-u-boot.dtsi files from arch/$(ARCH)/dts/ directory.

Cc: Sumit Garg <sumit.garg@linaro.org>
Acked-by: Viacheslav Bocharov <adeep@lexina.in>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # khadas-vim3_android
Link: https://lore.kernel.org/r/20240329-u-boot-of-upstream-v2-4-2512ad3eb63d@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2024-04-04 18:48:46 +02:00
Neil Armstrong
0364f25b5b dts: meson: Drop redundant GXL, GXM & AXG devicetree files
Since meson GXL, GXM & AXG based boards switched to using upstream DT,
so drop redundant files from arch/arm/dts directory. Only *-u-boot.dtsi files
kept in arch/arm/dts directory for these boards.

Cc: Sumit Garg <sumit.garg@linaro.org>
Acked-by: Viacheslav Bocharov <adeep@lexina.in>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # khadas-vim3_android
Link: https://lore.kernel.org/r/20240329-u-boot-of-upstream-v2-3-2512ad3eb63d@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2024-04-04 18:48:46 +02:00
Neil Armstrong
4bb4961f1e dts: meson: Switch GXL, GXM & AXG to using upstream DT
Enable OF_UPSTREAM to use upstream DT and add amlogic/ prefix to the
DEFAULT_DEVICE_TREE. And thereby directly build DTB from dts/upstream/src/
including *-u-boot.dtsi files from arch/$(ARCH)/dts/ directory.

Cc: Sumit Garg <sumit.garg@linaro.org>
Acked-by: Viacheslav Bocharov <adeep@lexina.in>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # khadas-vim3_android
Link: https://lore.kernel.org/r/20240329-u-boot-of-upstream-v2-2-2512ad3eb63d@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2024-04-04 18:48:46 +02:00
Caleb Connolly
9a556a0afc
dts: sdm845-db845c: add u-boot fixups
The USB VBUS supply for the type-A port is enabled via a GPIO regulator.
This is incorrectly modelled in Linux where only the PCIe dependency is
expressed. The correct way to handle this will be through a
usb-connector node, but for now we'll just mark the regulator as
always-on so that it will be enabled automatically during boot.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-04-04 17:46:47 +02:00
Caleb Connolly
1751d3c4ba
mach-snapdragon: call regulators_enable_boot_on()
Make sure we power on any boot-on or always-on regulators. These are
used for peripherals like USB on some platforms.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-04-04 17:46:47 +02:00
Caleb Connolly
b2f2c7b526
mach-snapdragon: fixup power-domains
We don't support the RPM(h)PD power domains in U-Boot, and we don't need
to - the necessary resources are on, and we aren't going to enter any
low power modes.

We could try using a no-op device, but this requires adding a compatible
for every platform, and just pollutes the driver model. So instead let's
just remove every "power-domains" property that references the RPM(h)pd
power controller. This takes <1ms as we're using OF_LIVE.

Of note, this only applies to drivers which are loading post-relocation.
Drivers loaded pre-reloc that reference the rpm(h)pd still need
DM_FLAG_DEFAULT_PD_CTRL_OFF in their flags.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-04-04 17:46:47 +02:00
Caleb Connolly
06db7f962f
mach-snapdragon: fixup USB nodes
We don't support USB super-speed in U-Boot yet, we lack the SS PHY
drivers, however from my testing even with a PHY driver there seem to be
other issues when talking to super-speed peripherals.

In pursuit of maintaining upstream DT compatibility, and simplifying
porting for new devices, let's implement the DT fixups necessary to
configure USB in high-speed only mode at runtime. The pattern is
identical for all Qualcomm boards that use the Synaptics DWC3
controller:

* Add an additional property on the Qualcomm wrapper node
* Remove the super-speed phy phandle and phy-name entries.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-04-04 17:46:47 +02:00
Volodymyr Babchuk
b563e766fe
clk: qcom: add support for power domains uclass
Now sub-drivers for particular SoCs can register them as power domain
drivers. This is needed for upcoming SM8150 support, because it needs
to power up the Ethernet module.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
[caleb: make ARCH_SNAPDRAGON select POWER_DOMAIN]
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-04-04 17:46:45 +02:00
Volodymyr Babchuk
86eb5d834d
qcom: board: validate fdt before trying to use it
There are cases when previous bootloader stage leaves some seemingly
valid value in r0, which in fact does not point to valid FDT
blob. This behavior was encountered when trying to boot U-Boot as
"hyp" loader on SA8155P-ADP.

To be sure that we really got the pointer to a device tree we need to
validate it with fdt_check_header() function.

Note: This approach is not 100% fool-proof, as get_prev_bl_fdt_addr()
theoretically can return a pointer to a region that is not physically
mapped and we will get data abort exception when fdt_check_header()
will try to access it. But at this early boot stage we don't know
where RAM is anyways so there is little we can do.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-04-04 17:46:45 +02:00
Marek Behún
0c350a670e arm: mvebu: system-controller: Add support for SYSRESET
Add driver model support for sysreset via mvebu system controller. This is
currently only available for U-Boot proper.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2024-04-04 10:45:27 +02:00