[PATCH v2 0/5] improve 'read' command, add 'write' command

2023-03-01 Thread Rasmus Villemoes
offers much that "read error" doesn't. New in v2: the last three patches add documentation, ensure CMD_WRITE is set for sandbox and adds some basic test cases for the various ways of accessing the partitions (by number, name, or as raw offset within the whole dis

[PATCH v2 1/5] cmd: read: use part_get_info_by_dev_and_name_or_num() instead of open-coded dev_part parsing

2023-03-01 Thread Rasmus Villemoes
: Simon Glass Signed-off-by: Rasmus Villemoes --- cmd/read.c | 32 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/cmd/read.c b/cmd/read.c index fecfadaa1f..8645db49bb 100644 --- a/cmd/read.c +++ b/cmd/read.c @@ -15,50 +15,34 @@ int do_read(struct

[PATCH v2 2/5] cmd: introduce 'write' command

2023-03-01 Thread Rasmus Villemoes
It's almost no extra code to hook up a buddy to the 'read' command. In fact, since the command is passed its own 'struct cmd_tbl', we can use the exact same callback, and let it figure out for itself whether it was invoked as "read" or "write". Sign

[PATCH v2 4/5] sandbox: enable CMD_WRITE

2023-03-01 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index ccbc18aad0..b7737814af 100644 --- a/configs/sandbox64_defconfig +++ b/configs

[PATCH v2 3/5] doc: document read/write commands

2023-03-01 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- doc/usage/cmd/read.rst | 40 doc/usage/index.rst| 1 + 2 files changed, 41 insertions(+) create mode 100644 doc/usage/cmd/read.rst diff --git a/doc/usage/cmd/read.rst b/doc/usage/cmd/read.rst new file mode 100644

[PATCH v2 5/5] test: add tests of 'read' and 'write' shell commands

2023-03-01 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- test/cmd/Makefile | 1 + test/cmd/rw.c | 104 ++ 2 files changed, 105 insertions(+) create mode 100644 test/cmd/rw.c diff --git a/test/cmd/Makefile b/test/cmd/Makefile index 2ffde8703a..7848f348bc 100644

[PATCH v3 0/5] improve 'read' command, add 'write' command

2023-03-02 Thread Rasmus Villemoes
2, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 1.0, 1.1.0, 1.1.1, 2.0.0a1, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1) ERROR: No matching distribution found for MarkupSafe==2.1.1 And then I give up. Rasmus Villemoes (5): cmd: read: use part_get_info_by_dev_and_name_or_num() in

[PATCH v3 1/5] cmd: read: use part_get_info_by_dev_and_name_or_num() instead of open-coded dev_part parsing

