[RFC 2/2] rockchip: rk3588: Add SoC specific RAM bank logic

2024-03-29 Thread Chris Morgan
From: Chris Morgan Add SoC specific RAM bank logic for the rk3588 boards. This logic works by reading the ATAGS created by the ROCKCHIP_TPL stage and applies fixups on those to ensure we aren't stepping on any reserved memory addresses. The existing logic requires us to define memory holes to

[RFC 1/2] rockchip: sdram: Allow board/soc specific RAM bank logic

2024-03-29 Thread Chris Morgan
From: Chris Morgan Allow individual boards or SoCs to alter the RAM bank addition logic by defining a __weak function that these boards can then override if needed. In the event this function fails, fallback to the default detection logic. Signed-off-by: Chris Morgan ---

[RFC 0/2] Update RAM Bank Logic for RK3588

2024-03-29 Thread Chris Morgan
From: Chris Morgan Use the ATAG info provided by the Rockchip binary TPL to identify RAM banks on the RK3588 when using the ROCKCHIP_TPL binary. This is needed because there are specific addresses that should not be written to for all RK3588 based devices with >=16GB of RAM, writing to these

Re: [PATCH 01/19] spi: cadence_qspi: Add support for DDR PHY mode

2024-03-29 Thread Greg Malysa
Hi Tejas, +Ian Roberts, (Apologies for the double mail--I accidentally dropped the u-boot mailing list in version 1) We have been developing OSPI support against the same Cadence IP in the Analog parts (SC594 and SC598) and we have some specific feedback as this patch series will affect the

Re: [PATCH] lib: fix newline in debug message

2024-03-29 Thread Heinrich Schuchardt
Thank you for catching this. %s/fix/add missing/ would make the subject clearer. We prefer to have a commit message in all patches, e.g. Add missing line break to improve readability. On 3/29/24 15:22, Maxim Moskalets wrote: Signed-off-by: Maxim Moskalets --- lib/rsa/rsa-verify.c | 2

Re: [PATCH] fdt: Fix fdt_pack_reg() on 64-bit platforms

