]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
18 months agostdio: Remove stdio_init()
Masahiro Yamada [Tue, 6 Jun 2023 11:37:42 +0000 (20:37 +0900)]
stdio: Remove stdio_init()

This function is not used by anyone.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agoconfigs: am64x_evm_*_defconfig: Enable High Secure device support
Vignesh Raghavendra [Sat, 3 Jun 2023 12:36:14 +0000 (18:06 +0530)]
configs: am64x_evm_*_defconfig: Enable High Secure device support

Enable CONFIG_TI_SECURE_DEVICE to support booting High Secure(HS)
variants of AM64x SoC.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
18 months agoconfigs: synquacer: increase SYS_MALLOC_F_LEN
Masahisa Kojima [Thu, 1 Jun 2023 09:13:51 +0000 (18:13 +0900)]
configs: synquacer: increase SYS_MALLOC_F_LEN

DM_FLAG_PRE_RELOC flag is added into some drivers
by recent commits such as
1bd790bc4b ("firmware: psci: enable DM_FLAG_PRE_RELOC").
Current SYS_MALLOC_F_LEN of SynQuacer Developerbox platform
is too small, Developerbox will not boot due to lack of
heap memory.

This commit increases the size of heap memory.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
18 months agotest: bdinfo: Add test for command bdinfo
Marek Vasut [Wed, 31 May 2023 01:03:58 +0000 (03:03 +0200)]
test: bdinfo: Add test for command bdinfo

Add test for command bdinfo .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agopython: Update requirements.txt for security issues
Tom Rini [Tue, 30 May 2023 19:50:30 +0000 (15:50 -0400)]
python: Update requirements.txt for security issues

Per GitHub Dependabot:
- Use setuptools 65.5.1 to avoid some DoS issue
- Use requests 2.31.0 to avoid leaking some proxy information

Signed-off-by: Tom Rini <trini@konsulko.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
18 months agodrivers: spi: omap3_spi: Initialize mode for all channels
Julien Panis [Mon, 29 May 2023 13:42:28 +0000 (15:42 +0200)]
drivers: spi: omap3_spi: Initialize mode for all channels

At first SPI transfers, multiple chip selects can be
enabled simultaneously. This is due to chip select
polarity, which is not properly initialized for all
channels. This patch fixes the issue.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
18 months agopsci: fix use of clobbered registers in asm
Sam Edwards [Sun, 28 May 2023 00:09:42 +0000 (18:09 -0600)]
psci: fix use of clobbered registers in asm

The functions `psci_get_context_id` and `psci_get_target_pc`
are written in C, so the C compiler may clobber registers r0-r3.
Do not use these registers to save data across calls.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
18 months agomkimage: ecdsa: password for signing from environment
Stefano Babic [Thu, 25 May 2023 08:18:05 +0000 (10:18 +0200)]
mkimage: ecdsa: password for signing from environment

Use a variable (MKIMAGE_SIGN_PASSWORD) like already done for RSA to
allow the signing process to run in batch.

Signed-off-by: Stefano Babic <sbabic@denx.de>
18 months agousb: eth: lan78xx: Fix logic in lan78xx_read_otp() to avoid a warning
Tom Rini [Thu, 4 Jun 2020 20:35:15 +0000 (16:35 -0400)]
usb: eth: lan78xx: Fix logic in lan78xx_read_otp() to avoid a warning

In lan78xx_read_otp() we want to know if sig is LAN78XX_OTP_INDICATOR_1
or LAN78XX_OTP_INDICATOR_2.  In the case of matching the first one we
set offset to itself, and clang warns about this.  Rework the logic so
that if sig is the second indicator we adjust the offset as today and if
it does not match the first indicator we return -EINVAL

Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
18 months agospl: spl-nor: return error if no valid image was loaded
Mario Kicherer [Mon, 30 Jan 2023 09:21:43 +0000 (10:21 +0100)]
spl: spl-nor: return error if no valid image was loaded

If only FIT images are enabled and loading the FIT image fails,
spl_nor_load_image() should return an error instead of zero.

Without this patch:

>>SPL: board_init_r()
spl_init
Trying to boot from NOR
Unsupported OS image.. Jumping nevertheless..
image entry point: 0x0

With patch:

>>SPL: board_init_r()
spl_init
Trying to boot from NOR
SPL: failed to boot from all boot devices (err=-6)
.### ERROR ### Please RESET the board ###

Signed-off-by: Mario Kicherer <dev@kicherer.org>
18 months agoMerge branch '2023-06-19-spl-nvme-support' into next
Tom Rini [Tue, 20 Jun 2023 13:35:16 +0000 (09:35 -0400)]
Merge branch '2023-06-19-spl-nvme-support' into next

To quote the author:
This patchset adds support to load images of the SPL's next booting
stage from a NVMe device

18 months agocommon: spl: Add spl NVMe boot support
Mayuresh Chitale [Sat, 3 Jun 2023 14:02:56 +0000 (19:32 +0530)]
common: spl: Add spl NVMe boot support

Add support to load the next stage image from an NVMe disk which may
be formatted as an EXT or FAT filesystem.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
[trini: Drop hunk changing disk/part.c as that breaks other users]
Signed-off-by: Tom Rini <trini@konsulko.com>
18 months agonvme: pci: Enable for SPL
Mayuresh Chitale [Sat, 3 Jun 2023 14:02:55 +0000 (19:32 +0530)]
nvme: pci: Enable for SPL

Enable NVME and PCI NVMe drivers for SPL builds. Also enable PCI_PNP
for SPL which is required to auto configure the PCIe devices.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
18 months agospl: blk: Support loading images from fs
Mayuresh Chitale [Sat, 3 Jun 2023 14:02:54 +0000 (19:32 +0530)]
spl: blk: Support loading images from fs

Add a generic API to support loading of SPL payload from any supported
filesystem on a given partition of a block device.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
18 months agospl: Add Kconfig options for NVME
Mayuresh Chitale [Sat, 3 Jun 2023 14:02:53 +0000 (19:32 +0530)]
spl: Add Kconfig options for NVME

Add kconfig options to enable NVME and PCI NVMe support in SPL

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agoglobal: Use proper project name U-Boot (next)
Michal Simek [Mon, 5 Jun 2023 11:58:59 +0000 (13:58 +0200)]
global: Use proper project name U-Boot (next)

Use proper project name in DTs, messages and READMEs.

Signed-off-by: Michal Simek <michal.simek@amd.com>
18 months agoMerge branch '2023-06-19-corstone1000-fwu-updates' into next
Tom Rini [Mon, 19 Jun 2023 20:43:53 +0000 (16:43 -0400)]
Merge branch '2023-06-19-corstone1000-fwu-updates' into next

To quote the author:
Now that the nvmxip block driver is merged we can add on top
of it the platform code to use GPT and FWU metadata in the
Corstone1000.

