]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
6 months agocli: panic when failed to allocate memory for the history buffer
Hanyuan Zhao [Tue, 5 Mar 2024 07:37:33 +0000 (15:37 +0800)] 
cli: panic when failed to allocate memory for the history buffer

This commit simply modifies the history initialize function,
replacing the return value by panic with reasons. The calling
chains of hist_init don't have steps explicitly throwing or
dealing with the ENOMEM error, and once the init fails, the
whole system is died. Using panic here to provide error
information instead.

Signed-off-by: Hanyuan Zhao <hanyuan-z@qq.com>
6 months agoboards: Remove empty BOARD_SPECIFIC_OPTIONS
Tom Rini [Mon, 4 Mar 2024 15:26:17 +0000 (10:26 -0500)] 
boards: Remove empty BOARD_SPECIFIC_OPTIONS

While there are currently uses for a stanza of "config BOARD_SPECIFIC_OPTIONS"
followed by "def_bool y" and a series of select/imply statements, having
this option set followed by nothing else doesn't provide anything.
Remove these stanzas.

Signed-off-by: Tom Rini <trini@konsulko.com>
6 months agocmd: rng: Add rng list command
Weizhao Ouyang [Mon, 4 Mar 2024 14:42:42 +0000 (14:42 +0000)] 
cmd: rng: Add rng list command

The 'rng list' command probes all RNG devices and list those devices
that are successfully probed. Also update the help info.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
6 months agodriver: rng: Fix SMCCC TRNG crash
Weizhao Ouyang [Mon, 4 Mar 2024 14:42:41 +0000 (14:42 +0000)] 
driver: rng: Fix SMCCC TRNG crash

Fix a SMCCC TRNG null pointer crash due to a failed smccc feature
binding.

Fixes: 53355bb86c25 ("drivers: rng: add smccc trng driver")
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
6 months agofirmware: psci: Fix bind_smccc_features psci check
Weizhao Ouyang [Mon, 4 Mar 2024 14:42:40 +0000 (14:42 +0000)] 
firmware: psci: Fix bind_smccc_features psci check

According to PSCI specification DEN0022F, PSCI_FEATURES is used to check
whether the SMCCC is implemented by discovering SMCCC_VERSION.

Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
6 months agoarm64: Enable CONFIG_64BIT for static analysis
Dan Carpenter [Mon, 4 Mar 2024 07:04:29 +0000 (10:04 +0300)] 
arm64: Enable CONFIG_64BIT for static analysis

In the Makefile there is a line that says this:

    # the checker needs the correct machine size
    CHECKFLAGS += $(if $(CONFIG_64BIT),-m64,-m32)

Set CONFIG_64BIT for ARM64 so that we pass -m64 to the static checkers
instead of -m32.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
6 months agoKconfig: move CONFIG_32/64BIT to arch/Kconfig
Dan Carpenter [Mon, 4 Mar 2024 07:04:15 +0000 (10:04 +0300)] 
Kconfig: move CONFIG_32/64BIT to arch/Kconfig

These configs are used in multiple places so put them in a shared
Kconfig file.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
6 months agofdt: Fix bootm_low handling
Marek Vasut [Sat, 2 Mar 2024 22:54:02 +0000 (23:54 +0100)] 
fdt: Fix bootm_low handling

According to README CFG_SYS_BOOTMAPSZ section, in case both "bootm_low" and
"bootm_size" variables are defined, "bootm_mapsize" variable is not defined
and CFG_SYS_BOOTMAPSZ macro is not defined, all data for the Linux kernel
must be between "bootm_low" and "bootm_low" + "bootm_size".

Currently, for systems with DRAM between 0x4000_0000..0x7fff_ffff and with
e.g. bootm_low=0x60000000 and bootm_size=0x10000000, the code will attempt
to reserve memory from 0x4000_0000..0x4fff_ffff, which is incorrect. This
is because "bootm_low" is not taken into consideration correctly.

The last parameter of lmb_alloc_base() is the maximum physical address of
the to be reserved LMB area. Currently this is the start of DRAM bank that
is considered for LMB area reservation + min(DRAM bank size, bootm_size).
In case bootm_low is set to non-zero, this maximum physical address has to
be shifted upward, to min(DRAM bank start + size, bootm_low + bootm_size),
otherwise the reserved memory may be below bootm_low address.

In case of multiple DRAM banks, the current change reserves top part of
the first bank, and reserves the rest of memory in the follow up banks.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
6 months agoMerge patch series "Introduce basic support for TI's AM62Px SoC family"
Tom Rini [Wed, 13 Mar 2024 14:10:25 +0000 (10:10 -0400)] 
Merge patch series "Introduce basic support for TI's AM62Px SoC family"

Bryan Brattlof <bb@ti.com> says:

Hello Again Everyone!

The AM62Px is an extension of the existing Sitara AM62x low-cost family
of application processors built for Automotive and Linux Application
development. Scalable Arm Cortex-A53 performance and embedded features,
such as: multi high-definition display support, 3D-graphics
acceleration, 4K video acceleration, and extensive peripherals make the
AM62Px well-suited for a broad range of automation and industrial
application, including automotive digital instrumentation, automotive
displays, industrial HMI, and more.

Some highlights of AM62P SoC are:

* Quad-Cortex-A53s (running up to 1.4GHz) in a single cluster.
  Dual/Single core variants are provided in the same package to allow HW
  compatible designs.

* One Device manager Cortex-R5F for system power and resource
  management, and one Cortex-R5F for Functional Safety or
  general-purpose usage.

* One 3D GPU up to 50 GLFOPS

* H.264/H.265 Video Encode/Decode.

* Display support: 3x display support over OLDI/LVDS (1x OLDI-DL, 1x or
  2x OLDI-SL), DSI, or DPI. Up to 3840x1080 @ 60fps resolution

* Integrated Giga-bit Ethernet switch supporting up to a total of two
  external ports (TSN capable).

* 9xUARTs, 5xSPI, 6xI2C, 2xUSB2, 3xCAN-FD, 3xMMC and SD, GPMC for
  NAND/FPGA connection, OSPI memory controller, 3xMcASP for audio,
  1xCSI-RX-4L for Camera, eCAP/eQEP, ePWM, among other peripherals.

* Dedicated Centralized Hardware Security Module with support for secure
  boot, debug security and crypto acceleration and trusted execution
  environment.

* One 32-bit DDR Subsystem that supports LPDDR4, DDR4 memory types.

* Multiple low power modes support, ex: Deep sleep, Standby, MCU-only,
  enabling battery powered system design.

