]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
2 years agosandbox: rename overlay sources to .dtso
Rasmus Villemoes [Mon, 25 Sep 2023 08:09:08 +0000 (10:09 +0200)] 
sandbox: rename overlay sources to .dtso

Distinguish more clearly between source files meant for producing .dtb
from those meant for producing .dtbo. No functional change, as we
currently have rules for producing a foo.dtbo from either foo.dts or
foo.dtso.

Note that in the linux tree, all device tree overlay sources have been
renamed to .dtso, and the .dts->.dtbo rule is gone since v6.5 (commit
81d362732bac). So this is also a step towards staying closer to linux
with respect to both Kbuild and device tree sources.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoarm64: zynqmp: rename overlay sources to .dtso
Rasmus Villemoes [Mon, 25 Sep 2023 08:09:07 +0000 (10:09 +0200)] 
arm64: zynqmp: rename overlay sources to .dtso

Distinguish more clearly between source files meant for producing .dtb
from those meant for producing .dtbo. No functional change, as we
currently have rules for producing a foo.dtbo from either foo.dts or
foo.dtso.

Note that in the linux tree, all device tree overlay sources have been
renamed to .dtso, and the .dts->.dtbo rule is gone since v6.5 (commit
81d362732bac). So this is also a step towards staying closer to linux
with respect to both Kbuild and device tree sources.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agoiot2050: rename overlay sources to .dtso
Rasmus Villemoes [Mon, 25 Sep 2023 08:09:06 +0000 (10:09 +0200)] 
iot2050: rename overlay sources to .dtso

Distinguish more clearly between source files meant for producing .dtb
from those meant for producing .dtbo. No functional change, as we
currently have rules for producing a foo.dtbo from either foo.dts or
foo.dtso.

Note that in the linux tree, all device tree overlay sources have been
renamed to .dtso, and the .dts->.dtbo rule is gone since v6.5 (commit
81d362732bac). So this is also a step towards staying closer to linux
with respect to both Kbuild and device tree sources.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
2 years agoarm: dts: imx8mm-cl-iot-gate: rename overlay sources to .dtso
Rasmus Villemoes [Mon, 25 Sep 2023 08:09:05 +0000 (10:09 +0200)] 
arm: dts: imx8mm-cl-iot-gate: rename overlay sources to .dtso

Distinguish more clearly between source files meant for producing .dtb
from those meant for producing .dtbo. No functional change, as we
currently have rules for producing a foo.dtbo from either foo.dts or
foo.dtso.

Note that in the linux tree, all device tree overlay sources have been
renamed to .dtso, and the .dts->.dtbo rule is gone since v6.5 (commit
81d362732bac). So this is also a step towards staying closer to linux
with respect to both Kbuild and device tree sources.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agoarm: apple: Add initial Apple M2 Ultra support
Janne Grunau [Wed, 6 Sep 2023 21:50:34 +0000 (23:50 +0200)] 
arm: apple: Add initial Apple M2 Ultra support

Apple's M2 Ultra SoC are somewhat similar to the M1 Ultra but needs
a tweaked memory map as the M2 Pro/Max SoCs.  USB, NVMe, UART, WDT
and PCIe are working with the existing drivers.

Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2 years agoevent: Rename rest of EVENT_SPY to EVENT_SPY_FULL or EVENT_SPY*
Marek Vasut [Tue, 5 Sep 2023 13:48:08 +0000 (15:48 +0200)] 
event: Rename rest of EVENT_SPY to EVENT_SPY_FULL or EVENT_SPY*

Fix up remaining occurances of EVENT_SPY with no suffix.

Fixes: 6c4cad7438 ("event: Rename EVENT_SPY to EVENT_SPY_FULL")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoenv: Improve ENV_OFFSET help message
Paul Barker [Fri, 1 Sep 2023 14:28:59 +0000 (15:28 +0100)] 
env: Improve ENV_OFFSET help message

When reading Kconfig help messages to understand ENV_OFFSET and
ENV_OFFSET_REDUND, developers may not realise that they need to also
look at the chosen ENV_IS_IN_* options to see how the offsets will be
interpreted.

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodriver: rng: Add DM_RNG interface for ARMv8.5 RNDR registers
Andre Przywara [Wed, 30 Aug 2023 11:32:30 +0000 (12:32 +0100)] 
driver: rng: Add DM_RNG interface for ARMv8.5 RNDR registers

The ARMv8.5 architecture extension defines architectural RNDR/RNDRRS
system registers, that provide 64 bits worth of randomness on every
read. Since it's an extension, and implementing it is optional, there is
a field in the ID_AA64ISAR0_EL1 ID register to query the availability
of those registers.

Add a UCLASS_RNG driver that returns entropy via repeated reads from
those system registers, if the extension is implemented.
The driver always binds, but checks the availability in the probe()
routine.

This helps systems which suffer from low boot entropy, since U-Boot can
provide entropy via the generic UEFI entropy gathering protocol to the OS,
at an early stage.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agotools: ensure zeroed padding in external FIT images
Roman Azarenko [Fri, 25 Aug 2023 08:10:14 +0000 (10:10 +0200)] 
tools: ensure zeroed padding in external FIT images

Padding the header of an external FIT image is achieved by truncating
the existing temporary FIT file to match the required alignment before
appending image data. Reusing an existing file this way means that the
padding will likely contain a portion of the original data not
overwritten by the new header.

Zero out any data past the end of the new header, and stop at either
the end of the desired padding, or the end of the old FIT file,
whichever comes first.

Fixes: 7946a814a319 ("Revert "mkimage: fit: Do not tail-pad fitImage with external data"")
Signed-off-by: Roman Azarenko <roman.azarenko@iopsys.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Drop some TODOs
Simon Glass [Fri, 25 Aug 2023 01:39:24 +0000 (19:39 -0600)] 
bootstd: Drop some TODOs

The existing TODOs are done, so remove them. Add another that came up
today.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoarm: dts: k3-am625-verdin: fix boot
Marcel Ziswiler [Tue, 10 Oct 2023 11:13:04 +0000 (13:13 +0200)] 
arm: dts: k3-am625-verdin: fix boot

A53 U-Boot proper got broken because nodes marked as 'bootph-pre-ram'
are no longer available in U-Boot proper before relocation.

Fix this by marking all nodes in u-boot.dtsi as 'bootph-all'.

Fixes: 9e644284ab812 ("dm: core: Report bootph-pre-ram/sram node as pre-reloc after relocation")
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agomalloc: Enable assertions if UNIT_TEST is enabled
Sean Anderson [Sun, 8 Oct 2023 02:01:56 +0000 (22:01 -0400)] 
malloc: Enable assertions if UNIT_TEST is enabled