But first, push 2 fixes that are needed to make all this work:
 - move nvmxip header to include
 - setup fwu metadata structures as packed (we have a 32bit
   writer - Secure enclave Cortex-M0 and a 64bit reader host
   Cortex-A35)

18 months agocorstone1000: add nvmxip, fwu-mdata and gpt options
Rui Miguel Silva [Mon, 12 Jun 2023 08:09:20 +0000 (09:09 +0100)]
corstone1000: add nvmxip, fwu-mdata and gpt options

Enable the newest features: nvmxip, fwu-metadata and
gpt. Commands to print the partition info, gpt info
and fwu metadata will be available.

Adjust also env boot script the address of the
bootbank with the new gpt layout, and also remove
the not needed kernel address bank0 and bank1
and retrieve function that would test the bank flag
before and now we are getting the info from the fwu
metadata.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
18 months agocorstone1000: set kernel_addr based on boot_idx
Rui Miguel Silva [Mon, 12 Jun 2023 08:09:19 +0000 (09:09 +0100)]
corstone1000: set kernel_addr based on boot_idx

We need to distinguish between boot banks and from which
partition to load the kernel+initramfs to memory.

For that, fetch the boot index, fetch the correspondent
partition, calculate the correct kernel address and
then set the env variable kernel_addr with that value.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
18 months agocorstone1000: add boot index
Rui Miguel Silva [Mon, 12 Jun 2023 08:09:18 +0000 (09:09 +0100)]
corstone1000: add boot index

it is expected that the firmware that runs before
u-boot somehow provide the information of the bank
for now we will fetch the info from the metadata
since the Secure enclave is the one responsible for
this information.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
18 months agocorstone1000: add fwu-metadata store info
Rui Miguel Silva [Mon, 12 Jun 2023 08:09:17 +0000 (09:09 +0100)]
corstone1000: add fwu-metadata store info

Add fwu-mdata node and handle for the reference
nvmxip-qspi.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
18 months agonvmxip: move header to include
Rui Miguel Silva [Mon, 12 Jun 2023 08:09:16 +0000 (09:09 +0100)]
nvmxip: move header to include

Move header to include to allow external code
to get the internal bdev structures to access
block device operations.

as at it, just add the UCLASS_NVMXIP string
so we get the correct output in partitions
listing.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
18 months agofwu_metadata: make sure structures are packed
Rui Miguel Silva [Mon, 12 Jun 2023 08:09:15 +0000 (09:09 +0100)]
fwu_metadata: make sure structures are packed

The fwu metadata in the metadata partitions
should/are packed to guarantee that the info is
correct in all platforms. Also the size of them
are used to calculate the crc32 and that is important
to get it right.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
18 months agoMerge tag 'u-boot-stm32-20230616' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Fri, 16 Jun 2023 14:51:58 +0000 (10:51 -0400)]
Merge tag 'u-boot-stm32-20230616' of https://source.denx.de/u-boot/custodians/u-boot-stm into next

serial: stm32: Fixes to avoid suprious characters
Use U-Boot device tree to configure MTD partitions stm32mp13 and stm32mp15 boards
stm32mp: stm32prog: Add support of ENV partition type
config: stm32mp15: remove CONFIG_FASTBOOT_USB_DEV and CONFIG_FASTBOOT_CMD_OEM_FORMAT
stm32: Add IWDG handling into PSCI suspend code
stm32: Fix OF_LIST on DHCOR
stm32: Add missing header for save_boot_params
stm32: Use __section(".data") with dot in the section name on DHSOM
stm32mp: soome changes and fixes for STM32MP13 and STM32MP15 boards
dts: stm32mp: alignment with v6.3
dts: stm32f769-disco: remove the dsi_host node
configs: stm32f746-disco: remove a useless comment

18 months agoserial: stm32: BRR must be set only when usart is disable
Patrice Chotard [Wed, 31 May 2023 06:01:31 +0000 (08:01 +0200)]
serial: stm32: BRR must be set only when usart is disable

To avoid spurious chars, BRR register must only be written when
USART is disabled.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
18 months agoserial: stm32: Wait TC bit before performing initialization
Patrice Chotard [Wed, 31 May 2023 06:01:30 +0000 (08:01 +0200)]
serial: stm32: Wait TC bit before performing initialization

In case there is still chars from previous bootstage to transmit, wait
for TC (Transmission Complete) bit to be set which ensure that the last
data written in the USART_TDR has been transmitted out of the shift
register.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
18 months agoconfigs: stm32f746-disco: remove a useless comment
Dario Binacchi [Sat, 22 Apr 2023 14:01:40 +0000 (16:01 +0200)]
configs: stm32f746-disco: remove a useless comment

Commit 8fc78fc73b7f9d ("configs: migrate CONFIG_BMP_16/24/32BPP to defconfigs")
made the comment useless.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
18 months agoARM: dts: stm32f769-disco: remove the dsi_host node
Dario Binacchi [Sat, 22 Apr 2023 14:02:36 +0000 (16:02 +0200)]
ARM: dts: stm32f769-disco: remove the dsi_host node

The node has become useless, as described in the
commit 754815b854258 ("video: stm32: remove the compatible "synopsys, dw-mipi-dsi" support")

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
18 months agoARM: dts: stm32mp: alignment with v6.3
Patrick Delaunay [Mon, 24 Apr 2023 14:21:10 +0000 (16:21 +0200)]
ARM: dts: stm32mp: alignment with v6.3

Device tree alignment with Linux kernel v6.3:
f5a058023239 - ARM: dts: stm32: add i2c nodes into stm32mp131.dtsi
8539ebb435a5 - ARM: dts: stm32: enable i2c1 and i2c5 on
  stm32mp135f-dk.dts
8539ebb435a5 - ARM: dts: stm32: add spi nodes into stm32mp131.dtsi
15f72e0da4da - ARM: dts: stm32: add pinctrl and disabled spi5 node in
  stm32mp135f-dk
ea99a5a02ebc - ARM: dts: stm32: Create separate pinmux for qspi cs pin
  in stm32mp15-pinctrl.dtsi
a306d8962a24 - ARM: dts: stm32: Rename mdio0 to mdio
0a5ebb1f3367 - ARM: dts: stm32: Replace SAI format with dai-format DT
  property
ccdab19738a6 - ARM: dts: stm32: add adc support to stm32mp13
022932ab55fd - ARM: dts: stm32: add adc pins muxing on stm32mp135f-dk
ab2806ddad9d - ARM: dts: stm32: add dummy vdd_adc regulator on
  stm32mp135f-dk
e46a180c060f - ARM: dts: stm32: add adc support on stm32mp135f-dk
9ebf215fbae1 - ARM: dts: stm32: add PWR fixed regulators on stm32mp131
16f4ff60519a - ARM: dts: stm32: add USBPHYC and dual USB HS PHY support
  on stm32mp131
4a47f0f3e936 - ARM: dts: stm32: add UBSH EHCI and OHCI support on
  stm32mp131