For those interested, more details about this SoC can be found in the
Technical Reference Manual here: https://www.ti.com/lit/pdf/spruj83

Proof-of-Life: https://paste.sr.ht/~bryanb/af2ac108a9362549aa326f182e87918d52bf2d71

6 months agoarm: mach-k3: fixup whitespace in SPDX License IDs
Bryan Brattlof [Tue, 12 Mar 2024 20:20:31 +0000 (15:20 -0500)] 
arm: mach-k3: fixup whitespace in SPDX License IDs

The SPDX ID format usese a single space used after the
'SPDX-License-Identifier:'. Fix all files that use any other white-space
character other than a single space.

Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agodoc: board: ti: introduce am62px documentation
Bryan Brattlof [Tue, 12 Mar 2024 20:20:30 +0000 (15:20 -0500)] 
doc: board: ti: introduce am62px documentation

Introduce basic documentation for the am62p family of SoCs.

Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agoconfigs: introduce configs needed for the am62px
Bryan Brattlof [Tue, 12 Mar 2024 20:20:29 +0000 (15:20 -0500)] 
configs: introduce configs needed for the am62px

Introduce the initial configs needed to support the am62px SoC family

Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agoarm: dts: introduce am62p5 U-Boot dts files
Bryan Brattlof [Tue, 12 Mar 2024 20:20:28 +0000 (15:20 -0500)] 
arm: dts: introduce am62p5 U-Boot dts files

Include the U-Boot device tree files needed to boot the board.

Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agodma: ti: k3-udma: Add DMA PSIL mappings for AM62P and J722S
Vignesh Raghavendra [Tue, 12 Mar 2024 20:20:27 +0000 (15:20 -0500)] 
dma: ti: k3-udma: Add DMA PSIL mappings for AM62P and J722S

Add PSIL data for the AM62P and the J722S SoC family. The PSIL mapping
for the J722S is the same except for the extra instances of the CSI-RX.
So let's reuse the same file for both the AM62P and J722S.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
[bb@ti.com: rebased to U-Boot v2024.01]
Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agofirmware: ti_sci_static_data: add static DMA channel data
Hari Nagalla [Tue, 12 Mar 2024 20:20:26 +0000 (15:20 -0500)] 
firmware: ti_sci_static_data: add static DMA channel data

Include the static DMA channel data for ti_sci

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agoboard: ti: introduce basic board files for the am62px family
Bryan Brattlof [Tue, 12 Mar 2024 20:20:25 +0000 (15:20 -0500)] 
board: ti: introduce basic board files for the am62px family

Introduce the basic files needed to support the am62px family of SoCs

Co-developed-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agoarch: mach-k3: introduce basic files to support the am62px SoC family
Bryan Brattlof [Tue, 12 Mar 2024 20:20:24 +0000 (15:20 -0500)] 
arch: mach-k3: introduce basic files to support the am62px SoC family

Introduce the basic functions and definitions needed to properly
initialize TI's am62p family of SoCs

Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agoarm: mach-k3: invert logic for split DM firmware config
Bryan Brattlof [Tue, 12 Mar 2024 20:20:23 +0000 (15:20 -0500)] 
arm: mach-k3: invert logic for split DM firmware config

Currently, for the K3 generation of SoCs, there are more SoCs that
utilize the split firmware approach than the combined DMSC firmware.
Invert the logic to avoid adding more and more SoCs to this list.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Acked-by: Andrew Davis <afd@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agoram: k3-ddrss: enable the am62ax's DDR controller for am62px
Bryan Brattlof [Tue, 12 Mar 2024 20:20:22 +0000 (15:20 -0500)] 
ram: k3-ddrss: enable the am62ax's DDR controller for am62px

The am62px family of SoCs uses the same DDR controller as found on the
am62ax family. Enable this option when building for the am62px family

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agoarm: mach-k3: am62px: introduce clock and device files for wkup spl
Bryan Brattlof [Tue, 12 Mar 2024 20:20:21 +0000 (15:20 -0500)] 
arm: mach-k3: am62px: introduce clock and device files for wkup spl

Include the clock and lpsc tree files needed for the wkup spl to
initialize the proper PLLs and power domains to boot the SoC.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agopower: domain: ti: use IS_ENABLED macro
Bryan Brattlof [Tue, 12 Mar 2024 20:20:20 +0000 (15:20 -0500)] 
power: domain: ti: use IS_ENABLED macro

Cleanup this list and standardize on using the IS_ENABLED macro for the
power domain data list.

Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agosoc: add info to identify the am62p SoC family
Bryan Brattlof [Tue, 12 Mar 2024 20:20:19 +0000 (15:20 -0500)] 
soc: add info to identify the am62p SoC family

Include the part number for TI's am62px family of SoCs so we can
properly identify it during boot

Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agoMerge tag 'v2024.04-rc4' into next
Tom Rini [Mon, 11 Mar 2024 17:40:06 +0000 (13:40 -0400)] 
Merge tag 'v2024.04-rc4' into next

Prepare v2024.04-rc4

6 months agoPrepare v2024.04-rc4 v2024.04-rc4
Tom Rini [Mon, 11 Mar 2024 17:11:46 +0000 (13:11 -0400)] 
Prepare v2024.04-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
6 months agoMerge tag 'u-boot-imx-master-20240311' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Mon, 11 Mar 2024 13:22:44 +0000 (09:22 -0400)] 
Merge tag 'u-boot-imx-master-20240311' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

- Use TF-A on imx8mp_beacon to fix boot regression.
- Use latest 6.8 dts for imx8mp_beacon.
- Fix the RAM initialization for phycore_imx8mp PCL-070 rev 1.
- Describe the 0087 i.mx8m mini product variant in tdx-cfg-block.

6 months agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 11 Mar 2024 13:05:01 +0000 (09:05 -0400)] 
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
6 months agoarm: dts: imx8mp-beacon-kit: Resync DTS with Linux 6.8
Adam Ford [Sun, 10 Mar 2024 16:59:01 +0000 (11:59 -0500)] 
arm: dts: imx8mp-beacon-kit: Resync DTS with Linux 6.8

The device tree has evolved over time, so re-sync.  This also
partial reverts one change on the PCIe, because U-Boot doesn't
have a proper driver.  However, since the clock is configured
to generate a 100MHz reference clock by default, a proper driver
isn't really necessary.

