Re: [PATCH 5/6] i2c: efi: avoid 64-bit division

2024-08-14 Thread Ahmad Fatoum
Hello Tomas, On 15.08.24 07:53, Tomas Marek wrote: > Hello Ahmad, > > Thanks for maintenance of the Barebox EFI. > > On Wed, Aug 14, 2024 at 11:24:23AM +0200, Ahmad Fatoum wrote: >> I2C message length is 16 bit, so doing a 64-bit division is overkill. >> Let's remove the cast and just rely on th

[PATCH 1/2] include: linux/math.h: promote DIV_ROUND_UP_ULL args to 64-bit

2024-08-14 Thread Ahmad Fatoum
DIV_ROUND_DOWN_ULL promotes division arguments to 64-bit, but DIV_ROUND_UP_ULL did so only for the division, not the addition for the round up. This would lead to a wrong result when the 32-bit addition wraps around. Linux has an explicit cast to fix this, so do likewise in barebox. Signed-off-by

[PATCH 2/2] i2c: efi: use DIV_ROUND_UP_ULL instead of native division

2024-08-14 Thread Ahmad Fatoum
64-bit division on 32-bit platforms is normally handled by libgcc, which, like the kernel, we don't link against in barebox. Instead we have a number of division helpers that should be used for 64-bit division, which either expand to a normal division if possible or to an out-of-line division. Mak

Re: [PATCH 5/6] i2c: efi: avoid 64-bit division

2024-08-14 Thread Tomas Marek
Hello Ahmad, Thanks for maintenance of the Barebox EFI. On Wed, Aug 14, 2024 at 11:24:23AM +0200, Ahmad Fatoum wrote: > I2C message length is 16 bit, so doing a 64-bit division is overkill. > Let's remove the cast and just rely on the usual integer promotion > to 32-bit. > > Cc: Tomas Marek > S

[PATCH 2/3] openrisc: implement C debug_ll for NS16550

2024-08-14 Thread Ahmad Fatoum
The early startup code is written in assembly, so the C DEBUG_LL implementation isn't as useful, but it can still come in handy as debugging aid, so let's add it. Signed-off-by: Ahmad Fatoum --- arch/openrisc/Kconfig| 1 + arch/openrisc/include/asm/debug_ll.h | 36 ++

[PATCH 1/3] debug_ll: ns16550: fix prototype in documentation comment

2024-08-14 Thread Ahmad Fatoum
The functions were changed to take a base parameter, so they can be used with PBL console instead of just DEBUG_LL. Update the comment to reflect the current state of the code. Fixes: e64990099c8f ("debug_ll ns16550: Add base address argument to register functions") Signed-off-by: Ahmad Fatoum -

[PATCH 3/3] ci: container: downgrade OpenRISC toolchain from 14.2.0 to 13.1.0

2024-08-14 Thread Ahmad Fatoum
The newest toolchain bump breaks OpenRISC start-up under QEMU: The console is now completely silent. Steps to reproduce the hang: CONTAINER_GCC13=bdfdd5effcc169ebf8a9df2f1a5956ef34549682f78b450a97aceea2afd76f7a CONTAINER_GCC14=fa35adeae1ab49b4dc09fc3bf4d68f92541a0d1f41e0df91a4879fd331e4b592

Re: [PATCH 1/6] common: pe: fix use of undefined macro for ARMv7

2024-08-14 Thread Sascha Hauer
On Wed, 14 Aug 2024 11:24:19 +0200, Ahmad Fatoum wrote: > IMAGE_FILE_MACHINE_ARMNT is not defined in barebox, unlike U-Boot. > The macro we have is IMAGE_FILE_MACHINE_ARMV7, which has the same value > of 0x01c4, so use that instead. > > Applied, thanks! [1/6] common: pe: fix use of undefined

Re: [PATCH 00/11] gpiolib: add support for OF GPIO configuration binding

2024-08-14 Thread Sascha Hauer
On Fri, 09 Aug 2024 16:23:54 +0200, Ahmad Fatoum wrote: > So far, GPIO bias configuration was done exclusively by pinctrl drivers. > All barebox pinctrl drivers work by consuming a device tree node with > a binding that differs from driver to driver and then applying the > configuration described

Re: [PATCH] ci: container: make wget less verbose

2024-08-14 Thread Sascha Hauer
On Wed, 14 Aug 2024 11:24:38 +0200, Ahmad Fatoum wrote: > When downloading toolchains, we already use the wget -nv (non-verbose) option > to avoid a lot of progress indication clutter in the logs: > > 12300K .. .. .. .. .. 19% 165M 0s > 12350K ...