2a46bb66c47f - ARM: dts: stm32: add USB OTG HS support on stm32mp131
9ebf215fbae1 - ARM: dts: stm32: add fixed regulators to support usb on
  stm32mp135f-dk
16f4ff60519a - ARM: dts: stm32: enable USB HS phys on stm32mp135f-dk
c4e7254cf6dc - ARM: dts: stm32: enable USB Host EHCI on stm32mp135f-dk
44978e135916 - ARM: dts: stm32: add pins for stm32g0 typec controller on stm32mp13
4f532403b1e5 - ARM: dts: stm32: enable USB OTG in dual role mode on
  stm32mp135f-dk
e1f15571c96c - ARM: dts: stm32: add mcp23017 pinctrl entry for stm32mp13
6cc71374002e - ARM: dts: stm32: add mcp23017 IO expander on I2C1 on
  stm32mp135f-dk
7ffd2266bd32 - ARM: dts: stm32: Fix qspi pinctrl phandle for
  stm32mp15xx-dhcor-som
21d83512bf2b - ARM: dts: stm32: Fix qspi pinctrl phandle for
  stm32mp15xx-dhcom-som
732dbcf52f74 - ARM: dts: stm32: Fix qspi pinctrl phandle for
  stm32mp151a-prtt1l
003b7c6b24f4 - ARM: dts: stm32: remove sai kernel clock on
  stm32mp15xx-dkx
f2b17b39bfff - ARM: dts: stm32: rename sound card on stm32mp15xx-dkx
dee3cb759d3d - ARM: dts: stm32: Remove the pins-are-numbered property
ae8cf3b48727 - ARM: dts: stm32: add i2s nodes on stm32mp131
619746a27bd0 - ARM: dts: stm32: add sai nodes on stm32mp131
c5e05d08ef90 - ARM: dts: stm32: add spdifrx node on stm32mp131
0a5afd3ee0d0 - ARM: dts: stm32: add dfsdm node on stm32mp131
bf9d876bea2e - ARM: dts: stm32: add timers support on stm32mp131
a3183748371d - ARM: dts: stm32: add timer pins muxing for stm32mp135f-dk
a9060c1326bc - ARM: dts: stm32: add timers support on stm32mp135f-dk
a12154058f75 - ARM: dts: stm32: Fix User button on stm32mp135f-dk
2f33df889e99 - ARM: dts: stm32: Use new media bus type macros
366384e49551 - ARM: dts: stm32: Update part number NVMEM description on
  stm32mp131

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agomedia: dt-bindings: media: Add macros for video interface bus types
Patrick Delaunay [Mon, 24 Apr 2023 14:21:09 +0000 (16:21 +0200)]
media: dt-bindings: media: Add macros for video interface bus types

Add a new dt-bindings/media/video-interfaces.h header that defines
macros corresponding to the bus types from media/video-interfaces.yaml.
This allows avoiding hardcoded constants in device tree sources.