2023-03-02 Thread Rasmus Villemoes
: Simon Glass Signed-off-by: Rasmus Villemoes --- cmd/read.c | 32 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/cmd/read.c b/cmd/read.c index fecfadaa1f..8645db49bb 100644 --- a/cmd/read.c +++ b/cmd/read.c @@ -15,50 +15,34 @@ int do_read(struct

[PATCH v3 2/5] cmd: introduce 'write' command

2023-03-02 Thread Rasmus Villemoes
It's almost no extra code to hook up a buddy to the 'read' command. In fact, since the command is passed its own 'struct cmd_tbl', we can use the exact same callback, and let it figure out for itself whether it was invoked as "read" or "write". Re

[PATCH v3 3/5] doc: document read/write commands

2023-03-02 Thread Rasmus Villemoes
n for both are similarly kept in sync, and to avoid duplication, document them both in read.rst, and add a stub write.rst referring to read.rst. Signed-off-by: Rasmus Villemoes --- doc/usage/cmd/read.rst | 44 + doc/usage/cmd/write.rst | 6 ++ doc/usage

[PATCH v3 4/5] sandbox: enable CMD_WRITE

2023-03-02 Thread Rasmus Villemoes
Reviewed-by: Simon Glass Signed-off-by: Rasmus Villemoes --- configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index ccbc18aad0..b7737814af 100644 --- a/configs

[PATCH v3 5/5] test: add tests of 'read' and 'write' shell commands

2023-03-02 Thread Rasmus Villemoes
Reviewed-by: Simon Glass Signed-off-by: Rasmus Villemoes --- test/cmd/Makefile | 1 + test/cmd/rw.c | 104 ++ 2 files changed, 105 insertions(+) create mode 100644 test/cmd/rw.c diff --git a/test/cmd/Makefile b/test/cmd/Makefile index

using binman sym for size of u-boot itb

2023-03-03 Thread Rasmus Villemoes
On imx8mp, binman is heavily used for the assembling of all the various pieces. Partly for my own future reference: There's u-boot-spl-ddr which is u-boot-spl.bin with the DDR firmware blobs tacked on at the end, and the sizes and positions of those blobs then updated via the binman syms mechanism

[PATCH] nvedit: simplify do_env_indirect()

2023-03-06 Thread Rasmus Villemoes
Instead of calling env_get(from) up to three times, just do it once, computing the value we will put into 'to' and error out if that is NULL (i.e. no 'from' variable and no default provided). No functional change. Signed-off-by: Rasmus Villemoes --- cmd/nvedit.c | 11

Re: [PATCH 1/1] lib/vsprintf.c: fix integer overflow in vsprintf

2023-03-09 Thread Rasmus Villemoes
On 09/03/2023 03.12, Ying-Chun Liu (PaulLiu) wrote: > From: Tom Cherry > > vsnprintf_internal() adds 'size' to 'buf' and vsprintf() sets 'size' > to 'INT_MAX' which can overflow. Yes, and? vsprintf_internal then detects that by looking at whether "end" is now before "buf", and if so corrects it

[PATCH] sysinfo: gpio: fix loop over DT "revisions" array

2023-03-10 Thread Rasmus Villemoes
ognize -EOVERFLOW as "not that many elements present" (and we have a test that specifically ensures that dev_read_u32_index() returns exactly that). So just drop the i < priv->gpio_num condition. While in here, fix the weird placement of the default: keyword. Signed-off-by: Ras

Re: i.MX8MP SPL failures due to memory corruption/overflow?

2023-03-15 Thread Rasmus Villemoes
On 15/03/2023 16.24, Frieder Schrempf wrote: > On 15.03.23 15:42, Frieder Schrempf wrote: >> On 15.03.23 15:17, Michael Nazzareno Trimarchi wrote: >>> Hi >>> >>> On Wed, Mar 15, 2023 at 3:13 PM Frieder Schrempf >>> wrote: Hi, I'm trying to bring up a new board based on the i.MX

Re: [PATCH v3 0/5] improve 'read' command, add 'write' command

2023-03-16 Thread Rasmus Villemoes
On 02/03/2023 09.12, Rasmus Villemoes wrote: > The first patch simplies do_read somewhat by making use of an existing > helper instead of parsing the dev_part string manually. As a bonus > (and my actual motivation), it now understands dev#partname syntax - > hard-coded partition nu

[PATCH] scripts/Makefile.lib: also consider $(CONFIG_SYS_BOARD)-u-boot.dtsi

2023-03-17 Thread Rasmus Villemoes
upported. It's quite natural to look for a file named after CONFIG_SYS_BOARD, with lower precedence of course than a -u-boot.dtsi file with the same basename as the .dts, but higher than CONFIG_SYS_SOC. Signed-off-by: Rasmus Villemoes --- Of course, this can cause unwanted changes for existing

[PATCH] gpio: allow passing NULL to gpio_request_by_line_name() to search all gpio controllers

2023-03-17 Thread Rasmus Villemoes
The API is more convenient to use if one doesn't have to know upfront which gpio controller has a line with the name one is searching for, and arrange to look that device up somehow. Or implement this loop oneself. Signed-off-by: Rasmus Villemoes --- drivers/gpio/gpio-uclass.

Re: [PATCH] scripts/Makefile.lib: also consider $(CONFIG_SYS_BOARD)-u-boot.dtsi

2023-03-18 Thread Rasmus Villemoes
On 18/03/2023 21.20, Simon Glass wrote: >> >> Now, the only way to be really sure is to build the world >> with/without this patch and check if any .dtb file changes, but I >> don't have the means to do that. But I do notice that >> >> >> doc/develop/devicetree/control.rst | 1 + >> scripts/Makef

Re: [PATCH] gpio: allow passing NULL to gpio_request_by_line_name() to search all gpio controllers

2023-03-18 Thread Rasmus Villemoes
On 18/03/2023 21.20, Simon Glass wrote: > Hi Rasmus, > > On Fri, 17 Mar 2023 at 14:13, Rasmus Villemoes > wrote: >> >> The API is more convenient to use if one doesn't have to know upfront >> which gpio controller has a line with the name one is searching for,

[PATCH] ARM: imx: imx8mp: fix enable_i2c_clk

2023-03-22 Thread Rasmus Villemoes
t;ARM: imx: imx8mp: Enable support for i2c5 and i2c6 on i.MX8MP" Signed-off-by: Rasmus Villemoes --- arch/arm/mach-imx/imx8m/clock_imx8mm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mm.c b/arch/arm/mach-imx/imx8m/clock_imx8

Re: [PATCH 5/4] mkimage: update man page and -h output

2023-10-11 Thread Rasmus Villemoes
On 11/10/2023 20.37, Tom Rini wrote: > On Thu, Sep 28, 2023 at 10:02:57AM +0200, Rasmus Villemoes wrote: > >> The man page correctly said that -B was ignored without -E, while the >> `mkimage -h` output suggested otherwise. Now that -B can actually be >> used by its

Re: [PATCH 5/4] mkimage: update man page and -h output

2023-10-13 Thread Rasmus Villemoes
On 12/10/2023 04.17, Sean Anderson wrote: > I was hoping you would respond to my most-recent email regarding this > series. > In particular: > > | Why does mkimage have to do this? Can't you just use truncate or, in a > | binman context, align-size? In both cases, that just affects the size of t

[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 0/2] serial: introduce CONFIG_CONSOLE_FLUSH_ON_NEWLINE

2023-10-16 Thread Rasmus Villemoes
rt IP 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 comm

[PATCH v2 2/2] serial: introduce CONFIG_CONSOLE_FLUSH_ON_NEWLINE

2023-10-16 Thread Rasmus Villemoes
ad 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

Re: [PATCH] kbuild: use which $(DTC) as a dependency

2023-10-17 Thread Rasmus Villemoes
On 17/10/2023 12.44, Richard Marko wrote: > If we try to build using external dtc using > >> make DTC=dtc > > we get a confusing error like > >> make[2]: *** No rule to make target 'arch/x86/dts/bayleybay.dtb', >> needed by 'dtbs'. Stop. > > Workaround is to use > >> make DTC=$( which dtc ) >

commit 83c63f0d118 (led: Move OF "label" property parsing to core)

2023-10-17 Thread Rasmus Villemoes
Hi, I'm trying to resurrect an old submission of a driver for ti,lp5562, so had occasion to dig into drivers/led/. And I think commit 83c63f0d118 is buggy or at least incomplete. Many of the drivers that were subsequently modified to not do that "label" parsing rely, in their .probe method, on th

Re: commit 83c63f0d118 (led: Move OF "label" property parsing to core)

2023-10-18 Thread Rasmus Villemoes
On 17/10/2023 17.33, Marek Vasut wrote: > On 10/17/23 15:29, Rasmus Villemoes wrote: >> static int led_gpio_bind(struct udevice *parent) >> { ... >>     ret = device_bind_driver_to_node(parent, "gpio_led", >> ofnode_get_name(no

Re: commit 83c63f0d118 (led: Move OF "label" property parsing to core)

2023-10-18 Thread Rasmus Villemoes
On 18/10/2023 09.43, Rasmus Villemoes wrote: > On 17/10/2023 17.33, Marek Vasut wrote: >> Which string ? The "bcm6753-led" is driver name , so that would have to >> be parametrized. > > Exactly. The only difference between the two examples (apart from the > sco

[PATCH 0/6] some LED patches

2023-10-19 Thread Rasmus Villemoes
ork with the linux driver), most of the logic is unchanged from Doug's original patch, so he is still listed as author. Doug Zobel (1): led: add TI LP5562 LED driver Rasmus Villemoes (5): led-uclass: do not create fallback label for top-level node led-uclass: honour ->label field popul

[PATCH 1/6] led-uclass: do not create fallback label for top-level node

2023-10-19 Thread Rasmus Villemoes
) [similar to what e3aa76644c2a did, but that then vanished with the next commit.] Fixes: 83c63f0d1185 ("led: Move OF "label" property parsing to core") Signed-off-by: Rasmus Villemoes --- drivers/led/led-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/

[PATCH 2/6] led-uclass: honour ->label field populated by driver's own .bind

2023-10-19 Thread Rasmus Villemoes
If the driver's own .bind method has populated uc_plat->label, don't override that. This is necessary for an upcoming driver for ti,lp5562, where the DT binding unfortunately says to use "chan-name" and not "label". Signed-off-by: Rasmus Villemoes --- drivers/

[PATCH 3/6] led: introduce led_bind_generic()

2023-10-19 Thread Rasmus Villemoes
All existing drivers in drivers/led/ contain a .bind method that does exactly the same thing, with just the actual driver name differing. Create a helper so all those individual methods can be changed to one-liners. Signed-off-by: Rasmus Villemoes --- drivers/led/led-uclass.c | 18

[PATCH 4/6] led: led_gpio: use led_bind_generic() helper

2023-10-19 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- drivers/led/led_gpio.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c index fbed151b5d..71421de628 100644 --- a/drivers/led/led_gpio.c +++ b/drivers/led/led_gpio.c @@ -11,7

[PATCH 5/6] led: led_pwm: use led_bind_generic() helper

2023-10-19 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- drivers/led/led_pwm.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/led/led_pwm.c b/drivers/led/led_pwm.c index 7c8eae9337..ae6de3087a 100644 --- a/drivers/led/led_pwm.c +++ b/drivers/led/led_pwm.c @@ -9,7 +9,6

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

2023-10-19 Thread Rasmus Villemoes
. As our boards only have the R,G,B outputs connected, I have not actually tested how the white channel behaves, but the R,G,B work exactly as expected. [1] https://lore.kernel.org/u-boot/1547150757-1561-1-git-send-email-douglas.zo...@climate.com/ Cc: Doug Zobel Signed-off-by: Rasmus Vill

Re: [PATCH v2] make: check if DTC variable is an absolute path

2023-10-20 Thread Rasmus Villemoes
On 19/10/2023 15.04, Richard Marko wrote: > If we try to build using external dtc using > >> make DTC=dtc > > we get a confusing error like > >> make[2]: *** No rule to make target 'arch/x86/dts/bayleybay.dtb', >> needed by 'dtbs'. Stop. > > Workaround is to use > >> make DTC=$( which dtc ) >

Re: [PATCH 1/6] led-uclass: do not create fallback label for top-level node

2023-10-23 Thread Rasmus Villemoes
On 19/10/2023 15.51, Marek Vasut wrote: > On 10/19/23 11:58, Rasmus Villemoes wrote: >> Many existing drivers, and led-uclass itself, rely on uc_plat->label >> being NULL for the device representing the top node, as opposed to the >> child nodes representing individual L

Re: [PATCH 2/6] led-uclass: honour ->label field populated by driver's own .bind

2023-10-23 Thread Rasmus Villemoes
On 19/10/2023 15.54, Marek Vasut wrote: > On 10/19/23 11:58, Rasmus Villemoes wrote: >> If the driver's own .bind method has populated uc_plat->label, don't >> override that. This is necessary for an upcoming driver for ti,lp5562, >> where the DT binding unfortu

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

2023-10-23 Thread Rasmus Villemoes
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 channel LED controller. Supports >> independent on/off control of all 4 channels. Supports LED_BLINK on 3 >> independent ch

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

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 siz

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' > > ⬢[z

Re: [REGRESSION] imx: spl_imx_romapi: boot loops

2023-10-24 Thread Rasmus Villemoes
tead "(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: > >> >

Re: [PATCH v3] cli: Consume invalid escape sequences early

2023-10-25 Thread Rasmus Villemoes
CONFIG_AUTOBOOT_STOP_STR="\x1b" and pressing to stop autoboot did have that side-effect of swallowing the first following char. But I never found the time to dig into why or if it was even fixable. Tom has already applied this, but nevertheless Tested-by: Rasmus Villemoes Rasmus

Re: [REGRESSION] imx: spl_imx_romapi: boot loops

2023-10-25 Thread Rasmus Villemoes
On 25/10/2023 18.01, Marcel Ziswiler wrote: > Hi Rasmus > > On Tue, 2023-10-24 at 16:32 +0200, Rasmus Villemoes wrote: >> What am I missing? > > Good question. Some more debugging revealed that we are missing 464 bytes at > the beginning of the buffer. Why > woul

Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

2023-10-26 Thread Rasmus Villemoes
pagesize. Fix this by recording the actual bytes downloaded. > > Fixes: 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of > spl_load_simple_fit() to get full FIT size") > Signed-off-by: Marcel Ziswiler > Thanks for reporting and fixing this, and sorry for the trouble. Acked-by: Rasmus Villemoes

Re: [PATCH 1/4] mkimage: also honour -B even without external data

2023-11-06 Thread Rasmus Villemoes
On 04/11/2023 20.43, Simon Glass wrote: > Hi Rasmus, > Are you planning a new version of this series? No. AFAICT there's nothing to be done on my end. Rasmus

Re: USB: error messages on DWC3 gadget endpoint dequeue

2023-09-15 Thread Rasmus Villemoes
On 15/09/2023 15.05, João Paulo Silva Gonçalves wrote: > Hi Marek, > > I was testing fastboot image download over usb for imx8mp (from usb > recovery patch of verdin-imx8mp) and i am having error messages on > endpoint request dequeue function of DWC3 gadget controller. However, > download is work

[PATCH 1/2] spl: make SYS_SPL_MALLOC depend on !(SPL_STACK_R && SPL_SYS_MALLOC_SIMPLE)

2023-09-15 Thread Rasmus Villemoes
fig am64x_evm_a53_defconfig am64x_evm_r5_defconfig am65x_evm_a53_defconfig am65x_hs_evm_a53_defconfig iot2050_defconfig j7200_evm_a72_defconfig j721e_evm_a72_defconfig j721s2_evm_a72_defconfig j721s2_evm_r5_defconfig verdin-am62_r5_defconfig Signed-off-by: Rasmus Villemoes --- common/s

[PATCH 0/2] make CONFIG_SPL_SYS_MALLOC_SIMPLE && CONFIG_SYS_SPL_MALLOC actually work

2023-09-15 Thread Rasmus Villemoes
e's a risk of some boards breaking. The solution for those boards will probably be to just drop CONFIG_SYS_SPL_MALLOC, since that hasn't actually done anything. Rasmus Villemoes (2): spl: make SYS_SPL_MALLOC depend on !(SPL_STACK_R && SPL_SYS_MALLOC_SIMPL

[PATCH 2/2] malloc_simple: add mem_malloc_init_simple()

2023-09-15 Thread Rasmus Villemoes
variant of mem_malloc_init() which will actually update the bookkeeping variables relevant to the actual and active malloc() implementation. Signed-off-by: Rasmus Villemoes --- common/dlmalloc.c | 2 +- common/malloc_simple.c | 7 +++ include/malloc.h | 7 +-- 3 files c

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

2022-09-27 Thread Rasmus Villemoes
t using __udelay() 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/

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

2022-09-27 Thread Rasmus Villemoes
: 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 0/4] handle watchdogs during keyed autoboot

2022-09-27 Thread Rasmus Villemoes
working the test, so 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-b

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

2022-09-27 Thread Rasmus Villemoes
id all 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/

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

2022-09-27 Thread Rasmus Villemoes
bling 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

[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

Re: CONFIG_DEFAULT_ENV_FILE Question

2022-09-29 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
. Considering 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

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
es matter 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

[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

commit 787f04bb6a - imx: add USB2_BOOT type

2022-10-07 Thread Rasmus Villemoes
Hi Peng It seems that commit 787f04bb6a (imx: add USB2_BOOT type) broke our board logic which relies on whether get_boot_device() returns USB_BOOT or not. Instrumenting get_boot_device() shows that on our imx8mp board, boot_instance is 3 when we're booting over USB, so boot_dev becomes 20 instead

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

2022-08-09 Thread Rasmus Villemoes
On 08/08/2022 21.07, Tom Rini wrote: > On Thu, May 12, 2022 at 09:33:09AM +0200, Rasmus Villemoes wrote: > >> Similar to what was done for the FEC driver in commit >> 89b5bd54c1a4 (net: fec: Allow the PHY node to be retrieved), make sure >> the PHY is associated with th

Re: default environment append from kconfig

2022-08-09 Thread Rasmus Villemoes
On 09/08/2022 12.47, Francesco Dolcini wrote: > Hello all, > is there any kconfig mechanism in u-boot to append environment variable to the > default one? > Well, despite the name, CONFIG_EXTRA_ENV_SETTINGS is not settable via kconfig, but only from board header file. And while it works, it's rat

[PATCH] phy: add of_set_phy_supported() helper, call from phy_config()

2022-08-09 Thread Rasmus Villemoes
property in their DT node, but that's orthogonal to what the phy supports.) Add a similar helper in U-Boot, and call it from phy_config(). Signed-off-by: Rasmus Villemoes --- Resending, this time including the u-boot list in recipients. Sorry for the duplicate. drivers/net/phy/phy.c | 2

Re: [PATCH] arm64: explicitly disable pointer authentication instructions

2022-08-09 Thread Rasmus Villemoes
On 10/08/2022 04.38, Peng Fan wrote: > > > On 8/8/2022 10:12 PM, Rasmus Villemoes wrote: >> The Yocto project builds their aarch64 cross-compiler with the >> configure knob --enable-standard-branch-protection, which means that >> their gcc behaves as if -mbranch-pr

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

2022-08-19 Thread Rasmus Villemoes
elative 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] fdt_support: add optional board_rng_seed() hook

2022-08-22 Thread Rasmus Villemoes
nel would still go through the same 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

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

2022-08-23 Thread Rasmus Villemoes
ike to 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_CO

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

2022-08-23 Thread Rasmus Villemoes
clk() 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

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 to

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 >>> destinati

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

2022-08-23 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 /chosen

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 hi

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-28 Thread Rasmus Villemoes
, 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-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: >>>>

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 f

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 me

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: htt

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 h

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

2022-09-05 Thread Rasmus Villemoes
On 02/09/2022 21.59, Simon Glass wrote: > Hi Rasmus, > > On Fri, 2 Sept 2022 at 01:00, Rasmus Villemoes > wrote: >> >>> What shall we do with this patch? Apply it? >> >> Well, that's probably not for me to decide (I guess Tom is), but I'd >>

[PATCH] soc: soc_ti_k3: fix revision array bounds checks

2023-03-24 Thread Rasmus Villemoes
If rev is equal to the array size, we'll access the array one-past-the-end. Signed-off-by: Rasmus Villemoes --- drivers/soc/soc_ti_k3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/soc_ti_k3.c b/drivers/soc/soc_ti_k3.c index 8af0ac7051..2182532236 1

[PATCH] stm32mp: fix various array bounds checks

2023-03-24 Thread Rasmus Villemoes
In all these cases, the index on the LHS is immediately afterwards used to access the array appearing in the ARRAY_SIZE() on the RHS - so if that index is equal to the array size, we'll access one-past-the-end of the array. Signed-off-by: Rasmus Villemoes --- Patch generated with '-U

[PATCH] i2c: designware_i2c: remove apparently redundant read of 'i2c, speeds' DT property

2023-03-24 Thread Rasmus Villemoes
is the only C code referencing "i2c,speeds"), so it seems pointless to insist that it's there. Signed-off-by: Rasmus Villemoes --- drivers/i2c/designware_i2c_pci.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/i2c/designware_i2c_pci.c b/drivers/i2c

[PATCH] phy: broadcom: don't duplicate genphy_startup

2023-03-28 Thread Rasmus Villemoes
Functionally, bcm_cygnus_startup() is an exact copy of genphy_startup(). Signed-off-by: Rasmus Villemoes --- drivers/net/phy/broadcom.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c index 566fcb8de7

[PATCH] phy: realtek: don't duplicate genphy_startup

2023-03-28 Thread Rasmus Villemoes
rtl8211e_startup() is an exact copy of genphy_startup(). Use that instead of duplicating it. Signed-off-by: Rasmus Villemoes --- drivers/net/phy/realtek.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c

[PATCH] serial-uclass: drop redundant code in serial_check_stdout()

2023-03-29 Thread Rasmus Villemoes
As the updated comment says, this is already handled by fdt_path_offset_namelen() itself. Signed-off-by: Rasmus Villemoes --- drivers/serial/serial-uclass.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/serial/serial-uclass.c b/drivers

Re: [PATCH] scripts/Makefile.lib: also consider $(CONFIG_SYS_BOARD)-u-boot.dtsi

2023-04-12 Thread Rasmus Villemoes
On 19/03/2023 20.29, Simon Glass wrote: > Hi Rasmus, > > On Sun, 19 Mar 2023 at 13:34, Rasmus Villemoes > wrote: >> >> On 18/03/2023 21.20, Simon Glass wrote: >> >>>> >>>> Now, the only way to be really sure is to build the world >>&

[PATCH] uclass: add uclass_find_device_by_phandle_id() helper

2023-04-13 Thread Rasmus Villemoes
. Signed-off-by: Rasmus Villemoes --- drivers/core/uclass.c | 42 ++ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 1762a0796d..3a919104a6 100644 --- a/drivers/core/uclass.c +++ b/drivers/core

[PATCH] dm: core: introduce uclass_get_device_by_of_path()

2023-04-13 Thread Rasmus Villemoes
ly getting a device via device tree path (including being given as an alias). Implement it in terms of ofnode rather than raw offsets so that this will work whether live tree is enabled or not. Signed-off-by: Rasmus Villemoes --- drivers/core/uclass.c | 6 ++ include/dm/uclass.h | 17

Re: commit 787f04bb6a - imx: add USB2_BOOT type

2023-04-16 Thread Rasmus Villemoes
On 26/10/2022 01.42, Rasmus Villemoes wrote: > 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 o

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

2023-04-18 Thread Rasmus Villemoes
On 19/04/2023 03.49, Simon Glass wrote: > Hi Rasmus, > > Returning to this old thread... > >> >> There's no problematic device tree, having two nodes with the same >> (base)name is perfectly fine and in fact sometimes expected/required (in >> the cases where a node name is standardized; e.g. havi

[PATCH] gpio-uclass: fix off-by-one in gpio_request_list_by_name_nodev()

2023-04-19 Thread Rasmus Villemoes
By the time we jump to the err label, count represents the number of gpios we've succesfully requested. So by subtracting one, we fail to free the most recently requested. Signed-off-by: Rasmus Villemoes --- drivers/gpio/gpio-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

  1   2   3   4   5   6   7   8   9   10   >