Re: [PATCH] ARM: i.MX: drop explicit reservation of scratch area

2024-08-14 Thread Sascha Hauer
On Wed, 14 Aug 2024 11:38:24 +0200, Ahmad Fatoum wrote: > The scratch area is just some unused space between top of stack and end > of early memory / start of OP-TEE. There's nothing i.MX specific about > it, except that we use it to store the bootrom log. > > The initcall reserving the scratch

Re: [PATCH v2 1/3] kvx: add qemu dts

2024-08-14 Thread Sascha Hauer
On Wed, Aug 14, 2024 at 10:46:17AM +0200, Sascha Hauer wrote: > > On Tue, 13 Aug 2024 14:44:06 +0200, Yann Sionneau wrote: > > Add qemu dts that will mostly be used to run test in CI. > > > > > > Applied, thanks! > > [1/3] kvx: add qemu dts > https://git.pengutronix.de/cgit/barebox/commi

[PATCH 5/6] i2c: efi: avoid 64-bit division

2024-08-14 Thread Ahmad Fatoum
I2C message length is 16 bit, so doing a 64-bit division is overkill. Let's remove the cast and just rely on the usual integer promotion to 32-bit. Cc: Tomas Marek Signed-off-by: Ahmad Fatoum --- drivers/i2c/busses/i2c-efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr

[PATCH 1/6] common: pe: fix use of undefined macro for ARMv7

2024-08-14 Thread Ahmad Fatoum
IMAGE_FILE_MACHINE_ARMNT is not defined in barebox, unlike U-Boot. The macro we have is IMAGE_FILE_MACHINE_ARMV7, which has the same value of 0x01c4, so use that instead. Signed-off-by: Ahmad Fatoum --- common/pe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/pe.c b

[PATCH] fixup! ci: pytest: test sandbox configuration with labgrid

2024-08-14 Thread Ahmad Fatoum
ci: pytest: add missing single quote for argument The argument needs to be quoted, so the backslashes aren't interpreted by the shell. Somehow I ended up sending the version with a missing second single quote... Signed-off-by: Ahmad Fatoum --- .github/workflows/test-labgrid-pytest.yml | 2 +- 1

[PATCH] ARM: i.MX: drop explicit reservation of scratch area

2024-08-14 Thread Ahmad Fatoum
The scratch area is just some unused space between top of stack and end of early memory / start of OP-TEE. There's nothing i.MX specific about it, except that we use it to store the bootrom log. The initcall reserving the scratch area was added to avoid barebox proper overwriting it later on durin

Re: [PATCH] common: make BOOTM_SHOW_TYPE depend on UIMAGE

2024-08-14 Thread Sascha Hauer
On Fri, 09 Aug 2024 16:18:08 +0200, Ahmad Fatoum wrote: > The config option only controls whether some extra uImage tags are > displayed extracted by calling functions in image.c. > > Rename image.c to uimage_types.c to make clear that it is > uImage-specific and hide the option when UIMAGE is n

[PATCH] ci: container: make wget less verbose

2024-08-14 Thread Ahmad Fatoum
When downloading toolchains, we already use the wget -nv (non-verbose) option to avoid a lot of progress indication clutter in the logs: 12300K .. .. .. .. .. 19% 165M 0s 12350K .. .. .. .. .. 19% 138M 0s 12400

[PATCH 3/6] filetype: fix else clause indentation

2024-08-14 Thread Ahmad Fatoum
clangd notes the unexpected indentation in the file, so remove that stray space. Signed-off-by: Ahmad Fatoum --- common/filetype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/filetype.c b/common/filetype.c index db65d1ece25a..3690d4ae077c 100644 --- a/common/filety

[PATCH 6/6] net: fsl_enetc: fix compilation for 32-bit

2024-08-14 Thread Ahmad Fatoum
The driver is only used on the 64-bit LS1028, but compile testing on 32-bit fails mostly due to unnecessary pointer casts. Fixing them cleans up the code a little, so let's do that even if there's no functional change. Signed-off-by: Ahmad Fatoum --- drivers/net/fsl_enetc.c | 19 +--

[PATCH 4/6] acpi: fix compilation for 32-bit

2024-08-14 Thread Ahmad Fatoum
Build test on x86 fails due to pointer cast and because of forcing the bigger alignment on the flexible array. The problematic pointer cast is for the XSDT, which is 64-bit-only, so let's fix the cast and return an error if we somehow see an XSDT on 32-bit. For the flexible array, the first struc

[PATCH 2/6] efi: fs: fix determination of read-only files