dlmalloc has some sanity checks it performs on free() which can help detect
memory corruption. However, they are only enabled if DEBUG is defined before
including common.h. Define DEBUG earlier if UNIT_TEST is enabled so that
assertions are enabled in sandbox.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoarm: dts: k3-j721e-sk/common-proc-board: Fix boot
Nishanth Menon [Thu, 5 Oct 2023 18:15:14 +0000 (13:15 -0500)] 
arm: dts: k3-j721e-sk/common-proc-board: Fix boot

Since commit 9e644284ab81 ("dm: core: Report bootph-pre-ram/sram node
as pre-reloc after relocation") A53 u-boot proper is broken. This is
because nodes marked as 'bootph-pre-ram' are not available at u-boot
proper before relocation.

To fix this we mark all nodes in u-boot.dtsi as 'bootph-all'.

Fixes: 69b19ca67bcb ("arm: dts: k3-j721e: Sync with v6.6-rc1")
Cc: Neha Francis <n-francis@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Tested-by: Tom Rini <trini@konsulko.com> # J721E-EVM GP
Tested-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
2 years agoarm: mach-k3: Remove secure device makefile
Andrew Davis [Thu, 5 Oct 2023 14:21:17 +0000 (09:21 -0500)] 
arm: mach-k3: Remove secure device makefile

This is now done using binman but this file was leftover and is now
unused, remove it.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2 years agoboard: siemens: iot2050: Fix logical bug in PG1/PG2 detection
Jan Kiszka [Thu, 5 Oct 2023 04:37:25 +0000 (06:37 +0200)] 
board: siemens: iot2050: Fix logical bug in PG1/PG2 detection

This caused the wrong fdtfile to be set and was failing to apply M.2
settings.

Fixes: badaa1f6a7a9 ("boards: siemens: iot2050: Unify PG1 and PG2/M.2 configurations again")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2 years agoarm: dts: k3-am65-iot2050: Fix boot
Jan Kiszka [Thu, 5 Oct 2023 04:37:17 +0000 (06:37 +0200)] 
arm: dts: k3-am65-iot2050: Fix boot

Since commit 9e644284ab812 ("dm: core: Report bootph-pre-ram/sram node
as pre-reloc after relocation") A53 u-boot proper is broken. This is
because nodes marked as 'bootph-pre-ram' are not available at u-boot
proper before relocation.

To fix this we mark all nodes in u-boot.dtsi as 'bootph-all'.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
2 years agospi: mtk_spim: prevent global pll clock override
Nicolò Veronese [Tue, 3 Oct 2023 22:14:26 +0000 (00:14 +0200)] 
spi: mtk_spim: prevent global pll clock override

With commit 793e62301180 ("spi: mtk_spim: get spi clk rate only once") a
new system to calculate the SPI clocks has been added.

Unfortunately, the do_div macro overrides the global priv->pll_clk_rate
field. This will cause to have a reduced clock rate on each subsequent
SPI call.

Signed-off-by: Valerio 'ftp21' Mancini <ftp21@ftp21.eu>
Signed-off-by: Nicolò Veronese <nicveronese@gmail.com>
2 years agoMakefile: make u-boot-initial-env target depend explicitly on scripts_basic
Rasmus Villemoes [Tue, 3 Oct 2023 10:02:17 +0000 (12:02 +0200)] 
Makefile: make u-boot-initial-env target depend explicitly on scripts_basic

We're seeing sporadic errors like

  ENVC    include/generated/env.txt
  HOSTCC  scripts/basic/fixdep
  ENVP    include/generated/env.in
  ENVT    include/generated/environment.h
  HOSTCC  tools/printinitialenv
/bin/sh: 1: scripts/basic/fixdep: not found
make[1]: *** [scripts/Makefile.host:95: tools/printinitialenv] Error 127
make[1]: *** Deleting file 'tools/printinitialenv'
make: *** [Makefile:2446: u-boot-initial-env] Error 2
make: *** Waiting for unfinished jobs....

where sometimes the "fixdep: not found" is instead "fixdep: Permission
denied" and the Error 127 becomes 126.

This smells like a race condition, and indeed it is: Currently,
u-boot-initial-env is a prerequisite of the envtools target, which
also lists scripts_basic as a prerequisite:

envtools: u-boot-initial-env scripts_basic $(version_h) $(timestamp_h) tools/version.h
$(Q)$(MAKE) $(build)=tools/env

However, the u-boot-initial-env rule involves building the
printinitialenv helper, which in turn is built using an if_changed_dep
rule. That means we must ensure scripts/basic/fixdep is built and
ready before trying to build printinitialenv, i.e. the
u-boot-initial-env rule itself must depend on the phony scripts_basic
target.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoboard: xen: introduce virtio-blk support
Andrii Chepurnyi [Tue, 3 Oct 2023 08:58:28 +0000 (08:58 +0000)] 
board: xen: introduce virtio-blk support

Added new xenguest_arm64_virtio_defconfig which
enables support for virtio-blk using various types
of transport like virtio-pci, vrtio-mmio. Currently
supported: up to 2 PCI host bridges and 10 MMIO devices.
Note: DT parsing code was partly taken from pci-uclass.c
Limitation: All memory regions should be
below 4GB address space.

Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com>
2 years agoboard: synquacer: set actual gd->ram_top and gd->ram_size
Masahisa Kojima [Tue, 3 Oct 2023 02:29:57 +0000 (11:29 +0900)] 
board: synquacer: set actual gd->ram_top and gd->ram_size

Current gd->ram_size and gd->ram_top reflect only the
first DRAM bank even if the SynQuacer Developerbox could
have up to three DRAM banks.
With the commit 06d514d77c37 ("lmb: consider EFI memory map"),
the first DRAM bank indicates <4GB address, so whole >4GB memory
is marked as EFI_BOOT_SERVICES_DATA and it results that
U-Boot can not access >4GB memory.

Since 64-bits DRAM address is fully available on the SynQuacer
Developerbox, let's set the installed DIMM information to
gd->ram_top and gd->ram_size.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
2 years agoinput: avoid NULL dereference
Heinrich Schuchardt [Tue, 3 Oct 2023 01:09:01 +0000 (03:09 +0200)] 
input: avoid NULL dereference

Before using the result of env_get("stdin") we must check if it is NULL.

Avoid #if. This resolves the -Wunused-but-set-variable issue and we don't
need a dummy assignment in the else branch. Anyway this warning is
disabled in the Makefile.

For sake of readability use an early return after the configuration check.

Checking CONFIG_SPL_BUILD is incorrect as env_get() is only defined if
CONFIG_$(SPL_TPL)ENV_SUPPORT=y.

Fixes: 985ca3945fa3 ("spl: input: Allow input in SPL and TPL")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agomkimage: allow internalization of data-position
Lars Feyaerts [Mon, 2 Oct 2023 08:00:14 +0000 (10:00 +0200)] 
mkimage: allow internalization of data-position

Make it possible for data that was externalized using a static external
position (-p) to be internalized. Enables the ability to convert
existing FIT images built with -p to be converted to a FIT image where the
data is internal, to be converted to a FIT image where the data is
external relative to the end of the FIT (-E) or change the initial
static external position to a different static external position (-p).

Removing the original external-data-related properties ensures that
they're not present after conversion. Without this, they would still be
present in the resulting FIT even if the FIT has been, for example,
internalized.

Signed-off-by: Lars Feyaerts <lars@bitbiz.be>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agocheckpatch: skip fdtdec_* check for tools
Lars Feyaerts [Mon, 2 Oct 2023 08:00:13 +0000 (10:00 +0200)] 
checkpatch: skip fdtdec_* check for tools

Have checkpatch.pl skip warnings for use of fdtdec_* functions in
ooling; livetree isn't used there.

Signed-off-by: Lars Feyaerts <lars@bitbiz.be>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMerge tag 'fsl-qoirq-2023-10-10' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Wed, 11 Oct 2023 14:21:33 +0000 (10:21 -0400)] 
Merge tag 'fsl-qoirq-2023-10-10' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq

Drop legacy PPA secure FW support
support for MC reserved memory
reset the FLSHxCR1 registers for nxp_fspi

2 years agoMerge branch '2023-10-10-blk-sandbox-support-binding-a-device-with-a-given-logical...
Tom Rini [Wed, 11 Oct 2023 01:47:50 +0000 (21:47 -0400)] 
Merge branch '2023-10-10-blk-sandbox-support-binding-a-device-with-a-given-logical-block-size'

To quote the author:
At present on Sandbox when binding to a host backing file, the host
block device is created with a hard-coded 512 bytes block size.

Such assumption works for most cases, but for situation that with a raw
image file dump from a pre-formatted GPT partitioned disk image from a
4KiB block size device, when binding this file to a host device and mapping
this device to a blkmap, "blkmap" command like "blkmap part" won't work
correctly, due to block size mismatch during parsing the partition table.

This series updates Sandbox block driver, as well as the blkmap driver,
to get rid of the hard-coded 512 bytes block size assumption.

This series is available at u-boot-x86/blk for testing.

Test log (512 block size):

  => host bind 0 test.img
  => host info
  dev       blocks  blksz label           path
    0       262144    512 0               test.img
  => blkmap create 0
  Created "0"
  => blkmap map 0 0 40000 linear host 0 0
  Block 0x0+0x40000 mapped to block 0x0 of "host 0"
  => blkmap info
  Device 0: Vendor: U-Boot Rev: 1.0 Prod: blkmap
              Type: Hard Disk
              Capacity: 128.0 MB = 0.1 GB (262144 x 512)
  => blkmap part

  Partition Map for BLKMAP device 0  --   Partition Type: EFI

  Part    Start LBA       End LBA         Name
          Attributes
          Type GUID
          Partition GUID
    1     0x00000022      0x000000bd      "u-boot-spl"
          attrs:  0x0000000000000000
          type:   5b193300-fc78-40cd-8002-e86c45580b47
                  (5b193300-fc78-40cd-8002-e86c45580b47)
          guid:   0bb6bb6e-4aac-4c27-be03-016b01e7b941
    2     0x00000822      0x00000c84      "u-boot"
          attrs:  0x0000000000000000
          type:   2e54b353-1271-4842-806f-e436d6af6985
                  (2e54b353-1271-4842-806f-e436d6af6985)
          guid:   91d50814-8e31-4cc0-97dc-779e1dc59056
    3     0x00000c85      0x0000cc84      "rootfs"
          attrs:  0x0000000000000004
          type:   0fc63daf-8483-4772-8e79-3d69d8477de4
                  (linux)
          guid:   42799722-6e55-46e6-afa9-529e7af3f03b

Test log (4096 block size):

  => host bind 0 test.img 4096
  => host info
  dev       blocks  blksz label           path
    0        32768   4096 0               test.img
  => blkmap create 0
  Created "0"
  => blkmap map 0 0 8000 linear host 0 0
  Block 0x0+0x8000 mapped to block 0x0 of "host 0"
  => blkmap info
  Device 0: Vendor: U-Boot Rev: 1.0 Prod: blkmap
              Type: Hard Disk
              Capacity: 128.0 MB = 0.1 GB (32768 x 4096)
  => blkmap part

  Partition Map for BLKMAP device 0  --   Partition Type: EFI

  Part    Start LBA       End LBA         Name
          Attributes
          Type GUID
          Partition GUID
    1     0x00000100      0x00001fff      "primary"
          attrs:  0x0000000000000000
          type:   0fc63daf-8483-4772-8e79-3d69d8477de4
                  (linux)
          guid:   eba904d7-72c1-4dbd-bb4e-36be49cba5e3
    2     0x00002000      0x00007ffa      "primary"
          attrs:  0x0000000000000000
          type:   0fc63daf-8483-4772-8e79-3d69d8477de4
                  (linux)
          guid:   c48c360e-db47-46da-ab87-26416fad3cd3

2 years agodisk: part: Handle blkmap device in print_part_header()
Bin Meng [Tue, 26 Sep 2023 08:43:45 +0000 (16:43 +0800)] 
disk: part: Handle blkmap device in print_part_header()

Print out the blkmap device type when showing partition header for
a blkmap device.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodisk: part: Print out the unknown device uclass id
Bin Meng [Tue, 26 Sep 2023 08:43:44 +0000 (16:43 +0800)] 
disk: part: Print out the unknown device uclass id

It's helpful to output the device uclass id for unknown devices
during the debugging process.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: blk: Drop blk_{read,write}_devnum()
Bin Meng [Tue, 26 Sep 2023 08:43:43 +0000 (16:43 +0800)] 
dm: blk: Drop blk_{read,write}_devnum()

blk_{read,write}_devnum() are no longer used by anywhere in the
source tree. Drop them.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agocmd: blk_common: Stop using hard-coded block size for Sandbox operations
Bin Meng [Tue, 26 Sep 2023 08:43:42 +0000 (16:43 +0800)] 
cmd: blk_common: Stop using hard-coded block size for Sandbox operations

commit 3d2fc7971454 ("cmd: blk: Allow generic read/write operations to work in sandbox")
used the hard-coded block size (512) for accessing the sandbox host
device. Now that we have added support for non-512 block size for both
Sandbox host device and blkmap driver, let's stop using the hard-coded
block size.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: blk: Rename get_desc() and make it externally visible
Bin Meng [Tue, 26 Sep 2023 08:43:41 +0000 (16:43 +0800)] 
dm: blk: Rename get_desc() and make it externally visible

get_desc() can be useful outside blk-uclass.c. Let's change it to
an API and make it externally visible.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agocmd: blk_common: Use macros for the return values
Bin Meng [Tue, 26 Sep 2023 08:43:40 +0000 (16:43 +0800)] 
cmd: blk_common: Use macros for the return values

Avoid using magic number 0/1 for the command result.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoblk: blkmap: Support mapping to device of any block size
Bin Meng [Tue, 26 Sep 2023 08:43:39 +0000 (16:43 +0800)] 
blk: blkmap: Support mapping to device of any block size

At present if a device to map has a block size other than 512,
the blkmap map process just fails. There is no reason why we
can't just use the block size of the mapped device.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agocmd: blkmap: Make map_handlers[] and its .fn static
Bin Meng [Tue, 26 Sep 2023 08:43:38 +0000 (16:43 +0800)] 
cmd: blkmap: Make map_handlers[] and its .fn static

These are only used in cmd/blkmap.c.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoblk: blkmap: Make bind/unbind routines static
Bin Meng [Tue, 26 Sep 2023 08:43:37 +0000 (16:43 +0800)] 
blk: blkmap: Make bind/unbind routines static

These 2 are only used in drivers/block/blkmap.c.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agocmd: host: Print out the block size of the host device
Bin Meng [Tue, 26 Sep 2023 08:43:36 +0000 (16:43 +0800)] 
cmd: host: Print out the block size of the host device

It's useful if we can print out the block size of the host device
in the "host info" command.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoblk: host_dev: Sanity check on the size of host backing file
Bin Meng [Tue, 26 Sep 2023 08:43:35 +0000 (16:43 +0800)] 
blk: host_dev: Sanity check on the size of host backing file

Since we are emulating a block device, its size should be multiple
of the configured block size.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoblk: host_dev: Make host_sb_detach_file() and host_sb_ops static
Bin Meng [Tue, 26 Sep 2023 08:43:34 +0000 (16:43 +0800)] 
blk: host_dev: Make host_sb_detach_file() and host_sb_ops static

They are only used in drivers/block/host_dev.c.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoblk: sandbox: Support binding a device with a given logical block size
Bin Meng [Tue, 26 Sep 2023 08:43:33 +0000 (16:43 +0800)] 
blk: sandbox: Support binding a device with a given logical block size

Allow optionally set the logical block size of the host device to
bind in the "host bind" command. If not given, defaults to 512.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
2 years agocmd: host: Mandate the filename parameter in the 'bind' command
Bin Meng [Tue, 26 Sep 2023 08:43:32 +0000 (16:43 +0800)] 
cmd: host: Mandate the filename parameter in the 'bind' command

At present the host bind command does not require filename to be
provided. When it is not given NULL is passed to the host device
driver, which ends up failure afterwards.

Change to mandate the filename so that it is useful.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoblk: Use a macro for the typical block size
Bin Meng [Tue, 26 Sep 2023 08:43:31 +0000 (16:43 +0800)] 
blk: Use a macro for the typical block size

Avoid using the magic number 512 directly.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agotest/py: net: Add a test for 'pxe get' command
Love Kumar [Tue, 3 Oct 2023 13:12:46 +0000 (18:42 +0530)] 
test/py: net: Add a test for 'pxe get' command

Execute the 'pxe get' command to download a pxe configuration file from
the TFTP server and validate its interpretation.

Signed-off-by: Love Kumar <love.kumar@amd.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Link: https://lore.kernel.org/r/b5d263cf61282b158052ba87bde1fb4a227c0bb7.1696338593.git.love.kumar@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agonet: phy: xilinx_phy: Get rid of using property xlnx, phy-type
Venkatesh Yadav Abbarapu [Tue, 10 Oct 2023 03:04:36 +0000 (08:34 +0530)] 
net: phy: xilinx_phy: Get rid of using property xlnx, phy-type

As the xlnx,phy-type device tree property is deprecated and phy-mode
is being used, so removing the code references of xlnx,phy-type.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20231010030436.11854-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agoMerge branch '2023-10-09-assorted-fixes'
Tom Rini [Tue, 10 Oct 2023 12:54:17 +0000 (08:54 -0400)] 
Merge branch '2023-10-09-assorted-fixes'

- Cleanup how we pick what to launch in SPL, a few test changes, some TI
  K3 platform updates, top-level Makefile fixes and related cleanup,
  correct a problem with LMB overlap, other assorted fixes.

2 years agospi: nxp_fspi: reset the FLSHxCR1 registers
Han Xu [Wed, 13 Sep 2023 21:15:35 +0000 (16:15 -0500)] 
spi: nxp_fspi: reset the FLSHxCR1 registers

Reset the FLSHxCR1 registers to default value. ROM may set the register
value and it affects the SPI NAND normal functions.

Signed-off-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoboard: freescale: ls1088a: declare MC reserved regions
Laurentiu Tudor [Wed, 27 Sep 2023 15:30:49 +0000 (18:30 +0300)] 
board: freescale: ls1088a: declare MC reserved regions

Populate the device tree with the MC reserved memory regions.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoboard: freescale: ls2080a: declare MC reserved regions
Laurentiu Tudor [Wed, 27 Sep 2023 15:30:48 +0000 (18:30 +0300)] 
board: freescale: ls2080a: declare MC reserved regions

Populate the device tree with the MC reserved memory regions.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agodrivers: net: fsl-mc: add support for MC reserved memory
Laurentiu Tudor [Wed, 27 Sep 2023 15:30:47 +0000 (18:30 +0300)] 
drivers: net: fsl-mc: add support for MC reserved memory

Add support for declaring in device tree the reserved memory ranges
required for MC. Since the MC firmware acts as any DMA master present
in the SoC, the reserved memory ranges need also be identity mapped
in the SMMU, so create the required 'iommu-addresses' property in
the reserved memory nodes.
For now this support is used only on LX2160A SoCs.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoarmv8: fsl-layerscape: make some functions static
Laurentiu Tudor [Wed, 27 Sep 2023 15:30:46 +0000 (18:30 +0300)] 
armv8: fsl-layerscape: make some functions static

Some functions are not used outside this file, so make them static.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agofsl-layerscape: drop obsolete PPA secure firmware support
Laurentiu Tudor [Wed, 23 Aug 2023 13:25:46 +0000 (16:25 +0300)] 
fsl-layerscape: drop obsolete PPA secure firmware support

PPA was a secure firmware developed in-house which is no longer
supported and replaced by TF-A quite some years ago. Drop support
for it.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agoconfigs: layerscape: delete defconfigs using legacy PPA secure FW
Laurentiu Tudor [Tue, 10 Oct 2023 02:08:36 +0000 (10:08 +0800)] 
configs: layerscape: delete defconfigs using legacy PPA secure FW

PPA was a secure firmware developed in-house which is no longer
supported and replaced by TF-A quite some years ago. This makes
the defconfigs that make use of PPA obsolete, so remove them.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
 [Merged part 1 and part 2]
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 years agotest: Fix SPL tests not being run
Sean Anderson [Fri, 29 Sep 2023 16:06:54 +0000 (12:06 -0400)] 
test: Fix SPL tests not being run

SPL doesn't have OF_LIVE enabled, so we can only run tests with a flat
tree. Don't skip them even if they don't use the devicetree.

Fixes: 6ec5178c0ef ("test: Skip flat-tree tests if devicetree is not used")
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoboard/km/cent2: Fix buffer overflow when fixing MAC address
Francois Berder [Fri, 29 Sep 2023 14:11:00 +0000 (16:11 +0200)] 
board/km/cent2: Fix buffer overflow when fixing MAC address

String "/soc/fman/ethernet@e8000" is 25 bytes long
and not 24 due to extra byte for null character at
the end.

Signed-off-by: Francois Berder <fberder@outlook.fr>
2 years agostdio: fix stdio_deregister_dev()
Heinrich Schuchardt [Fri, 29 Sep 2023 00:47:17 +0000 (02:47 +0200)] 
stdio: fix stdio_deregister_dev()

When copying the name of a stdio device we must ensure that it is NUL
terminated before passing it to strcmp() to avoid a buffer overrun.

Truncating the name field leads to failure to deregister a stdio device.
When copying we must ensure that the name field sizes match.

Addresses-Coverity-ID: 350462 String not null terminated
Fixes: 5294e97832a6 ("stdio: extend "name" to 32 symbols")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: serial: fix serial_post_probe()
Heinrich Schuchardt [Fri, 29 Sep 2023 00:47:16 +0000 (02:47 +0200)] 
dm: serial: fix serial_post_probe()

The size of the name of a udevice is not limited.

When setting the fixed sized name field of a stdio device we must ensure
that the target string is NUL terminated to avoid buffer overflows.

Fixes: 57d92753d4ca ("dm: Add a uclass for serial devices")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agospl: Jump to image at end of board_init_r
Jonas Karlman [Wed, 27 Sep 2023 21:44:13 +0000 (21:44 +0000)] 
spl: Jump to image at end of board_init_r

spl_board_prepare_for_boot() is not called before jumping/invoking atf,
optee, opensbi or linux images.

Jump to image at the end of board_init_r() to fix this.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agospl: add __noreturn attribute to spl_invoke_atf function
Chanho Park [Fri, 8 Sep 2023 08:08:56 +0000 (17:08 +0900)] 
spl: add __noreturn attribute to spl_invoke_atf function

spl_invoke_atf function will not be returned to SPL. Thus, we need to
set __noreturn function attribute to the function.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
2 years agotools: iot2050-sign-fw.sh: Make localization of tools dir more robust
Jan Kiszka [Wed, 27 Sep 2023 15:41:09 +0000 (17:41 +0200)] 
tools: iot2050-sign-fw.sh: Make localization of tools dir more robust

When building in-tree, there is no source link.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2 years agoarm: mach-k3: common: fix compile warnings with PHYS_64BIT on 32bit
Matthias Schiffer [Wed, 27 Sep 2023 13:43:14 +0000 (15:43 +0200)] 
arm: mach-k3: common: fix compile warnings with PHYS_64BIT on 32bit

Use uintptr_t instead of phys_addr_t where appropriate, so passing the
addresses to writel() doesn't result in compile warnings when PHYS_64BIT
is set for 32bit builds (which is actually a useful configuration, as
the K3 SoC family boots from an R5 SPL, which may pass bank information
based on gd->bd->bi_dram to fdt_fixup_memory_banks() etc., so PHYS_64BIT
is needed for fixing up the upper bank).

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
2 years agotest/py: sleep: Add a test for the time command
Love Kumar [Wed, 27 Sep 2023 05:03:55 +0000 (10:33 +0530)] 
test/py: sleep: Add a test for the time command

Execute "time <sleep cmd>", and validate that it gives the approximately
the correct amount of command execution time.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2 years agomailbox: k3-sec-proxy: fix error handling for missing scfg in FDT
Matthias Schiffer [Tue, 26 Sep 2023 12:42:54 +0000 (14:42 +0200)] 
mailbox: k3-sec-proxy: fix error handling for missing scfg in FDT

The wrong field was checked.

Fixes: f9aa41023bd9 ("mailbox: Introduce K3 Secure Proxy Driver")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
2 years agotest: lmb: Add test for coalescing and overlap range
Udit Kumar [Tue, 26 Sep 2023 11:24:43 +0000 (16:54 +0530)] 
test: lmb: Add test for coalescing and overlap range

Add test case for an address range which is coalescing with one of
range and overlapping with next range

Cc: Simon Glass <sjg@google.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agolmb: remove overlapping region with next range
Udit Kumar [Tue, 26 Sep 2023 11:24:42 +0000 (16:54 +0530)] 
lmb: remove overlapping region with next range

In case of new memory range to be added is coalesced
with any already added non last lmb region.

And there is possibility that, then region in which new memory
range added is not adjacent to next region. But have some
sections are overlapping.

So along with adjacency check with next lmb region,
check for overlap should be done.

In case overlap  is found, adjust and merge these two lmb
region into one.

Reported-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
2 years agoexynos: Cleanup exynos_init
Tom Rini [Thu, 21 Sep 2023 23:32:48 +0000 (19:32 -0400)] 
exynos: Cleanup exynos_init

- None of the callers perform error checking and based on the non-empty
  versions of this function, there's no checking to be done, so make
  this a void.
- Add a default weak version of the function.
- Remove the empty versions of exynos_init now that we have a weak
  version.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoboard: Remove essentially empty board files and Makefiles
Tom Rini [Thu, 21 Sep 2023 23:32:47 +0000 (19:32 -0400)] 
board: Remove essentially empty board files and Makefiles

As part of reviewing a new platform, Daniel Schwierzeck noted that we
can have an empty Makefile in the board directory and don't need an
empty board.c file as well.  Further with further cleanup in the
Makefile we can now omit the Makefile entirely. Remove a number of now
unnecessary board.c and Makefiles.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMakefile: Allow for board directories to not have a Makefile
Tom Rini [Thu, 21 Sep 2023 23:32:46 +0000 (19:32 -0400)] 
Makefile: Allow for board directories to not have a Makefile

It is entirely possible at this point to have platforms in U-Boot that
do not have board-specific C code (just Kconfig or environment) and so
make it optional to have to descend in to and then build in the board
directory.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoARM: vexpress_ca9x4: Add missing flash width config option
Patryk Biel [Wed, 20 Sep 2023 07:41:20 +0000 (09:41 +0200)] 
ARM: vexpress_ca9x4: Add missing flash width config option

Allow for a proper configuration of CFI flash banks avaialble on the vexpress_ca9x4
board. Without this option, the CFI flash incorrectly detects that the board has two
banks of 32MB flash devices, while in reality, the board provides
two flash banks, each with 64MB size. As a result, it becomes impossible to e.g. to
save u-boot env in flash. According to device tree for this board and
its implementation in QEMU, the CFI width should be set to 32 bits.

After applying this fix, CFI flash will correctly detect both flash
banks each with a size of 64MB. As as result the functionality of e.g. saving u-boot
env will work correctly.

Tested on QEMU 6.2.0.

Cc: Kristian Amlie <kristian.amlie@northern.tech>
Signed-off-by: Patryk Biel <pbiel7@gmail.com>
Reviewed-by: Kristian Amlie <kristian.amlie@northern.tech>
2 years agobootstd: use ARCH_DMA_MINALIGN in memalign() when allocating memory
Tony Dinh [Tue, 19 Sep 2023 21:27:21 +0000 (14:27 -0700)] 
bootstd: use ARCH_DMA_MINALIGN in memalign() when allocating memory

Use ARCH_DMA_MINALIGN in memalign() when allocating memory to read the script from the media.

Ref: https://lore.kernel.org/u-boot/CAJaLiFy05F3Cr4X4G2mVkppXnBEFZrHQ+5CngYN8eJPg8ENWkg@mail.gmail.com/T/#m26daadc2463fe653b814a94e6309e5e6bb6be1d1

Note: this patch depends on the previous patch
https://patchwork.ozlabs.org/project/uboot/patch/20230917230649.30357-1-mibodhi@gmail.com/

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMakefile: Force regeneration of env.txt
Andrew Davis [Fri, 15 Sep 2023 14:43:23 +0000 (09:43 -0500)] 
Makefile: Force regeneration of env.txt

If the source .env file changes to one that is also older than the
generated env.txt file then the .env file is not regenerated. This
means when switching board configs we do not regenerate the env.

This can be tested with:

$ make j721e_evm_a72_defconfig
$ make # this may fail to complete but that is okay for this test
$ make am64x_evm_a53_defconfig
$ make
$ vim include/generated/env.txt

Note this is still the J721e env not the AM64 config as expected.

As ENV_FILE is set based on configuration, regenerate anytime
autoconf.h changes.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoarm64: versal: Add SelectMAP boot mode identification
Polak, Leszek [Sun, 8 Oct 2023 14:34:42 +0000 (14:34 +0000)] 
arm64: versal: Add SelectMAP boot mode identification

The SelectMAP configuration interface provides an 8-bit,
16-bit or 32-bit bidirectional data bus interface to the Versal FPGA
configuration logic that can be used for both configuration and readback.

A connected microcontoller to the SelectMAP interface can load boot
image with bitstream, TF-A (ARM Trusted Firmware) and U-Boot.

This commit adds the missing identification of the SelectMAP mode.

Signed-off-by: Polak, Leszek <LPolak@arri.de>
Reviewed-by: Stefan Roese <sr@denx.de>
Cc: Michal Simek <michal.simek@amd.com>
Cc: Stefan Roese <sr@denx.de>
Link: https://lore.kernel.org/r/DU0PR07MB8419F7765892CDBCE7D559C5C8CFA@DU0PR07MB8419.eurprd07.prod.outlook.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 years agoarm64: xilinx: Do not use '_' in si5335 DT node names
Michal Simek [Wed, 27 Sep 2023 10:05:32 +0000 (12:05 +0200)] 
arm64: xilinx: Do not use '_' in si5335 DT node names

Character '_' not recommended in node name. Use '-' instead.
Pretty much run sed below for node names.
s/si5335_/si5335-/

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ac752b1e27f02efb32608188992bb7ae50e4b1b0.1695809130.git.michal.simek@amd.com
2 years agoRevert "clk: versal: Enable clock driver for Versal NET"
Michal Simek [Wed, 27 Sep 2023 10:02:53 +0000 (12:02 +0200)] 
Revert "clk: versal: Enable clock driver for Versal NET"

This partially reverts commit ff33227819f579ffb963e0dac6bc6a6566b89563.

Versal NET clock node should use "xlnx,versal-net-clk", "xlnx,versal-clk"
compatible string that's why it is not necessary to define Versal NET
specific compatible string if there is no any other change needed. It can
be get back if there is a need to differentiate clock support between
Versal and Versal NET.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c09276022db5f1b150679cc7a9f9583363ace2fb.1695808971.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Do not use '_' in DT node names
Michal Simek [Wed, 27 Sep 2023 09:57:48 +0000 (11:57 +0200)] 
arm64: zynqmp: Do not use '_' in DT node names

Using '_' is not recommended for node names. Use '-' instead.
Pretty much run seds below for node names.
s/heartbeat_led/heartbeat-led/
s/gtr_sel/gtr-sel/
s/zynqmp_ipi/zynqmp-ipi/
s/nvmem_firmware/nvmem-firmware/
s/soc_revision/soc-revision/

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/dd33d6cb0595ffedab117d477f4a3c9d9eb11715.1695808665.git.michal.simek@amd.com
2 years agoarm: dts: xilinx: Remove undocumented is-dual property
Michal Simek [Wed, 27 Sep 2023 09:56:06 +0000 (11:56 +0200)] 
arm: dts: xilinx: Remove undocumented is-dual property

Xilinx was using in past is-dual property for QSPIs to reflect their
configurations. But handling for them never reached upstream code that's
why better to remove them.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/15980560b98672959a889ff9970cbe9540b4ed69.1695808563.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Add support for zcu670-revB
Michal Simek [Wed, 27 Sep 2023 09:53:37 +0000 (11:53 +0200)] 
arm64: zynqmp: Add support for zcu670-revB

RevB has different SD level shifter compare to revA. There are couple of
changes between revisions but none of them requires SW alignment.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/0f2bb29f88615ce75f887c006060543b4aeafd48.1695808407.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Add support for zcu670-revA
Michal Simek [Wed, 27 Sep 2023 09:53:36 +0000 (11:53 +0200)] 
arm64: zynqmp: Add support for zcu670-revA

The board is sharing a lot of components with zcu208 but it contains
differet silicon and also several components are done differently.
The board has 4GB memory connected to PS and additional 4GB connected to
PL. Compare to zcu208 sata support has been dropped and only USB3.0 is
using GTR (lane2). Others GTRs are routed to connectors.

MIO configuration is also shared with zcu111.

The board is using si5381 chip compare to si5341 which is normally used.
And as of now there is no Linux driver for this chip. PS reference clock is
generated out of si570 chip which is also new approach compare to zcu208.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/3b296ef0f52bd94e32bdeb6d1beee29ac85f00a2.1695808407.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Add support for VPXA2785
Michal Simek [Wed, 27 Sep 2023 09:53:35 +0000 (11:53 +0200)] 
arm64: zynqmp: Add support for VPXA2785

VPXA2785(vp-x-a2785-00) is evaluation board which contains two PCIe-Edge
fingers, one for PCIe-B(gen5x8) and one for CPM(dual gen5x8, gen5x16).
Each of the ports can operate in endpoint or root port mode. This allows
the single card to be used for both root port, endpoint, and switch modes.

The board is designed in the similar manner as others Versal boards. It
means board also have ZynqMP Zu4 System Controller which is described in a
separate file.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/59d3b1f7e785bc65518b465e5122fd2787616a93.1695808407.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Describe i2c structures for SCs
Michal Simek [Wed, 27 Sep 2023 09:53:34 +0000 (11:53 +0200)] 
arm64: zynqmp: Describe i2c structures for SCs

Generic system controller (SC) covers connection defined by specification
but different boards have different i2c devices. That's why describe i2c
devices available on multiple boards.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ca1826b8b58981111229a94527818cc5a191ca9a.1695808407.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Add support for SC revC
Michal Simek [Wed, 27 Sep 2023 09:53:33 +0000 (11:53 +0200)] 
arm64: zynqmp: Add support for SC revC

System controller revC is using ADI ethernet phy instead of TI because of
supply chain issues.
Describe reset assert and de-assert times to 10us and 5ms respectively
according to the datasheet. Also setup RGMII RX and TX delay values to
2400ps as per board bring up observations.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/2790f6cede7485556d581ab8270dda477fa21522.1695808407.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Create description for generic SC (vpk120-revB)
Michal Simek [Wed, 27 Sep 2023 09:53:32 +0000 (11:53 +0200)] 
arm64: zynqmp: Create description for generic SC (vpk120-revB)

System controllers are pretty much the same on the all boards that's why
use autodetection based on i2c eeprom. This should end up with having only
one BSP for all SCs with only DT overlays to cover different i2c
structures.

All MIOs are fixed by the spec that's why not a problem to description
pinctrl setting.

Apart from eth phy reset, it also set proper phy delays.
The TI DP83867 PHY datasheet says:
T1: Post RESET stabilization time == 195us
T3: Hardware configuration pins transition to output drivers == 64us
T4: RESET pulse width == 1us
So with a little overhead set 'reset-assert-us' to 100us (T4) and
'reset-deassert-us' to 280us (T1+T3).

NOTE: The tuning of TI DP83867 phy reset delay is derived from linux
upstream commit: 5dbadc848259(arm64: dts: fsl: add support for Kontron
pitx-imx8m board).

i2c structure on Xilinx Versal evaluation platforms contain a lot of
devices but also connection to connectors like SFP. Because of this
complicated structure with also all level shifters, i2c muxes, etc. not all
devices are able to reliably work on 400kHz even if they are compatible
with this speed. That's why set i2c frequency to 100KHz to increase
reliability of the i2c bus.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c8092340f92144f0cc9096194198f227015bc013.1695808407.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Add support for vpk120-revA
Michal Simek [Wed, 27 Sep 2023 09:53:31 +0000 (11:53 +0200)] 
arm64: zynqmp: Add support for vpk120-revA

Board contains two systems. The primary is Versal VP1202 ACAP device and
the secondary is ZynqMP zu4 which acts as system controller. The patch is
describing only ZynqMP system controller part.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/bd8b79d7c6693e90e12bce422f8ed00f2f43c9ae.1695808407.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Add x-prc-01/02/03/04/05 revA support from SC
Michal Simek [Wed, 27 Sep 2023 09:53:30 +0000 (11:53 +0200)] 
arm64: zynqmp: Add x-prc-01/02/03/04/05 revA support from SC

Add i2c accessible devices with description.
There is versal specific eeprom and i2c-gpio controller.

SE3 has also clock chip present.

Also remove x-prc description from SC dts.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/4f71ec6a63240fd4aaa3453824138281c50d71c3.1695808407.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Add support for vck190 revB system controller
Michal Simek [Wed, 27 Sep 2023 09:53:29 +0000 (11:53 +0200)] 
arm64: zynqmp: Add support for vck190 revB system controller

There are some changes between revA and revB boards. u39 8T49N240 was
removed and also three ina226 at 42/43/44 addresses (u178/u180/u182).

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/461cfe5b2b882365413f90d19efd8abcd6be56ed.1695808407.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Remove xlnx,fclk nodes
Michal Simek [Wed, 27 Sep 2023 09:53:28 +0000 (11:53 +0200)] 
arm64: zynqmp: Remove xlnx,fclk nodes

xlnx,fclk nodes are not described in dtschema that's why remove them.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/b25dedd066f587321751d7d20c1f65bb96c53b89.1695808407.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Add support for KD240 Kria SOM CC
Michal Simek [Wed, 27 Sep 2023 09:53:27 +0000 (11:53 +0200)] 
arm64: zynqmp: Add support for KD240 Kria SOM CC

Add support for KD240 Kria SOM CC. It is pretty much subset of KR260 board
from PS perspective.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/835f1d1b8982d46b902db69daad64e8445c051e9.1695808407.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Aligned QSPI configuration with latest spec
Michal Simek [Fri, 22 Sep 2023 10:35:43 +0000 (12:35 +0200)] 
arm64: zynqmp: Aligned QSPI configuration with latest spec

Official DT binding description for dual stacked/paralllel configurations
have been merged that's why switch to it.

Link: https://lore.kernel.org/r/20220126112608.955728-3-miquel.raynal@bootlin.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/2912091c231f5e945ee44601c285fe16263448da.1695378830.git.michal.simek@amd.com
2 years agoARM: zynq: Describe nand device in DT
Michal Simek [Fri, 22 Sep 2023 10:35:42 +0000 (12:35 +0200)] 
ARM: zynq: Describe nand device in DT

Linux requires to describe nand structure under nand controller.
If it is not described nand device is not detected by Linux.

Error shown by Linux kernel:
pl35x-nand-controller e1000000.nand-controller: Incorrect number of NAND chips (0)
pl35x-nand-controller: probe of e1000000.nand-controller failed with error -22

When wired:
nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
nand: Micron MT29F2G08ABAEAWP
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/3fcd68ccdfed5e6c079681e3b29e06583ec8a375.1695378830.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Sync licenses with Linux kernel
Michal Simek [Fri, 22 Sep 2023 10:35:41 +0000 (12:35 +0200)] 
arm64: zynqmp: Sync licenses with Linux kernel

There is difference between licenses in the Linux kernel and there
shouldn't be any diff because all changes are coming from the same source
at the same time. The difference is really in a time when they were
upstreamed. That's why sync it up.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/813b29378083153b67c60772f28cd2613519f338.1695378830.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Convert kv260-revA overlay to ASCII text
Michal Simek [Fri, 22 Sep 2023 10:35:40 +0000 (12:35 +0200)] 
arm64: zynqmp: Convert kv260-revA overlay to ASCII text

File was in UTF-8 format but there is no reason for it. Convert it to
ASCII/plain text.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/e4d52b898b461b86bb82009f37635f351279c753.1695378830.git.michal.simek@amd.com
2 years agoarm64: dts: zynqmp: Add ports for the DisplayPort subsystem
Laurent Pinchart [Fri, 22 Sep 2023 10:35:39 +0000 (12:35 +0200)] 
arm64: dts: zynqmp: Add ports for the DisplayPort subsystem

The DPSUB DT bindings now specify ports to model the connections with
the programmable logic and the DisplayPort output. Add them to the
device tree.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/1c91420e90bc823d7529834c33438216857c7161.1695378830.git.michal.simek@amd.com
2 years agoarm64: dts: zynqmp: zcu106a: Describe DisplayPort connector
Laurent Pinchart [Fri, 22 Sep 2023 10:35:38 +0000 (12:35 +0200)] 
arm64: dts: zynqmp: zcu106a: Describe DisplayPort connector

Add a device tree node to describe the DisplayPort connector, and
connect it to the DPSUB output.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/fe037c93ed41bc5ca97887964037520d449ca98c.1695378830.git.michal.simek@amd.com
2 years agoarm64: xilinx: Remove address/size-cells from gem nodes
Michal Simek [Fri, 22 Sep 2023 10:35:37 +0000 (12:35 +0200)] 
arm64: xilinx: Remove address/size-cells from gem nodes

Some boards are using one mdio bus which holds multiple phys and also
boards are using mdio node for bus description. That's why there are cases
where address/size-cells are unnecessary which is also reported by make W=1
dtbs. That's why remove them from zynqmp.dtsi and let board DTSes to handle
it based on used description.

Error log:
/axi/ethernet@ff0e0000: unnecessary #address-cells/#size-cells without
"ranges" or child "reg" property

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/02f308c774d4f2a798a9a8c066824114a19841a7.1695378830.git.michal.simek@amd.com
2 years agoarm64: xilinx: Put ethernet phys to mdio node
Michal Simek [Fri, 22 Sep 2023 10:35:36 +0000 (12:35 +0200)] 
arm64: xilinx: Put ethernet phys to mdio node

All zynqmp boards have been already described via mdio node that's why also
convert the rest of the boards. With using mdio node there is an option to
add reset property for the whole mdio bus which is reflected by
's/phy-reset-gpios/reset-gpios/g' for some boards.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ff165281a70a38e2b76fee91e6255ce95ce8021b.1695378830.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Fix Siva's email address format
Michal Simek [Fri, 22 Sep 2023 10:35:35 +0000 (12:35 +0200)] 
arm64: zynqmp: Fix Siva's email address format

Some patches didn't have his full name and also there was one more ">" at
the end of email address. That's why correct both of these issues.

Fixes: 174d728471d5 ("arm64: zynqmp: Switch to amd.com emails")
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/e970cc0dfabe293c2baf6b231d34f3af0386f1eb.1695378830.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Describe bus-width for SD card on KV260
Michal Simek [Fri, 22 Sep 2023 10:35:34 +0000 (12:35 +0200)] 
arm64: zynqmp: Describe bus-width for SD card on KV260

SD card is connected with 4 data lines which should be described properly.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/065cb9f1c6706eb4d70066e25cfc30d17b9f875d.1695378830.git.michal.simek@amd.com
2 years agoarm64: xilinx: Use lower case for partition address
Michal Simek [Fri, 22 Sep 2023 10:35:33 +0000 (12:35 +0200)] 
arm64: xilinx: Use lower case for partition address

Lower case should be used for register address.
Issue is reported as:
flash@0: partitions: Unevaluated properties are not allowed
('partition@22A0000' was unexpected)

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/66b3361df883ecab4f36ce3b4196fb606c802598.1695378830.git.michal.simek@amd.com
2 years agoarm64: xilinx: Remove address/size-cells from flash node
Michal Simek [Fri, 22 Sep 2023 10:35:32 +0000 (12:35 +0200)] 
arm64: xilinx: Remove address/size-cells from flash node

Partitions are described via fixed-partitions that's why there is no need
to have address/size-cells in flash node.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c704be9d9f3d09c1cc55b092efeb9c73fcda6451.1695378830.git.michal.simek@amd.com
2 years agoarm64: dts: xilinx: zynqmp: Add RPU subsystem device node
Tanmay Shah [Fri, 22 Sep 2023 10:35:31 +0000 (12:35 +0200)] 
arm64: dts: xilinx: zynqmp: Add RPU subsystem device node

RPU subsystem can be configured in cluster-mode or split mode.
Also each r5 core has separate power domains.

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/dde364939b4fbe3f7be7b6f5dff42e7d8b2f5c46.1695378830.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Describe interrupts by using macros
Michal Simek [Fri, 22 Sep 2023 10:35:30 +0000 (12:35 +0200)] 
arm64: zynqmp: Describe interrupts by using macros

Use arm-gic.h and irq.h for interrupt description. It helps to improve
readability of device tree file.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/e0db567e1eb4e4e90e59270f41708919682dacf4.1695378830.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Remove resetin/out from K24 psu_init
Michal Simek [Mon, 18 Sep 2023 14:11:23 +0000 (16:11 +0200)] 
arm64: zynqmp: Remove resetin/out from K24 psu_init

The code is not called that's why remove it.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/7b207e90f68028ab36fcc22df4127492f174793d.1695046281.git.michal.simek@amd.com
2 years agoarm64: zynqmp: Rename dt overlay file names from dts to dtso
Michal Simek [Mon, 18 Sep 2023 14:09:18 +0000 (16:09 +0200)] 
arm64: zynqmp: Rename dt overlay file names from dts to dtso

Use dtso suffix instead of dts. Build option was introduced by
commit a0f9a77912b2 ("kbuild: Allow DTB overlays to built from .dtso named
source files").

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/1dce37e72428c14a3ccbb5dc674b90dfe56b75ac.1695046155.git.michal.simek@amd.com