Re: [PATCH 6/6] led: add TI LP5562 LED driver

2023-10-23 Thread Rasmus Villemoes
On 23/10/2023 11.39, Marek Vasut wrote: > On 10/23/23 11:11, Rasmus Villemoes wrote: >> On 19/10/2023 15.58, Marek Vasut wrote: >>> On 10/19/23 11:58, Rasmus Villemoes wrote: >>>> From: Doug Zobel >>>> >>>> Driver for the TI LP5562 4 ch

[PATCH v2 1/2] serial: serial-uclass.c: move definition of _serial_flush up a bit

2023-10-16 Thread Rasmus Villemoes
Preparation for next patch. Reviewed-by: Simon Glass Signed-off-by: Rasmus Villemoes --- drivers/serial/serial-uclass.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index

[PATCH v2 2/2] serial: introduce CONFIG_CONSOLE_FLUSH_ON_NEWLINE

2023-10-16 Thread Rasmus Villemoes
of cpp ifdef, we can remove the ifdef around the _serial_flush() definition - if neither CONSOLE_FLUSH_SUPPORT or CONSOLE_FLUSH_ON_NEWLINE are enabled, the compiler elides _serial_flush(), but it won't warn about it being unused. Signed-off-by: Rasmus Villemoes --- common/Kconfig | 10

[PATCH v2 0/2] serial: introduce CONFIG_CONSOLE_FLUSH_ON_NEWLINE

2023-10-16 Thread Rasmus Villemoes
has time to actually emit all the characters. That can be very confusing, because one doesn't then know exactly where the hang happens. Rasmus Villemoes (2): serial: serial-uclass.c: move definition of _serial_flush up a bit serial: introduce CONFIG_CONSOLE_FLUSH_ON_NEWLINE common/Kconfig

Re: [REGRESSION] imx: spl_imx_romapi: boot loops

2023-10-24 Thread Rasmus Villemoes
On 24/10/2023 09.39, Marcel Ziswiler wrote: > Hi > > On our weekly master upstream CI build we noticed Verdin iMX8M Plus boot > looping. > > Bisecting pointed to the following commit: > > commit 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of > spl_load_simple_fit() to get full FIT

Re: [REGRESSION] imx: spl_imx_romapi: boot loops

2023-10-24 Thread Rasmus Villemoes
On 24/10/2023 12.03, Marcel Ziswiler wrote: > Hi Rasmus > > Thanks for your help. > > On Tue, 2023-10-24 at 11:18 +0200, Rasmus Villemoes wrote: > > > [snip] > >> Hm. Can you show the result of 'fdtdump u-boot.itb | head' > > ⬢[zim@toolbox

Re: [REGRESSION] imx: spl_imx_romapi: boot loops

2023-10-24 Thread Rasmus Villemoes
"(pagesize > 1 ? 1024 : 1)" or something like that. I don't think it will work, but OTOH my analysis below doesn't find any other (fundamental) difference between the old and new code. > > On Tue, 2023-10-24 at 13:17 +0200, Rasmus Villemoes wrote: > >> >> and this

[PATCH] imx8m: fix reading of DDR4 MR registers

2022-04-25 Thread Rasmus Villemoes
. get_trained_CDD() is already declared. This has only been compile-tested for the imx8mm-cl-iot-gate board (since I don't have the hardware), but since I've merely moved its definition of lpddr4_mr_read(), I'd be surprised if it changed anything for that board. Signed-off-by: Rasmus Villemoes --- arch/arm

[PATCH] phy: dp83867: add dp83867_{read,write}_mmd helpers

2022-05-17 Thread Rasmus Villemoes
the advantage of avoiding passing the DP83867_DEVADDR argument at all call sites, which allows lines to be unwrapped (and probably also gives a little .text reduction by itself). Signed-off-by: Rasmus Villemoes --- drivers/net/phy/dp83867.c | 52 +++ 1 file

[PATCH] common/board_r.c: drop legacy and unused bi_enetaddr

2022-05-20 Thread Rasmus Villemoes
. But if the board doesn't, this code runs before initr_net() -> eth_initialize(), and thus before the code in eth-uclass which fetches MAC addresses from eeprom, fuses or whatnot and populates the (run-time) environment with those values. Signed-off-by: Rasmus Villemoes --- common/board_

[PATCH] fdtdec: drop needlessly convoluted CONFIG_PHANDLE_CHECK_SEQ

2022-05-19 Thread Rasmus Villemoes
for both. Since the proper check is so simple, there's no reason to hide that behind a config option (and if one really wanted that, it should be called something else because there's no need to involve phandle in the check). Signed-off-by: Rasmus Villemoes --- configs/am65x_evm_a53_defconfig

Re: [PATCH] fdtdec: drop needlessly convoluted CONFIG_PHANDLE_CHECK_SEQ

2022-05-19 Thread Rasmus Villemoes
On 19/05/2022 12.41, Aswath Govindraju wrote: > Hi Rasmus, > > On 19/05/22 14:40, Rasmus Villemoes wrote: >> Asking if the alias we found actually points at the device tree node >> we passed in (in the guise of its offset from blob) can be done simply >> by as

Re: [PATCH] fdtdec: drop needlessly convoluted CONFIG_PHANDLE_CHECK_SEQ

2022-05-19 Thread Rasmus Villemoes
On 19/05/2022 13.50, Aswath Govindraju wrote: > Understood, thanks for the explanation. I am good with this patch. > > Acked-by: Aswath Govindraju > Thanks. For completeness, to expand on this: >> it's somewhat fragile to rely on (at least one of) the >> nodes in question to even have a

Re: [PATCH 2/2] pmic: pca9450: drop pointless .data entries

2022-06-02 Thread Rasmus Villemoes
On 02/06/2022 02.30, Jaehoon Chung wrote: > Dear Rasums, > > On 5/17/22 08:44, Jaehoon Chung wrote: >> On 5/3/22 17:58, Rasmus Villemoes wrote: >>> These are the i2c addresses of the chips, but that comes from device >>> tree. Having that information du

[PATCH 1/3] net: dwc_eth_qos: remove use of DWC_NET_PHYADDR

2022-05-12 Thread Rasmus Villemoes
dress 4 (and it also has a corresponding legacy #define CONFIG_FEC_MXC_PHYADDR 4). So I believe it should be completely safe to remove it from there as well. Signed-off-by: Rasmus Villemoes --- drivers/net/dwc_eth_qos.c| 3 --- include/configs/imx8mp_evk.h | 2 -- include/configs/imx8m

[PATCH 2/3] phy: introduce eth_phy_get_node_and_addr()

2022-05-12 Thread Rasmus Villemoes
the fixed-link support). Signed-off-by: Rasmus Villemoes --- drivers/net/eth-phy-uclass.c | 9 - include/eth_phy.h| 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/eth-phy-uclass.c b/drivers/net/eth-phy-uclass.c index 27b77444a0..05e1de8be9 100644

[PATCH 3/3] net: dwc_eth_qos: set proper DT node for phy device

2022-05-12 Thread Rasmus Villemoes
with a ti,dp83867 phy sitting in front of the eqos interface. Signed-off-by: Rasmus Villemoes --- drivers/net/dwc_eth_qos.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index 27b3f98e0e..af35960b42 100644 --- a/drivers/net

[PATCH 0/3] dwc_eth_qos PHY dt node fixups

2022-05-12 Thread Rasmus Villemoes
since it just returns an extra piece of inforamtion that eth_phy_get_node() already found). And the third hooks it up in the dwc_eth_qos driver. Rasmus Villemoes (3): net: dwc_eth_qos: remove use of DWC_NET_PHYADDR phy: introduce eth_phy_get_node_and_addr() net: dwc_eth_qos: set proper DT

