]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
19 months agorockchip: rk3568-rock-3a: Use pinctrl for sdmmc and sdhci in SPL
Jonas Karlman [Wed, 17 May 2023 18:26:34 +0000 (18:26 +0000)]
rockchip: rk3568-rock-3a: Use pinctrl for sdmmc and sdhci in SPL

Enable pinctrl for sdmmc and sdhci in SPL to support loading of FIT
image from SD and eMMC storage when booting from SPI NOR flash.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3568-rock-3a: Update defconfig
Jonas Karlman [Wed, 17 May 2023 18:26:34 +0000 (18:26 +0000)]
rockchip: rk3568-rock-3a: Update defconfig

Update defconfig for rk3568-rock-3a with new defaults.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load
next stage from a FIT image and then jump to next stage not back to
BootRom.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash
of FIT images. This help indicate if there is an issue loading any of
the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded
to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config option to include useful gpio cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is
set based on cpuid read from OTP.

Filter out assigned-clock props with CONFIG_OF_SPL_REMOVE_PROPS,
U-Boot proper will read and configure assigned-clock props.

Remove the CONFIG_SPL_PMIC_RK8XX=y option, the pmic is not used in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3568-evb: Update defconfig
Jonas Karlman [Wed, 17 May 2023 18:26:32 +0000 (18:26 +0000)]
rockchip: rk3568-evb: Update defconfig

Update defconfig for rk3568-evb with new defaults.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load
next stage from a FIT image and then jump to next stage not back to
BootRom.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash
of FIT images. This help indicate if there is an issue loading any of
the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded
to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config options to include useful gpio, i2c, pmic and regulator cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is
set based on cpuid read from OTP.

Filter out assigned-clock props with CONFIG_OF_SPL_REMOVE_PROPS,
U-Boot proper will read and configure assigned-clock props.

Add config options to enable support for the RK809 PMIC.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3566-radxa-cm3-io: Use pinctrl for sdmmc and sdhci in SPL
Jonas Karlman [Wed, 17 May 2023 18:26:31 +0000 (18:26 +0000)]
rockchip: rk3566-radxa-cm3-io: Use pinctrl for sdmmc and sdhci in SPL

Enable pinctrl for sdmmc and sdhci in SPL to support loading of FIT
image from SD and eMMC storage when booting from SPI NOR flash.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3566-radxa-cm3-io: Update defconfig
Jonas Karlman [Wed, 17 May 2023 18:26:30 +0000 (18:26 +0000)]
rockchip: rk3566-radxa-cm3-io: Update defconfig

Update defconfig for rk3566-radxa-cm3-io with new defaults. Also add
missing supported mmc modes to sdhci node.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load
next stage from a FIT image and then jump to next stage not back to
BootRom.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash
of FIT images. This help indicate if there is an issue loading any of
the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded
to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config option to include useful gpio cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is
set based on cpuid read from OTP.

Filter out assigned-clock props with CONFIG_OF_SPL_REMOVE_PROPS,
U-Boot proper will read and configure assigned-clock props.

Add CONFIG_SYS_NS16550_MEM32=y to use 32bit access of serial register.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk356x-u-boot: Add xin24m clock node to SPL
Jonas Karlman [Wed, 17 May 2023 18:26:29 +0000 (18:26 +0000)]
rockchip: rk356x-u-boot: Add xin24m clock node to SPL

Add bootph-all prop to xin24m clock node, it is referenced by cru node.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agospi: rockchip_sfc: Use linux rockchip,sfc-no-dma prop
Jonas Karlman [Wed, 17 May 2023 18:26:28 +0000 (18:26 +0000)]
spi: rockchip_sfc: Use linux rockchip,sfc-no-dma prop

Use the same prop as linux to control the use of fifo or dma mode. Also
add a u-boot,spl-sfc-no-dma prop to control the same in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agoconfigs: rock5b-rk3588: add PCI drivers and command
Eugen Hristev [Wed, 17 May 2023 10:01:02 +0000 (13:01 +0300)]
configs: rock5b-rk3588: add PCI drivers and command

Add drivers for PCIe , phy, and command.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agoARM: dts: rockchip: rock5b: enable pcie2x1l2 and associated combphy
Christopher Obbard [Wed, 17 May 2023 10:01:01 +0000 (13:01 +0300)]
ARM: dts: rockchip: rock5b: enable pcie2x1l2 and associated combphy

Enable the PCIe 2x1l 2 device and associated combphy.
On this bus, the Rock5B has an Ethernet transceiver connected.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
[eugen.hristev@collabora.com: minor tweaks]
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
[jonas@kwiboo.se: add PCIe pins]
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agoARM: dts: rockchip: rk3588s-u-boot: add pcie2x1l2 with PHY
Joseph Chen [Wed, 17 May 2023 10:01:00 +0000 (13:01 +0300)]
ARM: dts: rockchip: rk3588s-u-boot: add pcie2x1l2 with PHY

Add the node for PCIe 2x1l 2 device together with the corresponding
combphy.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
[eugen.hristev@collabora.com: moved to -u-boot.dtsi, minor
adaptations]
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
[jonas@kwiboo.se: adapt to kernel node]
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rockpro64: Build u-boot-rockchip-spi.bin
Jonas Karlman [Sat, 6 May 2023 17:41:15 +0000 (17:41 +0000)]
rockchip: rockpro64: Build u-boot-rockchip-spi.bin

Enable CONFIG_ROCKCHIP_SPI_IMAGE to build u-boot-rockchip-spi.bin.
Define CONFIG_SYS_SPI_U_BOOT_OFFS to write u-boot.itb at the expected
offset. Enable CONFIG_LTO to reduce size of SPL so that the mkimage
output fit before the 0x60000 offset in u-boot-rockchip-spi.bin.

  => sf probe
  SF: Detected gd25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
  => load mmc 1:1 10000000 u-boot-rockchip-spi.bin
  1442304 bytes read in 27 ms (50.9 MiB/s)
  => sf update $fileaddr 0 $filesize
  device 0 offset 0x0, size 0x160200
  1421824 bytes written, 20480 bytes skipped in 9.501s, speed 155432 B/s

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rock-pi-4: Use SDMA to boost eMMC performance
Jonas Karlman [Wed, 17 May 2023 18:40:41 +0000 (18:40 +0000)]
rockchip: rock-pi-4: Use SDMA to boost eMMC performance