2024-08-14 Thread Ahmad Fatoum
The negation was erroneously applied to only the left-hand argument falsifying the result. Fix this. Signed-off-by: Ahmad Fatoum --- fs/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/efi.c b/fs/efi.c index 11073e9961c4..cb0eb40da4c2 100644 --- a/fs/efi.c +++ b/fs/ef

Re: [PATCH 4/4] ARM: i.MX8M: neuter initcalls when EFI booted

2024-08-14 Thread Ahmad Fatoum
On 09.08.24 16:17, Ahmad Fatoum wrote: > When enabling EFI payload support in a build that has i.MX boards > enabled, booting the EFI payload reports some failed initcalls. > > Disable them if we don't probe from device tree or aren't on an > i.MX system. > > Signed-off-by: Ahmad Fatoum > --- >

Re: (subset) [PATCH 1/4] ARM: add ARM32/ARM64 symbols for use in generic code

2024-08-14 Thread Sascha Hauer
On Fri, 09 Aug 2024 16:17:52 +0200, Ahmad Fatoum wrote: > The CPU_32 and CPU_64 symbols are only defined for ARM, but they are > still confusing to encounter in common code, because they have no > explicit reference to ARM. Add ARM32/ARM64 symbols that can be used > instead. > > Applied, thank

Re: [PATCH 1/3] fastboot: print all variables only on getvar:all and not its prefixes

2024-08-14 Thread Sascha Hauer
On Fri, 09 Aug 2024 16:19:57 +0200, Ahmad Fatoum wrote: > strcmp_l1 compares up to the length of the first arguments, i.e. it does > a prefix check. For this, the prefix, which is usually a string literal, > needs to be the first argument. > > The check for getvar:all doesn't follow this with th

Re: [PATCH] clk: imx: clk-pllv2: Fix unitialized variable warning

2024-08-14 Thread Sascha Hauer
On Wed, 14 Aug 2024 10:33:12 +0200, Sascha Hauer wrote: > __clk_pllv2_set_rate() might return with an error in which case some > of the variables are used uninitialized. Check for an error like the > Kernel does. > > Applied, thanks! [1/1] clk: imx: clk-pllv2: Fix unitialized variable warning

Re: [PATCH v2 1/3] kvx: add qemu dts

2024-08-14 Thread Sascha Hauer
On Tue, 13 Aug 2024 14:44:06 +0200, Yann Sionneau wrote: > Add qemu dts that will mostly be used to run test in CI. > > Applied, thanks! [1/3] kvx: add qemu dts https://git.pengutronix.de/cgit/barebox/commit/?id=b5e4def4741e (link may not be stable) [2/3] ci: container: add qemu-system

[PATCH] clk: imx: clk-pllv2: Fix unitialized variable warning

2024-08-14 Thread Sascha Hauer
__clk_pllv2_set_rate() might return with an error in which case some of the variables are used uninitialized. Check for an error like the Kernel does. Signed-off-by: Sascha Hauer --- drivers/clk/imx/clk-pllv2.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/clk/

Re: [PATCH 3/3] README: bring it up to date

2024-08-14 Thread Sascha Hauer
On Fri, Aug 09, 2024 at 04:24:44PM +0200, Ahmad Fatoum wrote: > Most of the file was written when barebox used to be called U-Boot v2. > It thus focused on comparisons and highlighted some aspects that > U-Boot has since adopted. > > Give the file an overhaul by converting it to ReST and highlight

Re: [PATCH 1/3] Documentation: devel: background-execution: update section on I2C slices

2024-08-14 Thread Sascha Hauer
On Fri, 09 Aug 2024 16:24:42 +0200, Ahmad Fatoum wrote: > When the documentation was written, there were no I2C slices yet. > The example is still useful to explain why slices need to be used, so > we'll leave it in, but update the documentation to reflect that slices > are indeed used now in I2C

Re: [PATCH 1/7] ci: container: update to Debian Bookworm with GCC v14.2.0

2024-08-14 Thread Sascha Hauer
On Tue, 13 Aug 2024 09:01:55 +0200, Ahmad Fatoum wrote: > We have been using the same distro/toolchain for more than a year now, > so let's update them to their newest versions. > > pip3 now warns that we are not in a venv. Acknowledge this and ignore > it as we want labgrid to be available to p

Re: [PATCH] ARM: i.MX8MP: König+Bauer AlphaJet: remove barebox partition from eMMC

2024-08-14 Thread Sascha Hauer
On Tue, 13 Aug 2024 19:01:03 +0200, Roland Hieber wrote: > The board cannot boot from eMMC because the SoM does not configure the > boot pins appropriately, and has no way of choosing the eMMC as a boot > medium. Instead, the area is used for the GPT partition table. Remove > the confusing entry