dwc_eth_qos driver for tegra

2022-05-23 Thread Rasmus Villemoes
Hi I'm looking at switching the dwc_eth_qos driver over to use dm_eth_phy_connect(). However, I'm a little puzzled by the code for the tegra variant. The comment at the top of the file, as well as tegra186.dtsi, says phy-mode = "rgmii"; But eqos_get_interface_tegra186() returns a hard-coded

Re: dwc_eth_qos driver for tegra

2022-05-23 Thread Rasmus Villemoes
On 23/05/2022 12.57, Marek Vasut wrote: > On 5/23/22 11:17, Rasmus Villemoes wrote: >> Hi > > Hi, > >> I'm looking at switching the dwc_eth_qos driver over to use >> dm_eth_phy_connect(). However, I'm a little puzzled by the code for the >> tegra variant

Re: [PATCH] phy: dp83867: add dp83867_{read,write}_mmd helpers

2022-05-24 Thread Rasmus Villemoes
On 19/05/2022 16.38, Vladimir Oltean wrote: > Hi Rasmus, > > On Tue, May 17, 2022 at 04:27:06PM +0200, Rasmus Villemoes wrote: >> Since the phy_{read,write}_mmd functions are static inlines using >> other static inline functions, they cause code using them to explode.

Re: [PATCH] Revert "fdtdec: drop needlessly convoluted CONFIG_PHANDLE_CHECK_SEQ"

2022-07-05 Thread Rasmus Villemoes
On 05/07/2022 11.47, Simon Glass wrote: > Hi Tom, > > On Sun, 3 Jul 2022 at 06:43, Tom Rini wrote: >> >> On Sun, Jul 03, 2022 at 02:32:42AM -0600, Simon Glass wrote: >>> Hi, >>> >>> On Sun, 3 Jul 2022 at 02:25, Simon Glass wrote: The fdt_path_offset() function is slow since it must

[PATCH] i2c: avoid dynamic stack use in dm_i2c_write

2022-07-07 Thread Rasmus Villemoes
ral limit.] Signed-off-by: Rasmus Villemoes --- drivers/i2c/i2c-uclass.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c index 71bc2b5b8a..a06553324e 100644 --- a/drivers/i2c/i2c-uclass.c ++

Re: [PATCH] scripts/Makefile.lib: add -D__U_BOOT__ to dtc_cpp_flags

2022-07-04 Thread Rasmus Villemoes
On 01/07/2022 21.25, Tom Rini wrote: > On Fri, Jul 01, 2022 at 09:27:59AM +0200, Rasmus Villemoes wrote: >> When trying to use the exact same device tree source to build the dtbs >> used with U-Boot and linux, one often runs into various problems. For >> example, files unde

[PATCH] scripts/Makefile.lib: add -D__U_BOOT__ to dtc_cpp_flags