Enable the use of SDMA mode to boost eMMC performance on ROCK Pi 4.
Also add missing flags to indicate the supported MMC modes.

Using mmc read command to read 32 MiB data shows following improvement:

  => time mmc read 10000000 2000 10000

Before: time: 3.178 seconds
After: time: 0.402 seconds

This also enables CONFIG_SPL_FIT_SIGNATURE option to help discover
any possible future issue with loading TF-A into DRAM/SRAM.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rockpro64: Use SDMA to boost eMMC performance
Jonas Karlman [Sat, 6 May 2023 17:41:12 +0000 (17:41 +0000)]
rockchip: rockpro64: Use SDMA to boost eMMC performance

Enable the use of SDMA mode to boost eMMC performance on RockPro64.
Also add missing flags to indicate the supported MMC modes.

Using mmc read command to read 32 MiB data shows following improvement:

  => time mmc read 10000000 2000 10000

Before: time: 3.178 seconds
After: time: 0.402 seconds

This also enables CONFIG_SPL_FIT_SIGNATURE option to help discover
any possible future issue with loading TF-A into DRAM/SRAM.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agommc: rockchip_sdhci: Disable DMA mode using a device tree property
Jonas Karlman [Sat, 6 May 2023 17:41:11 +0000 (17:41 +0000)]
mmc: rockchip_sdhci: Disable DMA mode using a device tree property

Loading part of TF-A into SRAM from eMMC using DMA fails on RK3399
similar to other Rockchip SoCs. Checksum validation fails with:

  ## Checking hash(es) for Image atf-2 ... sha256 error!
  Bad hash value for 'hash' hash node in 'atf-2' image node
  spl_load_simple_fit: can't load image loadables index 1 (ret = -1)
  mmc_load_image_raw_sector: mmc block read error
  SPL: failed to boot from all boot devices
  ### ERROR ### Please RESET the board ###

Add a device tree property, u-boot,spl-fifo-mode, to control when the
rockchip_sdhci driver should disable the use of DMA and fallback on PIO
mode. Same device tree property is used by the rockchip_dw_mmc driver.

