]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
17 months agoMerge branch '2023-07-22-TI-K3-improvements'
Tom Rini [Mon, 24 Jul 2023 17:55:59 +0000 (13:55 -0400)]
Merge branch '2023-07-22-TI-K3-improvements'

- Actually merge the assorted K3 platform improvements that were
  supposed to be in commit 247aa5a19115 ("Merge branch
  '2023-07-21-assorted-TI-platform-updates'")

17 months agoMerge tag 'u-boot-at91-fixes-2023.10-a' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 24 Jul 2023 14:58:25 +0000 (10:58 -0400)]
Merge tag 'u-boot-at91-fixes-2023.10-a' of https://source.denx.de/u-boot/custodians/u-boot-at91

First set of u-boot-atmel fixes for the 2023.07 cycle:

This small fixes set includes the LTO configs for the boards that had
the SPL size up to the limit (sama5d2-based), such that more code can be
added.  It also includes a fix for mmc non-removable.

17 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Mon, 24 Jul 2023 14:58:07 +0000 (10:58 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv

- Set up per-hart stack before any function call
- Sync visionfive2 board DTS with Linux
- Define cache line size for USB 3.0 driver for RISC-V CPU

17 months agoatmel_sdhci: Force card-detect if MMC_CAP_NONREMOVABLE.
Zixun LI [Wed, 17 May 2023 13:49:45 +0000 (15:49 +0200)]
atmel_sdhci: Force card-detect if MMC_CAP_NONREMOVABLE.

If the device attached to the MMC bus is not removable, set force card-detect
bit to bypass card detection procedure, so card detection pin can be used for
other purposes.

It's also a workaround for SAMA5D2 who doesn't drive CMD if using GPIO for card
detection.

Signed-off-by: Zixun LI <zli@ogga.fr>
Reviewed-by: Eugen Hristev <eugen.hristev@collabora.com>
17 months agoconfigs: sama5d2: enable CONFIG_LTO
Eugen Hristev [Mon, 24 Jul 2023 10:05:13 +0000 (13:05 +0300)]
configs: sama5d2: enable CONFIG_LTO

arm-none-linux-gnueabihf-ld.bfd: u-boot-spl section `__u_boot_list' will not fit in region `.sram'
arm-none-linux-gnueabihf-ld.bfd: region `.sram' overflowed by 100 bytes

SPL is at limit so to stop seeing above error in built, enable
link time optimizations CONFIG_LTO.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Tested-by: Mihai Sain <mihai.sain@microchip.com>
17 months agoconfigs: at91: sama5d2_icp_mmc: Enable CONFIG_LTO
Stefan Roese [Thu, 27 Apr 2023 08:59:45 +0000 (10:59 +0200)]
configs: at91: sama5d2_icp_mmc: Enable CONFIG_LTO

Adding just a tiny bit more code for sama5d2_icp_mmc leads to a SRAM
image overflow. Fix this by enabling LTO for this board, so that such
changes still can be made to the common U-Boot code.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Pali Rohár <pali@kernel.org>
Tested-by: Mihai Sain <mihai.sain@microchip.com>
[eugen.hristev@microchip.com: restrict patch just to CONFIG_LTO]
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
17 months agoriscv: define a cache line size for the generic CPU
Heinrich Schuchardt [Fri, 21 Jul 2023 16:01:18 +0000 (18:01 +0200)]
riscv: define a cache line size for the generic CPU

The USB 3.0 driver xhci-mem.c requires CONFIG_SYS_CACHELINE_SIZE to be set.

Define the cache line size for QEMU on RISC-V to be 64 bytes.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
17 months agodoc: visionfive2: apply a trailing space to the prompt
Chanho Park [Fri, 14 Jul 2023 09:41:09 +0000 (18:41 +0900)]
doc: visionfive2: apply a trailing space to the prompt

Apply the trailing space changes in the guide document.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
17 months agoconfigs: visionfive2: add a trailing space to prompt
Chanho Park [Fri, 14 Jul 2023 09:41:08 +0000 (18:41 +0900)]
configs: visionfive2: add a trailing space to prompt

Adds a trailing space to SYS_PROMPT to make it easier to distinguish
between commands and the prompt.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
17 months agoclk: starfive: jh7110: Add of_xlate ops and macros for clock id conversion
Xingyu Wu [Fri, 7 Jul 2023 10:50:11 +0000 (18:50 +0800)]
clk: starfive: jh7110: Add of_xlate ops and macros for clock id conversion

Modify the drivers to add of_xlate ops and transform clock id.

Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Torsten Duwe <duwe@suse.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
17 months agodt-bindings: clock: jh7110: Modify clock id to be same with Linux
Xingyu Wu [Fri, 7 Jul 2023 10:50:10 +0000 (18:50 +0800)]
dt-bindings: clock: jh7110: Modify clock id to be same with Linux

The clock id needs to be changed to be consistent with Linux.

Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Torsten Duwe <duwe@suse.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
17 months agoriscv: dts: jh7110: Add clock source from PLL
Xingyu Wu [Fri, 7 Jul 2023 10:50:09 +0000 (18:50 +0800)]
riscv: dts: jh7110: Add clock source from PLL

Change the PLL clock source from syscrg to sys_syscon child node.

Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Torsten Duwe <duwe@suse.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
17 months agoriscv: dts: jh7110: Add PLL clock controller node
Xingyu Wu [Fri, 7 Jul 2023 10:50:08 +0000 (18:50 +0800)]
riscv: dts: jh7110: Add PLL clock controller node

Add child node about PLL clock controller in sys_syscon node.

Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Torsten Duwe <duwe@suse.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
17 months agoclk: starfive: jh7110: Separate the PLL driver
Xingyu Wu [Fri, 7 Jul 2023 10:50:07 +0000 (18:50 +0800)]
clk: starfive: jh7110: Separate the PLL driver

Drop the PLL part in SYSCRG driver and separate to be a single
PLL driver of which the compatible is "starfive,jh7110-pll".

Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Torsten Duwe <duwe@suse.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
17 months agoriscv: setup per-hart stack earlier
Bo Gan [Sun, 11 Jun 2023 23:54:17 +0000 (16:54 -0700)]
riscv: setup per-hart stack earlier

Harts need to use per-hart stack before any function call, even if that
function is a simple one. When the callee uses stack for register save/
restore, especially RA, if nested call, concurrent access by multiple
harts on the same stack will cause data-race.

This patch sets up SP before `board_init_f_alloc_reserve`. A side effect
of this is that the memory layout has changed as the following:

+----------------+        +----------------+ <----- SPL_STACK/
|  ......        |        |  hart 0 stack  |        SYS_INIT_SP_ADDR
|  malloc_base   |        +----------------+
+----------------+        |  hart 1 stack  |
|  GD            |        +----------------+ If not SMP, N=1
+----------------+        |  ......        |
|  hart 0 stack  |        +----------------+
+----------------+   ==>  |  hart N-1 stack|
|  hart 1 stack  |        +----------------+
+----------------+        |  ......        |
|  ......        |        |  malloc_base   |
+----------------+        +----------------+
|  hart N-1 stack|        |  GD            |
+----------------+        +----------------+
|                |        |                |

Signed-off-by: Bo Gan <ganboing@gmail.com>
Cc: Rick Chen <rick@andestech.com>
Cc: Leo <ycliang@andestech.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
17 months agoMerge branch '2023-07-22-TI-binman-and-K3-improvements'
Tom Rini [Mon, 24 Jul 2023 01:46:05 +0000 (21:46 -0400)]
Merge branch '2023-07-22-TI-binman-and-K3-improvements'

- Migrate TI K3 platforms to using binman to generate all images, and
  then improve the platform slightly.

17 months agoconfigs: am64: Fix booting of fitImage on AM64x
Kamlesh Gurudasani [Fri, 14 Jul 2023 05:52:41 +0000 (11:22 +0530)]
configs: am64: Fix booting of fitImage on AM64x

Do not limit the maximum size of the buffer that is used to decompress
the OS image in to, this causes issue while inflating the image, if image
size is greater than the buffer.
Remove CONFIG_SYS_BOOTM_LEN

Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agoKconfig: Enable FIT_SIGNATURE if ARM64
Manorit Chawdhry [Fri, 14 Jul 2023 05:52:40 +0000 (11:22 +0530)]
Kconfig: Enable FIT_SIGNATURE if ARM64

Enabling FIT_SIGNATURE required the old authentication method to be
disabled so disable this for K3 SOCs and enable FIT_SIGNATURE for K3
Platforms.

Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com>
[ cleanup the patch ]
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agolib: Kconfig: k3: Enable SHA512 for fit signature
Manorit Chawdhry [Fri, 14 Jul 2023 05:52:39 +0000 (11:22 +0530)]
lib: Kconfig: k3: Enable SHA512 for fit signature

We are using our custMpk for signing that is a 4096 bit key, 4096 bit
rsa key requires a SHA512 hashing algorithm to be enabled as per the
source. Even though it is not mandated but this is how it works and is
tested.

Enables SHA512 if fit signature is enabled on K3 platforms.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agok3-*-binman: dts: Pack u-boot.dtb instead of soc specific dtb
Manorit Chawdhry [Fri, 14 Jul 2023 05:52:38 +0000 (11:22 +0530)]
k3-*-binman: dts: Pack u-boot.dtb instead of soc specific dtb

FIT signature requires the updates to u-boot.dtb and the DTB that we
pack don't get updates with the changes of the signature node.

Pack u-boot.dtb as the default DTB so that the signature node changes
can be reflected in them.

(Note, this is only packaging the primary platform and the secondary
 platform will require manual changes for the FIT signature enablement)

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
[ add additional boards that were missing ]
Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoboard: ti: keys: add .key and .crt for fit signature signing
Manorit Chawdhry [Fri, 14 Jul 2023 05:52:37 +0000 (11:22 +0530)]
board: ti: keys: add .key and .crt for fit signature signing

Fit signature mechanism through the standards require the presence of
.key and .crt in the folder with the same name, since we are using our
custMpk only for the signing, update the format to that of standards to
be compatible for packaging easily.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agoconfigs: k3: make consistent bootcmd across all k3 socs
Kamlesh Gurudasani [Fri, 14 Jul 2023 05:52:36 +0000 (11:22 +0530)]
configs: k3: make consistent bootcmd across all k3 socs

Default to common bootcmd that is set across all k3 devices.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com>
17 months agoinclude: armv7: Enable distroboot across all configs
Manorit Chawdhry [Fri, 14 Jul 2023 05:52:35 +0000 (11:22 +0530)]
include: armv7: Enable distroboot across all configs

Since K3 devices are moving towards distroboot, remove duplicates and
add it in common file to import from.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
[trini: Add am65x_evm to this patch]
Signed-off-by: Tom Rini <trini@konsulko.com>
17 months agoenv: Make common bootcmd across all k3 devices
Manorit Chawdhry [Fri, 14 Jul 2023 05:52:34 +0000 (11:22 +0530)]
env: Make common bootcmd across all k3 devices

This is helpful to go forward with distro_bootcmd as default boot.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agoarm: k3: Add regex/gsub command handling
Andrew Davis [Fri, 14 Jul 2023 05:52:33 +0000 (11:22 +0530)]
arm: k3: Add regex/gsub command handling

The 'gsub' setexpr sub command is using when creating the FIT image
configuration string on K3 devices. Enable this for K3.

Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agoconfigs: Enable setexpr command on TI devices
Andrew Davis [Fri, 14 Jul 2023 05:52:32 +0000 (11:22 +0530)]
configs: Enable setexpr command on TI devices

This is used when building the FIT image configuration string. Enable
it for all FIT using TI platforms.

Signed-off-by: Andrew Davis <afd@ti.com>
[ extend to other k3 boards ]
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agoenvironment: ti: Make get_fdt_mmc common
Andrew Davis [Fri, 14 Jul 2023 05:52:31 +0000 (11:22 +0530)]
environment: ti: Make get_fdt_mmc common

Since get_fdt_mmc is common, factor it out into mmc.env and remove
it from each platform env file along with changing the directory path to
reflect the standards. Use it in mmcloados but keep loadfdt
defined in case it is still used by some external uEnv.txt script.

Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agoenvironment: ti: Prefix ARM64 DTB names with directory
Andrew Davis [Fri, 14 Jul 2023 05:52:30 +0000 (11:22 +0530)]
environment: ti: Prefix ARM64 DTB names with directory

In Linux the ARM64 DTSs are stored in vendor directories to help organize
the files and prevent naming collisions. The deployed DTBs will mirror
this and so the vendor prefix should be added to the variable used to
locate these files.

Suggested-by: Ryan Eatmon <reatmon@ti.com>
Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Nikhil M Jain <n-jain1@ti.com>
17 months agoconfigs: k3: Remove saved environments
Manorit Chawdhry [Fri, 14 Jul 2023 05:52:29 +0000 (11:22 +0530)]
configs: k3: Remove saved environments

Having saved environments usually causes inconsistencies while in
development workflow. The saved environments conflict with the
default ones that U-boot should be updating during development
but that doesn't happen and the saved environments need to be
reset during bootups to test the changes causing extra debugs.

Remove the saved environments as a default. Environments can always
be re-enabled locally if one does like them or needs them for
some production environment. Optionally, Uenv.txt can also be used on
some of the boot media.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agoinclude: j7*_evm.h: Cleanups to be done
Manorit Chawdhry [Fri, 14 Jul 2023 05:52:28 +0000 (11:22 +0530)]
include: j7*_evm.h: Cleanups to be done

Some miscellaneous cleanups for boards.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agomach-k3: common: correct the calculations for determining firewalls
Manorit Chawdhry [Fri, 14 Jul 2023 05:52:27 +0000 (11:22 +0530)]
mach-k3: common: correct the calculations for determining firewalls

The background firewall calculations were wrong, fix that to determine
both the background and foreground correctly.

Fixes: 8bfce2f9989f ("arm: mach-k3: common: reorder removal of firewalls")
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agoboard: ti: am64x: am64x.env: set fdtfile env variable
Kamlesh Gurudasani [Fri, 14 Jul 2023 05:52:26 +0000 (11:22 +0530)]
board: ti: am64x: am64x.env: set fdtfile env variable

Set fdtfile env variable similar to other k3 socs.

Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Nikhil M Jain <n-jain1@ti.com>
17 months agoKconfig: j721s2: Fix the scratchpad base
Manorit Chawdhry [Fri, 14 Jul 2023 05:52:25 +0000 (11:22 +0530)]
Kconfig: j721s2: Fix the scratchpad base

Fix the regression that occurred during the alignment of binman series
merges along with these HS fixes that caused silent regression in this.

Fixes: 30a7ee87fd1a ("Kconfig: j721s2: Change K3_MCU_SCRATCHPAD_BASE to non firewalled region")
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agoarch: mach-k3: security: fix the check for authentication
Manorit Chawdhry [Fri, 14 Jul 2023 05:52:24 +0000 (11:22 +0530)]
arch: mach-k3: security: fix the check for authentication

Fix regression occurred during refactoring for the mentioned commit.

Fixes: bd6a24759374 ("arm: mach-k3: security: separate out validating binary logic")
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agoCI: Make use of buildman requirements.txt
Tom Rini [Fri, 21 Jul 2023 18:44:46 +0000 (00:14 +0530)]
CI: Make use of buildman requirements.txt

Now that buildman has a requirements.txt file we need to make use of it.

Reviewed-by: Simon Glass <sjg@chromium.org>
[n-francis@ti.com: Adding missing command from .azure-pipelines.yml]
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
17 months agobuildman: Create a requirements.txt file
Tom Rini [Fri, 21 Jul 2023 18:44:45 +0000 (00:14 +0530)]
buildman: Create a requirements.txt file

At this point, buildman requires a few different modules and so we need
a requirements.txt to track what modules are needed.

Cc: Simon Glass <sjg@chromium.org>
Cc: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
17 months agobinman: Overwrite symlink if it already exists
Andrew Davis [Fri, 21 Jul 2023 18:44:44 +0000 (00:14 +0530)]
binman: Overwrite symlink if it already exists

Without this re-building will fail with an error when trying to create
the symlink for the second time with an already exists error.

Signed-off-by: Andrew Davis <afd@ti.com>
[n-francis@ti.com: Added support for test output dir and testcase]
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agodoc: board: ti: Update documentation for binman flow
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:43 +0000 (00:14 +0530)]
doc: board: ti: Update documentation for binman flow

Earlier documentation specified builds for generating bootloader images
using an external TI repository k3-image-gen and core-secdev-k3. Modify
this to using the binman flow so that user understands how to build the
final boot images.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agok3: tools: config.mk: Update makefile and remove scripts
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:42 +0000 (00:14 +0530)]
k3: tools: config.mk: Update makefile and remove scripts

Since binman is used to package bootloader images for all K3 devices, we
do not have to rely on the earlier methods to package them.

Scripts that were used to generate x509 certificate for tiboot3.bin and
generate tispl.bin, u-boot.img have been removed.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoarm: k3-am65x-iot2050: Use binman for tispl.bin for iot2050
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:41 +0000 (00:14 +0530)]
arm: k3-am65x-iot2050: Use binman for tispl.bin for iot2050

Move to using binman to generate tispl.bin which is used to generate the
final flash.bin bootloader for iot2050 boards.

Cc: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoam62a: dts: binman: Package tiboot3.bin, tispl.bin, u-boot.img
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:40 +0000 (00:14 +0530)]
am62a: dts: binman: Package tiboot3.bin, tispl.bin, u-boot.img

Support added for HS-SE, HS-FS and GP boot binaries for AM62ax.

HS-SE:
    * tiboot3-am62ax-hs-evm.bin
    * tispl.bin
    * u-boot.img

HS-FS:
    * tiboot3-am62ax-hs-fs-evm.bin
    * tispl.bin
    * u-boot.img

GP:
    * tiboot3.bin --> tiboot3-am62ax-gp-evm.bin
    * tispl.bin_unsigned
    * u-boot.img_unsigned

It is to be noted that the bootflow followed by AM62ax requires:

tiboot3.bin:
* R5 SPL
* R5 SPL dtbs
* TIFS
* board-cfg
* pm-cfg
* sec-cfg
* rm-cfg

tispl.bin:
* DM
* ATF
* OP-TEE
* A72 SPL
* A72 SPL dtbs

u-boot.img:
* A72 U-Boot
* A72 U-Boot dtbs

Reviewed-by: Simon Glass <sjg@chromium.org>
[afd@ti.com: changed output binary names appropriately]
Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoam62a: yaml: Add board configs for AM62ax
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:39 +0000 (00:14 +0530)]
am62a: yaml: Add board configs for AM62ax

Added YAML configs for AM62ax

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoam625: dts: binman: Package tiboot3.bin, tispl.bin and u-boot.img
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:38 +0000 (00:14 +0530)]
am625: dts: binman: Package tiboot3.bin, tispl.bin and u-boot.img

Support added for HS-SE, HS-FS and GP boot binaries for AM62.

HS-SE:
    * tiboot3-am62x-hs-evm.bin
    * tispl.bin
    * u-boot.img

HS-FS:
    * tiboot3-am62x-hs-fs-evm.bin
    * tispl.bin
    * u-boot.img

GP:
    * tiboot3.bin --> tiboot3-am62x-gp-evm.bin
    * tispl.bin_unsigned
    * u-boot.img_unsigned

It is to be noted that the bootflow followed by AM62 requires:

tiboot3.bin:
* R5 SPL
* R5 SPL dtbs
* TIFS
* board-cfg
* pm-cfg
* sec-cfg
* rm-cfg

tispl.bin:
* DM
* ATF
* OP-TEE
* A72 SPL
* A72 SPL dtbs

u-boot.img:
* A72 U-Boot
* A72 U-Boot dtbs

Reviewed-by: Simon Glass <sjg@chromium.org>
[afd@ti.com: changed output binary names appropriately]
Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoam62: yaml: Add board configs for AM62
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:37 +0000 (00:14 +0530)]
am62: yaml: Add board configs for AM62

Added YAML configs for AM62

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoj721s2: dts: binman: Package tiboot3.bin, tispl.bin and u-boot.img
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:36 +0000 (00:14 +0530)]
j721s2: dts: binman: Package tiboot3.bin, tispl.bin and u-boot.img

Support has been added for both HS-SE, HS-FS  and GP images.

HS-SE:
    * tiboot3-j721s2-hs-evm.bin
    * tispl.bin
    * u-boot.img

HS-FS:
    * tiboot3-j721s2-hs-fs-evm.bin
    * tispl.bin
    * u-boot.img

GP:
    * tiboot3.bin --> tiboot3-j721s2-gp-evm.bin
    * tispl.bin_unsigned
    * u-boot.img_unsigned

It is to be noted that the bootflow followed by J721S2 requires:

tiboot3.bin:
* R5 SPL
* R5 SPL dtbs
* TIFS
* board-cfg
* pm-cfg
* sec-cfg
* rm-cfg

tispl.bin:
* DM
* ATF
* OP-TEE
* A72 SPL
* A72 SPL dtbs

u-boot.img:
* A72 U-Boot
* A72 U-Boot dtbs

Reviewed-by: Simon Glass <sjg@chromium.org>
[afd@ti.com: changed output binary names appropriately]
Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoj721s2: yaml: Add board configs for J721S2
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:35 +0000 (00:14 +0530)]
j721s2: yaml: Add board configs for J721S2

Added YAML configs for J721S2

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoam64x: dts: binman: Package tiboot3.bin, tispl.bin u-boot.img
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:34 +0000 (00:14 +0530)]
am64x: dts: binman: Package tiboot3.bin, tispl.bin u-boot.img

Support added for HS and GP boot binaries for AM64x.

HS-SE:
    * tiboot3-am64x_sr2-hs-evm.bin
    * tispl.bin
    * u-boot.img

HS-FS:
    * tiboot3-am64x_sr2-hs-fs-evm.bin
    * tispl.bin
    * u-boot.img

GP:
    * tiboot3.bin --> tiboot3-am64x-gp-evm.bin
    * tispl.bin_unsigned
    * u-boot.img_unsigned

Note that the bootflow followed by AM64x requires:

tiboot3.bin:
* R5 SPL
* R5 SPL dtbs
* sysfw
* board-cfg
* pm-cfg
* sec-cfg
* rm-cfg

tispl.bin:
* ATF
* OP-TEE
* A53 SPL
* A53 SPL dtbs

u-boot.img:
* A53 U-Boot
* A53 U-Boot dtbs

Reviewed-by: Simon Glass <sjg@chromium.org>
[afd@ti.com: changed output binary names appropriately]
Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoam64x: yaml: Add board configs for AM64x
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:33 +0000 (00:14 +0530)]
am64x: yaml: Add board configs for AM64x

Added YAML configs for AM64xx

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoam65: dts: binman: Package tiboot3.bin, sysfw.itb, tispl.bin, u-boot.img
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:32 +0000 (00:14 +0530)]
am65: dts: binman: Package tiboot3.bin, sysfw.itb, tispl.bin, u-boot.img

Support has been added for both HS-SE(SR 2.0) and GP(SR 2.0) images.

HS-SE:
* tiboot3-am65x_sr2-hs-evm.bin
* sysfw-am65x_sr2-hs-evm.itb
* tispl.bin
* u-boot.img

GP:
* tiboot3.bin --> tiboot3-am65x_sr2-gp-evm.bin
* sysfw.itb --> sysfw-am65x_sr2-gp-evm.itb
* tispl.bin_unsigned
* u-boot.img_unsigned

Note that the bootflow followed by AM65x requires:

tiboot3.bin:
* R5 SPL
* R5 SPL dtbs
sysfw.itb:
* sysfw
* board-cfg
* pm-cfg
* sec-cfg
* rm-cfg

tispl.bin:
* ATF
* OP-TEE
* A53 SPL
* A53 SPL dtbs

u-boot.img:
* A53 U-Boot
* A53 U-Boot dtbs

Reviewed-by: Simon Glass <sjg@chromium.org>
[afd@ti.com: changed output binary names appropriately]
Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoam65x: yaml: Add AM65x board config files
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:31 +0000 (00:14 +0530)]
am65x: yaml: Add AM65x board config files

Added YAML configs for AM65x

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoj7200: dts: binman: Package tiboot3.bin, tispl.bin, u-boot.img
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:30 +0000 (00:14 +0530)]
j7200: dts: binman: Package tiboot3.bin, tispl.bin, u-boot.img

Support has been added for both HS-SE(SR 2.0), HS-FS(SR 2.0) and GP
images.

HS-SE:
* tiboot3-j7200_sr2-hs-evm.bin
* tispl.bin
* u-boot.img

HS-FS:
* tiboot3-j7200_sr2-hs-fs-evm.bin
* tispl.bin
* u-boot.img

GP:
* tiboot3.bin --> tiboot3-j7200-gp-evm.bin
* tispl.bin_unsigned
* u-boot.img_unsigned

It is to be noted that the bootflow followed by J7200 requires:

tiboot3.bin:
* R5 SPL
* R5 SPL dtbs
* TIFS
* board-cfg
* pm-cfg
* sec-cfg
* rm-cfg

tispl.bin:
* DM
* ATF
* OP-TEE
* A72 SPL
* A72 SPL dtbs

u-boot.img:
* A72 U-Boot
* A72 U-Boot dtbs

Reviewed-by: Simon Glass <sjg@chromium.org>
[afd@ti.com: changed output binary names appropriately]
Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoj7200: yaml: Add J7200 board config files
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:29 +0000 (00:14 +0530)]
j7200: yaml: Add J7200 board config files

Added YAML configs for J7200

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoj721e: dts: binman: Package tiboot3.bin, sysfw.itb, tispl.bin, u-boot.img
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:28 +0000 (00:14 +0530)]
j721e: dts: binman: Package tiboot3.bin, sysfw.itb, tispl.bin, u-boot.img

By providing entries in the binman node of the device tree, binman will
be able to find and package board config artifacts generated by
TIBoardConfig with sysfw.bin and generate the final image sysfw.itb.
It will also pick out the R5 SPL and sign it with the help of TI signing
entry and generate the final tiboot3.bin.

Entries for A72 build have been added to k3-j721e-binman.dtsi to
generate tispl.bin and u-boot.img.

Support has been added for both HS-SE(SR 1.1), HS-FS(SR 2.0) and GP images
In HS-SE, the encrypted system firmware binary must be signed along with
the signed certificate binary.

HS-SE:
* tiboot3-j721e_sr1_1-hs-evm.bin
* sysfw-j721e_sr1_1-hs-evm.itb
* tispl.bin
* u-boot.img

HS-FS:
* tiboot3-j721e_sr2-hs-fs-evm.bin
* sysfw-j721e_sr2-hs-fs-evm.itb
* tispl.bin
* u-boot.img

GP:
* tiboot3.bin -->tiboot3-j721e-gp-evm.bin
* sysfw.itb --> sysfw-j721e-gp-evm.itb
* tispl.bin_unsigned
* u-boot.img_unsigned

It is to be noted that the bootflow followed by J721E requires:

tiboot3.bin:
* R5 SPL
* R5 SPL dtbs

sysfw.itb:
* TIFS
* board-cfg
* pm-cfg
* sec-cfg
* rm-cfg

tispl.bin:
* DM
* ATF
* OP-TEE
* A72 SPL
* A72 SPL dtbs

u-boot.img:
* A72 U-Boot
* A72 U-Boot dtbs

Reviewed-by: Simon Glass <sjg@chromium.org>
[afd@ti.com: changed output binary names appropriately]
Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoj721e: schema: yaml: Add general schema and J721E board config files
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:27 +0000 (00:14 +0530)]
j721e: schema: yaml: Add general schema and J721E board config files

Schema file in YAML must be provided in board/ti/common for validating
input config files and packaging system firmware. The schema includes
entries for rm-cfg, board-cfg, pm-cfg and sec-cfg.

Board config files must be provided in board/ti/<devicename> in YAML.
These can then be consumed for generation of binaries to package system
firmware. Added YAML configs for J721E in particular.

Signed-off-by: Tarun Sahu <t-sahu@ti.com>
[n-francis@ti.com: prepared patch for upstreaming]
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoarm: dts: k3: Add support for packaging sysfw.itb and tiboot3.bin
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:26 +0000 (00:14 +0530)]
arm: dts: k3: Add support for packaging sysfw.itb and tiboot3.bin

Board config binary artifacts must be generated to be used by binman to
package sysfw.itb and tiboot3.bin for all K3 devices.

For devices that follow combined flow, these board configuration
binaries must again be packaged into a combined board configuration
blobs to be used by binman to package tiboot3.bin.

Add common k3-binman.dtsi to generate all the board configuration
binaries needed.

Also add custMpk.pem and ti-degenerate-key.pem needed for signing GP and
HS bootloader images common to all K3 devices.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agobinman: ti-secure: Add support for TI signing
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:25 +0000 (00:14 +0530)]
binman: ti-secure: Add support for TI signing

The ti-secure entry contains certificate for binaries that will be
loaded or booted by system firmware whereas the ti-secure-rom entry
contains certificate for binaries that will be booted by ROM. Support
for both these types of certificates is necessary for booting of K3
devices.

Reviewed-by: Simon Glass <sjg@chromium.org>
[vigneshr@ti.com: fixed inconsist cert generation by multiple packing]
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agobinman: ti-board-config: Add support for TI board config binaries
Neha Malcom Francis [Fri, 21 Jul 2023 18:44:24 +0000 (00:14 +0530)]
binman: ti-board-config: Add support for TI board config binaries

The ti-board-config entry loads and validates a given YAML config file
against a given schema, and generates the board config binary. K3
devices require these binaries to be packed into the final system
firmware images.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoMerge branch '2023-07-21-assorted-TI-platform-updates'
Tom Rini [Fri, 21 Jul 2023 23:33:05 +0000 (19:33 -0400)]
Merge branch '2023-07-21-assorted-TI-platform-updates'

- The first half of a number of TI platform bugfixes and improvements,
  primarily around K3 platforms and splash screen support.

17 months agocommon: Kconfig: Fix CMD_BMP/BMP dependency
Samuel Dionne-Riel [Tue, 18 Jul 2023 08:57:36 +0000 (14:27 +0530)]
common: Kconfig: Fix CMD_BMP/BMP dependency

Using `default y` will not select BMP when CMD_BMP has been enabled, if
it was already configured.

By using `select`, if `CMD_BMP` is turned on, it will force the presence
of `BMP`.

Fixes: 072b0e16c4 ("common: Kconfig: Add BMP configs")
Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
17 months agodoc: board: ti: am62x_sk: Add A53 SPL DDR layout
Nikhil M Jain [Tue, 18 Jul 2023 08:57:35 +0000 (14:27 +0530)]
doc: board: ti: am62x_sk: Add A53 SPL DDR layout

To understand usage of DDR in A53 SPL stage, add a table showing region
and space used by major components of SPL.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
17 months agoconfigs: am62x_evm_a53: Add bloblist address
Nikhil M Jain [Tue, 18 Jul 2023 08:57:34 +0000 (14:27 +0530)]
configs: am62x_evm_a53: Add bloblist address

Set bloblist address to 0x80D00000.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
17 months agocommon: spl: spl: Remove video driver
Nikhil M Jain [Tue, 18 Jul 2023 08:57:33 +0000 (14:27 +0530)]
common: spl: spl: Remove video driver

Use config SPL_VIDEO_REMOVE to remove video driver at SPL stage before
jumping to next stage, in place of CONFIG_SPL_VIDEO, to allow user to
remove video if required.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agodrivers: video: Kconfig: Add config remove video
Nikhil M Jain [Tue, 18 Jul 2023 08:57:32 +0000 (14:27 +0530)]
drivers: video: Kconfig: Add config remove video

This is required since user may want to either call the remove method
of video driver and reset the display or not call the remove method
to continue displaying until next stage.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
17 months agocommon: board_f: Pass frame buffer info from SPL to u-boot
Nikhil M Jain [Tue, 18 Jul 2023 08:57:31 +0000 (14:27 +0530)]
common: board_f: Pass frame buffer info from SPL to u-boot

U-boot proper can use frame buffer address passed from SPL to reserve
the memory area used by framebuffer set in SPL so that splash image
set in SPL continues to get displayed while u-boot proper is running.

Put the framebuffer address and size in a bloblist to make them
available at u-boot proper, if in u-boot proper CONFIG_VIDEO is defined.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoinclude: video: Reserve video using blob
Nikhil M Jain [Tue, 18 Jul 2023 08:57:30 +0000 (14:27 +0530)]
include: video: Reserve video using blob

Add method to reserve video framebuffer information using blob,
received from previous stage.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoboard: ti: am62x: evm: Update function calls for splash screen
Nikhil M Jain [Tue, 18 Jul 2023 08:57:29 +0000 (14:27 +0530)]
board: ti: am62x: evm: Update function calls for splash screen

Use spl_dcache_enable, in place of setup_dram, arch_reserve_mmu to set
up pagetable, initialise DRAM and enable Dcache to avoid multiple
function calls.

Check for CONFIG_SPL_VIDEO in place of CONFIG_SPL_VIDEO_TIDSS to prevent
any build failure in case video config is not defined and video related
functions are called.

Check for CONFIG_SPL_SPLASH_SCREEN and CONFIG_SPL_BMP before calling
splash_display to avoid compilation failure.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
17 months agoarch: arm: mach-k3: common: Return a pointer after setting page table
Nikhil M Jain [Tue, 18 Jul 2023 08:57:28 +0000 (14:27 +0530)]
arch: arm: mach-k3: common: Return a pointer after setting page table

In spl_dcache_enable after setting up page table, set gd->relocaddr
pointer to tlb_addr, to get next location to reserve memory. Align
tlb_addr with 64KB address.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
17 months agocommon: spl: spl: Update stack pointer address
Nikhil M Jain [Tue, 18 Jul 2023 08:57:27 +0000 (14:27 +0530)]
common: spl: spl: Update stack pointer address

At SPL stage when stack is relocated, the stack pointer needs to be
updated, the stack pointer may point to stack in on chip memory even
though stack is relocated.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
17 months agoarm: mach-k3: am62a7: change some prints to debug prints
Bryan Brattlof [Mon, 17 Jul 2023 23:01:33 +0000 (18:01 -0500)]
arm: mach-k3: am62a7: change some prints to debug prints

There is little need to print the devstat information or when we exit a
function during a typical boot. Remove them to reduce the noise during
typical operation

Signed-off-by: Bryan Brattlof <bb@ti.com>
17 months agoram: k3-ddrss: do not touch ctrl regs during training
Bryan Brattlof [Mon, 17 Jul 2023 22:15:26 +0000 (17:15 -0500)]
ram: k3-ddrss: do not touch ctrl regs during training

During LPDDR initialization we will loop through a series of frequency
changes in order to train at the various operating frequencies. During
this training, accessing the DRAM_CLASS bitfield could happen during a
frequency change and cause the read to hang.

Store the DRAM type into the main structure to avoid multiple readings
while the independent phy is training.

Signed-off-by: Bryan Brattlof <bb@ti.com>
17 months agoarm: omap2: Fix warning in force_emif_self_refresh
Tom Rini [Mon, 17 Jul 2023 19:26:43 +0000 (15:26 -0400)]
arm: omap2: Fix warning in force_emif_self_refresh

The function declaration for force_emif_self_refresh takes no parameters
but does not specify this, only the prototype in the headers do.  As
clang will warn about this, correct it.

Signed-off-by: Tom Rini <trini@konsulko.com>
17 months agoconfigs: k2x_evm: Always include FIT loading support
Andrew Davis [Fri, 14 Jul 2023 19:00:58 +0000 (14:00 -0500)]
configs: k2x_evm: Always include FIT loading support

Non-HS boards can use FIT images so include the env var commands
for these unconditionally.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
17 months agoarm: mach-k3: am62: Fixup CPU core, gpu and pru nodes in fdt
Emanuele Ghidoli [Fri, 14 Jul 2023 15:23:10 +0000 (17:23 +0200)]
arm: mach-k3: am62: Fixup CPU core, gpu and pru nodes in fdt

AM62x SoC is available in multiple variant:
- CPU cores (Cortex-A) AM62x1 (1 core), AM62x2 (2 cores), AM62x4 (4 cores)
- GPU AM625x with GPU, AM623x without GPU
- PRU (Programmable RT unit) can be present or not on AM62x2/AM62x4

Remove the relevant FDT nodes by reading the actual configuration
from the SoC registers, with that change is possible to have a single
dts/dtb file handling the different variant at runtime.
While removing GPU node and CPU nodes also the watchdog node
in the same Module Domain is removed.

A similar approach is implemented for example on i.MX8 and STM32MP1 SoC.

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
17 months agoarm: mach-k3: am62: Add CTRLMMR_WKUP_JTAG_DEVICE_ID register definition
Emanuele Ghidoli [Fri, 14 Jul 2023 15:23:09 +0000 (17:23 +0200)]
arm: mach-k3: am62: Add CTRLMMR_WKUP_JTAG_DEVICE_ID register definition

Add register address and relevant bitmasks and shifts.
Allow reading these information:
- device identification
- number of cores (part of device identification)
- features (currently: PRU / no PRU)
- security
- functional safety
- speed grade
- temperature grade
- package

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Andrew Davis <afd@ti.com>
17 months agoarm: k3: Fix ft_system_setup so it can be enabled on any SoC
Emanuele Ghidoli [Fri, 14 Jul 2023 15:23:08 +0000 (17:23 +0200)]
arm: k3: Fix ft_system_setup so it can be enabled on any SoC

ft_system_setup cannot be enabled on SoC without msmc sram otherwise
fdt_fixup_msmc_ram function fails causing system reset.

Fix by moving fdt_fixup_msmc_ram to common_fdt.c file and creating
SoC (AM654, J721E and J721S2) specific files for fdt fixups.

This change was verified to not change anything on any existing board
(all the J721S2, AM654 and J721E boards requires it,
none of the remaining k3 boards require it).

Fixes: 30e96a240156 ("arm: mach-k3: Move MSMC fixup to SoC level")
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
17 months agoarm: dts: Fix build of am62a7 dtbs
Nishanth Menon [Thu, 13 Jul 2023 19:40:51 +0000 (14:40 -0500)]
arm: dts: Fix build of am62a7 dtbs

am62a7 should be built with CONFIG_SOC_K3_AM62A7 not CONFIG_SOC_K3_AM625

Fixes: 6bdfa69155d8 ("arm: dts: introduce am62a7 u-boot dtbs")
Cc: Bryan Brattlof <bb@ti.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Cc: Francesco Dolcini <francesco@dolcini.it>
Cc: Sjoerd Simons <sjoerd@collabora.com>
Cc: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
17 months agoarm: mach-k3: *: dev-data: Update to use ARRAY_SIZE
Nishanth Menon [Thu, 13 Jul 2023 19:36:34 +0000 (14:36 -0500)]
arm: mach-k3: *: dev-data: Update to use ARRAY_SIZE

Instead of hard-coding the count of entries manually, use ARRAY_SIZE
to keep the count updates appropriately.

Cc: Bryan Brattlof <bb@ti.com>
Suggested-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
17 months agoarm: mach-k3: am62a7_init: Open up FSS_DAT_REG3 firewall
Vignesh Raghavendra [Sun, 2 Jul 2023 09:16:54 +0000 (14:46 +0530)]
arm: mach-k3: am62a7_init: Open up FSS_DAT_REG3 firewall

On security enforced (HS-SE) devices ROM firewalls OSPI data region3 that
is present in above 64bit region. Open this up in bootloader to allow
Linux to access OSPI flashes in mmap mode.

Without this kernel will crash when accessing this region due to
firewall violations on HS-SE devices.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
17 months agocommon: splash_source: Fix type casting errors
Nikhil M Jain [Wed, 21 Jun 2023 10:59:53 +0000 (16:29 +0530)]
common: splash_source: Fix type casting errors

During compilation splash_source puts out below warning for type
conversion in splash_load_fit for bmp_load_addr and fit_header.
Change their type to uintptr_t to fix the warnings.

common/splash_source.c: In function ‘splash_load_fit’:
common/splash_source.c:366:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  366 |         img_header = (struct legacy_img_hdr *)bmp_load_addr;
      |                      ^
common/splash_source.c:376:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  376 |         res = splash_storage_read_raw(location, (u32)fit_header, fit_size);
      |                                                 ^
common/splash_source.c:401:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  401 |                 memmove((void *)bmp_load_addr, internal_splash_data, internal_splash_size);

The above warnings are generated if CONFIG_FIT is enabled.

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
17 months agoboard: ti: am62x: evm: Include necessary header files
Nikhil M Jain [Wed, 21 Jun 2023 10:59:52 +0000 (16:29 +0530)]
board: ti: am62x: evm: Include necessary header files

At the time of compilation evm.c gives below warning for implicit
declaration of enable_caches, to mitigate this include cpu_func.h.

board/ti/am62x/evm.c: In function ‘spl_board_init’:
board/ti/am62x/evm.c:90:9: warning: implicit declaration of function ‘enable_caches’ [-Wimplicit-function-declaration]
90 |         enable_caches();

Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
17 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Fri, 21 Jul 2023 14:01:11 +0000 (10:01 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

For once this adds USB support for two SoCs: the H616 and the F1C100s
series. The rest is support for LPDDR3 DRAM chips on H616 boards.

Gitlab CI passed, and I booted that briefly on an H616 and an F1C200s
board. I don't have an H616 board with LPDDR3 DRAM, but reportedly that
works for Mikhail, and doesn't regress on my DDR3 boards.

17 months agoMerge tag 'xilinx-for-v2023.10-rc1-v2' of https://source.denx.de/u-boot/custodians...
Tom Rini [Fri, 21 Jul 2023 13:57:59 +0000 (09:57 -0400)]
Merge tag 'xilinx-for-v2023.10-rc1-v2' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx changes for v2023.10-rc1 v2

axi_emac:
- Change return value if RX packet is not ready

cadence_qspi:
- Enable flash reset for Versal NET

dt:
- Various DT syncups with Linux kernel
- SOM - reserved pmufw memory location

fpga:
- Add load event

mtd:
- Add missing dependency for FLASH_CFI_MTD

spi/nand:
- Minor cleanup in Xilinx drivers

versal-net:
- Prioritize boot device in boot_targets
- Wire mini ospi/qspi/emmc configurations

watchdog:
- Use new versal-wwdt property

xilinx:
- fix sparse warnings in various places ps7_init*
- add missing headers
- consolidate code around zynqmp_mmio_read/write
- switch to amd.com email

zynqmp_clk:
- Add handling for gem rx/tsu clocks

zynq_gem:
- Configure mdio clock at run time

zynq:
- Enable fdt overlay support

zynq_sdhci:
- Call dll reset only for ZynqMP SOCs

17 months agoevent: Add fpga load event
Christian Taedcke [Thu, 20 Jul 2023 07:27:24 +0000 (09:27 +0200)]
event: Add fpga load event

This enables implementing custom logic after a bitstream was loaded
into the fpga.

Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Link: https://lore.kernel.org/r/20230720072724.11516-1-christian.taedcke-oss@weidmueller.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agoclk: zynqmp: Add gem rx and tsu clocks to return register
Ashok Reddy Soma [Thu, 20 Jul 2023 07:28:59 +0000 (01:28 -0600)]
clk: zynqmp: Add gem rx and tsu clocks to return register

Add gem_tsu and gem0_rx till gem3_rx to return proper register from
zynqmp_clk_get_register. Otherwise firmware won't be able to set clock
for these due to incorrect register address.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230720072859.3724-1-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agoclk: zynqmp: Add set_rate support for gem rx and tsu clks
Ashok Reddy Soma [Wed, 19 Jul 2023 08:49:12 +0000 (02:49 -0600)]
clk: zynqmp: Add set_rate support for gem rx and tsu clks

gem0_rx till gem3_rx  and gem_tsu are missing from set rate function.
Add them, so that they can be set from pmu firmware via clock framework.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230719084912.30209-1-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agonet: axi_emac: Change return value to -EAGAIN if RX is not ready
Maksim Kiselev [Wed, 19 Jul 2023 06:53:37 +0000 (09:53 +0300)]
net: axi_emac: Change return value to -EAGAIN if RX is not ready

If there is no incoming package than axiemac_recv will return -1 which
in turn leads to printing `eth_rx: recv() returned error -1` error
message in eth_rx function. But missing a package is not an fatal error,
so return -EAGAIN in that case would be more suitable.

Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
Link: https://lore.kernel.org/r/20230719065337.69280-1-bigunclemax@gmail.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
17 months agoarm64: zynqmp: Remove clock-names from pcap node
Michal Simek [Mon, 10 Jul 2023 12:37:43 +0000 (14:37 +0200)]
arm64: zynqmp: Remove clock-names from pcap node

Clock is not used in driver and also not described in binding.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/0a0fa0ba197fa4051a2c8a24e1451cefadce7517.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Rename ams_ps/pl node names
Michal Simek [Mon, 10 Jul 2023 12:37:42 +0000 (14:37 +0200)]
arm64: zynqmp: Rename ams_ps/pl node names

Fix child node names to be aligned with dt-binding available in the Linux
kernel which requires names as ams-ps@ and ams-pl@.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/8f1451d614f654cb0d0da1e799e876c078fbf2c9.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Remove interrupt/reg-names for AMS
Michal Simek [Mon, 10 Jul 2023 12:37:41 +0000 (14:37 +0200)]
arm64: zynqmp: Remove interrupt/reg-names for AMS

These two properties are not described in DT binding and also not used by
driver that's why remove them.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/b123c7e537dcf70802e828bbcd484a761a264186.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: remove snps, enable_guctl1_resume_quirk quirk for usb
Piyush Mehta [Mon, 10 Jul 2023 12:37:40 +0000 (14:37 +0200)]
arm64: zynqmp: remove snps, enable_guctl1_resume_quirk quirk for usb

To sync with the upstream code, removed 'snps,enable_guctl1_resume_quirk'
quirk for usb. This quirk is no more available in linux after the xilinx
release 2022.2.

This functionality is taken care of by the 'snps,resume-hs-terminations'
quirk.

Signed-off-by: Piyush Mehta <piyush.mehta@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/4b7a132116bf0248cdb558e04de3b06b412c4a0f.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: add pmu interrupt-affinity
Radhey Shyam Pandey [Mon, 10 Jul 2023 12:37:39 +0000 (14:37 +0200)]
arm64: zynqmp: add pmu interrupt-affinity

Explicitly specify interrupt affinity to avoid HW perfevents
need to guess. This avoids the following error upon linux boot:
armv8-pmu pmu: hw perfevents: no interrupt-affinity property,
guessing.

Reported-by: John Toomey <john.toomey@amd.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c2f55a10cf54c6004f5dfe2ea18bcb4cf04f5723.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Sync node name address with reg (mailbox)
Michal Simek [Mon, 10 Jul 2023 12:37:38 +0000 (14:37 +0200)]
arm64: zynqmp: Sync node name address with reg (mailbox)

Address in node name should match with the first reg property in DT.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/47bea10bbc3c88727c1fe839ff20e15a0c79c339.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Add L2 cache nodes
Radhey Shyam Pandey [Mon, 10 Jul 2023 12:37:37 +0000 (14:37 +0200)]
arm64: zynqmp: Add L2 cache nodes

Linux kernel throws "cacheinfo: Unable to detect cache hierarchy for
CPU 0" warning when booting on zu+ Soc. To fix it add the L2 cache
node and let each CPU point to it.

Reported-by: John Toomey <john.toomey@amd.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c8dfabab12c97922aaad7fa91be0cbc7e4021528.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Fix usb reset over bootmode pins on zcu100
Michal Simek [Mon, 10 Jul 2023 12:37:36 +0000 (14:37 +0200)]
arm64: zynqmp: Fix usb reset over bootmode pins on zcu100

The commit a4180c369607 ("arm64: zynqmp: Add mode-pin GPIO controller DT
node") added usb phy reset over bootmode pins by default on usb0 only.
zcu100 is using usb0 as peripheral and usb1 as host. Unfortunately reset
line is shared for both usb ulpi phys but usb_rst_b is connected to usb5744
hub which is used only in host mode. Especially this chip requires reset to
operate properly that's why better assign gpio reset to usb1 instead of
usb0.
Without this change usb start crashed when runs.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/1ca80ec5bf7a595c03822f3e4e3683298205067a.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Cover K24 revB/1 SOM
Michal Simek [Mon, 10 Jul 2023 12:37:35 +0000 (14:37 +0200)]
arm64: zynqmp: Cover K24 revB/1 SOM

Extend compatible versions for K24 SOM.
Changes are not affecting SW behavior that's why all versions are
compatible to each other.
Describing all revisions is done by purpose because user space SW is
reading compatible string for logic around DT overlays and bitstreams.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/92eba01ac316e58bd2d3508b0e63bbfafbedbb73.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Record compatible string for kv260 rev2
Michal Simek [Mon, 10 Jul 2023 12:37:34 +0000 (14:37 +0200)]
arm64: zynqmp: Record compatible string for kv260 rev2

PCB rev2 compare to rev1 has some changes in PL side (IAS sensor AR1335
autofocus feature). PS side is completely unchanged.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/42f78dee8429eeac016d73de5c73af46fdaf4a98.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Assign TSU clock frequency for KV and KD boards
Harini Katakam [Mon, 10 Jul 2023 12:37:33 +0000 (14:37 +0200)]
arm64: zynqmp: Assign TSU clock frequency for KV and KD boards

Set TSU clock frequency as 250MHz (minimum when running at 1G) on
KV and KD carrier cards to allow PTP functionality.

Signed-off-by: Harini Katakam <harini.katakam@amd.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/4b758d503ef545e4d25d3930b0eb0793f1c415d2.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Increase reset assert time for TI SGMII PHY
Harini Katakam [Mon, 10 Jul 2023 12:37:32 +0000 (14:37 +0200)]
arm64: zynqmp: Increase reset assert time for TI SGMII PHY

Increase reset assert time for TI SGMII PHY on KR260 CC starting
6.1 kernel. This PHY does not come out of reset with the existing
100us pulse width as per testing on multiple carrier cards. The reset
is driven via a PCA9570 I2C expander. The expander driver was updated
to an upstream version in 6.1 where gpio_chip _set was optimized.
Delays in earlier kernels may have masked this issue. This is a safe
workaround value for assert pulse width before the discussions are
resolved with TI.

Signed-off-by: Harini Katakam <harini.katakam@amd.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/8fb9f17d43a43ef504c9f29006cd686cce8ac98b.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Fix gpio comment about No of gpios
Michal Simek [Mon, 10 Jul 2023 12:37:31 +0000 (14:37 +0200)]
arm64: zynqmp: Fix gpio comment about No of gpios

There are total 174 gpios but from 0 - 173 that's why fix comment to
reflect it.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c7e94b334e7dd6297e0d3a36a6a3d04bd7e9e967.1688992653.git.michal.simek@amd.com
17 months agoarm64: zynqmp: Assign TSU clock frequency for KR260
Harini Katakam [Mon, 10 Jul 2023 12:37:30 +0000 (14:37 +0200)]
arm64: zynqmp: Assign TSU clock frequency for KR260

Set TSU clock frequency as 250MHz (minimum when running at 1G) on
KR260 CC to allow PTP functionality.

Signed-off-by: Harini Katakam <harini.katakam@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/d065b5c2c6450910bf57d104d65946111493caaa.1688992653.git.michal.simek@amd.com