Signed-off-by: Adam Ford <aford173@gmail.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
6 months agotoradex: tdx-cfg-block: add 0087 i.mx8m mini product variant
Joao Paulo Goncalves [Fri, 8 Mar 2024 14:18:01 +0000 (11:18 -0300)] 
toradex: tdx-cfg-block: add 0087 i.mx8m mini product variant

Add new product id 0087 Verdin iMX8M Mini Quad 2GB IT.

Signed-off-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
6 months agoconfigs: imx8mp_beacon: Fall back to using TF-A
Adam Ford [Thu, 7 Mar 2024 11:58:58 +0000 (05:58 -0600)] 
configs: imx8mp_beacon: Fall back to using TF-A

When the board was originally added, it enabled some features which
allowed it to bypass Trusted Firmware, but as the feature set of
Linux grew and more features became available, the U-Boot config
options which bypassed TF-A caused issues, so it needs to return
to the standard operating mode of using TF-A or the system no
longer boots.

Fixes: ab53bd43dbde ("arm64: imx: Add support for imx8mp-beacon-kit")
Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
6 months agoboard: phycore_imx8mp: Use 2GHz RAM timings for PCL-070 from pcb_rev 1
Benjamin Hahn [Wed, 6 Mar 2024 16:18:32 +0000 (17:18 +0100)] 
board: phycore_imx8mp: Use 2GHz RAM timings for PCL-070 from pcb_rev 1

We need to differ between PCL-070 and PCM-070. PCL-070 supports 2GHz RAM
timings from pcb rev 1 or newer. PCM-070 supports 2GHz RAM timings from
pcb rev 3 or newer.

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
6 months agoboard: phytec: common: phytec_som_detection: Add phytec_get_som_type
Benjamin Hahn [Wed, 6 Mar 2024 16:18:31 +0000 (17:18 +0100)] 
board: phytec: common: phytec_som_detection: Add phytec_get_som_type

Add a function that gets the som_type from the EEPROM.
Add an enum for the som_type.

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
6 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Sat, 9 Mar 2024 16:29:48 +0000 (11:29 -0500)] 
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

- Singular quirk DT property rename.

6 months agonet: phy: Use PHY MDIO address from DT if available
Marek Vasut [Sun, 28 Jan 2024 01:19:40 +0000 (02:19 +0100)] 
net: phy: Use PHY MDIO address from DT if available

In case the PHY is fully described in DT, use PHY MDIO address
from DT directly instead of always using auto-detection. This
also fixes the behavior of 'mdio list' in such DT setup, which
now prints the PHY connected to the MAC correctly.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
6 months agoMerge branch '2024-03-07-assorted-fixes' into next
Tom Rini [Thu, 7 Mar 2024 16:56:35 +0000 (11:56 -0500)] 
Merge branch '2024-03-07-assorted-fixes' into next

- Add phytec am64x platform, update am65-cpsw and a few other assorted
  fixes.

6 months agocmd: md5sum: use hash_command
Igor Opaniuk [Sat, 2 Mar 2024 15:05:48 +0000 (16:05 +0100)] 
cmd: md5sum: use hash_command

Drop old implementation and use hash_command() instead, as
how it's currently done for crc32 and sha1sum cmds.

Test:
=> md5sum 0x60000000 0x200
md5 for 60000000 ... 600001ff ==> e6bbbe95f5b41996f4a9b9af7bbd4050

Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com>
6 months agoautoboot: Add check for result of malloc_cache_aligned()
Maks Mishin [Thu, 29 Feb 2024 22:32:11 +0000 (01:32 +0300)] 
autoboot: Add check for result of malloc_cache_aligned()

Return value of a function 'malloc_cache_aligned'
is dereferenced at autoboot.c:207 without checking for NULL,
but it is usually checked for this function.

Found by RASU JSC.

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
6 months agoserial: pl01x: set baudrate when probing
Yang Xiwen [Wed, 28 Feb 2024 10:57:52 +0000 (18:57 +0800)] 
serial: pl01x: set baudrate when probing

It is found that when DM is enabled, only generic init function is
called in .probe(). Baudrate is never honored. Add a function call
to .setbrg() when probing so that we can update the baudrate of the
serial device.

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
6 months agonet: am65-cpsw: cpsw_mdio: Switch to proper DM_MDIO framework
Roger Quadros [Wed, 28 Feb 2024 10:35:27 +0000 (12:35 +0200)] 
net: am65-cpsw: cpsw_mdio: Switch to proper DM_MDIO framework

Add a new Kconfig symbol MDIO_TI_CPSW for the CPSW MDIO
driver and build it with proper DM support if enabled.

If MDIO_TI_CPSW is not enabled then we continue to
behave like before.

Clean up MDIO custom handling in am65-cpsw and use
dm_eth_phy_connect() to get the PHY.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Tested-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
6 months agonet: mdio: Handle bus level GPIO Reset
Roger Quadros [Wed, 28 Feb 2024 10:35:26 +0000 (12:35 +0200)] 
net: mdio: Handle bus level GPIO Reset

Some platforms have bus level Reset controlled
by a GPIO line. If available then handle bus reset
via GPIO.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
6 months agodoc: board: phytec: Add phyCORE-AM64x
Wadim Egorov [Wed, 28 Feb 2024 08:42:17 +0000 (09:42 +0100)] 
doc: board: phytec: Add phyCORE-AM64x

Add documentation for PHYTEC phyCORE-AM64x SoM.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
6 months agoboard: phytec: am64x: Add PHYTEC phyCORE-AM64x SoM
Wadim Egorov [Wed, 28 Feb 2024 08:42:16 +0000 (09:42 +0100)] 
board: phytec: am64x: Add PHYTEC phyCORE-AM64x SoM

Add support for PHYTEC phyCORE-AM64x SoM.

Supported features:
  - 2GB DDR4 RAM
  - eMMC Flash
  - external uSD
  - OSPI NOR Flash
  - debug UART

Product page SoM: https://www.phytec.com/product/phycore-am64x

Device trees were taken from Linux v6.8-rc2.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
6 months agoCheck curve_name for null to avoid crash
Bob Wolff [Tue, 27 Feb 2024 23:57:03 +0000 (15:57 -0800)] 
Check curve_name for null to avoid crash

If mixed rsa and ecdsa keys are specified in dtsi, an rsa key can be sent
into the ecdsa verify. Without the ecdsa,curve property, this function will
crash due to lack of checking the null pointer return.

Signed-off-by: Bob Wolff <bob.wolff68@gmail.com>
6 months agoMerge patch series "Move DRAM address of ATF"
Tom Rini [Wed, 6 Mar 2024 14:11:00 +0000 (09:11 -0500)] 
Merge patch series "Move DRAM address of ATF"