Based on linux commit f7eeb0084593 ("media: dt-bindings: media: Add macros
for video interface bus types")

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agopmic: stpmic1: support new prefix node name for regulator
Patrick Delaunay [Thu, 27 Apr 2023 13:36:38 +0000 (15:36 +0200)]
pmic: stpmic1: support new prefix node name for regulator

The '_' character is discouraged in the node name, this patch adds the
new prefix of regulator subnode, with the '-' character, in STM32MP1 driver
to support the new  naming rule in Linux kernel device trees.

It is a preliminary patch before Linux device tree synchronization
for STMicroelectronics boards.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agostm32mp: stm32prog: use the decimal format by default for offset parsing
Patrick Delaunay [Thu, 27 Apr 2023 13:36:37 +0000 (15:36 +0200)]
stm32mp: stm32prog: use the decimal format by default for offset parsing

Change the default base for offset parsing with simple_strtoull(),
so offset in flashlayout is coded in base 10 by default, even if string
start with '0'. The Octal encoding is not supported. The base 16
is still supported when the '0x' header is detected.

This patch solves an unexpected parsing result when the address,
provided by decimal value is starting by 0, for example 0x4400 = 00017408
is a invalid with current code.

...
P 0x04 fsbl1 Binary mmc0 00017408         tf-a.stm32
....

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agostm32mp: stm32prog: fix OTP read/write error management
Patrick Delaunay [Thu, 27 Apr 2023 13:36:36 +0000 (15:36 +0200)]
stm32mp: stm32prog: fix OTP read/write error management

Avoid to ignore the OTP read/write error and transmits the error
to STM32CubeProgrammer.

Today the error is only displayed in log error:
so the user on HOST thinks the OTP operation is performed.

Reported-by: Mickael GARDET <m.gardet@overkiz.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Fixes: 75ea9e75931c ("stm32mp: stm32prog: add TEE support in stm32prog command")
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agoconfigs: stm32mp1: reduce DDR_CACHEABLE_SIZE to supported 256MB DDR
Patrick Delaunay [Thu, 27 Apr 2023 13:36:35 +0000 (15:36 +0200)]
configs: stm32mp1: reduce DDR_CACHEABLE_SIZE to supported 256MB DDR

Reduces the CONFIG_DDR_CACHEABLE_SIZE, the size of DDR mapped cacheable
before relocation, to support DDR with only 256MB because the OP-TEE
reserved memory is located at end of the DDR.

By default the new size of 128MB cacheable memory is enough
in dram_bank_mmu_setup() for early_enable_caches() in arch_cpu_init()
and is correct for DDR size = 256MB.

After relocation the real size of DDR, excluding the no-map reserved
memory, is used after the U-Boot device tree parsing.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agostm32mp: bsec: add check on null size in misc ops
Patrick Delaunay [Thu, 27 Apr 2023 13:36:34 +0000 (15:36 +0200)]
stm32mp: bsec: add check on null size in misc ops

Add a protection in misc bsec ops for request with null size.

For example OP-TEE error occurs when get_eth_nb() return 0 in
setup_mac_address() for unknown part number because U-Boot read 0 OTPs.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agostm32mp: add support of STM32MP15x Rev.Y
Patrick Delaunay [Thu, 27 Apr 2023 13:36:33 +0000 (15:36 +0200)]
stm32mp: add support of STM32MP15x Rev.Y

Add support of STM32MP15x Rev.Y for the Silicon revision REV_ID = 0x2003.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agoARM: stm32: Use __section(".data") with dot in the section name on DHSOM
Marek Vasut [Thu, 4 May 2023 19:52:08 +0000 (21:52 +0200)]
ARM: stm32: Use __section(".data") with dot in the section name on DHSOM

The correct specifier of the section is ".data" and not "data",
use the former to place the variables in ".data" section.

Fixes: 731fd50e27f ("ARM: stm32: Implement board coding on AV96")
Fixes: 92ca0f7446c ("ARM: dts: stm32: Synchronize DDR setttings on DH SoMs")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
18 months agoARM: stm32: Add missing header for save_boot_params
Marek Vasut [Thu, 4 May 2023 19:52:30 +0000 (21:52 +0200)]
ARM: stm32: Add missing header for save_boot_params

The get_stm32mp_rom_api_table() function is defined in sys_params.h ,
add the missing header to avoid compiler warning.

Fixes: dbeaca79b79 ("ARM: stm32: Factor out save_boot_params")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
18 months agoARM: stm32: Fix OF_LIST on DHCOR
Tom Rini [Fri, 5 May 2023 00:11:02 +0000 (20:11 -0400)]
ARM: stm32: Fix OF_LIST on DHCOR

The ITS file used to build the images here lists three dtb files as
being used. Today, these are built by the logic that will over-build dtb
files based on SOC/etc symbols being set. To future proof this platform
and be generally correct, we list all 3 of the device trees used here in
OF_LIST.

Cc: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
18 months agoARM: stm32: Add IWDG handling into PSCI suspend code
Marek Vasut [Thu, 11 May 2023 19:55:45 +0000 (21:55 +0200)]
ARM: stm32: Add IWDG handling into PSCI suspend code

In case the IWDG is enabled by either U-Boot or Linux, the IWDG can never
be disabled again. That includes low power states, which means that if the
IWDG is enabled, the SoC would reset itself after a while in suspend via
the IWDG. This is not desired behavior.

It is possible to enable IWDG pre-timeout IRQ which is routed into the EXTI,
and use that IRQ to wake the CPU up before the IWDG timeout is reached and
reset is triggered. This pre-timeout IRQ can be used to reload the WDT and
then suspend the CPU again every once in a while.

Implement this functionality for both IWDG1 and IWDG2 by reading out all
the unmasked IRQs, comparing the list with currently pending IRQs in GICv3:
- If any IRQ is pending and it is NOT IWDG1 or IWDG2 pre-timeout IRQ,
  wake up and let OS handle the IRQs
- If IWDG1 or IWDG2 IRQ is pending and no other IRQ is pending,
  ping the respective IWDG and suspend again

This does not seem to have any adverse impact on power consumption in suspend.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
18 months agoconfig: stm32mp15: remove CONFIG_FASTBOOT_CMD_OEM_FORMAT
Patrick Delaunay [Tue, 30 May 2023 12:26:21 +0000 (14:26 +0200)]
config: stm32mp15: remove CONFIG_FASTBOOT_CMD_OEM_FORMAT

Remove the support of the fastboot "oem format" command for STM32MP15x
boards and removed the associated env variable "partitions".
This command is not required; with fastboot tool, the GPT partition can
be handle with "flash" command in "gpt" target (=CONFIG_FASTBOOT_GPT_NAME),
for example: fastboot flash gpt gpt.bin

This patch avoids to define the GPT partitioning in U-Boot environment,
which is incompatible with planned modifications, for example to
support TF-A firmware update.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agoconfig: stm32mp15: remove CONFIG_FASTBOOT_USB_DEV
Patrick Delaunay [Tue, 30 May 2023 12:26:20 +0000 (14:26 +0200)]
config: stm32mp15: remove CONFIG_FASTBOOT_USB_DEV

The CONFIG_FASTBOOT_USB_DEV is used to select USB OTG controller other
than 0 but it is not the case for STM32MP15 boards; it can be removed
to simplify the STM32MP15 defconfig files.

On STM32MP15x boards, we have only one USB device with instance 0,
so the device is hardcoded arch/arm/mach-stm32mp/cpu.c with
the command "fastboot 0" and this define is not used in config files
(include/configs/stm32mp15_st_common.h).

Fixes: 4633fd51c5d7 ("stm32mp1: activate FASTBOOT on eMMC")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agostm32mp: stm32prog: Add support of FWU_MDATA partition type
Patrick Delaunay [Thu, 8 Jun 2023 15:09:56 +0000 (17:09 +0200)]
stm32mp: stm32prog: Add support of FWU_MDATA partition type

Add support of "FWU_MDATA" partition type in flashlayout to select
the TF-A firmware update metadata partition type guid, associated to
U-Boot "system" partition type guid, FWU_MDATA_GUID introduced by
commit 2eaedc95164f ("FWU: Add FWU metadata structure and driver for
accessing metadata") and used in gpt_get_mdata_partitions() for
commit 554b38f7a532 ("FWU: Add FWU metadata access driver for GPT
partitioned block devices")

See also recommendation in FWU-PSA-A_DEN0118_1.0ALP3.pdf
  4.1.2 Metadata integration with GPT
  When embedded in a GPT, each metadata replica occupies a single
  partition with PartitionTypeGUID = metadata_uuid.
  UUID = 8a7a84a0-8387-40f6-ab41-a8b9a5a60d23

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agostm32mp: stm32prog: Add support of ESP partition type
Patrick Delaunay [Thu, 8 Jun 2023 15:09:55 +0000 (17:09 +0200)]
stm32mp: stm32prog: Add support of ESP partition type

Add support of "ESP" partition type in flashlayout to select
the "EFI System Partition", associated to U-Boot "system"
partition type  guid, PARTITION_SYSTEM_GUID =
C12A7328-F81F-11d2-BA4B-00A0C93EC93B.

This partition is the bootable partition for efi boot.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agostm32mp: stm32prog: Add support of ENV partition type
Patrick Delaunay [Thu, 8 Jun 2023 15:09:54 +0000 (17:09 +0200)]
stm32mp: stm32prog: Add support of ENV partition type

Add support of "ENV" partition type in flashlayout to select
the "u-boot-env" GUID, with PARTITION_U_BOOT_ENVIRONMENT =
3de21764-95bd-54bd-a5c3-4abe786f38a8, that mean a partition
holding a U-Boot environment introduced by
commit c0364ce1c695 ("doc/README.gpt: define partition type
GUID for U-Boot environment")'

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agoarm: dts: stm32: Add partitions in flash0 and nand node for stm32mp15xx-dhcom/dhcor
Patrick Delaunay [Thu, 8 Jun 2023 15:16:48 +0000 (17:16 +0200)]
arm: dts: stm32: Add partitions in flash0 and nand node for stm32mp15xx-dhcom/dhcor

Add partitions subnode in flash0 for stm32mp157xx-dhcom/dhcor boards.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agoconfigs: stm32mp1: disable CMD_MTDPARTS
Patrice Chotard [Thu, 8 Jun 2023 15:16:47 +0000 (17:16 +0200)]
configs: stm32mp1: disable CMD_MTDPARTS

Disable CMD_MTDPARTS as it's no more needed and it is strongly
encouraged to avoid using this command anymore.
(see comments in ./cmd/Kconfig:2422).

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agostm32mp: stm32prog: Remove tee_detected from stm32prog_data struct
Patrice Chotard [Thu, 8 Jun 2023 15:16:46 +0000 (17:16 +0200)]
stm32mp: stm32prog: Remove tee_detected from stm32prog_data struct

As stm32prog_get_tee_partitions() is no more used, remove tee_detected
boolean from stm32prog_data struct and all code using it.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agoboard: st: remove board_mtdparts_default
Patrick Delaunay [Thu, 8 Jun 2023 15:16:45 +0000 (17:16 +0200)]
board: st: remove board_mtdparts_default

Remove the function board_mtdparts_default and the associated file
or configs, only used by the CONFIG_SYS_MTDPARTS_RUNTIME now removed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agoboard: stm32mp1: use fdt_copy_fixed_partitions
Patrick Delaunay [Thu, 8 Jun 2023 15:16:44 +0000 (17:16 +0200)]
board: stm32mp1: use fdt_copy_fixed_partitions

Copy the fixed partition nodes from U-Boot device tree to Linux kernel
device tree to dynamically configure the MTD partitions.

fdt_copy_fixed_partitions is only based on device tree
and replace the function fdt_fixup_mtdparts based on mtdparts variable;
the variable mtdid and mtdparts are not more required.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agoconfigs: stm32mp: Disable SYS_MTDPARTS_RUNTIME for stm32mp15 and stm32mp13
Patrice Chotard [Thu, 8 Jun 2023 15:16:43 +0000 (17:16 +0200)]
configs: stm32mp: Disable SYS_MTDPARTS_RUNTIME for stm32mp15 and stm32mp13

As we don't use anymore MTDPARTS_xx Kconfig variables
(MTDPARTS_NAND0_BOOT, MTDPARTS_NOR0_BOOT...),
disable SYS_MTDPARTS_RUNTIME.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agoarm: dts: stm32: Add partitions in flash0 and nand node for stm32mp15xx-ev1
Patrice Chotard [Thu, 8 Jun 2023 15:16:42 +0000 (17:16 +0200)]
arm: dts: stm32: Add partitions in flash0 and nand node for stm32mp15xx-ev1

Add partitions subnode in flash0 and nand nodes for all stm32mp157xx-ev1
boards. Update only the file stm32mp157c-ev1-*u-boot.dtsi, included by
other files  stm32mp15*-ev1-*-u-boot.dtsi.

For SCMI variant of device tree used with stm32mp15_defconfig
add partitions needed by TF-A firmware update:
- metadata to save the TF-A information: 2 copy
- fip-a / fip-b: two FIP slots, used for system A/B (seamless) update
- the previous "fsbl" partition with 2 copy of TFA is replaced
  by 2 partitions (only one copy in each MTD partition) to simplify
  the update: no need to managed this copy on update, need to update the
  two partition (skip bad block for NAND)
The offset for ENV partition are also updated in stm32mp15_defconfig

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agoarm: dts: stm32: Align stm32mp15xx-*-scmi-u-boot.dtsi file
Patrick Delaunay [Thu, 8 Jun 2023 15:16:41 +0000 (17:16 +0200)]
arm: dts: stm32: Align stm32mp15xx-*-scmi-u-boot.dtsi file

Update "secure" version of STM32 boards based on SCMI when RCC_TZCR.TZEN=1
stm32mp15xx-*-scmi-u-boot.dtsi with latest patches on files
stm32mp15xx-*-u-boot.dtsi.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agostm32mp: stm32prog: Remove usage of "mtdparts" function
Patrice Chotard [Thu, 8 Jun 2023 15:16:40 +0000 (17:16 +0200)]
stm32mp: stm32prog: Remove usage of "mtdparts" function

Motivation for this patch is to remove usage of function define
in cmd/mtdparts.c interface, based on env variables mtdids and mtdparts:
mtdparts_init() and find_dev_and_part().
See commit 938db6fe5da3 ("cmd: mtdparts: describe as legacy")

Now, all MTD devices are populated with their partition's information
found in DT, accessible in MTD devices. Use these information to find
the wanted partitions, no more need of find_dev_and_part() usage.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agodfu: mtd: remove direct call of mtdparts_init function
Patrick Delaunay [Thu, 8 Jun 2023 15:16:39 +0000 (17:16 +0200)]
dfu: mtd: remove direct call of mtdparts_init function

With MTD support in driver model, the direct call of mtdparts_init
should be avoided and replaced by mtd_probe_devices.

With the modificaton when MTDIDS/MTDPARTS are empty the OF fallback
with partition describe in device tree is correctly performed,
introduced by commit dc339bf784f0 ("mtd: add support for parsing
partitions defined in OF").
With this patch the dependency with CONFIG_CMD_MTDPARTS is removed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agofdt_support: add fdt_copy_fixed_partitions function
Patrick Delaunay [Thu, 8 Jun 2023 15:16:38 +0000 (17:16 +0200)]
fdt_support: add fdt_copy_fixed_partitions function

Add a new function fdt_copy_fixed_partitions to copy the fixed
partition nodes from U-Boot device tree to Linux kernel
device tree and to dynamically configure the MTD partitions.

This function fdt_copy_fixed_partitions is only based on device tree
with livetree compatible function and replace the function
fdt_fixup_mtdparts based on mtdparts variable.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
18 months agofdt_support: include dm/ofnode.h
Patrick Delaunay [Thu, 8 Jun 2023 15:16:37 +0000 (17:16 +0200)]
fdt_support: include dm/ofnode.h

This patch is a preliminary patch to use ofnode function
is fdt_support to read the U-Boot device tree with livetree
compatible functions.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agoMerge tag 'fsl-qoriq-2023-6-15' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Thu, 15 Jun 2023 15:02:22 +0000 (11:02 -0400)]
Merge tag 'fsl-qoriq-2023-6-15' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq into next

DM_MDIO/CMD for ls1046afrwy
sync APIs for fsl-mc
ldpaa_eth update
lx2160ardb recv support.
net: dsa fix of fallback lookup

18 months agoconfigs: ls1046afrwy: enable DM_MDIO and DM_CMD
Camelia Groza [Wed, 7 Jun 2023 11:20:47 +0000 (14:20 +0300)]
configs: ls1046afrwy: enable DM_MDIO and DM_CMD

With DM_ETH configured by default, complete the Ethernet enablement for
LS1046AFRWY by activating DM_MDIO.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agoboard: freescale: ls1046afrwy: enumerate PCI devices
Camelia Groza [Wed, 7 Jun 2023 11:20:46 +0000 (14:20 +0300)]
board: freescale: ls1046afrwy: enumerate PCI devices

Call pci_init() from board_init() to force PCI enumeration at probe time.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agoarm: dts: ls1046afrwy: add the FMan Ethernet nodes
Camelia Groza [Wed, 7 Jun 2023 11:20:45 +0000 (14:20 +0300)]
arm: dts: ls1046afrwy: add the FMan Ethernet nodes

Describe the FMan Ethernet interfaces present on the board.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: fsl-mc: sync remaining MC commands
Ioana Ciornei [Wed, 31 May 2023 16:04:36 +0000 (19:04 +0300)]
net: fsl-mc: sync remaining MC commands

This patch targets the last remaining commands left to sync to their
latest form - mainly the mc_get_version() API.

Besides this, remove any macro which is now of no help.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: fsl-mc: sync DPIO MC APIs
Ioana Ciornei [Wed, 31 May 2023 16:04:35 +0000 (19:04 +0300)]
net: fsl-mc: sync DPIO MC APIs

Sync the Data Path IO APIs to their latest form, this means the layout
of each command is created based on structures which clearly describe
the endianness of each field rather than some macros.

The command version is kept in place, meaning that the minimum MC
version accepted is not changed in any way.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: fsl-mc: sync DPSPARSER MC APIs
Ioana Ciornei [Wed, 31 May 2023 16:04:34 +0000 (19:04 +0300)]
net: fsl-mc: sync DPSPARSER MC APIs

Sync the Data Path Soft Parser APIs to their latest form, this
means the layout of each command is created based on structures which
clearly describe the endianness of each field rather than some macros.

The command version is kept in place, meaning that the minimum MC
version accepted is not changed in any way.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: fsl-mc: sync DPNI MC APIs
Ioana Ciornei [Wed, 31 May 2023 16:04:33 +0000 (19:04 +0300)]
net: fsl-mc: sync DPNI MC APIs

Sync the Data Path Network Interface APIs to their latest form, this
means the layout of each command is created based on structures which
clearly describe the endianness of each field rather than some macros.

The command version is kept in place, meaning that the minimum MC
version accepted is not changed in any way.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: fsl-mc: sync DPRC MC APIs
Ioana Ciornei [Wed, 31 May 2023 16:04:32 +0000 (19:04 +0300)]
net: fsl-mc: sync DPRC MC APIs

Sync the Data Resource Container APIs to their latest form, this means
the layout of each command is created based on structures which clearly
describe the endianness of each field rather than some macros.

The command version is kept in place, meaning that the minimum MC
version accepted is not changed in any way.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: fsl-mc: sync DPMAC MC APIs
Ioana Ciornei [Wed, 31 May 2023 16:04:31 +0000 (19:04 +0300)]
net: fsl-mc: sync DPMAC MC APIs

Sync the Data Path MAC APIs to their latest form, this means the
layout of each command is created based on structures which clearly
describe the endianness of each field rather than some macros.

The command version is kept in place, meaning that the minimum MC
version accepted is not changed in any way.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: fsl-mc: sync DPBP MC APIs
Ioana Ciornei [Wed, 31 May 2023 16:04:30 +0000 (19:04 +0300)]
net: fsl-mc: sync DPBP MC APIs

Sync the Data Path Buffer Pool APIs to their latest form, this means the
layout of each command is created based on structures which clearly
describe the endianness of each field rather than some macros.

The command version is kept in place, meaning that the minimum MC
version accepted is not changed in any way.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: fsl-mc: remove unused MC APIs
Ioana Ciornei [Wed, 31 May 2023 16:04:29 +0000 (19:04 +0300)]
net: fsl-mc: remove unused MC APIs

There are multiple MC APIs which were added years ago but they are not
used at all in the u-boot source code. Remove all these APIs.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agoboard: fsl: lx2160ardb: add dts fixup function for RevC and newer
Florin Chiculita [Wed, 31 May 2023 15:02:18 +0000 (18:02 +0300)]
board: fsl: lx2160ardb: add dts fixup function for RevC and newer

Since the new RevC LX2160A-RDB board has its 10G Aquantia PHYs at
different MDIO bus addresses, we must update both the kernel DTS and
u-boot's DTS (in case of DM_ETH) in case the board is indeed RevC or
newer. Use the newly introduced get_board_rev() function to trigger a
fixup of the kernel DTS to properly match the actual PHY addresses.
All this is encapsulated in the fdt_fixup_board_phy_revc() function
which will be used in the next patch.

Use the newly fdt_fixup_board_phy_revc() function introduced to
update both kernel's DTS and u-boot's DTS.

Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agoboard: fsl: lx2160ardb: add api for obtaining board revision
Florin Chiculita [Wed, 31 May 2023 15:02:17 +0000 (18:02 +0300)]
board: fsl: lx2160ardb: add api for obtaining board revision

Add new API for obtaining board revision and trigger the i2c node
fixup with this new API.

Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: ldpaa_eth: export DPNI and DPMAC counters through 'net stats'
Ioana Ciornei [Tue, 23 May 2023 13:47:48 +0000 (16:47 +0300)]
net: ldpaa_eth: export DPNI and DPMAC counters through 'net stats'

Export the already existing DPNI and DPMAC counters through the newly
added callbacks.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agocmd: net: add a 'net stats' command to dump network statistics
Ioana Ciornei [Tue, 23 May 2023 13:47:47 +0000 (16:47 +0300)]
cmd: net: add a 'net stats' command to dump network statistics

Add a new option to the 'net' command which can be used to dump network
statistics.

To do this, 3 new callbacks are added to the eth_ops structure:
.get_sset_count(), .get_strings(), .get_stats(). These callbacks
have the same functions as in Linux: to return the number of counters,
the strings which describe those counters and the actual values.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: ldpaa_eth: extend debug capabilities with DPMAC statistics
Ioana Ciornei [Tue, 23 May 2023 13:47:46 +0000 (16:47 +0300)]
net: ldpaa_eth: extend debug capabilities with DPMAC statistics

The ldpaa_eth driver already had a DPMAC statistics dump, this patch
extends the list of stats and adds a bit more structure to the code.

For a bit more context, the DPAA2 u-boot software architecture uses a
default network interface object - a DPNI - which, at runtime, will get
connected to the currently used DPMAC object.
Each time the .stop() eth callback is called, the DPMAC is destroyed
thus any previous counters will get lost.

As a preparation for the next patches, we add a software kept set of
DPMAC counters which will get updated before each destroy operation
takes place.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: ldpaa_eth: extend debug capabilities with DPNI statistics
Ioana Ciornei [Tue, 23 May 2023 13:47:45 +0000 (16:47 +0300)]
net: ldpaa_eth: extend debug capabilities with DPNI statistics

The ldpaa_eth driver already had a DPNI statistics dump, this patch
extends the list of stats and adds a bit more structure to the code.

For a bit more context, the DPAA2 u-boot software architecture uses a
default network interface object - a DPNI - which, at runtime, will get
connected to the currently used DPMAC object.
Each time the .stop() eth callback is called, the DPNI is reset to its
original state, including its counters.

As a preparation for the next patches, we add a software kept set of
DPNI counters which will get updated before each reset operation takes
place.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: ldpaa_eth: transform dpni_statistics from a struct to a union
Ioana Ciornei [Tue, 23 May 2023 13:47:44 +0000 (16:47 +0300)]
net: ldpaa_eth: transform dpni_statistics from a struct to a union

In order to simplify code, dpni_statistics can be written as a union.
Using the raw accessors we can just loop through all the statistics from
a page without trying to access each an every one independently.
Make this change to a union.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: ldpaa_eth: fix the memory layout of the dpmac_get_counters() API
Ioana Ciornei [Tue, 23 May 2023 13:47:43 +0000 (16:47 +0300)]
net: ldpaa_eth: fix the memory layout of the dpmac_get_counters() API

Each MC commands has a specific predefined memory layout that gets
interpreted by the firmware. The dpmac_get_counters() API memory layout
is wrong, thus the results returned by the command are incorrect.

Fix this by updating the offset of the counter field.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agonet: dsa: Fix OF fallback lookup for ports
Marcus Comstedt [Mon, 15 May 2023 15:44:23 +0000 (15:44 +0000)]
net: dsa: Fix OF fallback lookup for ports

The variable 'node' was already invalid, so using it for further
lookup will not work.

Signed-off-by: Marcus Comstedt <marcus.comstedt@requtech.se>
Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
18 months agoMerge tag 'tpm-for_tom-13062023' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Tue, 13 Jun 2023 17:14:49 +0000 (13:14 -0400)]
Merge tag 'tpm-for_tom-13062023' of https://source.denx.de/u-boot/custodians/u-boot-tpm into next

tpm autostart

18 months agotest/py: Account PCR updates properly during testing
Ilias Apalodimas [Wed, 7 Jun 2023 09:18:12 +0000 (12:18 +0300)]
test/py: Account PCR updates properly during testing

Currently we only read the pcr updates once on test_tpm2_pcr_read().
It turns out that the tpm init sequence of force_init() which consists
of:
- tpm2 init
- tpm2 startup TPM2_SU_CLEAR
- tpm2 self_test full
- tpm2 clear TPM2_RH_LOCKOUT

also counts as an update.  Running this in the console verifies the
update bump
=> tpm2 init
=> tpm2 startup TPM2_SU_CLEAR
=> tpm2 self_test full
=> tpm pcr_read 10 $loadaddr
PCR #10 content (28 known updates):
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=> tpm2 clear TPM2_RH_LOCKOUT
=> tpm pcr_read 10 $loadaddr
PCR #10 content (29 known updates):
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>

With the recent changes of replacing 'tpm2 init' with 'tpm2 autostart'
we end up always running the full init.  The reason is 'tpm init'
returns -EBUSY if the tpm is already open, while 'tpm autostart' handles
ths gracefully and continues with the initialization.  It's worth noting
that this won't affect the device functionality at all since
retriggering the startup sequence and selftests has no side effects.

Instead of relying on the initial value, reread the 'known updates'
just before updating the PCR to ensure we read the correct values
before testing

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
18 months agotest/py: replace 'tpm2 init, startup, selftest' sequences
Ilias Apalodimas [Wed, 7 Jun 2023 09:18:11 +0000 (12:18 +0300)]
test/py: replace 'tpm2 init, startup, selftest' sequences

Instead of copy pasting the commands needed to start a TPM consisting
of:
- tpm init
- tpm startup TPM2_SU_CLEAR
- tpm2 self_test full
use the newly added 'autostart' which does the same thing and simplify
our python scripts

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
18 months agotpm: Add 'tpm autostart' shell command
Ilias Apalodimas [Wed, 7 Jun 2023 09:18:10 +0000 (12:18 +0300)]
tpm: Add 'tpm autostart' shell command

For a TPM device to be operational we need to initialize it and
perform its startup sequence.  The 'tpm init' command currently calls
tpm_init() which ends up calling the ->open() per-device callback and
performs the initial hardware configuration as well as requesting
locality 0 for the caller.  There no code that currently calls
tpm_init() without following up with a tpm_startup() and tpm_self_test_full()
or tpm_continue_self_test().

So let's add a 'tpm autostart' command and call tpm_auto_start() which
leaves the device in an operational state.

It's worth noting that calling tpm_init() only, doesn't allow a someone
to use the TPM since the startup sequence is mandatory. We always
repeat the pattern of calling
- tpm_init()
- tpm_startup()
- tpm_self_test_full() or tpm_continue_self_test()

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
18 months agoMerge tag 'xilinx-for-v2023.10-rc1' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Mon, 12 Jun 2023 20:42:37 +0000 (16:42 -0400)]
Merge tag 'xilinx-for-v2023.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze into next

Xilinx changes for v2023.10-rc1

global:
- Use proper U-Boot project name

Fix sparse warnings in zynqmp-clk, zynqmp handoff, board

cmd:
- Cover incorrect 0 length entries

Versal NET:
- Add bootmode logic
- Support SPP production version
- Add loadpdi command

ZynqMP:
- Clear pmufw node command ID handling
- Change power domain behavior around zynqmp_pmufw_node()
- Fix zynqmp cmd return values and pmufw command
- Fix R5 tcm init and modes

mmc:
- Sync Versal NET emmc DT binding

pcie:
- Add support for ZynqMP PCIe root port

video:
- Add support for ZynqMP DP

tools:
- Fix debug message in relocate-rela

18 months agoMerge tag v2023.07-rc4 into next
Tom Rini [Mon, 12 Jun 2023 18:55:33 +0000 (14:55 -0400)]
Merge tag v2023.07-rc4 into next

Signed-off-by: Tom Rini <trini@konsulko.com>
18 months agoPrepare v2023.07-rc4
Tom Rini [Mon, 12 Jun 2023 17:45:09 +0000 (13:45 -0400)]
Prepare v2023.07-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
18 months agoarm64: versal: Add missing prototypes
Algapally Santosh Sagar [Fri, 9 Jun 2023 09:05:31 +0000 (03:05 -0600)]
arm64: versal: Add missing prototypes

Add missing prototypes to fix the below sparse warnings
1. warning: no previous prototype for 'set_r5_halt_mode'
[-Wmissing-prototypes]
2. warning: no previous prototype for 'set_r5_tcm_mode'
[-Wmissing-prototypes]
3. warning: no previous prototype for 'release_r5_reset'
[-Wmissing-prototypes]
4.warning: no previous prototype for 'enable_clock_r5'
[-Wmissing-prototypes]

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230609090531.31794-3-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
18 months agoarm64: versal: Add missing prototype for initialize_tcm
Algapally Santosh Sagar [Fri, 9 Jun 2023 09:05:30 +0000 (03:05 -0600)]
arm64: versal: Add missing prototype for initialize_tcm

Add the missing prototype pointed by below sparse warning
warning: no previous prototype for 'initialize_tcm'
[-Wmissing-prototypes]

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230609090531.31794-2-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
18 months agoarm64: zynqmp: Fix lockstep mode cpu release functionality
Venkatesh Yadav Abbarapu [Thu, 8 Jun 2023 03:21:52 +0000 (08:51 +0530)]
arm64: zynqmp: Fix lockstep mode cpu release functionality

For lockstep mode, cpu_release function is expecting to execute
on R5 core 0, if there is attempt to pass other than R5 core 0,
through an error saying "Lockstep mode should run on R5 core 0 only".

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20230608032152.980-3-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
18 months agoarm64: zynqmp: Fix tcminit mode param
Venkatesh Yadav Abbarapu [Thu, 8 Jun 2023 03:21:51 +0000 (08:51 +0530)]
arm64: zynqmp: Fix tcminit mode param

While invoking "zynqmp tcminit mode" command (which is invalid command)
on U-Boot, it just works. Check the mode param, if it is valid then
only initialize the TCM.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20230608032152.980-2-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
18 months agoPCI: zynqmp: Add ZynqMP NWL PCIe root port driver
Stefan Roese [Thu, 25 May 2023 09:49:18 +0000 (11:49 +0200)]
PCI: zynqmp: Add ZynqMP NWL PCIe root port driver

This patch adds the PCIe controller driver for the Xilinx / AMD ZynqMP
NWL PCIe Bridge as root port. The driver source is partly copied from
the Linux PCI driver and modified to enable usage in U-Boot (e.g.
simplified and interrupt support removed).

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Pali Rohár <pali@kernel.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20230525094918.111949-1-sr@denx.de
Signed-off-by: Michal Simek <michal.simek@amd.com>
18 months agofirmware: zynqmp: Extend debug message to show parameters
Michal Simek [Thu, 1 Jun 2023 11:34:34 +0000 (13:34 +0200)]
firmware: zynqmp: Extend debug message to show parameters

Also print more arguments not just ID when xilinx_pm_request is called.
It helps to decode what firmware is asked to do.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/54928d061da75bd972a3b6a1219204e730b49225.1685619271.git.michal.simek@amd.com
18 months agoarm64: zynqmp: Fix return code from do_zynqmp_pmufw()
Michal Simek [Thu, 1 Jun 2023 11:25:04 +0000 (13:25 +0200)]
arm64: zynqmp: Fix return code from do_zynqmp_pmufw()

zynqmp_pmufw_node() can also return values like -ENODEV which means that
NODE has been already configured that's why don't propagate this error
code.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/e52d24d8d3efb276778d387dc716e4e065e0626f.1685618701.git.michal.simek@amd.com
18 months agoarm64: zynqmp: Fix command error values properly
Michal Simek [Thu, 1 Jun 2023 11:21:07 +0000 (13:21 +0200)]
arm64: zynqmp: Fix command error values properly

Process errors from command via cmd_process_error() as is done on Versal.
When internal function returns different number then CMD_RET_SUCCESS(0),
CMD_RET_FAILURE(1) or CMD_RET_USAGE(-1) shell react on these errors by
throwing an error like
"exit not allowed from main input shell." that's why use
cmd_process_error() to make sure that error code is all the time correct.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/d511935ba10daf95c70996fae6e6ffc374efffa0.1685618464.git.michal.simek@amd.com
18 months agovideo: zynqmp: Enable 1024x768 resolution
Michal Simek [Wed, 17 May 2023 08:42:12 +0000 (10:42 +0200)]
video: zynqmp: Enable 1024x768 resolution

Add support for 1024x768 60p resolution and set it up this resolution by
default. This resolution is still able to use only one GT line. But for
example 800x600 60p has some issues with settings. That's why extend this
table by tested resolutions.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/957e1e85a05744326ec2606dadc1af6e69976f37.1684312924.git.michal.simek@amd.com
18 months agoxilinx: zynqmp: Enable the vidconsole by default
Venkatesh Yadav Abbarapu [Wed, 17 May 2023 08:42:11 +0000 (10:42 +0200)]
xilinx: zynqmp: Enable the vidconsole by default

Add the vidconsole flags for video serial console.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/f1b58d1d1052bf2d8cb8b25af44ecbb567ebbd4a.1684312924.git.michal.simek@amd.com
18 months agovideo: zynqmp: Driver for Xilinx ZynqMP DisplayPort Subsystem
Venkatesh Yadav Abbarapu [Wed, 17 May 2023 08:42:10 +0000 (10:42 +0200)]
video: zynqmp: Driver for Xilinx ZynqMP DisplayPort Subsystem

The Xilinx ZynqMP SoC has a hardened display pipeline named DisplayPort
Subsystem. It includes a buffer manager, blender, an audio mixer and a
DisplayPort source controller (transmitter). The DisplayPort controller can
source data from memory (non-live input) or the stream (live input). The
DisplayPort controller is responsible for managing the link and physical
layer functionality. The controller packs audio/video data into transfer
units and sends them over the main link. The link rate and lane counts can
be selected based on the application bandwidth requirements. The
DisplayPort pipeline consists of the DisplayPort direct memory access (DMA)
for fetching data from memory. The DisplayPort DMA controller (DPDMA)
supports up to six input channels as non-live input.

This driver supports the DisplayPort Subsystem and implements
1)640x480 resolution
2)RGBA8888 32bpp format
3)DPDMA channel 3 for Graphics
4)Non-live input
5)Fixed 5.4G link rate
6)Tested on ZCU102 board