2022-07-01 Thread Rasmus Villemoes
as a proxy, but it's much more readable, maintainable and robust if one's .dts has "ifdef __U_BOOT__" rather than "ifdef __ASSEMBLY__". Signed-off-by: Rasmus Villemoes --- scripts/Makefile.lib | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/Makefile.lib b/script

[PATCH v2 0/6] imx8 ROM API cleanup

2022-06-20 Thread Rasmus Villemoes
, but since the patch is not identical I've elided the R-b. Rasmus Villemoes (6): imx8: add hidden IMX8_ROMAPI Kconfig symbol imx8: sys_proto.h: change guard logic around ROM API imx8: add rom api wrappers imx8: use ROM API wrappers in spl_imx_romapi.c imx8m: soc.c: use rom_api_query_boot_infor

[PATCH v2 1/6] imx8: add hidden IMX8_ROMAPI Kconfig symbol

2022-06-20 Thread Rasmus Villemoes
In order not to repeat the IMX8MN || IMX8MP || IMX8ULP logic in multiple places where we need to know if the SOC exposes the ROM API, add a "def_bool y" Kconfig symbol. Reviewed-by: Peng Fan Signed-off-by: Rasmus Villemoes --- arch/arm/mach-imx/Kconfig | 6 +- 1 file changed, 5

[PATCH v2 3/6] imx8: add rom api wrappers

2022-06-20 Thread Rasmus Villemoes
l make use of these to reduce boilerplate. [1] One wonders, for example, if the check is only applied to the lower 32 bits, or if we're implicitly relying on all 64-bit pointer values we're passing effectively have 0 in the upper 32 bits. Reviewed-by: Peng Fan Signed-off-by: Rasmus Villemoes --- arch/a

[PATCH v2 2/6] imx8: sys_proto.h: change guard logic around ROM API

2022-06-20 Thread Rasmus Villemoes
. Reviewed-by: Peng Fan Signed-off-by: Rasmus Villemoes --- arch/arm/include/asm/mach-imx/sys_proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h index fdbbfb169c..02816197c1 100644

[PATCH v2 4/6] imx8: use ROM API wrappers in spl_imx_romapi.c

2022-06-20 Thread Rasmus Villemoes
Simplify the use of the ROM API by using the wrappers that take care of saving/restoring gd and computing the xor value. This makes the generated code smaller and the C code easier to read. Reviewed-by: Peng Fan Signed-off-by: Rasmus Villemoes --- arch/arm/mach-imx/spl_imx_romapi.c | 47

[PATCH v2 6/6] imx8ulp: soc.c: use rom_api_query_boot_infor() wrapper

2022-06-20 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- arch/arm/mach-imx/imx8ulp/soc.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-imx/imx8ulp/soc.c b/arch/arm/mach-imx/imx8ulp/soc.c index 35020c9714..c0f0df356e 100644 --- a/arch/arm/mach-imx/imx8ulp/soc.c +++ b

[PATCH v2 5/6] imx8m: soc.c: use rom_api_query_boot_infor() wrapper

2022-06-20 Thread Rasmus Villemoes
Reviewed-by: Peng Fan Signed-off-by: Rasmus Villemoes --- arch/arm/mach-imx/imx8m/soc.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 59335356b5..d5eb50143c 100644 --- a/arch/arm/mach-imx/imx8m/soc.c

Re: [PATCH] fdtdec: drop needlessly convoluted CONFIG_PHANDLE_CHECK_SEQ

2022-06-11 Thread Rasmus Villemoes
On 08/06/2022 16.18, eugen.hris...@microchip.com wrote: > On 5/19/22 3:16 PM, Rasmus Villemoes wrote: >> On 19/05/2022 13.50, Aswath Govindraju wrote: >> >>> Understood, thanks for the explanation. I am good with this patch. >>> >>> Ack

Re: [PATCH] crypto: fsl_hash: Remove unnecessary alignment check in caam_hash()

2022-06-06 Thread Rasmus Villemoes
On 29/04/2022 15.34, Stefan Roese wrote: > While working on an LX2160 based board and updating to latest mainline > I noticed problems using the HW accelerated hash functions on this > platform, when trying to boot a FIT Kernel image. Here the resulting > error message: > >Using

Re: [PATCH] misc: i2c_eeprom: fix at24c32 offset_len

2022-04-28 Thread Rasmus Villemoes
On 28/04/2022 13.11, Eugen Hristev wrote: > According to at24c32 datasheet: > > RANDOM READ: A random read requires a “dummy” byte write sequence to load in > the dataword address. Once the device address word and data word address are > clocked in and acknowledged by the EEPROM, the

please modify output of i.MX8MSCALE DDR Tool

2022-04-28 Thread Rasmus Villemoes
Hi NXP folks Is it possible for you to modify the i.MX8MSCALE DDR Tool so that the lpddr4_timing.c files it emits use "static" in front of ddr_ddrc_cfg[] and all the other arrays it defines; the only symbol that file defines which should have external linkage is the final "struct dram_timing_info

[PATCH] common/console.c: use CONFIG_VAL() with PRE_CON_BUF_* variables

2022-05-03 Thread Rasmus Villemoes
constrained). So a prerequisite for adding SPL_PRE_CONSOLE_BUFFER is to make the code use SPL_-specific values. No functional change. Signed-off-by: Rasmus Villemoes --- common/console.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/console.c b/common