Andrew Davis <afd@ti.com> says:

Explanation for this series is mostly in [4/6]. First 3
patches should be safe to take independent of the last 3.

6 months agoarm: mach-k3: Move DRAM address of ATF for AM62/AM62a
Andrew Davis [Wed, 14 Feb 2024 16:30:09 +0000 (10:30 -0600)] 
arm: mach-k3: Move DRAM address of ATF for AM62/AM62a

The current address of TF-A in DRAM is just below the 512MB address line.
This means if the DRAM in a system is 512MB then TF-A is right at the
end of memory which is often reused, for instance U-Boot relocates itself
here. If a system has less than 512MB then that system wouldn't work at
all as TF-A would fail to load.

To avoid the issues above, move TF-A to the start of DRAM, which doesn't
change from system to system.

As TF-A is position independent, this has no dependency on TF-A. We
also fixup DT as needed when TF-A address is moved, so this change also
has no dependency on Linux and is fully forward/backward compatible.

Signed-off-by: Andrew Davis <afd@ti.com>
Acked-by: Bryan Brattlof <bb@ti.com>
6 months agoarm: mach-k3: am62a: Fixup TF-A/OP-TEE reserved-memory node in FDT
Andrew Davis [Wed, 14 Feb 2024 16:30:08 +0000 (10:30 -0600)] 
arm: mach-k3: am62a: Fixup TF-A/OP-TEE reserved-memory node in FDT

The address we load TFA and OP-TEE to is configurable by
CONFIG_K3_{ATF,OPTEE}_LOAD_ADDR, but the DT nodes reserving this memory
are static. Fix that by updating this node when the loaded address
does not match the address in DT.

Signed-off-by: Andrew Davis <afd@ti.com>
Acked-by: Bryan Brattlof <bb@ti.com>
6 months agoarm: mach-k3: am62: Fixup TF-A/OP-TEE reserved-memory node in FDT
Andrew Davis [Wed, 14 Feb 2024 16:30:07 +0000 (10:30 -0600)] 
arm: mach-k3: am62: Fixup TF-A/OP-TEE reserved-memory node in FDT

The address we load TF-A and OP-TEE to is configurable by Kconfig
CONFIG_K3_{ATF,OPTEE}_LOAD_ADDR, but the DT nodes reserving this memory
are often statically defined. As these binaries are dynamically loadable,
and in the case of OP-TEE may not even be loaded at all, hard-coding these
addresses is not a hardware description, but rather a configuration.

If the address that U-Boot loaded TF-A or OP-TEE does not match the
address in hard-coded in DT, then fix that node address. This also handles
the case when no reserved memory for these is provided by DT, which is
more correct as explained above.

Add this fixup function, and enable it for AM62.

Signed-off-by: Andrew Davis <afd@ti.com>
Acked-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
6 months agoarm: mach-k3: am62: Enable OF_SYSTEM_SETUP for all boards
Andrew Davis [Wed, 14 Feb 2024 16:30:06 +0000 (10:30 -0600)] 
arm: mach-k3: am62: Enable OF_SYSTEM_SETUP for all boards

The fixups provided by ft_system_setup() are applicable for all AM62 based
boards. Select this at the target selection level for all AM62 boards and
remove it from any specific defconfig.

Signed-off-by: Andrew Davis <afd@ti.com>
6 months agoarm: mach-k3: Add config option for setting OP-TEE address
Andrew Davis [Wed, 14 Feb 2024 16:30:05 +0000 (10:30 -0600)] 
arm: mach-k3: Add config option for setting OP-TEE address

Much like we have for ATF, OP-TEE has a standard address that we load
it too and run it from. Add a Kconfig item for this to remove some
hard-coding and allow this address to be more easily changed.

Signed-off-by: Andrew Davis <afd@ti.com>
Acked-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
6 months agoarm: mach-k3: Add default ATF location for AM62/AM62a
Andrew Davis [Wed, 14 Feb 2024 16:30:04 +0000 (10:30 -0600)] 
arm: mach-k3: Add default ATF location for AM62/AM62a

There is a default ATF load address that is used for devices that have
ATF running in SRAM. For AM62 and AM62a, ATF runs from DRAM. Instead
of having to override the address in every defconfig, make add a
default for these ATF in DRAM devices.

Signed-off-by: Andrew Davis <afd@ti.com>
Acked-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
6 months agoarm: dts: k3-binman: Make optee optional as requirement
Michael Trimarchi [Mon, 26 Feb 2024 07:14:15 +0000 (08:14 +0100)] 
arm: dts: k3-binman: Make optee optional as requirement

Allow boards that use ti_spl_template to not use optee part in
configuration.
Vendor can have module with 256 Mb of memory and they try to optimize
the available memory just using the essential components.
This change allow to remove tee from configuration without binman
fail.

configurations {
default = "conf-0";

conf-0 {
description = "k3-am62_ccm_m3";
firmware = "atf";
loadables = "dm", "spl";
fdt = "fdt-0";
};
};

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
6 months agoMerge patch series "Enable OSPI on j721e"
Tom Rini [Tue, 5 Mar 2024 13:39:54 +0000 (08:39 -0500)] 
Merge patch series "Enable OSPI on j721e"

Jonathan Humphreys <j-humphreys@ti.com> says:

This series enables OSPI storage and boot.

6 months agoarm: dts: k3-j721e-sk: Remove OSPI phypattern partition
Jonathan Humphreys [Sat, 24 Feb 2024 00:23:07 +0000 (18:23 -0600)] 
arm: dts: k3-j721e-sk: Remove OSPI phypattern partition

The phy calibration pattern partition isn't needed as the Cadence driver isn't
calibrating the phys.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
Fixes: 58d61fb5a77e ("arm: dts: k3-j721e-sk: Add initial A72 specific dts support")
6 months agoarm: mach-k3: j721e: Enable OSPI boot
Jonathan Humphreys [Sat, 24 Feb 2024 00:23:06 +0000 (18:23 -0600)] 
arm: mach-k3: j721e: Enable OSPI boot

Add boot ROM XSPI bootmode, and set to BOOT_DEVICE_SPI if detected.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
6 months agoconfigs: j721e: Enable OSPI memory
Jonathan Humphreys [Sat, 24 Feb 2024 00:23:05 +0000 (18:23 -0600)] 
configs: j721e: Enable OSPI memory