In commit 2cc6cde647e2 ("mmc: rockchip_sdhci: Limit number of blocks
read in a single command") the DMA mode was disabled using a CONFIG
option on RK3588. Revert that and instead disable DMA using the device
tree property for all RK3588 boards, also apply similar workaround for
all RK3399 boards.

Fixes: 2cc6cde647e2 ("mmc: rockchip_sdhci: Limit number of blocks read in a single command")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Quentin Schulz <foss+uboot@0leil.net> # RK3399 Puma, RK3588 Tiger
19 months agommc: rockchip_sdhci: Skip blocks read workaround on RK3399
Jonas Karlman [Sat, 6 May 2023 17:41:09 +0000 (17:41 +0000)]
mmc: rockchip_sdhci: Skip blocks read workaround on RK3399

The workaround to limit number of blocks to read in a single command
should only be applied to RK3568 and RK3588. Change to be more strict
when to apply the workaround.

Fixes: 2cc6cde647e2 ("mmc: rockchip_sdhci: Limit number of blocks read in a single command")
Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Quentin Schulz <foss+uboot@0leil.net> # RK3399 Puma, RK3588 Tiger
19 months agophy: rockchip: naneng-combphy: Support rk3588
Jon Lin [Thu, 27 Apr 2023 07:35:35 +0000 (10:35 +0300)]
phy: rockchip: naneng-combphy: Support rk3588

Add support for rk3588 phy variant.
The PHY clock is fixed at 100MHz.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
[kever.yang@rock-chips.com: update pcie pll parameters]
Co-developed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
[eugen.hristev@collabora.com: squashed, tidy up]
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agophy: rockchip: naneng-combphy: Add support for multiple resets
Eugen Hristev [Thu, 27 Apr 2023 07:35:34 +0000 (10:35 +0300)]
phy: rockchip: naneng-combphy: Add support for multiple resets

Some variants of the PHY have more than just one reset.
To cover all cases, request the rests in bulk rather than just
the reset at index 0.

Co-developed-by: Ren Jianing <jianing.ren@rock-chips.com>
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agopci: pcie_dw_rockchip: Support max_link_speed dts property
Jon Lin [Thu, 27 Apr 2023 07:35:33 +0000 (10:35 +0300)]
pci: pcie_dw_rockchip: Support max_link_speed dts property

Add support for max_link_speed specified in the PCI DT binding.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
[eugen.hristev@collabora.com: port to latest API, set default correctly,
align to 80 chars]
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
[jonas@kwiboo.se: switch to dev_read_u32_default]
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agopci: pcie_dw_rockchip: Add rk3588 compatible
Jon Lin [Thu, 27 Apr 2023 07:35:32 +0000 (10:35 +0300)]
pci: pcie_dw_rockchip: Add rk3588 compatible

Add compatible for RK3588 SoC.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agoreset: rockchip: implement rk3588 lookup table
Eugen Hristev [Mon, 15 May 2023 10:55:04 +0000 (13:55 +0300)]
reset: rockchip: implement rk3588 lookup table

The current DT bindings for the rk3588 clock use a different ID than the
one that is supposed to be written to the hardware registers.
Thus, we cannot use directly the id provided in the phandle, but rather
use a lookup table to correctly setup the hardware.

This approach has been implemented already in Linux, by commit :
f1c506d152ff ("clk: rockchip: add clock controller for the RK3588")

Hence, implement a similar approach using the lookup table, and adapt
the existing reset driver to work with SoCs using lookup table.
The file rst-rk3588.c has been copied as much as possible from Linux.

Adapt the clk rk3588 driver as well to bind the reset driver with the
lookup table.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
19 months agoconfigs: rockchip: rock5b-rk3588: add pinctrl to SPL
Eugen Hristev [Mon, 15 May 2023 13:44:03 +0000 (16:44 +0300)]
configs: rockchip: rock5b-rk3588: add pinctrl to SPL

Add pinctrl driver in SPL. Do not remove pinctrl properties for SPL dtb.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agoARM: dts: rk3588-rock-5b-u-boot: add bootph-all to pinctrl for sdmmc
Eugen Hristev [Mon, 15 May 2023 13:44:02 +0000 (16:44 +0300)]
ARM: dts: rk3588-rock-5b-u-boot: add bootph-all to pinctrl for sdmmc

To be able to initialize the pinctrl correctly at SPL level and read
u-boot proper from SD-Card, the pinctrl must be initialized.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agophy: Keep balance of counts when ops is missing
Jonas Karlman [Mon, 15 May 2023 09:59:50 +0000 (12:59 +0300)]
phy: Keep balance of counts when ops is missing

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Fixes: 226fce6108fe ("phy: Track power-on and init counts in uclass")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
19 months agophy: rockchip-inno-usb2: add initial support for rk3588 PHY
Eugen Hristev [Mon, 15 May 2023 09:59:49 +0000 (12:59 +0300)]
phy: rockchip-inno-usb2: add initial support for rk3588 PHY

Add initial support for the rk3588 PHY variant.
The lookup for the host-port reg inside the struct now does a do {} while()
instead of a while() {} in order to allow a first check for reg == 0.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Co-developed-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
19 months agophy: remove phy-supply related code
Eugen Hristev [Mon, 15 May 2023 09:59:48 +0000 (12:59 +0300)]
phy: remove phy-supply related code

phy-supply is now handled at uclass level. Remove it from the drivers that
implement it at the driver level.

Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
Suggested-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
19 months agophy: add support for phy-supply
Eugen Hristev [Mon, 15 May 2023 09:59:47 +0000 (12:59 +0300)]
phy: add support for phy-supply

Some phys require a phy-supply property that is a phandle to a regulator
that needs to be enabled for phy operations.
Implement basic supply lookup, enable and disabling, if DM_REGULATOR is
available.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
[jonas@kwiboo.se:
use regulator_set_enable_if_allowed and disable if power_on ops fails]
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
19 months agoconfigs: rockchip: rock5b-rk3588: enable USB and regulators
Eugen Hristev [Wed, 17 May 2023 09:21:26 +0000 (12:21 +0300)]
configs: rockchip: rock5b-rk3588: enable USB and regulators

Enable USB command, USB drivers, PHY and regulators, for USB host
operations.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
19 months agoARM: dts: rockchip: rk3588-rock-5b-u-boot: add USB 2.0 host
Eugen Hristev [Mon, 15 May 2023 09:59:45 +0000 (12:59 +0300)]
ARM: dts: rockchip: rk3588-rock-5b-u-boot: add USB 2.0 host

Add USB 2.0 host nodes and PHYs.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Co-developed-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
19 months agoMerge tag 'efi-2023-07-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Tue, 16 May 2023 15:23:30 +0000 (11:23 -0400)]
Merge tag 'efi-2023-07-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-07-rc3

Documentation:

* update the description of signature algorithms

UEFI:

* fix unaligned access to GUID in HII database protocol
* fix launching EFI binaries loaded via semihosting
* fix filling of file path in loaded image protocol for non-block devices

19 months agoMerge branch '2023-05-15-assorted-bugfixes'
Tom Rini [Tue, 16 May 2023 15:16:42 +0000 (11:16 -0400)]
Merge branch '2023-05-15-assorted-bugfixes'

- Merge in a long-standing fix for some exynos platforms, correct a
  Kconfig description, fix some env issues, fix an issue in
  devfdt_get_addr_size_index_ptr and look for "panel-timings" not
  "panel-timing" per upstream binding.

19 months agoMerge tag 'xilinx-for-v2023.07-rc3' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 16 May 2023 13:10:57 +0000 (09:10 -0400)]
Merge tag 'xilinx-for-v2023.07-rc3' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx changes for v2023.07-rc3

.mailmap
- Fix Xilinx IDs

ZynqMP:
- Fix R5 split boot mode
- DT fixes - sync with Linux

Xilinx:
- Enable virtio and RNG support
- Enable ADI ethernet phy

SPI/Zynq:
- Fix dummy byte calculation

19 months agoenvironment: ti: rproc: fix remoteproc environment variables
Manorit Chawdhry [Mon, 15 May 2023 06:52:42 +0000 (12:22 +0530)]
environment: ti: rproc: fix remoteproc environment variables

During refactor this seemed to have been missed.

Fixes: 65dbb128fb45 ("include: environment: ti: Use .env for environment variables")
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
19 months agocore: fdtaddr: use map_sysmem() as cast for the return (part 2)
Johan Jonker [Wed, 10 May 2023 21:48:44 +0000 (23:48 +0200)]
core: fdtaddr: use map_sysmem() as cast for the return (part 2)

For the devfdt_get_addr_size_index_ptr() function use
map_sysmem() function as cast for the return for use in
sandbox.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
19 months agodrivers: core: ofnode: fix typo in panel timing decode
Raphael Gallais-Pou [Thu, 11 May 2023 14:36:52 +0000 (16:36 +0200)]
drivers: core: ofnode: fix typo in panel timing decode

In case where a single timing resolution is implemented in the
device-tree, the property is named "panel-timing", as specify
in Linux kernel binding file:

Documentation/devicetree/bindings/display/panel/panel-common.yaml

  # Display Timings
  panel-timing:
    description:
      Most display panels are restricted to a single resolution and
      require specific display timings. The panel-timing subnode expresses those
      timings.
    $ref: panel-timing.yaml#

  display-timings:
    description:
      Some display panels support several resolutions with different timings.
      The display-timings bindings supports specifying several timings and
      optionally specifying which is the native mode.
    $ref: display-timings.yaml#