2024-03-29 Thread Heinrich Schuchardt
On 3/30/24 01:55, Sam Protsenko wrote: When "memory" node is being processed in fdt_pack_reg() on ARM64 platforms, an unaligned bus access might happen, which leads to "synchronous abort" CPU exception. Consider next dts example: / { #address-cells = <2>; #size-cells =

[PATCH] fdt: Fix fdt_pack_reg() on 64-bit platforms

2024-03-29 Thread Sam Protsenko
When "memory" node is being processed in fdt_pack_reg() on ARM64 platforms, an unaligned bus access might happen, which leads to "synchronous abort" CPU exception. Consider next dts example: / { #address-cells = <2>; #size-cells = <1>; memory@8000 {

Re: [PATCH v2] tpm-v2: allow algoirthm name to be configured for pcr_read and pcr_extend

2024-03-29 Thread Tim Harvey
On Thu, Mar 28, 2024 at 11:18 PM Ilias Apalodimas wrote: > > Hi Tim, > > On Thu, 28 Mar 2024 at 19:01, Tim Harvey wrote: > > > > For pcr_read and pcr_extend commands allow the digest algorithm to be > > specified by an additional argument. If not specified it will default to > > SHA256 for

Re: [PATCH 2/2] part: efi: Treat unused partition type GUID as a valid case

2024-03-29 Thread Sam Protsenko
On Thu, Mar 28, 2024 at 8:07 PM Heinrich Schuchardt wrote: > > On 3/28/24 23:29, Sam Protsenko wrote: > > Some platforms use the "unused" (all-zero) GUID as a partition type GUID > > to make some partitions hidden from the OS. For example, Samsung phones > > and other devices often have GPT

[PATCH 19/19] rockchip: rk3588-generic: Add support for USB OTG

2024-03-29 Thread Jonas Karlman
Extend the Generic RK3588S/RK3588 target to also include support for USB OTG, RockUSB and UMS. Signed-off-by: Jonas Karlman --- arch/arm/dts/rk3588-generic-u-boot.dtsi | 22 ++ arch/arm/dts/rk3588-generic.dts | 3 ++- configs/generic-rk3588_defconfig| 17

[PATCH 18/19] rockchip: rk356x-generic: Add support for SPI flash and USB OTG

2024-03-29 Thread Jonas Karlman
Extend the Generic RK3566/RK3568 target to also include support for SPI flash, USB OTG, RockUSB and UMS. Also fix sdmmc alias, include missing pinctrl and add broken-cd prop to fix use of SD-card in linux. Signed-off-by: Jonas Karlman --- arch/arm/dts/rk3568-generic-u-boot.dtsi | 7 +

[PATCH 17/19] rockchip: rk3588-edgeble-neu6: Enable FIT checksum validation

2024-03-29 Thread Jonas Karlman
Enable SPL_FIT_SIGNATURE=y and LEGACY_IMAGE_FORMAT=y to validate FIT images checksum in SPL. Change to SPL_MAX_SIZE=0x4 to allow SPL up to 256 KiB in size. Enable SPL_DM_SEQ_ALIAS=y and SPL_PINCTRL=y to ensure eMMC and SD-card pinctrl is configured in SPL. Enable SYS_NS16550_MEM32=y to use

[PATCH 14/19] rockchip: rk3588-coolpi: Add boards to documentation

2024-03-29 Thread Jonas Karlman
Add the CoolPi 4 Model B and CoolPi CM5 EVB board to the documentation. Also fix .dtb-file entries in Makefile. Fixes: 3e15dee38d45 ("board: rockchip: Add support for rk3588 based Cool Pi CM5 EVB") Signed-off-by: Jonas Karlman --- arch/arm/dts/Makefile | 4 ++--

[PATCH 16/19] rockchip: rk3588-turing-rk1: Use dwc3-generic driver

2024-03-29 Thread Jonas Karlman
RK35xx boards are expected to use the dwc3-generic driver and not the xhci-dwc3 driver. Remove the USB_XHCI_DWC3 option to ensure that the dwc3-generic driver is used. Also enable DWC_AHCI to support on-board SATA. Fixes: 153ac950a599 ("board: rockchip: Add the Turing RK1 SoM") Signed-off-by:

[PATCH 15/19] rockchip: rk3588-toybrick: Add missing Kconfig options

2024-03-29 Thread Jonas Karlman
Add .dtb-file entry to Makefile and enable Kconfig options required to configure pinctrl in SPL. Also add missing PHY_ROCKCHIP_NANENG_COMBOPHY. Fixes: 9fdd9a546986 ("board: rockchip: add Rockchip Toybrick TB-RK3588X board") Signed-off-by: Jonas Karlman --- arch/arm/dts/Makefile | 1

[PATCH 13/19] rockchip: rk3566-pinetab2: Fix reading FIT from SPI flash

2024-03-29 Thread Jonas Karlman
The SF_DEFAULT_SPEED Kconfig option got lost during merge and this prevent reading FIT from SPI flash. Restore the SF_DEFAULT_SPEED option to fix this. Fixes: 8a94c376f6cb ("rockchip: Use common bss and stack addresses on RK356x") Signed-off-by: Jonas Karlman ---

[PATCH 12/19] rockchip: rk3588: Update bootph props

2024-03-29 Thread Jonas Karlman
After the commit aca95282c1b7 ("Makefile: Use the fdtgrep -u flag") bootph props is propagating to parent nodes. Update bootph props to ensure eMMC, SD-card and SPI flash is available in SPL and U-Boot proper pre-reloc phase also remove unneeded bootph props that automatically is propagated to

[PATCH 11/19] rockchip: rk356x: Update bootph props

2024-03-29 Thread Jonas Karlman
After the commit aca95282c1b7 ("Makefile: Use the fdtgrep -u flag") bootph props is propagating to parent nodes. Update bootph props to ensure eMMC, SD-card and SPI flash is available in SPL and U-Boot proper pre-reloc phase also remove unneeded bootph props that automatically is propagated to

[PATCH 10/19] rockchip: rk35xx: Sort soc u-boot.dtsi alphabetically

2024-03-29 Thread Jonas Karlman
Sort nodes and props in RK356x/RK3588 u-boot.dtsi alphabetically, nodes is sorted by reg addr then by alphabetical order. This has no intended change beside sorting existing nodes and removing a duplicated usbdpphy0_grf node. Signed-off-by: Jonas Karlman --- arch/arm/dts/rk356x-u-boot.dtsi |

[PATCH 09/19] rockchip: rk356x: Imply enhanced features for standard boot

2024-03-29 Thread Jonas Karlman
Imply BOOTSTD_FULL for all RK356x boards to more closely follow RK3588. Signed-off-by: Jonas Karlman --- arch/arm/mach-rockchip/Kconfig | 1 + configs/bpi-r2-pro-rk3568_defconfig | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-rockchip/Kconfig

[PATCH 08/19] rockchip: rk35xx: Imply support for GbE PHY

2024-03-29 Thread Jonas Karlman
Imply support for GbE PHY status parsing and configuration when support for onboard ethernet is enabled. Signed-off-by: Jonas Karlman --- arch/arm/mach-rockchip/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index

[PATCH 07/19] rockchip: rk35xx: Enable random generator

2024-03-29 Thread Jonas Karlman
The RK35xx SoCs contain a crypto engine block that can generate random numbers. Enable rng node in soc u-boot.dtsi and enable Kconfig options to take advantage of the random generator. Signed-off-by: Jonas Karlman --- arch/arm/dts/rk3566-anbernic-rgxx3-u-boot.dtsi | 6 --

[PATCH 06/19] rockchip: rk35xx: Sort imply statements alphabetically

2024-03-29 Thread Jonas Karlman
Sort imply statements under ROCKCHIP_RK3568 and ROCKCHIP_RK3588 alphabetically. Signed-off-by: Jonas Karlman --- arch/arm/mach-rockchip/Kconfig | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-rockchip/Kconfig

[PATCH 04/19] rockchip: rk3588: Drop REGULATOR_PWM Kconfig option

2024-03-29 Thread Jonas Karlman
RK3588 boards do not have any pwm-regulator compatible nodes in DT, drop the superfluous REGULATOR_PWM Kconfig options. Signed-off-by: Jonas Karlman --- configs/evb-rk3588_defconfig | 1 - configs/neu6a-io-rk3588_defconfig| 1 - configs/neu6b-io-rk3588_defconfig| 1 -

[PATCH 05/19] rockchip: rk3566-anbernic-rgxx3: Remove SPL_ROCKCHIP_BACK_TO_BROM option

2024-03-29 Thread Jonas Karlman
SPL_ROCKCHIP_BACK_TO_BROM should normally only be enabled when BROM should load U-Boot binary. SPL on Anbernic RGxx3 devices load TF-A and U-Boot proper from FIT images and does never jump back to BROM from SPL. Remove the superfluous Kconfig option from defconfig to align with other RK356x

[PATCH 03/19] rockchip: rk35xx: Drop USB_GADGET_PRODUCT_NUM Kconfig option

2024-03-29 Thread Jonas Karlman
The commit 8c19275fdb13 ("rockchip: Update the default USB Product ID value") added default product id for all supported Rockchip SoCs. Remove USB_GADGET_PRODUCT_NUM options that match default value from RK35xx boards. Signed-off-by: Jonas Karlman --- configs/pinetab2-rk3566_defconfig | 1 -

[PATCH 02/19] clk: rockchip: rk3588: Add REF_CLK_USB3OTGx support

2024-03-29 Thread Jonas Karlman
The REF_CLK_USB3OTGx clocks is used as reference clock for USB3 block. Add simple support to get rate of REF_CLK_USB3OTGx clocks to fix reference clock period configuration. Signed-off-by: Jonas Karlman --- drivers/clk/rockchip/clk_rk3588.c | 6 ++ 1 file changed, 6 insertions(+) diff

[PATCH 01/19] clk: rockchip: rk356x: Add CLK_USB3OTGx_REF support

2024-03-29 Thread Jonas Karlman
The CLK_USB3OTGx_REF clocks is used as reference clock for USB3 block. Add simple support to get rate of CLK_USB3OTGx_REF clocks to fix reference clock period configuration. Signed-off-by: Jonas Karlman --- drivers/clk/rockchip/clk_rk3568.c | 4 1 file changed, 4 insertions(+) diff --git

[PATCH 00/19] rockchip: rk35xx: Miscellaneous fixes and updates

2024-03-29 Thread Jonas Karlman
This series include miscellaneous fixes and updates for RK356x and RK3588 boards. Patch 1-2 adds support for reference clocks used by USB driver. Patch 3-5 drops unnecessary Kconfig options. Patch 6-9 sort and imply RNG, PHY_GIGE and BOOTSTD_FULL Kconfig options. Patch 10-12 sort and update

[PATCH v2 4/5] dts: meson-g12a: Switch to using upstream DT

2024-03-29 Thread Neil Armstrong
Enable OF_UPSTREAM to use upstream DT and add amlogic/ prefix to the DEFAULT_DEVICE_TREE. And thereby directly build DTB from dts/upstream/src/ including *-u-boot.dtsi files from arch/$(ARCH)/dts/ directory. Cc: Sumit Garg Acked-by: Viacheslav Bocharov Reviewed-by: Sumit Garg Signed-off-by:

[PATCH v2 2/5] dts: meson: Switch GXL, GXM & AXG to using upstream DT

2024-03-29 Thread Neil Armstrong
Enable OF_UPSTREAM to use upstream DT and add amlogic/ prefix to the DEFAULT_DEVICE_TREE. And thereby directly build DTB from dts/upstream/src/ including *-u-boot.dtsi files from arch/$(ARCH)/dts/ directory. Cc: Sumit Garg Acked-by: Viacheslav Bocharov Reviewed-by: Sumit Garg Signed-off-by:

[PATCH v2 1/5] configs: meson64: remove amlogic prefix in fdtfile when CONFIG_OF_UPSTREAM is selected

2024-03-29 Thread Neil Armstrong
Remove amlogic/ path prefix in CFG_EXTRA_ENV_SETTINGS fdtfile when using CONFIG_OF_UPSTREAM, otherwise amlogic/ is added twice. Signed-off-by: Neil Armstrong --- include/configs/meson64.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/configs/meson64.h

[PATCH v2 0/5] arm: meson: Switch to using upstream DT for GXL, GXM, AXG, G12A, G12B & SM1 SoCs

2024-03-29 Thread Neil Armstrong
Enable OF_UPSTREAM to use upstream DT and add amlogic/ prefix to the DEFAULT_DEVICE_TREE. And thereby directly build DTB from dts/upstream/src/ including *-u-boot.dtsi files from arch/$(ARCH)/dts/ directory and drop redundant files from arch/arm/dts directory. Only *-u-boot.dtsi files kept in

Re: [PATCH v4 0/7] Clean up arm linker scripts

2024-03-29 Thread Tom Rini
On Fri, 15 Mar 2024 08:43:44 +0200, Ilias Apalodimas wrote: > The arm linker scripts had a mix of symbols and C defined variables in an > effort to emit relative references instead of absolute ones e.g [0]. A > linker bug prevented us from doing so [1] -- fixed since 2016. > This has led to

[PATCH 1/1] cli: always show cursor

2024-03-29 Thread Heinrich Schuchardt
We may enter the command line interface in a state where on the remote console the cursor is not shown. Send an escape sequence to enable it. Signed-off-by: Heinrich Schuchardt --- common/cli.c | 4 1 file changed, 4 insertions(+) diff --git a/common/cli.c b/common/cli.c index

[PATCH] lib: fix newline in debug message

2024-03-29 Thread Maxim Moskalets
Signed-off-by: Maxim Moskalets --- lib/rsa/rsa-verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rsa/rsa-verify.c b/lib/rsa/rsa-verify.c index 1007b6979a..e1093ce1a4 100644 --- a/lib/rsa/rsa-verify.c +++ b/lib/rsa/rsa-verify.c @@ -342,7 +342,7 @@ static int

Re: [RFC PATCH] efi_loader: conditionally enable SetvariableRT

2024-03-29 Thread Ilias Apalodimas
On Fri, 29 Mar 2024 at 14:57, Heinrich Schuchardt wrote: > > On 3/29/24 13:25, Mark Kettenis wrote: > >> From: Ilias Apalodimas > >> Date: Fri, 29 Mar 2024 09:19:27 +0200 > >> > >> When EFI variables are stored on file we don't allow SetVariableRT, > >> since the OS doesn't know how to access or

Re: [RFC PATCH] efi_loader: conditionally enable SetvariableRT

2024-03-29 Thread Heinrich Schuchardt
On 3/29/24 13:25, Mark Kettenis wrote: From: Ilias Apalodimas Date: Fri, 29 Mar 2024 09:19:27 +0200 When EFI variables are stored on file we don't allow SetVariableRT, since the OS doesn't know how to access or write that file. At the same time keeping the U-Boot drivers alive in runtime

Re: [RFC PATCH] efi_loader: conditionally enable SetvariableRT

2024-03-29 Thread Ilias Apalodimas
Hi Heinrich, > > > > > > + struct efi_var_entry *var; > > > + efi_uintn_t ret; > > > + bool append, delete; > > > + u64 time = 0; > > > + > > > + /* Authenticated variables are not supported */ > > > + if (attributes & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)

Re: [RFC PATCH] efi_loader: conditionally enable SetvariableRT

2024-03-29 Thread Ilias Apalodimas
Hi Mark, [...] > > > > Open questions: > > Looking at the EFI spec, I can't find a documented way of notifying the OS > > that the storage is volatile. I would like to send a hint to the OS about > > that and I was thinking of adding a configuration table with the filename, > > which U-Boot

Re: [RFC PATCH] efi_loader: conditionally enable SetvariableRT

2024-03-29 Thread Ilias Apalodimas
[...] > > > > +config EFI_RT_VOLATILE_STORE > > + bool "Allow variable runtime services in volatile storage (e.g RAM)" > > + depends on EFI_VARIABLE_FILE_STORE > > + help > > + When EFI variables are stored on file we don't allow SetVariableRT, > > + since the OS doesn't

Re: [RFC PATCH] efi_loader: conditionally enable SetvariableRT

2024-03-29 Thread Mark Kettenis
> From: Ilias Apalodimas > Date: Fri, 29 Mar 2024 09:19:27 +0200 > > When EFI variables are stored on file we don't allow SetVariableRT, > since the OS doesn't know how to access or write that file. At the same > time keeping the U-Boot drivers alive in runtime sections and performing > writes

[PATCH 1/1] doc: improve description of FAT partition name generation

2024-03-29 Thread Heinrich Schuchardt
List all prefix currently used for generating FAT partition names. Describe which device class uses which prefix. Signed-off-by: Heinrich Schuchardt --- doc/usage/partitions.rst | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/usage/partitions.rst

Re: [RFC PATCH] efi_loader: conditionally enable SetvariableRT

2024-03-29 Thread Heinrich Schuchardt
On 3/29/24 08:19, Ilias Apalodimas wrote: When EFI variables are stored on file we don't allow SetVariableRT, since the OS doesn't know how to access or write that file. At the same time keeping the U-Boot drivers alive in runtime sections and performing writes from the firmware is dangerous --

[PATCH 4/4] config: xea: Add limits for SPL and u-boot proper sizes

2024-03-29 Thread Lukasz Majewski
The XEA board has following hard constraints regarding size of binaries: - u-boot.sb < 48 KiB - u-boot.img < 448 KiB Added values are supposed to avoid exceeding size of binaries during future u-boot development. Signed-off-by: Lukasz Majewski --- (no changes since v1)

[PATCH 3/4] arm: xea: Add support for reading SoM (CPU) board HW revision

2024-03-29 Thread Lukasz Majewski
The XEA board now has several HW revisions for SoM boards. This patch provides support for reading this revision ID values in early u-boot proper as production devices boot via falcon boot with correct DTB flashed at production (so there is no need to alter SPL). Additionally, the maximal SPL

[PATCH 2/4] arm: spl: Add definition for PHY reset GPIO for XEA HW rev. 2

2024-03-29 Thread Lukasz Majewski
The imx287 based XEA board's revision 2 uses GPIO_3_21 for PHY reset It is safe to keep the GPIO_2_13 as well, as in the SPL SPI1 is not used for transmission. This simplifies the code, as the proper configuration is performed either in falcon boot's read DTB or in u-boot proper (with correct FIT

[PATCH 1/4] arm: spl: xea: Remove I2S pins configuration from early initialization

2024-03-29 Thread Lukasz Majewski
XEA is not supporting and using I2S codec, so there is no need to configure pins for it. Signed-off-by: Lukasz Majewski --- (no changes since v1) board/liebherr/xea/spl_xea.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/board/liebherr/xea/spl_xea.c b/board/liebherr/xea/spl_xea.c

[PATCH 0/4] arm: xea: Provide enhancements for XEA board

2024-03-29 Thread Lukasz Majewski
This patch series is a preparatory patch for supporting different versions of XEA board HW (until problem with Linux kernel support for multiple revisions is resorted). Moreover, limits for u-boot.sb and u-boot.img has been set to avoid binary sizes exceeding in the future. Changes in v2:

Re: [RFC] Makefile.lib: find capsule ESL dtsi file when CONFIG_OF_UPSTREAM=y

2024-03-29 Thread Jon Humphreys
Sughosh Ganu writes: > On Thu, 28 Mar 2024 at 09:34, Jon Humphreys wrote: >> >> Sughosh Ganu writes: >> >> > hi Jonathan, >> > >> > On Wed, 27 Mar 2024 at 08:05, Jonathan Humphreys >> > wrote: >> >> >> >> When CONFIG_OF_UPSTREAM is enabled, DTS files are in SOC subdirectories >> >> (vs the

Re: [RFC PATCH] efi_loader: conditionally enable SetvariableRT

2024-03-29 Thread Ilias Apalodimas
+cc Peter On Fri, 29 Mar 2024 at 09:19, Ilias Apalodimas wrote: > > When EFI variables are stored on file we don't allow SetVariableRT, > since the OS doesn't know how to access or write that file. At the same > time keeping the U-Boot drivers alive in runtime sections and performing > writes

Re: [PATCH 1/1] riscv: starfive: MMC card detect

2024-03-29 Thread Minda Chen
> > The VisionFive 2 board uses GPIO 41 as card detect as documented in > https://doc-en.rvspace.org/VisionFive2/PDF/SCH_RV002_V1.2A_20221216.pdf. > > Signed-off-by: Heinrich Schuchardt > --- > arch/riscv/dts/jh7110-starfive-visionfive-2.dtsi | 2 +- > 1 file changed, 1 insertion(+), 1

[RFC PATCH] efi_loader: conditionally enable SetvariableRT

2024-03-29 Thread Ilias Apalodimas
When EFI variables are stored on file we don't allow SetVariableRT, since the OS doesn't know how to access or write that file. At the same time keeping the U-Boot drivers alive in runtime sections and performing writes from the firmware is dangerous -- if at all possible. For GetVariableRT we

Re: [PATCH v2] tpm-v2: allow algoirthm name to be configured for pcr_read and pcr_extend

2024-03-29 Thread Ilias Apalodimas
Hi Tim, On Thu, 28 Mar 2024 at 19:01, Tim Harvey wrote: > > For pcr_read and pcr_extend commands allow the digest algorithm to be > specified by an additional argument. If not specified it will default to > SHA256 for backwards compatibility. > > A follow-on to this could be to extend all PCR