Set config values to enable OSPI functionality.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
6 months agoMerge patch series "enable OSPI support on AM64x"
Tom Rini [Tue, 5 Mar 2024 13:39:31 +0000 (08:39 -0500)] 
Merge patch series "enable OSPI support on AM64x"

Jonathan Humphreys <j-humphreys@ti.com> says:

This series enables OSPI support for AM64x by setting the proper configs, and DT
entries for SPL.

6 months agoarm: dts: k3-am642-evm/sk: Enable OSPI support in SPL
Jonathan Humphreys [Sat, 24 Feb 2024 00:17:02 +0000 (18:17 -0600)] 
arm: dts: k3-am642-evm/sk: Enable OSPI support in SPL

Add bootph DT tags to enable OSPI in SPL.
Set OSPI regs for R5 SPL to address OSPI's boot region.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
6 months agoconfigs: am64x_evm_*_defconfig: Enable OSPI support
Jonathan Humphreys [Sat, 24 Feb 2024 00:17:01 +0000 (18:17 -0600)] 
configs: am64x_evm_*_defconfig: Enable OSPI support

Add configs to support OSPI flash.

Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
6 months agoarch/arm/mach-omap2/omap5/fdt.c: ft_fixup_clocks: use clock-output-names property...
Romain Naour [Mon, 22 Jan 2024 10:30:44 +0000 (11:30 +0100)] 
arch/arm/mach-omap2/omap5/fdt.c: ft_fixup_clocks: use clock-output-names property as fallback (kernel 5.19+)

Clock names has been updated in kernel 5.19+ with the removal of
non-standard node names [1]. Due to this change, ft_opp_clock_fixups()
doesn't work anymore since ft_fixup_clocks() is looking to the clock
name and ft_opp_clock_fixups() error out with the following message:

  ft_fixup_clocks failed for DSP voltage domain: <valid offset/length>

We can't use the new clock name since several clock are using the same
generic name "clock". ft_opp_clock_fixups() is looking at the clocks
node in cm_core_aon@0:

/sys/firmware/devicetree/base/ocp/interconnect@4a000000/segment@0/target-module@5000/cm_core_aon@0/clocks
  ...
  clock@120
  clock@160
  clock@1a0
  clock@1e0
  clock@210
  clock@234
  clock@284
  clock@2a8
  clock@2d8

When fdt_subnode_offset() fail, we can look at clock-output-names
property as fallback since it contain the previous clock name.

libfdt doesn't provide any support to replace fdt_subnode_offset() by
a new function looking for clock-output-names property instead of the
node name. So we have to implement it in arch/arm/mach-omap2/omap5/fdt.c
for now.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e4920169e7a2a839836d3a0d8cda1bae8caa3056

Cc: Suman Anna <s-anna@ti.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Andrew Davis <afd@ti.com>
Signed-off-by: Romain Naour <romain.naour@skf.com>
6 months agovirtio: fix get_config / set_config for legacy VirtIO targets
Dmitry Baryshkov [Mon, 12 Feb 2024 07:37:08 +0000 (09:37 +0200)] 
virtio: fix get_config / set_config for legacy VirtIO targets

The functions virtio_pci_get_config() and virtio_pci_set_config() don't
take the offset into account when reading the config space. For example
this manifests when U-Boot tries to read the MAC address of the VirtIO
networking device. It reads 6 equa bytes instead of the proper addess.

Fix those functions by taking the offset in the config space into
account.

Fixes: 4135e10732a0 ("virtio: Add virtio over pci transport driver")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
6 months agoMerge patch series "Fix driver for misc/atsha204a"
Tom Rini [Tue, 5 Mar 2024 13:08:31 +0000 (08:08 -0500)] 
Merge patch series "Fix driver for misc/atsha204a"

Michał Barnaś <barnas@google.com> says:

Fix the driver to behave like the chip datasheet requires.
Improve wake up function to send low signal on SDA line for at least
60us as chip requires to wake up. Fix sleep function to move the chip
into sleep mode, not into idle mode. Remove unnecessary for loop,
which would never run for more than one iteration.

6 months agomisc: atsha204a: fix wakeup function
Michał Barnaś [Mon, 19 Feb 2024 16:32:04 +0000 (16:32 +0000)] 
misc: atsha204a: fix wakeup function

The ATSHA204A chip requires SDA line to go low for at least 60us to
wake up the chip. Previous implementation did not meet this requirement
due to the NAK received on bus and not sending the zeroes.
The function to ignore the NAK and send bytes regardless is not
supported in the u-boot making it impossible to wake up the chip
this way.
Instead, the bus speed, if needed, is set to lowest value and the
message is sent to the address 0x0. This way, the address of zero
makes the SDA line go low for about 80us, meeting the required time
to wake up the chip. The zero length packet is not sent by the i2c,
so the one byte is sent to the transfer function, but only the address
is sent anyway.
After sending the zero address, the bus speed is restored to the
previous value if it was slowed down to wake up the chip.

Signed-off-by: Michał Barnaś <barnas@google.com>
6 months agomisc: atsha204a: fix sleep function
Michał Barnaś [Mon, 19 Feb 2024 16:32:03 +0000 (16:32 +0000)] 
misc: atsha204a: fix sleep function

Fix the sleep function to issue the sleep command instead of idle one.

Signed-off-by: Michał Barnaś <barnas@google.com>
6 months agomisc: atsha204a: remove broken for loop
Michał Barnaś [Mon, 19 Feb 2024 16:32:02 +0000 (16:32 +0000)] 
misc: atsha204a: remove broken for loop

Some previous commit changed the continue statement to return,
making the for loop used to retry waking up the chip to always
return after one iteration. This commit removes the loop, cleaning
the code a little.

Signed-off-by: Michał Barnaś <barnas@google.com>
6 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Tue, 5 Mar 2024 12:08:55 +0000 (07:08 -0500)] 
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-marvell

- net: mv88e6xxx: fix missing SMI address initialization (Marek)
- mvebu: turris_omnia: Enable networking via ethernet switch (Marek)
- mvebu: helios-4: add config fragment for spi booting et al (Josua)
- rng: Add Turris Mox rTWM RNG driver (Max)

6 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Tue, 5 Mar 2024 12:08:10 +0000 (07:08 -0500)] 
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

One fix makes the reboot more robust on some older board, another one
stabilises the initial clock setup on the A10/A20.
Two patches make sure our DRAM init does not actually change the content
of the DRAM array, which allows to use DRAM for Linux' pstore
functionality.
We get SPI support for U-Boot proper for one more SoC, that patch was
lingering around for a while, and should not affect other SoCs, so I am
merging this now.
As an added bonus, we get the defconfig file for a new board, the DT was
already synced from the kernel tree.

