Re: [PATCH] Documentation: state: add real-world example for stride size calculation

2024-06-13 Thread Sascha Hauer
On Wed, 12 Jun 2024 15:36:53 +0200, Ahmad Fatoum wrote: > The usual use of barebox state is to store the bootstate for > bootchooser. Thus change the example to use the minimum size of the > bootstate variable set instead and relate the result to stride size and > partition size. > > Applied,

Re: [PATCH master] serial: stm32: suppress -EPROBE_DEFER messages using dev_err_probe

2024-06-13 Thread Sascha Hauer
On Tue, 11 Jun 2024 10:27:14 +0200, Ahmad Fatoum wrote: > A return code of -EPROBE_DEFER is not necessarily an error as the clock > driver may indeed be probed later. Use dev_err_probe to silence the > error message in this situation and to store it for later use if the > probe is deferred perman

Re: [PATCH v1 1/2] arm: boards: Add support for Protonic MECIO1 board

2024-06-13 Thread Sascha Hauer
On Wed, 12 Jun 2024 15:05:08 +0200, Oleksij Rempel wrote: > Applied, thanks! [1/2] arm: boards: Add support for Protonic MECIO1 board https://git.pengutronix.de/cgit/barebox/commit/?id=979f8397a217 (link may not be stable) [2/2] arm: boards: Add support for Protonic MECT1S board

Re: [PATCH] net: phy: dp83tg720: wake up PHYs in managed mode

2024-06-13 Thread Sascha Hauer
On Wed, 12 Jun 2024 15:02:56 +0200, Oleksij Rempel wrote: > In case this PHY is bootstrapped for managed mode, we need to manually > wake it. Otherwise no link will be detected. > > Applied, thanks! [1/1] net: phy: dp83tg720: wake up PHYs in managed mode https://git.pengutronix.de/cgit/

Re: [PATCH] ARM: stm32mp: remove unused hardcoded MMIO address constants

2024-06-13 Thread Sascha Hauer
On Tue, 11 Jun 2024 10:28:29 +0200, Ahmad Fatoum wrote: > These address are not used and probably won't be soon, because they are > either probed from DT or handled in the secure world. > > Given that they are needlessly generic (STM32_ instead of STM32MP1(5)), > let's drop them. > > > [...]

Re: [PATCH 0/6] semihosting: extend support for ARM64, console

2024-06-13 Thread Sascha Hauer
On Tue, 11 Jun 2024 08:59:17 +0200, Ahmad Fatoum wrote: > So far, we limited semihosting support to 32-bit ARM, but it's also > usable on ARM64 and even RISC-V. > > This series does the first step by making it compile for ARM64 and also > adds DEBUG_LL and console drivers. > > Ahmad Fatoum (6):

Re: [PATCH 1/2] watchdog: bcm2835: add support for powering off SoC

2024-06-13 Thread Sascha Hauer
On Tue, 11 Jun 2024 08:58:10 +0200, Ahmad Fatoum wrote: > The watchdog peripheral on the Raspberry Pi can be used to shutdown by > writing a magic value that the firmware checks for and rebooting. > > This is useful to close an emulated Raspberry Pi in QEMU, so add > support. > > > [...] Appl

Re: [PATCH] serial: replace all clk_get with clk_get_for_console

2024-06-13 Thread Sascha Hauer
On Tue, 11 Jun 2024 08:58:00 +0200, Ahmad Fatoum wrote: > Unlike clk_get, clk_get_for_console returns NULL when the clock provider > lacks a driver, but the UART has already been configured by DEBUG_LL. > > This allows drivers to disable the set baudrate callback and continue > probe, so the use

Re: [PATCH master 1/4] efi: hide EFI related symbols when !EFI

2024-06-13 Thread Sascha Hauer
On Tue, 11 Jun 2024 08:57:15 +0200, Ahmad Fatoum wrote: > In order not to clutter configs, we should hide symbols that are EFI > related when CONFIG_EFI is disabled, especially as we are going to add > more options with the loader support. > > Applied, thanks! [1/4] efi: hide EFI related symb

[PATCH v2 10/11] FIT: save filename during fit_open

2024-06-13 Thread Marco Felsch
This is in preparation of buffering fit_open() calls to not load the same fit twice if it is still open. Signed-off-by: Marco Felsch --- common/image-fit.c | 4 include/image-fit.h | 1 + 2 files changed, 5 insertions(+) diff --git a/common/image-fit.c b/common/image-fit.c index e93946a06

