[PATCH 2/6] net: compare received length to sizeof(ip_hdr), not sizeof(ip_udp_hdr)

2022-10-14 Thread Rasmus Villemoes
ecksum(), that would then lead to accessing ~4G of address space, very likely leading to a crash. Signed-off-by: Rasmus Villemoes --- net/net.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/net.c b/net/net.c index 536731245b..86b1d90159 100644 --- a/net/net.c +++ b/

[PATCH 1/6] net: improve check for no IP options

2022-10-14 Thread Rasmus Villemoes
There's no reason we should accept an IP packet with a malformed IHL field. So ensure that it is exactly 5, not just <= 5. Signed-off-by: Rasmus Villemoes --- net/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/net.c b/net/net.c index 81905f6315..536731245b 100

[PATCH 0/6] broken CVE fix (b85d130ea0ca)

2022-10-14 Thread Rasmus Villemoes
the "ensure the payload has non-negative size" to the first place we can check that instead of relying on that check to happen in several places. Rasmus Villemoes (6): net: improve check for no IP options net: compare received length to sizeof(ip_hdr), not sizeof(ip_udp_hdr) net: (actua

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

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] arm64: explicitly disable pointer authentication instructions

2022-08-10 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] net: dwc_eth_qos: fix double resource leak in eqos_remove()

2022-08-04 Thread Rasmus Villemoes
On 16/05/2022 02.26, Ramon Fried wrote: > On Wed, May 11, 2022 at 5:13 PM Rasmus Villemoes > wrote: >> >> Not only does eqos_remove() fail to free the buffers that have been >> allocated by eqos_probe_resources_core(), it repeats those allocations >> and t

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

2022-08-04 Thread Rasmus Villemoes
On 16/05/2022 02.27, Ramon Fried wrote: > On Wed, May 11, 2022 at 5:58 PM Rasmus Villemoes > wrote: >> >> I have an iMX8MP with a ti,dp83867 phy in front of the eqos >> interface. The phy is Gbit capable - however, the C and D differential >> pairs are not physicall

Re: [PATCH 0/3] dwc_eth_qos PHY dt node fixups

2022-08-04 Thread Rasmus Villemoes
On 12/05/2022 09.33, Rasmus Villemoes wrote: > I need the dwc_eth_qos to gain a fix similar to what fec_mxc got in > 89b5bd54c1a4. > > The first patch provides a simplification around the logic for > fetching the phy's address, so there's one less case to worry about. > >

[PATCH] arm64: explicitly disable pointer authentication instructions

2022-08-08 Thread Rasmus Villemoes
-protection, this changes nothing. For the Yocto toolchain, this reduces the size of both SPL and U-Boot proper by about 3% for my imx8mp target. If you don't have a Yocto toolchain, the effect can easily be reproduced by applying this patch and changing =none to =standard. Signed-off-by: Rasmus

Why is arm64 built with -ffixed-r9 ?

2022-08-08 Thread Rasmus Villemoes
Looking at one of the .o.cmd files, I noticed that we build arm64 with both -ffixed-r9 and -ffixed-x18. The latter is obviously what we use for gd, but the former doesn't seem to serve any purpose on arm64, and just seems to be an accident of the makefile fragment organization. When I just remove

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

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

2022-08-09 Thread Rasmus Villemoes
n 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 | 20 +

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

Re: [PATCH] checkpatch.pl: Reword IS_ENABLED() warning

2022-08-03 Thread Rasmus Villemoes
On 02/08/2022 14.33, Tom Rini wrote: > While there are good reasons to use 'if (IS_ENABLED(CONFIG_...))' for > runtime tests, there's equally good reasons to use '#ifdef CONFIG_...' > for build time tests. Reword this message to hopefully avoid confusion. > > Cc: Simon Glass > Signed-off-by:

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

2022-08-01 Thread Rasmus Villemoes
On 31/07/2022 15.28, Tom Rini wrote: > On Sat, Jul 30, 2022 at 07:27:26PM -0600, Simon Glass wrote: >> Hi Tom, >> >> Shall I pick it up for the upcoming release? > > I don't think we should pick up the revert as I don't think there's > agreement that reverting this is the right step forward

Re: [PATCH 0/6] broken CVE fix (b85d130ea0ca)