The CI looked happy with changes, and I tested them on five different
boards with different SoCs.

6 months agorng: Add Turris Mox rTWM RNG driver
Max Resch [Thu, 15 Feb 2024 16:57:57 +0000 (17:57 +0100)] 
rng: Add Turris Mox rTWM RNG driver

A RNG driver for Armada 3720 boards running the Turris Mox rWTM firmware
from CZ.NIC in the secure processor.

Signed-off-by: Max Resch <resch.max@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
6 months agoboard: helios-4: add config fragment for spi booting
Josua Mayer [Fri, 2 Feb 2024 15:13:34 +0000 (16:13 +0100)] 
board: helios-4: add config fragment for spi booting

Add a config fragment with required differences for booting from spi
flash instead of sd-card (default).

Settings for environment location are based on vendor u-boot:
https://github.com/kobol-io/u-boot/blob/helios4/include/configs/helios4.h#L59

The fragment can be applied on top of helios4_defconfig by make:
make helios4_defconfig spiboot.config

Signed-off-by: Josua Mayer <josua@solid-run.com>
6 months agoarm: mvebu: helios4_defconfig: enable setexpr command
Josua Mayer [Fri, 2 Feb 2024 15:13:33 +0000 (16:13 +0100)] 
arm: mvebu: helios4_defconfig: enable setexpr command

Update the helios4 defconfig to enable the 'setexpr' command, which is a
default and useful for various complex boot-scripts.

Signed-off-by: Josua Mayer <josua@solid-run.com>
6 months agoarm: dts: armada-38x-solidrun-microsom: configure i2c0 bus
Josua Mayer [Fri, 2 Feb 2024 15:13:32 +0000 (16:13 +0100)] 
arm: dts: armada-38x-solidrun-microsom: configure i2c0 bus

SolidRun Armada-388 SoM has an i2c bus supporting on-som eeprom, and
peripherals on a carrier.
armada-38x.dtsi disables this bus by default, it should be enabled by
som or carrier dts.

Linux has moved i2c0 from helios-4 board dts to som dtsi, including
status, pinctrl and clock speed.
Copy these settings from mainline.

This fixes accessing i2c bus from u-boot commandline.

Signed-off-by: Josua Mayer <josua@solid-run.com>
6 months agoarm: mvebu: turris_omnia: Enable networking via ethernet switch
Marek Mojík [Tue, 19 Dec 2023 09:55:55 +0000 (10:55 +0100)] 
arm: mvebu: turris_omnia: Enable networking via ethernet switch

The Turris Omnia contains the Marvell 88E6176 ethernet switch. Add
config options and device tree to enable the support.

Signed-off-by: Marek Mojík <marek.mojik@nic.cz>
Signed-off-by: Marek Behún <kabel@kernel.org>
6 months agonet: mv88e6xxx: fix missing SMI address initialization
Marek Mojík [Wed, 6 Dec 2023 14:35:56 +0000 (15:35 +0100)] 
net: mv88e6xxx: fix missing SMI address initialization

The mv88e6xxx driver does not currently initialize the smi_addr field, but
instead keeps the default zero value. This leads to driver being unusable
on devices where the switch is not on address zero of the mdio bus. Fix
this problem by reading the SMI address from device tree.

Signed-off-by: Marek Mojík <marek.mojik@nic.cz>
Reviewed-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
6 months agosunxi: restore modified memory
Andrey Skvortsov [Wed, 27 Dec 2023 21:28:43 +0000 (00:28 +0300)] 
sunxi: restore modified memory

Current sunxi DRAM initialisation code does several test accesses to the
DRAM array to detect aliasing effects and so determine the correct
row/column configuration. This changes the DRAM content, which breaks
use cases like soft reset and Linux's ramoops mechanism.

Fix this problem by saving and restoring the content of the DRAM cells
that is used for the test writes.

Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
6 months agosunxi: reorganize mctl_mem_matches_* functions
Andrey Skvortsov [Wed, 27 Dec 2023 21:28:42 +0000 (00:28 +0300)] 
sunxi: reorganize mctl_mem_matches_* functions

mctl_mem_matches and mctl_mem_matches_base identical functions. To
avoid code duplication move them to dram_helpers and make
mctl_mem_matches use generic mctl_mem_matches_base.

Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
6 months agousb: xhci-dwc3: Fix support for dis_enblslpm_quirk
Jonas Karlman [Sat, 2 Mar 2024 13:09:49 +0000 (13:09 +0000)] 
usb: xhci-dwc3: Fix support for dis_enblslpm_quirk

No device tree in U-Boot or linux use the wrong spelling used in code.

Use correct property name as defined in dwc3 bindings.

Fixes: 062790f46131 ("usb: xhci-dwc3: Add USB2 PHY configuration")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Marek Vasut <marex@denx.de>
6 months agoMerge tag 'u-boot-imx-master-20240304' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Mon, 4 Mar 2024 20:41:38 +0000 (15:41 -0500)] 
Merge tag 'u-boot-imx-master-20240304' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/19817

- Fix i.MX93 OP-TEE support.
- Use the container image for i.MX93 revision A1.
- Fix display regression on opos6uldev.

6 months agoMerge branch '2024-03-04-assorted-TI-K3-updates' into next
Tom Rini [Mon, 4 Mar 2024 17:07:21 +0000 (12:07 -0500)] 
Merge branch '2024-03-04-assorted-TI-K3-updates' into next

- Merge assorted TI K3 platform / SoC updates

6 months agoMerge patch series "Introduce initial TI's J784S4 and AM69 support"
Tom Rini [Mon, 4 Mar 2024 17:02:49 +0000 (12:02 -0500)] 
Merge patch series "Introduce initial TI's J784S4 and AM69 support"

Apurva Nandan <a-nandan@ti.com> says:

Hello Everyone!

This series will introduce basic support (SD and UART) support for Texas
Instruments J784S4 EVM.

The J784S4 SoC device tree patches are taken from kernel patch submissions
and will be updated as they are accepted and merged to the kernel tree.
All other patches are specific to SPL and u-boot and do not have
dependency on other trees. Appreciate a review for acceptance to u-boot
tree.

Here are some of the salient features of the J784S4 automotive grade
application processor:

The J784S4 SoC belongs to the K3 Multicore SoC architecture
platform, providing advanced system integration in automotive,
ADAS and industrial applications requiring AI at the network edge.
This SoC extends the K3 Jacinto 7 family of SoCs with focus on
raising performance and integration while providing interfaces,
memory architecture and compute performance for multi-sensor, high
concurrency applications.

Some highlights of this SoC are:
* Up to 8 Cortex-A72s, four clusters of lockstep capable dual Cortex-R5F MCUs,
  4 C7x floating point vector DSPs with Matrix Multiply Accelerator(MMA) for
  deep learning and CNN.
* 3D GPU: Automotive grade IMG BXS-4-64 MC1
* Vision Processing Accelerator (VPAC) with image signal processor and Depth
  and Motion Processing Accelerator (DMPAC)
* Three CSI2.0 4L RX plus two CSI2.0 4L TX, two DSI Tx, one eDP/DP and one
  DPI interface.
* Integrated gigabit ethernet switch, up to 8 ports (TDA4VH), two ports
  support 10Gb USXGMII; Two 4 lane PCIe-GEN3 controllers, USB3.0 Dual-role
  device subsystems, Up to 20 MCANs, among other peripherals.

See J784S4 Technical Reference Manual (SPRUJ52 - JUNE 2022)
for further details: http://www.ti.com/lit/zip/spruj52

In addtion, the J784S4 EVM board is designed for TI J784S4 SoC. It
supports the following interfaces:
* 32 GB DDR4 RAM
* x2 Gigabit Ethernet interfaces capable of working in Switch and MAC mode
* x1 Input Audio Jack, x1 Output Audio Jack
* x1 USB2.0 Hub with two Type A host and x1 USB 3.1 Type-C Port
* x2 4L PCIe connector
* x1 UHS-1 capable micro-SD card slot
* 512 Mbit OSPI flash, 1 Gbit Octal NAND flash, 512 Mbit QSPI flash,
  UFS flash.
* x6 UART through UART-USB bridge
* XDS110 for onboard JTAG debug using USB
* Temperature sensors, user push buttons and LEDs
* 40-pin User Expansion Connector
* x2 ENET Expansion Connector, x1 GESI expander, x2 Display connector
* x1 15-pin CSI header
* x6 MCAN instances

Schematics: https://www.ti.com/lit/zip/sprr458

AM69 SD mode bootlog: https://gist.githubusercontent.com/apurvanandan1997/1b2c55d0204ff0f5a47ebbc196a97e99/raw/
J784S4 SD mode bootlog: https://gist.githubusercontent.com/apurvanandan1997/5e2ef85ee4322798d22b57a60dc917db/raw/
eMMC UDA moode bootlog: https://gist.githubusercontent.com/apurvanandan1997/3cffada252d50a8aa0c00a91f1f2f856/raw/

6 months agodma: ti: k3-udma: Fix ring_idx to pair k3 nav rings
Udit Kumar [Wed, 21 Feb 2024 14:23:44 +0000 (19:53 +0530)] 
dma: ti: k3-udma: Fix ring_idx to pair k3 nav rings

ring_idx was not correctly assigned in case of tflow_id is zero.
Which leads to wrong pairing of DMA for drivers like OSPI.

Fixes: 4312a1dfca26 ("dma: ti: k3-udma: Use ring_idx to pair k3 nav rings")
Reviewed-by: Jai Luthra <j-luthra@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
6 months agodoc: board: ti: k3: Add J784S4 EVM and AM69 SK documentation
Apurva Nandan [Fri, 23 Feb 2024 20:21:53 +0000 (01:51 +0530)] 
doc: board: ti: k3: Add J784S4 EVM and AM69 SK documentation

TI K3 J784S4 and AM69 are new additions to the K3 SoC family.
Add documentation about the J784S4 EVM and AM69 SK.

Signed-off-by: Dasnavis Sabiya <sabiya.d@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> # AM69-SK
6 months agoboard: ti: rm-cfg: Update rm-cfg to reflect new resource reservation
Vishal Mahaveer [Tue, 20 Feb 2024 20:39:44 +0000 (14:39 -0600)] 
board: ti: rm-cfg: Update rm-cfg to reflect new resource reservation

With the latest TIFS firmware, an additional virtual interrupt and
event is reserved for TIFS usage on am62x and am62ax devices.

Update the rm-cfg to reflect this new reservation.

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
6 months agoconfigs: am69_sk: Add defconfig for AM69 SK board
Dasnavis Sabiya [Fri, 23 Feb 2024 20:21:52 +0000 (01:51 +0530)] 
configs: am69_sk: Add defconfig for AM69 SK board

Add defconfig for AM69 SK A72 and R5 configuration.

This inlcudes and modifies the J784S4 EVM defconfigs:
j784s4_evm_a72_defconfig -> am69_sk_a72_defconfig
j784s4_evm_r5_defconfig -> am69_sk_r5_defconfig

Signed-off-by: Dasnavis Sabiya <sabiya.d@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> # AM69-SK
6 months agodma: ti: k3-udma: Fix error handling for setup_resources() in udma_probe()
Siddharth Vadapalli [Tue, 20 Feb 2024 10:04:51 +0000 (15:34 +0530)] 
dma: ti: k3-udma: Fix error handling for setup_resources() in udma_probe()

In udma_probe() the return value of setup_resources() is stored in the
u32 "ch_count" member of "struct udma_dev", due to which any negative
return value which indicates an error is masked.

Fix this by storing the return value of setup_resources() in the already
declared integer variable "ret", followed by assigning it to the "ch_count"
member of "struct udma_dev" in case of no error.

While at it, change the "return ret" at the end of udma_probe() to a
"return 0", to explicitly indicate that probe was successful.

Fixes: a8837cf43839 ("dma: ti: k3-udma: Query DMA channels allocated from Resource Manager")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
6 months agoconfigs: j784s4_evm: Add defconfig for J784S4 EVM board
Apurva Nandan [Fri, 23 Feb 2024 20:21:51 +0000 (01:51 +0530)] 
configs: j784s4_evm: Add defconfig for J784S4 EVM board

Add defconfigs for building R5 U-Boot SPL and A72 U-Boot.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> # AM69-SK
6 months agoconfigs: am64x_evm_r5_defconfig: enlarge simple malloc pool
Thomas Weißschuh [Fri, 9 Feb 2024 08:06:53 +0000 (09:06 +0100)] 
configs: am64x_evm_r5_defconfig: enlarge simple malloc pool