[PATCH] common/console.c: prevent pre-console buffer contents from being added to itself

2022-05-03 Thread Rasmus Villemoes
ctually come out on some device). So disable all use of the pre-console buffer while print_pre_console_buffer() is emitting it. Signed-off-by: Rasmus Villemoes --- common/console.c | 10 +- include/asm-generic/global_data.h | 12 2 files changed, 17 insertion

[PATCH 2/2] pmic: pca9450: drop pointless .data entries

2022-05-03 Thread Rasmus Villemoes
These are the i2c addresses of the chips, but that comes from device tree. Having that information duplicated here just adds confusion. Signed-off-by: Rasmus Villemoes --- drivers/power/pmic/pca9450.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/power/pmic

[PATCH 1/2] pmic: pca9450: add DM_I2C dependencies in Kconfig

2022-05-03 Thread Rasmus Villemoes
or the non-SPL_ variant. Signed-off-by: Rasmus Villemoes --- drivers/power/pmic/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig index 953c92e212..6c534aead7 100644 --- a/drivers/power/pmic/Kconfig +++ b/drivers/

Re: [PATCH] crypto/fsl: fsl_hash: Fix dcache issue in caam_hash_finish

2022-05-11 Thread Rasmus Villemoes
On 11/05/2022 10.53, Gaurav Jain wrote: > HW accelerated hash operations are giving incorrect hash output. > so add flush and invalidate for input/output hash buffers. > > Fixes: 94e3c8c4fd (crypto/fsl - Add progressive hashing support using > hardware acceleration.) AFAICT, it takes somewhat

[PATCH] net: dwc_eth_qos: lift parsing of max-speed DT property to common code

2022-05-11 Thread Rasmus Villemoes
of a phy_set_supported() call in eqos_start(), but the max-speed DT property is currently only parsed in eqos_probe_resources_stm32(). Lift that parsing to eqos_probe(). Signed-off-by: Rasmus Villemoes --- drivers/net/dwc_eth_qos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH] net: dwc_eth_qos: fix double resource leak in eqos_remove()

2022-05-11 Thread Rasmus Villemoes
Not only does eqos_remove() fail to free the buffers that have been allocated by eqos_probe_resources_core(), it repeats those allocations and thus drops twice as much memory on the floor. Signed-off-by: Rasmus Villemoes --- drivers/net/dwc_eth_qos.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH] dm: rtc: Avoid a race in the rtc_reset test

2022-08-02 Thread Rasmus Villemoes
delay. >>>>> >>>>> Fixes: https://source.denx.de/u-boot/u-boot/-/issues/4 >>>>> Reported-by: Bin Meng >>>>> Reported-by: Tom Rini >>>>> Suggested-by: Rasmus Villemoes >>>>> Signed-off-by: Simon Glass >

Re: [PATCH] fdt_support: add optional board_rng_seed() hook