2022-11-28 Thread Rasmus Villemoes
On 17/11/2022 01.32, Fabio Estevam wrote: > On Mon, Nov 14, 2022 at 10:04 AM Tom Rini wrote: >> >> On Mon, Nov 14, 2022 at 10:35:51AM +0100, Rasmus Villemoes wrote: >>> On 14/10/2022 19.43, Rasmus Villemoes wrote: >>>> tl;dr: b85d130ea0ca didn't fix the CVE(s)

Re: [PATCH] Revert "config: tools only: add VIDEO to build bmp_logo"

2023-01-25 Thread Rasmus Villemoes
On 25/01/2023 15.28, Rasmus Villemoes wrote: > On 20/01/2023 16.23, Tom Rini wrote: >> On Fri, Jan 20, 2023 at 08:30:27AM +, Peter Robinson wrote: >>> On Thu, Jan 19, 2023 at 2:02 PM Tom Rini wrote: >>>> >>>> On Thu, Jan 19, 2023 at 11:52:11AM +,

Re: [PATCH] Revert "config: tools only: add VIDEO to build bmp_logo"

2023-01-25 Thread Rasmus Villemoes
On 20/01/2023 16.23, Tom Rini wrote: > On Fri, Jan 20, 2023 at 08:30:27AM +, Peter Robinson wrote: >> On Thu, Jan 19, 2023 at 2:02 PM Tom Rini wrote: >>> >>> On Thu, Jan 19, 2023 at 11:52:11AM +, Peter Robinson wrote: On Thu, Jan 19, 2023 at 11:33 AM Fabio Estevam wrote: > >

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

2023-01-26 Thread Rasmus Villemoes
On 18/09/2022 08.13, Ramon Fried wrote: > On Tue, Aug 9, 2022 at 2:53 PM Rasmus Villemoes > wrote: >> >> Currently, U-Boot doesn't parse a "max-speed" DT property in a phy's >> DT node. That property is a standard binding which should be honoured, >> and in

Re: [PATCH] build_bug.h: Also define static_assert() when __CHECKER__ is defined