With the default size the stack grows into the malloc, pool leading to
stack corruption and boot failure.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
6 months agoarm: mach-k3: am62: Fixup thermal zone critical points
Joao Paulo Goncalves [Thu, 8 Feb 2024 09:29:51 +0000 (10:29 +0100)] 
arm: mach-k3: am62: Fixup thermal zone critical points

Read the max temperature for the SoC temperature grade from the hardware
and change the critical trip nodes on each thermal zone of FDT at
runtime so they are correct with the hardware value for its grade.

Signed-off-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
6 months agoarm: mach-k3: am62: Get soc max temperature by grade
Joao Paulo Goncalves [Thu, 8 Feb 2024 09:29:50 +0000 (10:29 +0100)] 
arm: mach-k3: am62: Get soc max temperature by grade

AM62x SoC is available in multiple temperature grade:
- Commercial: 0° to 95° C
- Industrial: -40° to 105° C
- Automotive: -40° to 125° C

Add a new function that returns the am62 max temperature value
accordingly to its temperature grade in Celsius.

Signed-off-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
6 months agoarm: mach-k3: Move ARM64 specific code into new arm64 directory
Andrew Davis [Fri, 2 Feb 2024 00:24:48 +0000 (18:24 -0600)] 
arm: mach-k3: Move ARM64 specific code into new arm64 directory

Like we did with R5, move ARM64 code into a specific directory to make
it clear what code is only meant to run on each core type.

Signed-off-by: Andrew Davis <afd@ti.com>
6 months agoarm: mach-k3: Move firewall removal into R5 directory
Andrew Davis [Fri, 2 Feb 2024 00:24:47 +0000 (18:24 -0600)] 
arm: mach-k3: Move firewall removal into R5 directory

Firewalls are only ever removed by the R5 core, move this code into
the R5 directory.

Signed-off-by: Andrew Davis <afd@ti.com>
6 months agoarm: mach-k3: am62a7: Disable firewalls only after loading SYSFW
Andrew Davis [Fri, 2 Feb 2024 00:24:46 +0000 (18:24 -0600)] 
arm: mach-k3: am62a7: Disable firewalls only after loading SYSFW

Currently we do this multiple times, instead just do it once after loading
SYSFW in R5 SPL.

Signed-off-by: Andrew Davis <afd@ti.com>
6 months agoarm: mach-k3: Move tispl.bin loading into R5 directory
Andrew Davis [Fri, 2 Feb 2024 00:24:45 +0000 (18:24 -0600)] 
arm: mach-k3: Move tispl.bin loading into R5 directory

ATF, OPTEE, DM (tispl.bin) loading is only ever done by the R5 core,
move the code into the R5 directory.

Signed-off-by: Andrew Davis <afd@ti.com>
6 months agoarm: mach-k3: Move disable_linefill_optimization() into R5 directory
Andrew Davis [Fri, 2 Feb 2024 00:24:44 +0000 (18:24 -0600)] 
arm: mach-k3: Move disable_linefill_optimization() into R5 directory

The disable_linefill_optimization() function is only ever loaded by the
R5 core, move the code into the R5 directory.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
6 months agoarm: mach-k3: Move SYS_K3_SPL_ATF definition into R5 Kconfig
Andrew Davis [Fri, 2 Feb 2024 00:24:43 +0000 (18:24 -0600)] 
arm: mach-k3: Move SYS_K3_SPL_ATF definition into R5 Kconfig

Loading ATF is only supported from the R5, move the Kconfig symbol
definition to match.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
6 months agoarm: dts: Introduce am69-sk u-boot dts files
Dasnavis Sabiya [Fri, 23 Feb 2024 20:21:50 +0000 (01:51 +0530)] 
arm: dts: Introduce am69-sk u-boot dts files

Introduce the base dts files needed for u-boot or to augment the linux
dtbs for use in the u-boot-spl and u-boot binaries.

Signed-off-by: Dasnavis Sabiya <sabiya.d@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> # AM69-SK
6 months agoarm: dts: Introduce j784s4 u-boot dts files
Apurva Nandan [Fri, 23 Feb 2024 20:21:49 +0000 (01:51 +0530)] 
arm: dts: Introduce j784s4 u-boot dts files

Introduce the base dts files needed for u-boot or to augment the linux
dtbs for use in the u-boot-spl and u-boot binaries.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
[ add binman and ddr dtsi files ]
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Dasnavis Sabiya <sabiya.d@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> # AM69-SK
6 months agoboard: ti: j784s4: Add boot environment variables
Apurva Nandan [Fri, 23 Feb 2024 20:21:48 +0000 (01:51 +0530)] 
board: ti: j784s4: Add boot environment variables

Add env file with necessary boot variables.

[ added env files ]
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
[ cleaned up the env files ]
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> # AM69-SK
6 months agoboard: ti: j748s4: Add board config yaml files
Apurva Nandan [Fri, 23 Feb 2024 20:21:47 +0000 (01:51 +0530)] 
board: ti: j748s4: Add board config yaml files

Add board-cfg, rm-cfg, pm-cfg, sec-cfg, tifs-rm-cfg yaml for buidling
u-boot sysfw data.

[ added board specific yaml files for binman ]
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> # AM69-SK
6 months agoboard: ti: j784s4: Add board support for J784S4 EVM
Apurva Nandan [Fri, 23 Feb 2024 20:21:46 +0000 (01:51 +0530)] 
board: ti: j784s4: Add board support for J784S4 EVM

Add board files for J784S4 EVM.

SYS_DISABLE_DCACHE_OPS is selected in the Kconfig because
J784S4/AM69 are a coherent architecture at A72 level by
MSMC support.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Dasnavis Sabiya <sabiya.d@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> # AM69-SK
6 months agodrivers: dma: Add support for J784S4 SoC
Apurva Nandan [Fri, 23 Feb 2024 20:21:45 +0000 (01:51 +0530)] 
drivers: dma: Add support for J784S4 SoC

Add support for DMA in J784S4 SoC.

Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> # AM69-SK
6 months agoarm: mach-k3: j784s4: Add clk and power support
Apurva Nandan [Fri, 23 Feb 2024 20:21:44 +0000 (01:51 +0530)] 
arm: mach-k3: j784s4: Add clk and power support

Add clk and device data which can be used by respective drivers
to configure clocks and PSC.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> # AM69-SK
6 months agosoc: ti: k3-socinfo: Add entry for J784S4 SoC
Apurva Nandan [Fri, 23 Feb 2024 20:21:43 +0000 (01:51 +0530)] 
soc: ti: k3-socinfo: Add entry for J784S4 SoC

Add support for J784S4 SoC Identification.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> # AM69-SK