2022-08-23 Thread Rasmus Villemoes
On 23/08/2022 15.38, Simon Glass wrote: >> +/** >> + * board_rng_seed() - Provide a seed to be passed via /chosen/rng-seed >> + * >> + * This function is called if CONFIG_BOARD_RNG_SEED is set, and must >> + * be provided by the board. It should return, via @buf, some suitable >> + * seed value

Re: [PATCH] image: Ensure image header name is null terminated

2022-08-23 Thread Rasmus Villemoes
On 23/08/2022 15.38, Simon Glass wrote: > Hi John, > > On Tue, 23 Aug 2022 at 03:46, John Keeping wrote: >> >> On Tue, Aug 23, 2022 at 03:59:07PM +1000, Joel Stanley wrote: >>> When building with GCC 12: >>> >>> ../include/image.h:779:9: warning: ‘strncpy’ specified bound 32 equals >>>

[RFC PATCH] imx8mp: fix boot hang when booting NXP kernel 5.15.32

2022-08-23 Thread Rasmus Villemoes
for that SOC. But this really seems like something that the kernel itself should (be able to) take care of, without relying on the bootloader having done such random magic. Signed-off-by: Rasmus Villemoes --- I don't know if upstream U-Boot cares about being able to boot a downstream NXP

Re: [PATCH] common/console.c: prevent pre-console buffer contents from being added to itself

2022-08-23 Thread Rasmus Villemoes
o make progress towards making pre-console-buffering usable in SPL (since I'm debugging yet another issue where I need to know what happened very early). On 03/05/2022 15.13, Rasmus Villemoes wrote: > I do not have any non-serial output devices, so a > print_pre_console_buffer(PRE_CONSOLE_FLUS

Re: [RFC PATCH] imx8mp: fix boot hang when booting NXP kernel 5.15.32

2022-08-25 Thread Rasmus Villemoes
On 24/08/2022 12.17, Peng Fan wrote: > > > On 8/23/2022 9:36 PM, Rasmus Villemoes wrote: >> We have observed a somewhat weird bug: When booting the downstream NXP >> kernel lf-5.15.32-2.0.0 [fa6c3168595c], sometimes the board would hang >> during imx_lcdifv3_probe(). A

Re: [PATCH] Makefile: Use relative paths for debugging symbols.

2022-08-29 Thread Rasmus Villemoes
On 29/08/2022 09.15, Rasmus Villemoes wrote: > I'm inclined to say that is a bug in gcc. I'll open a bug and see what > they say. And it turns out this is already reported, with the same suggested resolution as I was thinking of, namely extending the ASM_MAP definition: https://gcc.g

Re: [RFC PATCH 2/8] watchdog: Integrate watchdog triggering into the cyclic framework

2022-08-29 Thread Rasmus Villemoes
On 29/08/2022 08.23, Stefan Roese wrote: > This patch integrates the watchdog triggering into the recently added > cyclic infrastructure. Each watchdog device that shall be triggered > registers it's own cyclic function. This way, multiple watchdog devices > are still supported, each via a cyclic

Re: [RFC PATCH 5/8] watchdog: Get rid of ASSEMBLY hacks

2022-08-29 Thread Rasmus Villemoes
On 29/08/2022 08.23, Stefan Roese wrote: > Only one occurance of WATCHDOG_RESET is left in one assembler file. > This patch changes this occurance to a direct call to watchdog_reset Well... > and then removes all the ASSEMBLY ifdef'ery in watchdog.h, as it's not > needed any more to clean this

Re: [PATCH] Makefile: Use relative paths for debugging symbols.

2022-08-29 Thread Rasmus Villemoes
On 28/08/2022 23.46, Vagrant Cascadian wrote: > On 2022-08-28, Vagrant Cascadian wrote: >> On 2022-08-28, Rasmus Villemoes wrote: >>> On 26/08/2022 22.59, Tom Rini wrote: >>>> On Thu, Aug 18, 2022 at 10:31:34AM -0700, Vagrant Cascadian wrote:

[PATCH] fdt_support: add optional board_rng_seed() hook

2022-08-22 Thread Rasmus Villemoes
motions as it would if no rng-seed was passed before considering its CRNG initialized. I.e., by returning that unique-to-this-board value and setting random.trust_bootloader=n, the board would be no worse off than if board_rng_seed() returned nothing at all. Signed-off-by: Rasmus Villemoes

Re: [PATCH 08/21] dm: core: Allow adding ofnode subnodes

2022-09-01 Thread Rasmus Villemoes
On 31/08/2022 05.08, Simon Glass wrote: > Add this feature to the ofnode interface, supporting both livetree and > flattree. > > Signed-off-by: Simon Glass > --- > > drivers/core/of_access.c | 50 > drivers/core/ofnode.c| 30

Re: [PATCH] fdt_support: add optional board_rng_seed() hook

2022-09-02 Thread Rasmus Villemoes
On 02/09/2022 01.52, Simon Glass wrote: > Hi Rasmus, > > On Sat, 27 Aug 2022 at 19:52, Simon Glass wrote: >> >> Hi Rasmus, >> >> On Wed, 24 Aug 2022 at 19:25, Simon Glass wrote: >> I'm looking at adding full support to ofnode for reading/writing any >> tree, not just the control FDT. I should

Re: [PATCH] fdt_support: add optional board_rng_seed() hook

2022-08-24 Thread Rasmus Villemoes
On 23/08/2022 16.35, Simon Glass wrote: > Hi Rasmus, > > On Tue, 23 Aug 2022 at 07:06, Rasmus Villemoes > wrote: >> >> On 23/08/2022 15.38, Simon Glass wrote: >> >>>> +/** >>>> + * board_rng_seed() - Provide a seed to be passed via /cho

Re: [RFC PATCH] imx8mp: fix boot hang when booting NXP kernel 5.15.32

2022-08-24 Thread Rasmus Villemoes
On 23/08/2022 16.04, Marek Vasut wrote: > > You might want to check Linux /sys/kernel/debug/clk/clk_summary > before/after this change and see if there are any differences . If so, > try using assigned-clock-rates in Linux DT and see if that can achieve > the same "fix" effect. Thanks for the

Re: [PATCH] Makefile: Use relative paths for debugging symbols.

2022-08-28 Thread Rasmus Villemoes
vely, to use >> relative paths for occurrences of __FILE__ and debug paths. >> >> This enables reproducible builds regardless of the absolute path to >> the build directory: >> >> https://reproducible-builds.org/docs/build-path/ >> >> Signed-off-by: Vagran

Re: [PATCH] Makefile: Use relative paths for debugging symbols.

2022-08-19 Thread Rasmus Villemoes
ve paths in debugging symbols > +KBUILD_AFLAGS += --debug-prefix-map=$(srctree)/= > + Hm, ok, it seems this has been supported in binutils since ~2007, so I don't suppose this needs some equivalent to the cc-option guard. Acked-by: Rasmus Villemoes

[PATCH] watchdog: gpio_wdt: use __udelay() to avoid recursion

2022-09-27 Thread Rasmus Villemoes
y() directly. Signed-off-by: Rasmus Villemoes --- drivers/watchdog/gpio_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/gpio_wdt.c b/drivers/watchdog/gpio_wdt.c index fe06ec8cc9..2920c2c751 100644 --- a/drivers/watchdog/gpio_wdt.c +++ b/drivers/watchdo

[PATCH 3/4] sandbox: add SIGALRM-based watchdog device

2022-09-27 Thread Rasmus Villemoes
this driver for sandbox{,64}_defconfig, also enable the wdt command which was useful for hand-testing this new driver (especially with running u-boot under strace). Signed-off-by: Rasmus Villemoes --- arch/sandbox/cpu/os.c| 17 ++ configs/sandbox64_defconfig | 2 + configs

[PATCH 1/4] autoboot: make sure watchdog device(s) are handled with keyed autoboot

2022-09-27 Thread Rasmus Villemoes
-by: Rasmus Villemoes --- common/autoboot.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/autoboot.c b/common/autoboot.c index 63f2587941..cdafe76309 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -115,6 +115,7 @@ static int passwd_abort_crypt(uint64_t etime

[PATCH 4/4] sandbox.dtsi: add a sandbox,alarm-wdt instance

2022-09-27 Thread Rasmus Villemoes
In order to test that we properly handle watchdog(s) during the "wait for the user to interrupt autoboot" phase, we need a watchdog device to be watching us. Signed-off-by: Rasmus Villemoes --- arch/sandbox/dts/sandbox.dtsi | 6 ++ 1 file changed, 6 insertions(+) diff --git a/ar

[PATCH 0/4] handle watchdogs during keyed autoboot

2022-09-27 Thread Rasmus Villemoes
consider it mostly POC. Regardless, as I wrote above, I do hope the fix itself (1/4) can be applied soonish. Rasmus Villemoes (4): autoboot: make sure watchdog device(s) are handled with keyed autoboot watchdog: introduce a u-boot,autostart property sandbox: add SIGALRM-based watchdog device

[PATCH 2/4] watchdog: introduce a u-boot,autostart property

2022-09-27 Thread Rasmus Villemoes
the negations. Signed-off-by: Rasmus Villemoes --- doc/device-tree-bindings/watchdog/common.txt | 9 + drivers/watchdog/wdt-uclass.c| 15 +-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/device-tree-bindings/watchdog/common.txt b/doc/device

Re: [PATCH 5/6] net: tftp: use IS_ENABLED(CONFIG_NET_TFTP_VARS) instead of #if

2022-10-17 Thread Rasmus Villemoes
On 16/10/2022 20.28, Ramon Fried wrote: > On Fri, Oct 14, 2022 at 8:44 PM Rasmus Villemoes > wrote: >> >> Nothing inside this block depends on NET_TFTP_VARS to be set to parse >> correctly. Switch to C if() in preparation for adding code before >> this (to avoid

[PATCH 7/6] net: deal with fragment-overlapping-two-holes case

2022-10-17 Thread Rasmus Villemoes
another. So instead opt for this simple protection: Simply don't allow the eventual memcpy() to write beyond the last_byte of the current hole. Signed-off-by: Rasmus Villemoes --- I've been mulling over this over the weekend, and concluded that this should be enough for now. Even if I'm wrong

Re: [PATCH] lib: fix buggy strcmp and strncmp

2022-10-25 Thread Rasmus Villemoes
On 05/10/2022 11.09, Rasmus Villemoes wrote: > There are two problems with both strcmp and strncmp: > Hi Tom Could you consider applying this now to give it ample time to soak before release? I'm pretty confident it's correct. Rasmus

Re: commit 787f04bb6a - imx: add USB2_BOOT type

2022-10-25 Thread Rasmus Villemoes
On 18/10/2022 02.43, Peng Fan wrote: > + Stefano & Fabio > Is there any chance you could make some information on that ROM API public so it's possible for outsiders to understand what's going on? > > What could only help is to ask the ROM team to see whether they have > plan to

Re: [PATCH 3/6] net: (actually/better) deal with CVE-2022-{30790, 30552}

2022-10-25 Thread Rasmus Villemoes
On 20/10/2022 17.32, Artur Łącki wrote: > I tested these patches with my exploit. At the moment it looks like the > vulnerability has been fixed. Thanks for testing. Can I/we add a "Tested-by: Artur Łącki "? Rasmus

Re: imx8 regression: cyclic_register for watchdog@30280000 failed

2022-10-26 Thread Rasmus Villemoes
On 25/10/2022 18.32, Tim Harvey wrote: > Greetings, > > I've noticed a regression since the merge of the cyclic framework use > for watchdog on my imx8m boards: > > cyclic_register for watchdog@3028 failed > WDT: Failed to start watchdog@3028 > > A bisect lead me to the following 3

Re: [PATCH 5/5] cyclic: get rid of cyclic_init()

2022-10-28 Thread Rasmus Villemoes
On 28/10/2022 16.10, Stefan Roese wrote: > On 28.10.22 13:50, Rasmus Villemoes wrote: >> As for cyclic_uninit(), it was never really the opposite of >> cyclic_init() since it didn't free the struct cyclic_drv nor set >> gd->cyclic to NULL. Rename it to cyclic_

[PATCH 4/5] cyclic: switch to using hlist instead of list

2022-10-28 Thread Rasmus Villemoes
) and hlist_del(). - struct members and function return values updated. Signed-off-by: Rasmus Villemoes --- cmd/cyclic.c | 5 +++-- common/cyclic.c | 18 ++ include/cyclic.h | 6 +++--- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/cmd/cyclic.c b/cmd/cyclic.c

[PATCH 5/5] cyclic: get rid of cyclic_init()

2022-10-28 Thread Rasmus Villemoes
ntains 0 until it gets explicitly initialized, but that must be the case, otherwise testing gd for being NULL would not make much sense. Signed-off-by: Rasmus Villemoes --- common/board_f.c | 2 +- common/board_r.c | 1 - common/cyclic.c

[PATCH 0/5] cyclic: get rid of (the need for) cyclic_init()

2022-10-28 Thread Rasmus Villemoes
anything in SPL that would require a call to cyclic_unregister_all(). Rasmus Villemoes (5): cyclic: use a flag in gd->flags for recursion protection cyclic: drop redundant cyclic_ready flag list.h: synchronize hlist_for_each_entry* iterators with linux cyclic: switch to using hlist inst

[PATCH 1/5] cyclic: use a flag in gd->flags for recursion protection

2022-10-28 Thread Rasmus Villemoes
As a preparation for future patches, use a flag in gd->flags rather than a separate member in (the singleton) struct cyclic_drv to keep track of whether we're already inside cyclic_run(). Signed-off-by: Rasmus Villemoes --- common/cyclic.c | 6 +++--- include/asm-gene

[PATCH 3/5] list.h: synchronize hlist_for_each_entry* iterators with linux

2022-10-28 Thread Rasmus Villemoes
v6.1-rc1, including the hlist_entry_safe() helper used by the new versions. Signed-off-by: Rasmus Villemoes --- include/linux/list.h | 53 +--- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/include/linux/list.h b/include/linux/list.h index 3eacf68e3

[PATCH 2/5] cyclic: drop redundant cyclic_ready flag

2022-10-28 Thread Rasmus Villemoes
d->cyclic itself. The only wrinkle is that cyclic_uninit() actually did set ->cyclic_ready to false. However, since it doesn't free gd->cyclic, the cyclic infrastructure is actually still ready (i.e., the list_head is properly initialized as an empty list). Signed-off-by: Rasmus Vill

Re: imx8 regression: cyclic_register for watchdog@30280000 failed

2022-10-28 Thread Rasmus Villemoes
On 26/10/2022 21.06, Tim Harvey wrote: > 29caf9305b6f cyclic: Use schedule() instead of WATCHDOG_RESET() > ^^^ build issue resolved, boot issue on imx8mm-venice resolved, but > this is where we now encounter watchdog failures in both the SPL and > U-Boot: > > SPL: > cyclic_register for

Re: imx8 regression: cyclic_register for watchdog@30280000 failed

2022-10-27 Thread Rasmus Villemoes
On 27/10/2022 08.32, Stefan Roese wrote: >> In this case the watchdog gets >> started but never reset via cyclic. This is due to cyclic_init never >> being called in the SPL - where is that supposed to occur? > > I did not have many targets with WDT in SPL to test with. Seems that > I missed to

Re: [PATCH] gpio-uclass: fix gpio lookup by label

2022-10-04 Thread Rasmus Villemoes
On 04/10/2022 01.49, Simon Glass wrote: > On Mon, 3 Oct 2022 at 03:03, Rasmus Villemoes > wrote: >> >> Matching anything that just happens to have the sought-for label as a >> prefix is wrong. For example, if the board designer has designated 10 >> lines for debug pu

[PATCH] lib: fix buggy strcmp and strncmp

2022-10-05 Thread Rasmus Villemoes
somewhat, since it is used all over when parsing and matching DT nodes and properties, so let's find some other place to save those ~30 bytes. Signed-off-by: Rasmus Villemoes --- Please double- and triple-check before applying. I've tested these against my libc's strcmp() and strncmp() for thou

Re: [PATCH 2/2] buildman: Add --allow-missing-binaries flag to build with BINMAN_ALLOW_MISSING=1

2022-10-13 Thread Rasmus Villemoes
On 12/10/2022 16.52, Tom Rini wrote: >> Option 1 has the benefit that we don't do any of the blob handling, so >> it just dies right away. Perhaps this is a philosophical question, but >> it is a little subtle and I'm not actually sure people would notice >> the difference so long as they get the

Re: [PATCH 1/2] image: Suppress string truncation warning

2022-10-13 Thread Rasmus Villemoes
On 12/10/2022 21.47, Michal Suchanek wrote: > In file included from ../tools/imagetool.h:24, > from ../tools/default_image.c:16: > In function ‘image_set_name’, > inlined from ‘image_set_header’ at ../tools/default_image.c:133:2: > ../include/image.h:786:9: warning: ‘strncpy’

Re: [PATCH] image: fit: Fix not verifying data configuration

2022-10-13 Thread Rasmus Villemoes
On 12/10/2022 18.28, Sean Anderson wrote: > On 10/12/22 08:59, Simon Glass wrote: >> Hi Sean, >> >> On Tue, 11 Oct 2022 at 17:25, Sean Anderson >> wrote: >>> >>> When reading data from a FIT image, we must verify the configuration we >>> get it from. This is because when we have a key with

Re: [EXT] Re: [REGRESSION]: v2022.07: SHA256 hash is broken on imx8m series with CAAM enabled

2022-10-13 Thread Rasmus Villemoes
On 13/10/2022 08.20, Gaurav Jain wrote: > Hi Fabio > > Thanks for the patch information. > @Rasmus Villemoes I hope this fixed your problem? > Sort of, kind of. I monkey-patched arch/arm/dts/imx8mp-u-boot.dtsi to include that +_jr0 { + status = "disabled"; +}

[PATCH] imx8m: fix reading of DDR4 MR registers [again]

2022-10-06 Thread Rasmus Villemoes
. So apply the fix from 290ffe5788 once again. Fixes: 99c7cc58e1 (ddr: imx: Add i.MX9 DDR controller driver) Signed-off-by: Rasmus Villemoes --- drivers/ddr/imx/imx8m/ddr_init.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/ddr/imx/imx8m/ddr_init.c b/drivers

Re: [PATCH 1/2] global: Do not default to faking missing binaries for buildman

2022-10-11 Thread Rasmus Villemoes
to be passed on the 'make' line to enable this > behavior. Recreating the bitbake scenario that bit me with this applied correctly failed to build. Thanks. Tested-by: Rasmus Villemoes

Re: Broken watchdog in u-boot master branch

2022-10-11 Thread Rasmus Villemoes
On 10/10/2022 15.55, Tom Rini wrote: > On Sun, Oct 09, 2022 at 09:12:25PM +0200, Pali Rohár wrote: > >> Hello! Watchdog code seems to be broken in u-boot master branch. >> On Nokia N900 I'm getting following message in qemu: >> >> cyclic function rx51_watchdog took too long: 1us vs 1000us

Re: [PATCH v2 01/38] Makefile: Fake external blobs by default with binman

2022-10-10 Thread Rasmus Villemoes
On 10/01/2022 04.13, Simon Glass wrote: > This behaviour is necessary with boards where the binman description > requires processing external blobs, since these may be missing. > > Enable it by default, so that CI is happy. Warnings indicate that a valid > image is not produced, as with the

Re: [REGRESSION]: v2022.07: SHA256 hash is broken on imx8m series with CAAM enabled

2022-10-10 Thread Rasmus Villemoes
On 15/07/2022 14.40, ZHIZHIKIN Andrey wrote: > Hello Gaurav, > > In the new v2022.07, I've stumbled upon the issue with calculating the SHA256 > of > memory blocks with CAAM hashing. This causes the FIT image not to pass the > hash > validation, and also `sha256` command not operable. > > I'm

Re: CONFIG_DEFAULT_ENV_FILE Question

2022-09-30 Thread Rasmus Villemoes
On 28/09/2022 22.14, Jonathan DeNoon wrote: > Hello, I want to define my own default environment, so I have enabled > CONFIG_USE_DEFAULT_ENV_FILE. The next step appears to be setting the path to > the default environment file via CONFIG_DEFAULT_ENV_FILE. My questions are as > follows: > > *

[PATCH] gpio-uclass: fix gpio lookup by label

2022-10-03 Thread Rasmus Villemoes
ing how few in-tree defconfigs currently set DM_GPIO_LOOKUP_LABEL (ignoring sandbox, only four "real" boards), let's fix it before the use becomes more widespread. Signed-off-by: Rasmus Villemoes --- drivers/gpio/gpio-uclass.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) d

Re: [EXT] [REGRESSION]: v2022.07: SHA256 hash is broken on imx8m series with CAAM enabled

2022-10-14 Thread Rasmus Villemoes
On 14/10/2022 03.00, Peng Fan wrote: > >>> Right now I am not sure what could cause the issue. >>> As per our previous discussions, JR0 can not be used in uboot, so you >>> need to >>> mark it as disabled until kernel device tree is not sync. >> >> Actually, I've given this a try by setting

[PATCH 3/6] net: (actually/better) deal with CVE-2022-{30790,30552}

2022-10-14 Thread Rasmus Villemoes
overwrite the second H with our chosen payload. This is probably worth fixing... Signed-off-by: Rasmus Villemoes --- net/net.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/net.c b/net/net.c index 86b1d90159..340e7b8f18 100644 --- a/net/net.c +++ b/net/net.c @@ -907,

[PATCH 6/6] net: tftp: sanitize tftp block size, especially for TX

2022-10-14 Thread Rasmus Villemoes
net_tx_packet (which only has room for 1500 bytes plus change). Similarly, if tftpblocksize is set to something larger than what we can actually receive (e.g. 5, with NET_MAXDEFRAG being 16384), any tftp get just hangs because we never receive any packets. Signed-off-by: Rasmus Villemoes --- net

[PATCH 5/6] net: tftp: use IS_ENABLED(CONFIG_NET_TFTP_VARS) instead of #if

2022-10-14 Thread Rasmus Villemoes
Nothing inside this block depends on NET_TFTP_VARS to be set to parse correctly. Switch to C if() in preparation for adding code before this (to avoid a declaration-after-statement warning). Signed-off-by: Rasmus Villemoes --- net/tftp.c | 56

[PATCH 4/6] net: fix ip_len in reassembled IP datagram

2022-10-14 Thread Rasmus Villemoes
nce the RHS really should be "ntohs(ip->ip_len) - 20", i.e. the IP payload size. Now that we've fixed things so that len == ntohs(ip->ip_len) in all cases, change that sanity check to use len-20 as the RHS. Signed-off-by: Rasmus Villemoes --- net/net.c | 4 ++-- 1 file changed, 2 inser

Re: commit 787f04bb6a - imx: add USB2_BOOT type

2022-10-14 Thread Rasmus Villemoes
On 14/10/2022 02.55, Peng Fan wrote: > Hi Rasmus > > On 10/7/2022 4:08 PM, Rasmus Villemoes wrote: >> Hi Peng >> >> It seems that commit 787f04bb6a (imx: add USB2_BOOT type) broke our >> board logic which relies on whether get_boot_device() returns

<    2   3   4   5   6   7   8   9   >