2023-01-26 Thread Rasmus Villemoes
On 26/01/2023 19.17, Christophe Leroy wrote: > When doing a build with C=2, the following failure is encountered on > several files: > > CHECK arch/powerpc/cpu/mpc8xxx/fsl_lbc.c > arch/powerpc/cpu/mpc8xxx/fsl_lbc.c: note: in included file (through >

Re: [PATCH] build_bug.h: Also define static_assert() when __CHECKER__ is defined

2023-01-27 Thread Rasmus Villemoes
On 27/01/2023 09.41, Christophe Leroy wrote: > > Also I have a problem with the following u-boot commit : aa9e891c633 > ("include/linux/stddef.h: avoid 'warning: preprocessor token offsetof > redefined'") > > On uboot mainline I get: > ... > What can we do about it ? At least reverting it

Re: [PATCH v2 09/87] Rename ARCH_NPCM7xx

2023-01-29 Thread Rasmus Villemoes
On 29/01/2023 01.57, Simon Glass wrote: > CONFIG options must not use lower-case letter. Why? Rasmus

Re: [PATCH v2 09/87] Rename ARCH_NPCM7xx

2023-01-30 Thread Rasmus Villemoes
On 30/01/2023 16.54, Tom Rini wrote: > On Sun, Jan 29, 2023 at 10:57:28PM +0100, Rasmus Villemoes wrote: >> On 29/01/2023 01.57, Simon Glass wrote: >>> CONFIG options must not use lower-case letter. >> >> Why? > > So, kconfiglib complains about these. Which I

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

2023-01-30 Thread Rasmus Villemoes
On 30/01/2023 18.16, Tom Rini wrote: > On Thu, Jan 26, 2023 at 05:54:51PM -0700, Simon Glass wrote: >> Hi Rasmus, >> >> On Tue, 9 Aug 2022 at 05:53, Rasmus Villemoes >> wrote: >>> >>> Currently, U-Boot doesn't parse a "max-speed" DT prope

Re: [PATCH] env: Allow string CONFIG options in the text environment

2022-11-07 Thread Rasmus Villemoes
On 04/11/2022 20.08, Simon Glass wrote: > Hi Holger, > > On Fri, 4 Nov 2022 at 08:20, Holger Brunck > wrote: >> >> Hi Simon, >> I got no time to try it yet but I have a general comment. >> >>> >>> Sometimes it is useful to include a CONFIG option that contains a string. >>> This is hard to do in

Re: [PATCH 0/6] broken CVE fix (b85d130ea0ca)

2022-11-14 Thread Rasmus Villemoes
On 14/10/2022 19.43, Rasmus Villemoes wrote: > tl;dr: b85d130ea0ca didn't fix the CVE(s), but did break tftp of > certain file sizes - which is somewhat lucky, since that's how I > noticed in the first place. > At this point it seems unlikely that any more comments or reviews w

Re: [PATCH 1/1] doc: fix documentation of enum gd_flags

2022-11-15 Thread Rasmus Villemoes
On 14/11/2022 10.25, Heinrich Schuchardt wrote: > Correct GD_FLG_CYCLIC_RUNNING documentation to match Sphinx style. > > Fixes: d7de5ef62935 ("cyclic: use a flag in gd->flags for recursion > protection") > Signed-off-by: Heinrich Schuchardt Ack, obviously. But now that I look in global_data.h

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

2023-03-10 Thread Rasmus Villemoes
recognize -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: Rasmus Villem

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

2023-03-17 Thread Rasmus Villemoes
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 boards. But a bit

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

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

[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.c | 7

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

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] 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 100644

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

2023-03-24 Thread Rasmus Villemoes
t;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/designware_i2c_pci.c index 46c2545f21..

[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 '-U5' to make

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

[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

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

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

2023-03-02 Thread Rasmus Villemoes
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() instead of open-coded dev_part parsing

[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

[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 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
-by: 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". Reviewed-by: Simon Glass S

[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] 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 --- 1 file

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

2023-02-17 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". Signed-off-by: Rasmus Villemo

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

2023-02-17 Thread Rasmus Villemoes
-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 cmd_tbl *cmdtp, int flag

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

2023-02-17 Thread Rasmus Villemoes
t "read error" doesn't. Rasmus Villemoes (2): cmd: read: use part_get_info_by_dev_and_name_or_num() instead of open-coded dev_part parsing cmd: introduce 'write' command cmd/Kconfig | 5 + cmd/Makefile | 1 + cmd/read.c | 61 ++

[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 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 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 0/5] improve 'read' command, add 'write' command

2023-03-01 Thread Rasmus Villemoes
t "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 disk). Rasmus Villemoe

[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
-by: 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". Signed-off-by: Rasmus Villemo

Re: commit 787f04bb6a - imx: add USB2_BOOT type

2023-04-17 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

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

2023-04-20 Thread Rasmus Villemoes
On 20/04/2023 00.40, Simon Glass wrote: > On Wed, 19 Apr 2023 at 22:11, Rasmus Villemoes > wrote: >> >> 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 re

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.

[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(-) diff

Re: Unable to implement board fdt-fixup for imx8m CPU

2023-04-25 Thread Rasmus Villemoes
On 25/04/2023 04.17, Hugo Villeneuve wrote: > I need to detect at runtime the SOM configuration from an EEPROM, and based > on that information adjust the ethernet PHY property inside the device tree. > > I have already done that with success, it works great and as a temporary > workaround I

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

2023-04-25 Thread Rasmus Villemoes
On 25/04/2023 21.31, Tom Rini wrote: > On Fri, Mar 17, 2023 at 11:26:39AM +0100, Rasmus Villemoes 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

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

2023-04-26 Thread Rasmus Villemoes
On 25/04/2023 22.09, Tom Rini wrote: > On Tue, Apr 25, 2023 at 10:02:01PM +0200, Rasmus Villemoes wrote: >> On 25/04/2023 21.31, Tom Rini wrote: >>> On Fri, Mar 17, 2023 at 11:26:39AM +0100, Rasmus Villemoes wrote: >>> >> >>>> Now, the onl

Re: [PATCH] dm: core: introduce uclass_get_device_by_of_path()

2023-04-29 Thread Rasmus Villemoes
On 28/04/2023 21.21, Simon Glass wrote: >> Looks fine but please add a test to ofnode.c > > Did you send a patch with a test? If so I missed it. No, sorry, haven't found the time yet. > Also please check my tweak to this (OF_REAL) Looks correct. Rasmus

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

2023-05-01 Thread Rasmus Villemoes
On 27/04/2023 19.31, Tom Rini wrote: >> >> Well, I'm not sure there's a use case for building all of the extra >> device trees. I think what I'll do right now is fire off a CI run (or a >> few, in the event of problems) where we just use the logic of >> 3609e1dc5f4d and see what falls down. > >

[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

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

[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
ice 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: [PATCH 1/1] efi_loader: stop watchdogs in ExitBootServices()

2023-02-02 Thread Rasmus Villemoes
On 03/02/2023 03.15, Simon Glass wrote: > Hi Tom, > > On Thu, 2 Feb 2023 at 10:22, Tom Rini wrote: >> >> Honestly, not really? Some good number of SoCs will start the watchdog >> in ROM and these are also the ones that don't allow you to turn it off. > > I hope not, that sounds really risky.

Re: [PATCH] RFC: nvedit: support doing one (extra) expansion of the value in "env set"

2023-02-02 Thread Rasmus Villemoes
On 14/02/2020 12.54, Rasmus Villemoes wrote: > > Assume BOOT_ORDER contains some permutation of "A B C", and for each > letter x, there's a BOOT_x_LEFT counter telling how many boot attempts > that slot has left. Now I want to find the first x in $BOOT_ORDER for > which

Re: [PATCH 1/1] efi_loader: stop watchdogs in ExitBootServices()

2023-02-01 Thread Rasmus Villemoes
On 31/01/2023 16.07, Tom Rini wrote: > On Tue, Jan 31, 2023 at 02:03:10PM +0200, Ilias Apalodimas wrote: >> Hi all, >> >> On Mon, Jan 30, 2023 at 01:30:49PM -0500, Tom Rini wrote: >>> On Mon, Jan 30, 2023 at 01:13:55PM -0500, Tom Rini wrote: On Sat, Jan 28, 2023 at 09:57:45AM +0100, Heinrich

Re: [PATCH v2 09/87] Rename ARCH_NPCM7xx

2023-02-01 Thread Rasmus Villemoes
On 31/01/2023 15.16, Simon Glass wrote: > Hi Rasmus, > > On Mon, 30 Jan 2023 at 14:12, Rasmus Villemoes > wrote: >> >> On 30/01/2023 16.54, Tom Rini wrote: >>> On Sun, Jan 29, 2023 at 10:57:28PM +0100, Rasmus Villemoes wrote: >>>> On 29/01/2023 01.57,

[PATCH] scripts/Makefile.dts: tweak logic for deciding which dtbs to build

2023-05-04 Thread Rasmus Villemoes
board, and should in turn enable us to massively simplify arch/*/dts/Makefile. Signed-off-by: Rasmus Villemoes --- Per https://lore.kernel.org/u-boot/20230503145438.GB1134230@bill-the-cat/ I guess one could apply make's built-in sort function since the RHS is very likely to contain some

[PATCH 1/2] imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT size

2023-05-23 Thread Rasmus Villemoes
should not be necessary with this, since we only ever memcpy() valid image data. This only affects the CONFIG_SPL_LOAD_FIT case - I don't have any hardware or experience with the CONFIG_SPL_LOAD_IMX_CONTAINER case, so I leave that alone for now. Signed-off-by: Rasmus Villemoes --- arch/arm/ma

[PATCH 2/2] imx: spl_imx_romapi.c: remove dead code

2023-05-23 Thread Rasmus Villemoes
These IS_ENABLED(CONFIG_SPL_LOAD_FIT) cases can no longer be reached, and thus get_fit_image_size() is also redundant. Signed-off-by: Rasmus Villemoes --- arch/arm/mach-imx/spl_imx_romapi.c | 25 ++--- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/arch/arm

Re: [PATCH 3/3] arm: dts: imx8mp: Sync with Linux 6.3

2023-05-22 Thread Rasmus Villemoes
On 20/05/2023 00.26, Adam Ford wrote: > On Fri, May 19, 2023 at 5:19 PM Tim Harvey wrote: >> >> On Wed, May 3, 2023 at 9:11 AM Tim Harvey wrote: >>> >> Fabio, >> >> Apparently I didn't do a very good job of testing this. This patch is >> causing imx8mp-venice-* and imx8mp-evk boards to no longer

[PATCH] imx8m: soc.c: demote some printfs to debug

2023-05-22 Thread Rasmus Villemoes
instances in soc.c. Signed-off-by: Rasmus Villemoes --- arch/arm/mach-imx/imx8m/soc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 5a4f8358c9..f5c82dff35 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arc

Re: [PATCH 1/2] Revert "lib: string: Fix strlcpy return value", fix callers

2023-08-07 Thread Rasmus Villemoes
On 14/07/2023 13.24, Matthias Schiffer wrote: > Both the Linux kernel and libbsd agree that strlcpy() should always > return strlen(src) and not include the NUL termination. The incorrect > U-Boot implementation makes it impossible to check the return value for > truncation, and breaks code

[PATCH] scripts/Makefile.lib: change spelling of $(srctree)/arch/$(ARCH)/dts in dtc_cpp_flags

2023-05-16 Thread Rasmus Villemoes
...@gmail.com/ Signed-off-by: Rasmus Villemoes --- scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 7b27224b5d..b67da75ba1 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -186,7 +186,7

[PATCH 1/2] kbuild: add dtc as dependency on .dtb files

2023-05-04 Thread Rasmus Villemoes
[Linux commit b8fc5b2157b1] If dtc is rebuilt, we should rebuild .dtb files with the new dtc. [Import notes: Back then there was no .dtbo rule in Linux's Makefile.lib, but the current .dtbo rules in Linux also have the $(DTC) dependency, so also add it to our .dtbo rule.] Signed-off-by: Rasmus

[PATCH 2/2] kbuild: Allow DTB overlays to built from .dtso named source files

2023-05-04 Thread Rasmus Villemoes
t .dts named overlays can be renamed with time. After all have been renamed we can remove the other rule. [Import notes: Adapt to U-Boot by using the cmd_dtco function instead of cmd_dtc just like the current .dts -> .dtbo rule.] Signed-off-by: Rasmus Villemoes --- scripts/Makefile.lib | 3 +++ 1

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

2023-05-04 Thread Rasmus Villemoes
On 03/05/2023 16.54, Tom Rini wrote: > On Wed, May 03, 2023 at 09:51:58AM -0400, Tom Rini wrote: >> On Mon, May 01, 2023 at 10:49:22AM +0200, Rasmus Villemoes wrote: >>> On 27/04/2023 19.31, Tom Rini wrote: >>>>> >>>>> Well, I'm not sure

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

2023-05-03 Thread Rasmus Villemoes
On 01/05/2023 18.32, Simon Glass wrote: > Hi Rasmus, > > On Mon, 1 May 2023 at 02:49, Rasmus Villemoes > wrote: >> >> On 27/04/2023 19.31, Tom Rini wrote: >>>> >>>> Well, I'm not sure there's a use case for building all of the extra >>>&

Re: [PATCH v2 1/1] Makefile: pass -ansi option to cmd_gen_envp

2023-12-20 Thread Rasmus Villemoes
On 20/12/2023 09.59, Sébastien Szymanski wrote: > Without the '-ansi' option, the 'linux' string in env. files is replaced > with the string '1 '. For example, in the > board/armadeus/opos6uldev/opos6uldev.env file, > > kernelimg=opos6ul-linux.bin > > becomes > > kernelimg=opos6ul-1 .bin > >

[PATCH v2 1/8] cmd/mem.c: use memmove in do_mem_cp()

2024-01-03 Thread Rasmus Villemoes
), which is of course completely in the noise with all the string processing that a shell command does. Reviewed-by: Simon Glass Signed-off-by: Rasmus Villemoes --- cmd/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/mem.c b/cmd/mem.c index 66c2d36a148..c696b92a274

[PATCH v2 4/8] cmd/command.c: relax length check in cmd_get_data_size()

2024-01-03 Thread Rasmus Villemoes
Just check that the length is at least 2. This allows passing strings like ".b", which can be convenient when constructing tests (i.e. parametrizing the suffix used). Signed-off-by: Rasmus Villemoes --- common/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --gi

[PATCH v2 0/8] cmd/mem.c fixups

2024-01-03 Thread Rasmus Villemoes
into patch 1. 3 and 4 are preparations for the test cases added in patch 5. 6 is an actual fix; 32 bit targets wrongly list .q in their help texts. 7 and 8 fix stale documentation. Rasmus Villemoes (8): cmd/mem.c: use memmove in do_mem_cp() doc/usage/cmd/cp.rst: document that overlapping

[PATCH v2 6/8] cmd/mem.c: fix wrong use of ifdef, drop pointless SUPPORT_64BIT_DATA macro

2024-01-03 Thread Rasmus Villemoes
the proper "#if" instead. There's really no point defining another similarly-named macro with exactly the same value, so just use MEM_SUPPORT_64BIT_DATA throughout. Signed-off-by: Rasmus Villemoes --- cmd/mem.c | 38 ++ 1 file changed, 18 insertions(+), 2

[PATCH v2 2/8] doc/usage/cmd/cp.rst: document that overlapping regions are supported

2024-01-03 Thread Rasmus Villemoes
Now that the cp command is changed to use memmove() internally, update the documentation to explicitly state that overlapping regions are allowed. Signed-off-by: Rasmus Villemoes --- doc/usage/cmd/cp.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/usage/cmd/cp.rst

[PATCH v2 3/8] cmd/command.c: constify "arg" argument of cmd_get_data_size()

2024-01-03 Thread Rasmus Villemoes
This function obviously does not and must not modify "arg". Change the prototype to allow passing an argument of type "const char*" without requiring a cast. Signed-off-by: Rasmus Villemoes --- common/command.c | 2 +- include/command.h | 2 +- 2 files changed, 2 insert

[PATCH v2 5/8] test: add test of "cp" shell command

2024-01-03 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- test/cmd/Makefile | 1 + test/cmd/mem_copy.c | 169 2 files changed, 170 insertions(+) create mode 100644 test/cmd/mem_copy.c diff --git a/test/cmd/Makefile b/test/cmd/Makefile index e296ba1192b..b26b5b1ea85

[PATCH v2 7/8] README: drop mention of MEM_SUPPORT_64BIT_DATA

2024-01-03 Thread Rasmus Villemoes
s expected. It would probably be possible to make all such code explicitly use u64 and thus make it work on 32 bit targets, but until that is done, do not pretend that it's ok to override the automatic value of MEM_SUPPORT_64BIT_DATA. Signed-off-by: Rasmus Villemoes --- README | 3 --- 1 file

[PATCH v2 8/8] doc: drop references to non-existing CONFIG_MEM_SUPPORT_64BIT_DATA

2024-01-03 Thread Rasmus Villemoes
Such a config option does not exist. Rephrase, and avoid mentioning MEM_SUPPORT_64BIT_DATA, which is an implementation detail. Signed-off-by: Rasmus Villemoes --- doc/usage/cmd/cmp.rst | 2 +- doc/usage/cmd/cp.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/usage

Re: [PATCH v9 2/2] arm64: boot: Support Flat Image Tree

2024-01-09 Thread Rasmus Villemoes
On 14/12/2023 08.33, Masahiro Yamada wrote: > On Thu, Dec 14, 2023 at 3:12 PM Masahiro Yamada wrote: >> > One more question to confirm if I can use this > for my practical use-cases. > > Is U-Boot able to handle FIT (includes kernel + DTs) > and a separate initrd? > > # bootm : > > >

[PATCH] cmd/mem.c: use memmove in do_mem_cp()

2023-12-19 Thread Rasmus Villemoes
), which is of course completely in the noise with all the string processing that a shell command does. Signed-off-by: Rasmus Villemoes --- cmd/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/mem.c b/cmd/mem.c index 66c2d36a148..c696b92a274 100644 --- a/cmd/mem.c

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

2023-11-29 Thread Rasmus Villemoes
On 29/11/2023 16.23, Tom Rini wrote: > On Fri, Nov 17, 2023 at 12:38:11PM +0100, Rasmus Villemoes wrote: > >> --- >> doc/device-tree-bindings/leds/leds-lp5562.txt | 63 ++ >> drivers/led/Kconfig | 8 + >> drivers/led/Makefile

<    3   4   5   6   7   8   9   >