Fixes: 0347cc773270 ("drivers: core: ofnode: Add panel timing decode.")
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
19 months agoenvtools lack extra settings since commit 86b9c3e4e4 ("env: Allow U-Boot scripts...
Christophe Leroy [Thu, 11 May 2023 06:16:49 +0000 (08:16 +0200)]
envtools lack extra settings since commit 86b9c3e4e4 ("env: Allow U-Boot scripts to be placed in

After converting my targets from CFG_EXTRA_ENV_SETTINGS to
CONFIG_EXTRA_ENV_TEXT as suggested by Tom, I discovered that
fw_setenv doesn't set the entire defaut environment anymore.

I tried to fix it with the below patch, but it fails qemu-x86 CI test,
see https://source.denx.de/u-boot/custodians/u-boot-mpc8xx/-/pipelines/16326
That's the only CI test that fails AFAICS.

Could you help with a solution ? This needs to be fixed.

Thanks
Christophe

---- >8 ----
From: Christophe Leroy <christophe.leroy@csgroup.eu>
Subject: [RFC PATCH] envtools: Fix default environment

After converting some targets from CFG_EXTRA_ENV_SETTINGS to
CONFIG_EXTRA_ENV_TEXT, default environment embedded in
fw_env tool missed all extra settings.

Commit 86b9c3e4e4 ("env: Allow U-Boot scripts to be placed in
a .env file") restricted the inclusion of the content of that
file to builds without USE_HOSTCC.

But as mentionned in commit 79fc0c5f49 ("tools/env: cross-compile
fw_printenv without setting HOSTCC"), HOSTCC and USE_HOSTCC are
kept for code re-use.

Remove the restricting so that settings included in a .env
file are also added to fw_env tool.

Fixes: 86b9c3e4e4 ("env: Allow U-Boot scripts to be placed in a .env file")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
19 months agosamsung: common: do not reset if cros-ec uclass is missing
Henrik Grimler [Tue, 9 May 2023 19:05:47 +0000 (21:05 +0200)]
samsung: common: do not reset if cros-ec uclass is missing

Otherwise non-ChromeOS samsung devices, like the odroid boards, are
stuck in a bootloop if CONFIG_CROS_EC is not enabled:

    <...>
    MMC: SAMSUNG SDHCI: 2, EXYNOS DWMMC: 0
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    cros-ec communications failure -96

    Please reset with Power+Refresh

    Cannot init cros-ec device
    resetting ...

Issue started after commit e44d7e73fe0d ("dm: core: Switch
uclass_*_device_err to use uclass_*_device_check").

Signed-off-by: Henrik Grimler <henrik@grimler.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
19 months agoRevert "mmc: s5p_sdhci: unset the SDHCI_QUIRK_BROKEN_R1B"
Henrik Grimler [Tue, 9 May 2023 19:05:46 +0000 (21:05 +0200)]
Revert "mmc: s5p_sdhci: unset the SDHCI_QUIRK_BROKEN_R1B"

This reverts commit a034ec06ff1d558bbe11d5ee05edbb4de3ee2215.

Commit 4a3ea75de4c5 ("Revert "mmc: sdhci: set to INT_DATA_END when
there are data"") reverted the alternative fix that was added for
Exynos 4 devices, causing an error when trying to boot from an sdcard:

    <...>
    Loading Environment from MMC... sdhci_send_command: Timeout for status update!
    mmc fail to send stop cmd
    <...>

Re-add the quirk to allow booting from sdcards again.

Signed-off-by: Henrik Grimler <henrik@grimler.se>
19 months agovideo: tweak CONFIG_SPL_VIDEO description
John Keeping [Tue, 9 May 2023 11:02:50 +0000 (12:02 +0100)]
video: tweak CONFIG_SPL_VIDEO description

Make it clear that this is the SPL option to avoid potential confusion
when the description for CONFIG_SPL_VIDEO is the same as that for
CONFIG_VIDEO.

Signed-off-by: John Keeping <john@metanate.com>
19 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-cfi-flash
Tom Rini [Mon, 15 May 2023 12:33:16 +0000 (08:33 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-cfi-flash

- cfi: respect reg address length (Nuno)

19 months agomtd: cfi: respect reg address length
Nuno Sá [Thu, 11 May 2023 11:19:50 +0000 (13:19 +0200)]
mtd: cfi: respect reg address length

flash_get_size() will get the flash size from the device itself and go
through all erase regions to read protection status. However, the device
mappable region (eg: devicetree reg property) might be lower than the
device full size which means that the above cycle will result in a data
bus exception. This change fixes it by reading the 'addr_size' during
probe() and also use that as one possible upper limit.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
19 months ago.mailmap: Map all Xilinx users mail ids to AMD
Algapally Santosh Sagar [Wed, 26 Apr 2023 06:01:04 +0000 (00:01 -0600)]
.mailmap: Map all Xilinx users mail ids to AMD

The mail ids of all the current Xilinx users are to be mapped to AMD
following the merger with AMD. The mailmap file is updated accordingly.

The ids of Marek Behún and Michal Simek are taken as reference.

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/20230426060104.10412-3-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
19 months ago.mailmap: Sort the mailmap ids in dictionary order
Algapally Santosh Sagar [Wed, 26 Apr 2023 06:01:03 +0000 (00:01 -0600)]
.mailmap: Sort the mailmap ids in dictionary order

The mailmap ids are not arranged in the dictionary order. So, sort the
mailmap ids in the dictionary order.

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/20230426060104.10412-2-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
19 months agoRevert "spi: zynq_qspi: Use dummy buswidth in dummy byte calculation"
Stefan Herbrechtsmeier [Thu, 27 Apr 2023 06:53:54 +0000 (08:53 +0200)]
Revert "spi: zynq_qspi: Use dummy buswidth in dummy byte calculation"

This reverts commit e09784728689de7949d4cdd559a9590e0bfcc702. The
commit wrongly divides the dummy bytes by dummy bus width to calculate
the dummy bytes. The framework already converts the dummy cycles to the
number of bytes and the controller use the SPI flash command to
determine the dummy cycles via the address width.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Acked-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230427065355.7413-1-stefan.herbrechtsmeier-oss@weidmueller.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
19 months agoarm64: versal: Enable ADIN ethernet phy
Ashok Reddy Soma [Thu, 20 Apr 2023 08:56:45 +0000 (02:56 -0600)]
arm64: versal: Enable ADIN ethernet phy

Versal VEK280 board has Analog Devices ethernet phy. So, enable
CONFIG_PHY_ADIN config in Versal defconfig.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230420085645.21260-3-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
19 months agoarm64: zynqmp: Enable ADIN ethernet phy
Ashok Reddy Soma [Thu, 20 Apr 2023 08:56:44 +0000 (02:56 -0600)]
arm64: zynqmp: Enable ADIN ethernet phy

Some of the Kria SOM and ZynqMP boards are using Analog Devices ethernet
phy. So, enable CONFIG_PHY_ADIN for all ZynqMP platforms.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230420085645.21260-2-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
19 months agoarm64: zynqmp: Fix User MTD partition size
Michal Simek [Wed, 12 Apr 2023 14:30:27 +0000 (16:30 +0200)]
arm64: zynqmp: Fix User MTD partition size

The commit c8630167e0dc ("arm64: zynqmp: Add mtd partition for secure OS
storage area") didn't update User partition size that's why size was beyond
actual device size.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/0a56405553b87a75e066cd71697cafe7c1c97eef.1681309812.git.michal.simek@amd.com
19 months agoarm64: zynqmp: Fix issue of apps executing from R5 core 1
Ashok Reddy Soma [Wed, 5 Apr 2023 13:06:45 +0000 (15:06 +0200)]
arm64: zynqmp: Fix issue of apps executing from R5 core 1

In current implementation, applications can execute only on R5 core 0.
The boot address for R5 core 1 is not supplied. Pass TCM address for
R5 core 1 based on the argument to fix the issue.

Remove incomplete comment.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/da865717d26648ab7a84345ca8749712efdddee5.1680699999.git.michal.simek@amd.com
19 months agoARM: zynq: Sync Microzed board with Linux kernel
Michal Simek [Tue, 28 Mar 2023 07:21:33 +0000 (09:21 +0200)]
ARM: zynq: Sync Microzed board with Linux kernel

Fix model name, node locations and also add pinctrl description for usb.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/3295fde73db13a712b65f4967eb5f39ced895ad4.1679988091.git.michal.simek@amd.com
19 months agoARM: zynq: Switch from earlyprintk to earlycon
Michal Simek [Tue, 28 Mar 2023 07:17:31 +0000 (09:17 +0200)]
ARM: zynq: Switch from earlyprintk to earlycon

Switch to earlycon which is preffered over earlyprintk.
It is also sync with Linux kernel (zynq-microzed).

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/d280fa18068f80412cf12c235c5245651e7062e2.1679987839.git.michal.simek@amd.com
19 months agoxilinx: Enable virtio mmio transport and devices
Michal Simek [Thu, 23 Mar 2023 14:52:11 +0000 (15:52 +0100)]
xilinx: Enable virtio mmio transport and devices

Qemu can create virtio mmio transports and passing devices through it
that's why enable virtio by default on all arm64 based SoCs.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/a2ee18e7e8c1881ce72c5cd13127794a02410696.1679583129.git.michal.simek@amd.com
19 months agoarch: arm: zynqmp: mp.c: tcminit halt both cores in split mode
Neal Frager [Thu, 23 Mar 2023 08:25:06 +0000 (08:25 +0000)]
arch: arm: zynqmp: mp.c: tcminit halt both cores in split mode

The "zynqmp tcminit split" command should halt both cores and not just RPU1
when configuring the TCM memory for split mode.

Signed-off-by: Neal Frager <neal.frager@amd.com>
Link: https://lore.kernel.org/r/20230323082506.31576-1-neal.frager@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
19 months agoMerge branch 'master_rzn1/rzn1' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Sun, 14 May 2023 15:29:45 +0000 (11:29 -0400)]
Merge branch 'master_rzn1/rzn1' of https://source.denx.de/u-boot/custodians/u-boot-sh

- R-Car RZN1 support

19 months agoMerge branch '2023-05-13-bootstd-updates-and-improvements'
Tom Rini [Sun, 14 May 2023 15:27:18 +0000 (11:27 -0400)]
Merge branch '2023-05-13-bootstd-updates-and-improvements'

- Assorted bootstd fixes and cleanups. This should fix problems with
  Debian, and make script-based distributions work when BOOTMETH_DISTRO
  is enabled now (as BOOTMETH_DISTRO was renamed and then reintroduced).

19 months agobootstd: Create a new BOOTMETH_DISTRO
Simon Glass [Wed, 10 May 2023 22:34:47 +0000 (16:34 -0600)]
bootstd: Create a new BOOTMETH_DISTRO

We cannot be sure what bootmeth a distro will need to use. Add a new
BOOTMETH_DISTRO option which collects these together. Select this from
BOOTSTD_DEFAULTS so that it is clear what is needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Make BOOTMETH_EFILOADER depend on EFI_LOADER, select if EFI_LOADER]
Signed-off-by: Tom Rini <trini@konsulko.com>
19 months agobootstd: Rename distro and syslinux to extlinux
Simon Glass [Wed, 10 May 2023 22:34:46 +0000 (16:34 -0600)]
bootstd: Rename distro and syslinux to extlinux

We use the terms 'distro' to mean extlinux but they are not really the
same. 'Distro' could refer to any method of booting a distribution,
whereas extlinux is a particular method.

Also we sometimes use syslinux, but it is better to use the same term in
all cases.

Rename distro to syslinux and also update bootstd uses of syslinux to use
extlinux instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
19 months agobootstd: Tidy up reporting of errors
Simon Glass [Wed, 10 May 2023 22:34:26 +0000 (16:34 -0600)]
bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
19 months agobootstd: Correct default boot command
Simon Glass [Sat, 6 May 2023 14:27:09 +0000 (08:27 -0600)]
bootstd: Correct default boot command

The patch to relax flag requirements was not accepted[1], so we still have
to have separate bootcommands depending on CMD_BOOTFLOW_FULL.

The previous attempt at this did not work, since it used the wrong name
for the options.

Fix this and change the message to mention BOOTSTD_FULL since this affects
not just the flags, but all functionality, so is more likely what the user
wants.

Drop the useless condition on CMD_BOOTFLOW_FULL while we are here.

[1] https://patchwork.ozlabs.org/project/uboot/patch/20230329071655.1959513-2-sjg@chromium.org/

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: a91492b6e9c ("bootstd: Provide a default command")
19 months agobootstd: Require HUSH_PARSER for script booting
Simon Glass [Sat, 6 May 2023 02:03:05 +0000 (20:03 -0600)]
bootstd: Require HUSH_PARSER for script booting

Armbian uses a script which needs the HUSH parser. It is likely that
other distros will do the same. Enable it by default, just in case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Jonas Karlman <jonas@kwiboo.se>
19 months agobootstd: usb: Avoid initing USB twice
Simon Glass [Sat, 6 May 2023 02:03:04 +0000 (20:03 -0600)]
bootstd: usb: Avoid initing USB twice

This causes crashes on some boards, e.g. rockpro64. In any case, we
should not do it.

Check the usb_started flag to avoid this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Jonas Karlman <jonas@kwiboo.se>
Tested-by: Tom Rini <trini@konsulko.com>
19 months agousb: Tidy up the usb_start flag
Simon Glass [Sat, 6 May 2023 02:03:03 +0000 (20:03 -0600)]
usb: Tidy up the usb_start flag

This should be declared in a header file so that type-checking works
correctly.

Add a single declaration to usb.h and remove the others.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
19 months agobootstd: Work around missing partition 1
Simon Glass [Fri, 28 Apr 2023 19:18:09 +0000 (13:18 -0600)]
bootstd: Work around missing partition 1

If there is no partition numbered 1, we decide that there are no
partitions at all. That may not be correct, since at least one Debian
installed has just a single partition numbered 2.

Continue searching up to partition 3, just in case.

Signed-off-by: Simon Glass <sjg@chromium.org>
19 months agoefi_loader: fix efi_dp_from_file()
Heinrich Schuchardt [Sat, 13 May 2023 08:36:21 +0000 (10:36 +0200)]
efi_loader: fix efi_dp_from_file()

* When called from efi_dp_from_name() we miss to append the filename
  for non-block devices.
* expand_media_path() could be simplified by using efi_dp_from_file to
  prepend the device path of the boot device.

This can be avoided by passing a device path to efi_dp_from_file() instead
of a block device descriptor and a partition number.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
19 months agoefi_loader: simplify efi_dp_from_name()
Heinrich Schuchardt [Sat, 13 May 2023 08:30:43 +0000 (10:30 +0200)]
efi_loader: simplify efi_dp_from_name()

Don't do the same check and assignment in multiple places.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
19 months agoefi_loader: error code efi_dp_from_name()
Heinrich Schuchardt [Sat, 13 May 2023 08:22:21 +0000 (10:22 +0200)]
efi_loader: error code efi_dp_from_name()

Use EFI_OUT_OF_RESOURCES if the device path cannot be constructed.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
19 months agoefi_loader: clean up efi_dp_from_file
Heinrich Schuchardt [Sat, 13 May 2023 08:18:24 +0000 (10:18 +0200)]
efi_loader: clean up efi_dp_from_file

* Improve variable name usage: Use pos instead of buf to indicate the
  current position in a buffer.
* Avoid double assignment in a single code line.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
19 months agoefi_loader: duplicate code in efi_dp_from_name
Heinrich Schuchardt [Sat, 13 May 2023 08:00:55 +0000 (10:00 +0200)]
efi_loader: duplicate code in efi_dp_from_name

efi_dp_from_name() has duplicate code to replace slash by backslash.
path_to_uefi() called by efi_dp_from_file() already does this.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
19 months agoefi_loader: avoid #ifdef in efi_dp_from_name()
Heinrich Schuchardt [Sat, 13 May 2023 07:55:26 +0000 (09:55 +0200)]
efi_loader: avoid #ifdef in efi_dp_from_name()

According to our coding style guide #ifdef should be avoided.
Use IS_ENABLED() instead.

Sort string comparisons alphabetically.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
19 months agoefi_loader: support booting semihosting file
Heinrich Schuchardt [Fri, 12 May 2023 18:18:10 +0000 (20:18 +0200)]
efi_loader: support booting semihosting file

Executing an EFI binary fails for files loaded via semihosting.

Construct a dummy device path for EFI binaries loaded via semihosting.

A future complete solution may include the creation of a handle with a
simple file system protocol.

Reported-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
19 months agoefi_loader: print file path w/o boot device
Heinrich Schuchardt [Fri, 12 May 2023 19:23:15 +0000 (21:23 +0200)]
efi_loader: print file path w/o boot device

Helloworld.efi should print the file path even if the boot device is
not set.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
19 months agoefi_loader: Fix warnings for unaligned accesses
Ilias Apalodimas [Thu, 11 May 2023 16:40:35 +0000 (19:40 +0300)]
efi_loader: Fix warnings for unaligned accesses

Tom reports that when building with clang we see this warning:
field guid within 'struct efi_hii_keyboard_layout' is less aligned than 'efi_guid_t' and is usually due to 'struct efi_hii_keyboard_layout' being packed, which can lead to unaligned accesses [-Wunaligned-access]

This happens because 'struct efi_hii_keyboard_layout' is defined as
packed and thus has 1-byte alignment but efi_guid_t is a type that
requires greater alignment than that.

However the EFI spec describes the EFI_GUID as
"128-bit buffer containing a unique identifier value.
Unless otherwise specified"

So convert the efi_guid_t -> u8 b[16] here and skip the alignment
requirements.  Since the struct is packed to begin with, it makes no
difference on the final memory layout.

Suggested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
19 months agofwu: fix config FWU_MULTI_BANK_UPDATE
Heinrich Schuchardt [Sun, 7 May 2023 06:39:34 +0000 (08:39 +0200)]
fwu: fix config FWU_MULTI_BANK_UPDATE

Symbol CONFIG_EFI_SETUP_EARLY does not exist anymore.

CONFIG_FWU_MULTI_BANK_UPDATE without CONFIG_FWU_MDATA results in

    lib/fwu_updates/fwu.c:49: undefined reference to `fwu_get_mdata'

Fixes: 86794052418b ("FWU: Add support for the FWU Multi Bank Update feature")
Fixes: 023d9c93932c ("efi_loader: remove CONFIG_EFI_SETUP_EARLY")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
19 months agodoc: devicetree: fix u-boot.bin filename typo
Baruch Siach [Tue, 2 May 2023 10:21:46 +0000 (13:21 +0300)]
doc: devicetree: fix u-boot.bin filename typo

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
19 months agodoc: signature: trim the future work list
Baruch Siach [Tue, 2 May 2023 04:47:31 +0000 (07:47 +0300)]
doc: signature: trim the future work list

Since U-Boot supports more RSA/SHA variants, as well as ECDSA, remove
these items from the TODO list.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
19 months agodoc: signature: describe how to enable ECDSA
Baruch Siach [Tue, 2 May 2023 04:47:30 +0000 (07:47 +0300)]
doc: signature: describe how to enable ECDSA

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
19 months agodoc: signature: update algorithm addition description
Baruch Siach [Tue, 2 May 2023 04:47:29 +0000 (07:47 +0300)]
doc: signature: update algorithm addition description

U-Boot now uses the U_BOOT_CRYPTO_ALGO() macro.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
19 months agodoc: signature: update algorithms support description
Baruch Siach [Tue, 2 May 2023 04:47:28 +0000 (07:47 +0300)]
doc: signature: update algorithms support description

U-Boot supports more hash and verification algorithms these days.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
19 months agodoc: renesas: add Renesas board docs
Ralph Siemsen [Sat, 13 May 2023 01:36:58 +0000 (21:36 -0400)]
doc: renesas: add Renesas board docs

As a starting point, list all currently supported Renesas boards.

For the RZ/N1 board, add details about booting and flashing.

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
19 months agotools: spkgimage: add Renesas SPKG format
Ralph Siemsen [Sat, 13 May 2023 01:36:57 +0000 (21:36 -0400)]
tools: spkgimage: add Renesas SPKG format

Renesas RZ/N1 devices contain BootROM code that loads a custom SPKG
image from QSPI, NAND or USB DFU. Support this format in mkimage tool.

SPKGs can optionally be signed, however creation of signed SPKG is not
currently supported.

Example of how to use it:

tools/mkimage -n board/schneider/rzn1-snarc/spkgimage.cfg \
-T spkgimage -a 0x20040000 -e 0x20040000 \
-d u-boot.bin u-boot.bin.spkg

The config file (spkgimage.cfg in this example) contains additional
parameters such as NAND ECC settings.

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
19 months agoboard: schneider: add RZN1 board support
Ralph Siemsen [Sat, 13 May 2023 01:36:56 +0000 (21:36 -0400)]
board: schneider: add RZN1 board support

Add support for Schneider Electric RZ/N1D and RZ/N1S boards, which
are based on the Reneasas RZ/N1 SoC devices.

The intention is to support both boards using a single defconfig, and to
handle the differences at runtime.

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
19 months agoARM: rmobile: Add support for Renesas RZ/N1 SoC
Ralph Siemsen [Sat, 13 May 2023 01:36:55 +0000 (21:36 -0400)]
ARM: rmobile: Add support for Renesas RZ/N1 SoC

The RZ/N1 is a family of SoC devices from Renesas, featuring:

* ARM Cortex-A7 CPU (single/dual core) and/or Cortex-M3
* Integrated SRAM up to 6MB
* Integrated gigabit ethernet switch
* Optional DDR2/3 controller
* I2C, SPI, UART, NAND, QSPI, SDIO, USB, CAN, RTC, LCD

Add basic support for this family, modeled on the existing RZA1.

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
19 months agoARM: dts: add devicetree for Renesas RZ/N1 SoC
Ralph Siemsen [Sat, 13 May 2023 01:36:54 +0000 (21:36 -0400)]
ARM: dts: add devicetree for Renesas RZ/N1 SoC

This is taken directly from Linux kernel 6.3
(commit 457391b0380335d5e9a5babdec90ac53928b23b4)

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
19 months agoram: cadence: add driver for Cadence EDAC
Ralph Siemsen [Sat, 13 May 2023 01:36:53 +0000 (21:36 -0400)]
ram: cadence: add driver for Cadence EDAC

Driver for Cadence EDAC DDR controller, as found in the Renesas RZ/N1.

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
19 months agopinctrl: renesas: add R906G032 driver
Ralph Siemsen [Sat, 13 May 2023 01:36:52 +0000 (21:36 -0400)]
pinctrl: renesas: add R906G032 driver

Pinctrl/pinconf driver for Renesas RZ/N1 (R906G032) SoC.

This is quite rudimentary right now, and only supports applying a
default pin configuration as specified by the device tree.

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
19 months agoclk: renesas: add R906G032 driver
Ralph Siemsen [Sat, 13 May 2023 01:36:51 +0000 (21:36 -0400)]
clk: renesas: add R906G032 driver

Clock driver for the Renesas RZ/N1 SoC family. This is based on
Linux kernel 6.2.y drivers/clk/renesas/r9a06g032-clocks.c as found in
commit 02693e11611e ("clk: renesas: r9a06g032: Repair grave increment error"),
with the following additional patch series applied:
https://lore.kernel.org/linux-renesas-soc/20230301215520.828455-1-ralph.siemsen@linaro.org/

Notable difference: this version avoids allocating a 'struct clk'
for each clock source, as this is problematic before relocation.
Instead, it uses the same approach as existing Renesas R-Car Gen2/3
clock drivers, using a temporary structure filled on-the-fly.

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
19 months agoclk: renesas: prepare for non R-Car clock drivers
Ralph Siemsen [Sat, 13 May 2023 01:36:50 +0000 (21:36 -0400)]
clk: renesas: prepare for non R-Car clock drivers

Add new CONFIG_CLK_RCAR to control compilation of shared code for R-Car
clock drivers (renesas-cpg-mssr.c). Enable this for R-Car Gen2 and 3.

This is necessary so that CONFIG_CLK_RENESAS can be enabled, allowing
recursion into the drivers/clk/reneasas directory, without bringing in
the R-Car support code. The support code contains platform specific
access (TMU_BASE) which is not needed on other Renesas devices such as
RZ/N1.

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
19 months agoARM: armv7: add non-SPL enable for Cortex SMPEN
Ralph Siemsen [Sat, 13 May 2023 01:36:49 +0000 (21:36 -0400)]
ARM: armv7: add non-SPL enable for Cortex SMPEN

Commit 2564fce7eea3 ("sunxi: move Cortex SMPEN setting into start.S")
added SPL_ARMV7_SET_CORTEX_SMPEN to enable setting SMP bit. For
platforms not using SPL boot, add the corresponding non-SPL config,
so that CONFIG_IS_ENABLED(ARMV7_SET_CORTEX_SMPEN) works as expected.

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
19 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Thu, 11 May 2023 12:40:33 +0000 (08:40 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-x86

- Various fixes for Google chromebooks
- Various minor enhancements for coreboot

19 months agox86: samus: Adjust TPL start and pre-reloc memory size
Simon Glass [Thu, 4 May 2023 22:51:01 +0000 (16:51 -0600)]
x86: samus: Adjust TPL start and pre-reloc memory size

Move the TPL up a little to make room for the refcode binary blob. Also
increase the pre-relocation memory to make space for recent additions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
19 months agox86: samus: Don't include audio and SATA in TPL
Simon Glass [Thu, 4 May 2023 22:51:00 +0000 (16:51 -0600)]
x86: samus: Don't include audio and SATA in TPL

These are not used in TPL so disable the drivers to save space.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
19 months agox86: Simplify cpu_jump_to_64bit_uboot()
Simon Glass [Thu, 4 May 2023 22:50:59 +0000 (16:50 -0600)]
x86: Simplify cpu_jump_to_64bit_uboot()

This copies the cpu_call64() function to memory address and then jumps to
it. This seems to work correctly even when called from SPL, which is
running from SPI flash.

Drop the copy as it is not needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
19 months agospl: Commit MTRRs only in board_init_f_r()
Simon Glass [Thu, 4 May 2023 22:50:58 +0000 (16:50 -0600)]
spl: Commit MTRRs only in board_init_f_r()

We don't need to commit the SPI-flash MTRR change immediately, since it is
now done in the board_init_f_r(). Also this causes chromebook_link64 to
hang, presumably since we are still running from CAR (Cache-as-RAM) in
SPL. Coral handles this OK, perhaps since it is running from a different
memory area, but it has no effect on Coral anyway.

Drop the extra mtrr_commit() in the SPL implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
19 months agox86: spl: Avoid using init_cache_f_r() from SPL
Simon Glass [Thu, 4 May 2023 22:50:57 +0000 (16:50 -0600)]
x86: spl: Avoid using init_cache_f_r() from SPL

This function is used by U-Boot proper. It does not set up MTRRs when SPL
is enabled, but we do want this done when it is called from SPL. In fact
it is confusing to use the same function from SPL, since there are quite
a few conditions there.

All init_cache_f_r() really does is commit the MTRRs and set up the cache.
Do this in the SPL's version of this function instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
19 months agox86: Tidy up address for loading U-Boot from SPL
Simon Glass [Thu, 4 May 2023 22:50:55 +0000 (16:50 -0600)]
x86: Tidy up address for loading U-Boot from SPL

Use the binman symbols for this, to avoid hard-coding the value. We could
use CONFIG_X86_OFFSET_U_BOOT for the address, but it seems better to
obtain the offset and size through the same mechanism.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
19 months agox86: sysreset: Set up LPC only after relocation
Simon Glass [Tue, 9 May 2023 10:13:47 +0000 (18:13 +0800)]
x86: sysreset: Set up LPC only after relocation

Probing LPC can cause PCI enumeration to take place, which significantly
increases pre-relocation memory usage. Also, LPC is somtimes enabled
directly by SPL.

Adjust the logic to probe the LPC only after relocation. This allows
chromebook_link64 to start up without a much larger
CONFIG_SYS_MALLOC_F_LEN value.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
19 months agox86: spl: Show debugging for BSS
Simon Glass [Thu, 4 May 2023 22:50:54 +0000 (16:50 -0600)]
x86: spl: Show debugging for BSS

Show the area of memory cleared for BSS, when debugging is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
19 months agox86: mrc: Correct SPL debug message
Simon Glass [Thu, 4 May 2023 22:50:53 +0000 (16:50 -0600)]
x86: mrc: Correct SPL debug message

SPL printf() does not normally support %#x so just use %x instead. Hex is
expected in U-Boot anyway.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
19 months agox86: Tidy up availability of string functions
Simon Glass [Thu, 4 May 2023 22:50:52 +0000 (16:50 -0600)]
x86: Tidy up availability of string functions

For now, just enable the fast-but-large string functions in 32-boot
U-Boot proper only. Avoid using them in SPL. We cannot use then in 64-bit
builds since we only have 32-bit assembly.

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
19 months agox86: Support debug UART in 64-bit mode
Simon Glass [Thu, 4 May 2023 22:50:51 +0000 (16:50 -0600)]
x86: Support debug UART in 64-bit mode

The debug UART is already set up in SPL, so there is no need to do
anything here. We must provide the (empty) function though.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
19 months agox86: samus: Drop EFI_LOADER
Simon Glass [Thu, 4 May 2023 22:50:50 +0000 (16:50 -0600)]
x86: samus: Drop EFI_LOADER

This adds a lot of code so that it cannot be built with the binary
blobs. It is not used on this board. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
19 months agox86: ivybridge: Ensure LPC is available for GPIO base
Simon Glass [Thu, 4 May 2023 22:50:49 +0000 (16:50 -0600)]
x86: ivybridge: Ensure LPC is available for GPIO base

The bd82x6x_get_gpio_base() does not work if the LPC is not set up.
Probe it early to avoid this problem.

In chromebook_link64 this problem shows up as an inability to read
the GPIO straps for the memory type.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>