There will be additional work to configure GT lines based on DT, higher
resolutions, support for more compressed video formats, spliting code to
more files, add support for EDID, audio support, using clock framework for
all clocks and in general code clean up.

Codevelop-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/5c1567b63d0280dacc7efba2998857c399c25358.1684312924.git.michal.simek@amd.com
18 months agovideo: move zynqmp files to subdirectory
Venkatesh Yadav Abbarapu [Wed, 17 May 2023 08:42:09 +0000 (10:42 +0200)]
video: move zynqmp files to subdirectory

Place zynqmp files and headers in custom driver subdirectory.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/9aae6d217f0673c310818e3de38bb239c79c060c.1684312924.git.michal.simek@amd.com
18 months agovideo: bmp: Support rgba8888 pixel format
Michal Simek [Wed, 17 May 2023 08:42:08 +0000 (10:42 +0200)]
video: bmp: Support rgba8888 pixel format

Adding the support for RGBA8888 format for BMP decoding.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/322910eb24692f6140a001796501270eb1c53d9a.1684312924.git.michal.simek@amd.com
18 months agovideo: Add support for RGBA8888 format
Michal Simek [Wed, 17 May 2023 08:42:07 +0000 (10:42 +0200)]
video: Add support for RGBA8888 format

Add support for RGBA8888 32bpp format where pixels are picked in
32-bit integers, where the colors are stored in memory such that
R is at lowest address, G after that, B after that, and A last.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/aa1de54b7d4ff46df6858f76d52634e0c5c71a4a.1684312924.git.michal.simek@amd.com
18 months agofirmware: zynqmp: Store driver data in data section
Stefan Herbrechtsmeier [Tue, 23 May 2023 12:42:14 +0000 (14:42 +0200)]
firmware: zynqmp: Store driver data in data section

Store the driver data in the data section to make the data usable before
relocation. Additionally mark the driver data static to restrict the
access.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Link: https://lore.kernel.org/r/20230523124215.30915-5-stefan.herbrechtsmeier-oss@weidmueller.com
Signed-off-by: Michal Simek <michal.simek@amd.com>