[PATCH v2 03/11] FIT: skip possible overlay config nodes

2024-06-13 Thread Marco Felsch
The FIT spec is not very specific when it comes to device-tree overlay handling. Overlays can be added directely to an config node: config-a { compatible = "machine-compatible"; kernel = "kernel-img-name"; fdt = "fdt-base-name", "fdt-overlay1

[PATCH v2 06/11] FIT: expose useful helpers

2024-06-13 Thread Marco Felsch
The upcoming FIT overlay support requires these helpers for performing check on a fit image. Signed-off-by: Marco Felsch --- common/image-fit.c | 4 ++-- include/image-fit.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/image-fit.c b/common/image-fit.c index 7133

[PATCH v2 04/11] of: overlay: make the pattern match function more generic

2024-06-13 Thread Marco Felsch
The current overlay mechanism can handle files only, so filepattern was obvious. With the next commit this will change, so overlays can also supplied via FIT images. To prepare the pattern filter to match FIT config-nodes make the filter and global variable handling the pattern more generic by drop

[PATCH v2 02/11] of: overlay: add of.overlay.fitconfigpattern param

2024-06-13 Thread Marco Felsch
Add the a parameter which will be used by image-fit to decide if a config node belongs to a devicetree-overlay. Signed-off-by: Marco Felsch --- drivers/of/overlay.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 73c7a91db9b5..20e12211d63

[PATCH v2 08/11] of: overlay: drop unnecessary empty check in of_overlay_global_fixup_dir

2024-06-13 Thread Marco Felsch
This is now done during of_overlay_global_fixup() so we can drop it here. Signed-off-by: Marco Felsch --- drivers/of/overlay.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 941cd3d51883..dad4e05ca27f 100644 --- a/drivers/of/overlay.c +++

[PATCH v2 00/11] Add FIT image overlay support

2024-06-13 Thread Marco Felsch
Hi, this series add the support to load FIT image supplied devicetree overlays. The v1 of this series can be found here [1]. The overlay loading wasn't coupled to bootm due to the following reasons: - By making use of the common overlay handling we can specifiy a different/separate FIT image

[PATCH v2 05/11] of: overlay: make search dir/path more generic

2024-06-13 Thread Marco Felsch
In preparation of adding support for FIT image overlay handling the global.of.overlay.dir can be reused if we rename it to a more generic global.of.overlay.path since it does not imply an directory. This commit adds the ground work by deprecating the old global.of.overlay.dir and moving the direct

[PATCH v2 07/11] of: overlay: add FIT overlay support

2024-06-13 Thread Marco Felsch
This adds the support to load devicetree overlays from an FIT image. There are quite a few options to handle FIT overlays since the FIT overlay spec is not very strict. This patch implement the most configurable case where each overlay does have it's own config node (including the optional signatu

[PATCH v2 11/11] FIT: add support to cache opened fit images

2024-06-13 Thread Marco Felsch
Cache the FIT image fit_open() calls to avoid loading the same FIT image twice. This is very useful if the same FIT image is used to provide the base devicetree, kernel and initrd as well as devicetree overlays. Signed-off-by: Marco Felsch --- common/image-fit.c | 38 +++

[PATCH v2 1/2] ARM: aarch64: align scr_el3 register setup with U-Boot

2024-06-13 Thread Marco Felsch
Currently we don't honor the setup done by the BootROM. Fix this by reading the scr_el3 first and update the corresponding bits afterwards. Furthermore also align the register settings: - Remove the register with (RW) setup since this is done by the EL3 firmware (TF-A). - Set IRQ/FIQ/EA bits

[PATCH 3/9] nvmem: ocotp: add support to query the field-return sticky bit

2024-06-13 Thread Marco Felsch
The i.MX8M* devices do have an sticky bit which indicates if the field-return fuse can be written. Add support to query the lock bit. To make it easy to read align the STICKY bit definitions as well. Signed-off-by: Marco Felsch --- drivers/nvmem/ocotp.c| 24 include

[PATCH 1/9] i.MX: HABv4: fix SRK_LOCK for i.MX8M devices

2024-06-13 Thread Marco Felsch
All current known i.MX8M devices: i.MX8MQ, i.MX8MP, i.MX8MN, i.MX8MM use an other fuse to lock the SRK hash. Fix this by refactoring imx_hab_write_srk_hash_ocotp() and make the lock fusing device specific. Fixes: 6c4d5bb5acfe ("i.MX: HABv4: implement interface for i.MX8MQ") Signed-off-by: Marco Fe

[PATCH 5/9] i.MX: HAB: add imx_hab_revoke_key support

2024-06-13 Thread Marco Felsch
Add an helper to revoke an i.MX SRK key. At the moment the helper supprts i.MX8M devices only, but adding support for other SoCs can be done easily by providing the .revoke_key() hook. Signed-off-by: Marco Felsch --- drivers/hab/hab.c| 45 include

[PATCH 6/9] i.MX: HABv4: add more i.MX8M fuse defines

2024-06-13 Thread Marco Felsch
Add more common i.MX8M fuse defines so they can be reused by board code. Signed-off-by: Marco Felsch --- include/mach/imx/ocotp-fusemap.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/mach/imx/ocotp-fusemap.h b/include/mach/imx/ocotp-fusemap.h index e6fa96b40ba9..1aece9

[PATCH v2 2/2] ARM: i.MX8M: add support to handle ROM SError ERR050350

2024-06-13 Thread Marco Felsch
This ports U-Boot commit: | commit 2f3c92060dcd6bc9cfd3e2e344a3e1745ca39f09 | Author: Peng Fan | Date: Thu Jul 9 13:39:26 2020 +0800 | | imx8m: workaround ROM serror | | ROM SError happens on two cases: | | 1. ERR050342, on iMX8MQ HDCP enabled parts ROM writes to GPV1 register, but

[PATCH v2 4/5] nvmem: allow single and dynamic device ids

2024-06-13 Thread Marco Felsch
Right now the core implementation always make use of DEVICE_ID_DYNAMIC. This does not allow us having static devices supplied via the of-aliases node. Therefore sync the code base with Linux to allow single ids, albeit the id handling is still different. While on it fix the nvmem_register_cdev() b

[PATCH v2 3/5] nvmem: expose nvmem cells as cdev

2024-06-13 Thread Marco Felsch
Expose the nvmem cells via cdevs which is our equivalent to the Linux sysfs exposure. This allows the easier user queries for board code and shell. Keep the Linux function name scheme for nvmem_populate_sysfs_cells() to reduce the diff for nvmem_register() function. Signed-off-by: Marco Felsch --

[PATCH v2 2/5] nvmem: sync with linux code base

2024-06-13 Thread Marco Felsch
Re-sync our code base with Linux which moved quite a lot. This patch is huge but still is only a partly sync. The main changes are: - The nvmem_cell struct was splitted into nvmem_cell and nvmem_cell_entry - The cells are now parsed and registered during nvmem_register(), no longer duri

[PATCH 4/9] hab: convert flags to use BIT() macro

2024-06-13 Thread Marco Felsch
Make use of the BIT() macro to define the flags, no functional change. Signed-off-by: Marco Felsch --- include/hab.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/hab.h b/include/hab.h index da79a8ffea36..2cef3841d149 100644 --- a/include/hab.h +++ b/include/

[PATCH 8/9] i.MX8M: HABv4: add option to allow burning the field-return fuse

2024-06-13 Thread Marco Felsch
This adds the required Kconfig options which need to be enabled and correctly set to build a custom device specific barebox image which can be used to burn the FIELD_RETURN fuse. The CST tool can't handle quoted UID strings so we need to define it on the cmdline by using the -D switch. This remove

[PATCH 7/9] i.MX8M: HABv4: add an option to allow key revocation

2024-06-13 Thread Marco Felsch
The HAB code needs an special [Unlock] instruction to keep the SRK_REVOKE fuse bank unlocked. This is required if a key needs to be revoked. Signed-off-by: Marco Felsch --- arch/arm/mach-imx/Kconfig| 8 include/mach/imx/habv4-imx8-gencsf.h | 6 ++ 2 files changed, 14 ins

[PATCH 9/9] i.MX: HAB: add imx_hab_field_return support

2024-06-13 Thread Marco Felsch
Add a convenient common helper to burn the field-return fuse which wraps the platform specific hook. At the moment only i.MX8M devices are supported. Adding support for other platforms can be done by providing the platform specific hook. Signed-off-by: Marco Felsch --- drivers/hab/hab.c

[PATCH 2/9] nvmem: ocotp: add support to get/set srk_revoke sticky bit

2024-06-13 Thread Marco Felsch
The i.MX8M* devices do have an sticky bit which indicates if the srk_revoke fuse can be written. Add support to query and to set the lock bit. Signed-off-by: Marco Felsch --- drivers/nvmem/ocotp.c| 55 include/mach/imx/ocotp.h | 2 ++ 2 files changed

[PATCH v2 1/5] nvmem: fix nvmem_register error path

2024-06-13 Thread Marco Felsch
Currently the nvmem memory is freed without removing/unregister the nvmem->dev if nvmem_register_cdev() fails. Fix this by unregister the device first, free the memory and return the error code. Signed-off-by: Marco Felsch --- v2: - new patch drivers/nvmem/core.c | 12 1 file chang

[PATCH v2 5/5] eeprom: at24: fix device name handling

2024-06-13 Thread Marco Felsch
The at24 driver does not need to handle the ids by its own since the nvmem_core does the handling too. This lead into issues where the eeprom device is named: eeprom00. Fix the alias handling too since the devie would never be named as described in the alias, since we never told the nvmem-core to

[PATCH] mci: core: fix typos

2024-06-13 Thread Jules Maselbas
Signed-off-by: Jules Maselbas --- drivers/mci/mci-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c index b4139be11e..de1efe3bb9 100644 --- a/drivers/mci/mci-core.c +++ b/drivers/mci/mci-core.c @@ -1619,7 +1619,7 @@ stat

[PATCH v2 01/11] FIT: fix missing free in fit_open error path

2024-06-13 Thread Marco Felsch
Free the handle if read_file_2() fails. Signed-off-by: Marco Felsch --- common/image-fit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/common/image-fit.c b/common/image-fit.c index 251fda97b3fc..008804e6a6c3 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -922,6 +922,7 @@ str

[PATCH v2 09/11] of: overlay: replace filename with an more unique name

2024-06-13 Thread Marco Felsch
Since we do support FIT image overlays and file/dir based overlays the filename variable is not sufficient anylonger. Therefore rename the local variables as well as the filter function to hook. To not break any systems keep the old filename based name too but mark them as deprecated. Signed-off-

[PATCH] mci: core: clarify comment on MMC version detection

2024-06-13 Thread Jules Maselbas
The MMC version is read from the reserved bits 125:122 in the CSD register, theses bits are specified as SPEC_VERS by JEDEC in the eMMC standard JESD84. Signed-off-by: Jules Maselbas --- drivers/mci/mci-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mci/

[PATCH] mci: core: clarify why write_bl_len is the same as read_bl_len

2024-06-13 Thread Jules Maselbas
Signed-off-by: Jules Maselbas --- drivers/mci/mci-core.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c index 5a8f81ecb8..0afb0d26c8 100644 --- a/drivers/mci/mci-core.c +++ b/drivers/mci/mci-core.c @@ -1070,8 +1070,12 @@ st

Re: [PATCH] mci: core: clarify why write_bl_len is the same as read_bl_len

2024-06-13 Thread Sascha Hauer
On Thu, 13 Jun 2024 17:27:24 +0200, Jules Maselbas wrote: > Applied, thanks! [1/1] mci: core: clarify why write_bl_len is the same as read_bl_len https://git.pengutronix.de/cgit/barebox/commit/?id=89bb083f5a63 (link may not be stable) Best regards, -- Sascha Hauer

Re: [PATCH] mci: core: clarify comment on MMC version detection

2024-06-13 Thread Sascha Hauer
On Thu, 13 Jun 2024 15:53:38 +0200, Jules Maselbas wrote: > The MMC version is read from the reserved bits 125:122 in the CSD register, > theses bits are specified as SPEC_VERS by JEDEC in the eMMC standard JESD84. > > Applied, thanks! [1/1] mci: core: clarify comment on MMC version detection

Re: [PATCH] mci: core: fix typos

2024-06-13 Thread Sascha Hauer
On Thu, 13 Jun 2024 15:28:20 +0200, Jules Maselbas wrote: > Applied, thanks! [1/1] mci: core: fix typos https://git.pengutronix.de/cgit/barebox/commit/?id=cd74c163f8af (link may not be stable) Best regards, -- Sascha Hauer