[OSS-Tools] [PATCH v5 2/2] barebox-state: get devicetree from file

2019-10-24 Thread Ahmad Fatoum
and format. Signed-off-by: Steffen Trumtrar Signed-off-by: Enrico Jorns Signed-off-by: Ahmad Fatoum --- src/barebox-state.c | 41 + src/barebox-state.h | 2 +- src/keystore-blob.c | 2 +- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git

[OSS-Tools] [PATCH v5 1/2] libdt: support upper-case hexadecimals in value of partuuid property

2019-10-24 Thread Ahmad Fatoum
https://www.spinics.net/lists/u-boot-v2/msg39590.html [2]: v5.4-rc4, init/do_mounts.c: match_dev_by_uuid() [3]: util-linux v2.34, $(egrep -r '%[^\s"]+X' libblkid/) Signed-off-by: Ahmad Fatoum --- src/libdt.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sr

[OSS-Tools] [PATCH dt-utils v5 0/2] barebox-state: get devicetree from file

2019-10-24 Thread Ahmad Fatoum
partuuids - Fixed use after free by not allocating dynamic memory Ahmad Fatoum (1): libdt: support upper-case hexadecimals in value of partuuid property Steffen Trumtrar (1): barebox-state: get devicetree from file src/barebox-state.c | 41

[OSS-Tools] [PATCH] libdt: enumerate amba bus as well

2020-10-08 Thread Ahmad Fatoum
The STM32MP1 probes the SD/MMC host controller over amba, not the platform bus as most other ARM systems. Enumerate amba as well, so we can use barebox-state on that SoC. Reported-by: Jookia Tested-by: Xogium Signed-off-by: Ahmad Fatoum --- src/libdt.c | 1 + 1 file changed, 1 insertion

[OSS-Tools] [PATCH] barebox-state: add new --update option to avoid writes if possible

2020-10-08 Thread Ahmad Fatoum
will only write a variable if its new and old value compare unequal. This allows users to fire and forget execute barebox-state. Signed-off-by: Ahmad Fatoum --- src/barebox-state.c | 32 +--- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/barebox

Re: [OSS-Tools] [PATCH dt-utils v5 0/2] barebox-state: get devicetree from file

2020-07-09 Thread Ahmad Fatoum
On 10/24/19 4:24 PM, Ahmad Fatoum wrote: > For use on systems that don't normally have a device tree, like x86, > it would be nice to be able to pass barebox_state the path to a device > tree blob directly, which is what this patch set does. Gentle ping. > > Cheers > Ahmad

[OSS-Tools] [PATCH] barebox-state: introduce --no-lock option to avoid lock file

2020-07-09 Thread Ahmad Fatoum
barebox-state may be run in restricted contexts where /var/lock is not yet mounted. Introduce a --no-lock option for users that guarantee by other means that multiple instances of barebox-state won't run concurrently. Signed-off-by: Ahmad Fatoum --- Correct operation can be verified

[OSS-Tools] [PATCH v2] barebox-state: have the --set option to avoid writes if possible

2020-11-13 Thread Ahmad Fatoum
to determine whether the state should be dirtied does an extra allocation in interest of clarity. This overhead is deemed negligible compared to I/O and it makes the code easier to follow. Suggested-by: Jan Lübbe Signed-off-by: Ahmad Fatoum --- v1 -> v2: - incorporate Jan's (off-list) suggest

Re: [OSS-Tools] [PATCH] barebox-state: introduce --no-lock option to avoid lock file

2021-02-10 Thread Ahmad Fatoum
Hello, On 09.07.20 15:31, Ahmad Fatoum wrote: > barebox-state may be run in restricted contexts where /var/lock is not > yet mounted. Introduce a --no-lock option for users that guarantee by > other means that multiple instances of barebox-state won't run concurrently. Please dismiss. T

Re: [OSS-Tools] [PATCH dt-utils] state: use /run to store lockfile

2021-02-10 Thread Ahmad Fatoum
On 29.11.20 22:11, Stefan Agner wrote: > The current location /var/lock is considered legacy (at least by > systemd). Just use /run to store the lockfile and append the usual .lock > suffix. > > Signed-off-by: Stefan Agner Tested-by: Ahmad Fatoum > --- > src/barebox-stat

Re: [OSS-Tools] [PATCH dt-utils 1/4] treewide: add SPDX identifiers to files with GPL-2.0-or-later license

2021-03-30 Thread Ahmad Fatoum
Hello Roland, On 30.03.21 13:08, Roland Hieber wrote: > Uwe, could I get a Reviewed-by from you for these four patches? :-) We must still carry the full license texts in the project (cf. Linux LICENSES/). This is missing here, no? Cheers, Ahmad > > - Roland > > On Fri, Mar 26, 2021 at

Re: [OSS-Tools] [PATCH dt-utils 1/4] treewide: add SPDX identifiers to files with GPL-2.0-or-later license

2021-03-30 Thread Ahmad Fatoum
On 30.03.21 16:00, Uwe Kleine-König wrote: > Hi Ahmad, > > On Tue, Mar 30, 2021 at 03:50:19PM +0200, Ahmad Fatoum wrote: >> On 30.03.21 15:30, Uwe Kleine-König wrote: >>> On Tue, Mar 30, 2021 at 01:22:26PM +0200, Ahmad Fatoum wrote: >>>> On 30.03.21 13:08, R

Re: [OSS-Tools] [PATCH dt-utils 1/4] treewide: add SPDX identifiers to files with GPL-2.0-or-later license

2021-03-30 Thread Ahmad Fatoum
Hello, On 30.03.21 15:30, Uwe Kleine-König wrote: > Hello, > > On Tue, Mar 30, 2021 at 01:22:26PM +0200, Ahmad Fatoum wrote: >> On 30.03.21 13:08, Roland Hieber wrote: >>> Uwe, could I get a Reviewed-by from you for these four patches? :-) >> >> We mus

Re: [OSS-Tools] [PATCH dt-utils 1/4] treewide: add SPDX identifiers to files with GPL-2.0-or-later license

2021-03-30 Thread Ahmad Fatoum
Hello Roland, On 30.03.21 17:53, Roland Hieber wrote: > On Tue, Mar 30, 2021 at 03:50:19PM +0200, Ahmad Fatoum wrote: >> Hello, >> >> On 30.03.21 15:30, Uwe Kleine-König wrote: >>> Hello, >>> >>> On Tue, Mar 30, 2021 at 01:22:26PM +0200, Ahmad Fat

[OSS-Tools] [PATCH] libdt: prefer first found disk when looking for block devices

2023-11-06 Thread Ahmad Fatoum
totally future proof, but it worked ok for years and a better solution can always be added later with a regular release. Reported-by: Leonard Göhrs Signed-off-by: Ahmad Fatoum --- src/libdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libdt.c b/src/libdt.c index 650b40

[OSS-Tools] [PATCH dt-utils] meson: align libdt-utils version with autotools'

2023-11-06 Thread Ahmad Fatoum
a common file that's read from both build systems as we are intent on phasing out autotools anyway, once wrinkles such as what's fixed here are ironed out. Reported-by: Enrico Jörns Signed-off-by: Ahmad Fatoum --- meson.build | 9 + 1 file changed, 9 insertions(+) diff --git a/meson.build

[OSS-Tools] [PATCH dt-utils] README: provide git format.subjectPrefix line to copy

2023-11-06 Thread Ahmad Fatoum
and pasted. Cc: Bastian Krause Signed-off-by: Ahmad Fatoum --- README | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README b/README index d68e6dacae6c..c6ef99c10b00 100644 --- a/README +++ b/README @@ -44,8 +44,10 @@ The Git web view for this software can be found

Re: [OSS-Tools] [PATCH dt-utils] meson: align libdt-utils version with autotools'

2023-11-06 Thread Ahmad Fatoum
Hello Enrico, On 06.11.23 13:12, Enrico Jörns wrote: > Am Montag, dem 06.11.2023 um 13:04 +0100 schrieb Roland Hieber: >> On Mon, Nov 06, 2023 at 12:58:22PM +0100, Ahmad Fatoum wrote: >>> Makefile.am has: >>> >>>   LIBDT_CURRENT=6 >>>   LIB

[OSS-Tools] [PATCH dt-utils v2] meson: align libdt-utils version with autotools'

2023-11-06 Thread Ahmad Fatoum
GNOME's gcab[1]. More information about libtool versioning is available in its documentation[2]. [1]: https://gitlab.gnome.org/GNOME/gcab/-/commit/2c8048f74ec8c088397 [2]: https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html Reported-by: Enrico Jörns Signed-off-by: Ahmad

Re: [OSS-Tools] [PATCH v3 3/3] state: automatically find state.dtb in the ESP

2022-05-10 Thread Ahmad Fatoum
Hello Michael, On 10.05.22 08:57, Michael Olbrich wrote: > Systemd mounts the EFI System Partition (ESP) to /boot or /efi. > So look there for the state.dtb when the devicetree in sysfs/procfs is > not available. > > This way barebox-state can be used on EFI systems without manually > specifying

Re: [OSS-Tools] [PATCH v3 2/3] libdt: add support for barebox, storage-by-uuid

2022-05-10 Thread Ahmad Fatoum
On 10.05.22 08:57, Michael Olbrich wrote: > Signed-off-by: Michael Olbrich > --- > > uuid comparison fixed: > - compare the correct uuids > - don't crash when no uuid is present > > src/libdt.c | 74 + > 1 file changed, 69 insertions(+), 5

[OSS-Tools] [PATCH 0/3] state: void partition table reread when possible

2023-04-06 Thread Ahmad Fatoum
k0p6", O_RDONLY|O_LARGEFILE) = 4 Ahmad Fatoum (3): state: backend: direct: open block device in read-only mode if possible libdt: factor out u64 sysattr parsing into helper libdt: use block device partition instead of parent if found src/barebox-state/backend_bucket_direct.c | 5 +

[OSS-Tools] [PATCH 2/3] libdt: factor out u64 sysattr parsing into helper

2023-04-06 Thread Ahmad Fatoum
We will need to parse two more sysattrs in a follow-up patch, so factor this out for reuse. While at it switch to 64-bit strtoull: This may be more useful for future users and unlike atol doesn't invoke undefined behavior when parsing fails. Signed-off-by: Ahmad Fatoum --- src/libdt.c | 42

[OSS-Tools] [PATCH 1/3] state: backend: direct: open block device in read-only mode if possible

2023-04-06 Thread Ahmad Fatoum
, we do it only for the direct backend meant for use with block devices. Tested-by: Ulrich Ölmann Signed-off-by: Ahmad Fatoum --- src/barebox-state/backend_bucket_direct.c | 5 +++-- src/barebox-state/backend_storage.c | 2 +- src/barebox-state/state.c | 6 +++--- src

[OSS-Tools] [PATCH 3/3] libdt: use block device partition instead of parent if found

2023-04-06 Thread Ahmad Fatoum
-by: Ulrich Ölmann Signed-off-by: Ahmad Fatoum --- src/libdt.c | 62 + 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/src/libdt.c b/src/libdt.c index 6f1a9e309d53..7d03ac1d4394 100644 --- a/src/libdt.c +++ b/src/libdt.c @@ -2159,23

[OSS-Tools] [PATCH 1/5] configure: pass -fno-strict-aliasing to GCC

2023-05-31 Thread Ahmad Fatoum
Like the Linux kernel, barebox is built with -fno-strict-aliasing, and code is written to take advantage of that. As dt-utils imports code from barebox, we may import code that assumes aliasing to be non-strict, so we better compile it with the same rules. Signed-off-by: Ahmad Fatoum

[OSS-Tools] [PATCH 2/5] libdt: fix issues of external function without prototype

2023-05-31 Thread Ahmad Fatoum
-by: Ahmad Fatoum --- src/crc32.c | 1 + src/dt/dt.h | 1 + src/libdt.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/crc32.c b/src/crc32.c index 8d4dddcf6129..8273d3465f6f 100644 --- a/src/crc32.c +++ b/src/crc32.c @@ -8,6 +8,7 @@ * For conditions of distribution

[OSS-Tools] [PATCH 5/5] barebox-state: fix use after free in error path

2023-05-31 Thread Ahmad Fatoum
blob_bin is freed a few lines above unconditionally, so freeing it again in the error path will cause a double free. Signed-off-by: Ahmad Fatoum --- src/keystore-blob.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/keystore-blob.c b/src/keystore-blob.c index

[OSS-Tools] [PATCH 4/5] libdt: don't use old-style function definition

2023-05-31 Thread Ahmad Fatoum
Increasing the warning level has GCC warn us, so let's heed the warning. Signed-off-by: Ahmad Fatoum --- src/dt/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dt/common.h b/src/dt/common.h index 69a264cfc1a9..62776c0bb027 100644 --- a/src/dt/common.h +++ b/src

[OSS-Tools] [PATCH 3/5] libdt: use memcpy instead of strncpy

2023-05-31 Thread Ahmad Fatoum
Despite the name, GCC objects at the strncpy use in safe_strncpy on safety grounds. While that seems to be a false positive, we could just be using memcpy instead and side step this altogether. Signed-off-by: Ahmad Fatoum --- src/dt/common.h | 34 ++ 1 file

[OSS-Tools] [PATCH fixup 2/2] libdt: fix possible use of uninitialized variable

2023-05-31 Thread Ahmad Fatoum
property may not be always defined. So let's skip trying to do something with it in that case. Signed-off-by: Ahmad Fatoum --- src/libdt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libdt.c b/src/libdt.c index 302ca7a76375..ca0502ac9483 100644 --- a/src/libdt.c +++ b/src/libdt.c

[OSS-Tools] [PATCH fixup 1/2] libdt: remove ultimately unused variables

2023-05-31 Thread Ahmad Fatoum
These variables were recently added, but are unused. Drop them. Signed-off-by: Ahmad Fatoum --- src/libdt.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/libdt.c b/src/libdt.c index 44491a5e739b..302ca7a76375 100644 --- a/src/libdt.c +++ b/src/libdt.c @@ -2365,7

Re: [OSS-Tools] [PATCH v4 2/3] libdt: add support for barebox, storage-by-uuid

2023-05-31 Thread Ahmad Fatoum
Hello Michael, On 11.05.22 10:21, Michael Olbrich wrote: > Signed-off-by: Michael Olbrich Tested-by: Ahmad Fatoum I'd squash the two fixups I just sent when I apply this. Thanks, Ahmad > --- > > changes in v3: > uuid comparison fixed: > - compare the correct uuids >

[OSS-Tools] [PATCH 5/8] libdt: use block device partition instead of parent if found

2023-05-31 Thread Ahmad Fatoum
-by: Ulrich Ölmann Signed-off-by: Ahmad Fatoum --- src/libdt.c | 60 +++-- 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/src/libdt.c b/src/libdt.c index 440fcbd32fb4..e90ac5e26273 100644 --- a/src/libdt.c +++ b/src/libdt.c @@ -2212,23

[OSS-Tools] [PATCH 6/8] state: align with barebox use of of_cdev_find

2023-05-31 Thread Ahmad Fatoum
. Unlike __of_cdev_find, the new external function will return dynamically allocated memory to avoid consumer code having to know the struct cdev layout. Signed-off-by: Ahmad Fatoum --- src/barebox-state/state.c | 26 +++--- src/dt/common.h | 8 src/dt/dt.h

[OSS-Tools] [PATCH 3/8] libdt: drop broken if-branch

2023-05-31 Thread Ahmad Fatoum
in a way that works. Signed-off-by: Ahmad Fatoum --- src/libdt.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/libdt.c b/src/libdt.c index 580b0b0ba769..12d692d2b2cf 100644 --- a/src/libdt.c +++ b/src/libdt.c @@ -2519,13 +2519,10 @@ int of_get_devicepath(struct

[OSS-Tools] [PATCH 7/8] libdt: use of_find_device_by_uuid for partuuid lookup

2023-05-31 Thread Ahmad Fatoum
with the other code paths, where we determine the device path through the struct udev_device. Signed-off-by: Ahmad Fatoum --- src/libdt.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/libdt.c b/src/libdt.c index 1cfca40f9f79..4c000919d305 100644

[OSS-Tools] [PATCH 8/8] state: allow lookup of barebox state partition by Type GUID

2023-05-31 Thread Ahmad Fatoum
extra information on demand. Signed-off-by: Ahmad Fatoum --- src/barebox-state/state.c | 26 ++ src/dt/dt.h | 5 ++ src/libdt-utils.sym | 3 ++ src/libdt.c | 101 -- src/linux/uuid.h | 24 + src

[OSS-Tools] [PATCH 4/8] libdt: factor out __of_cdev_find helper

2023-05-31 Thread Ahmad Fatoum
it with the same information that of_get_devicepath would return. In later commits we will define helpers that return and process a struct cdev placed in dynamic memory. Signed-off-by: Ahmad Fatoum --- src/libdt.c | 82 + 1 file changed, 52 insertions

[OSS-Tools] [PATCH 1/8] state: backend: direct: open block device in read-only mode if possible

2023-05-31 Thread Ahmad Fatoum
, we do it only for the direct backend meant for use with block devices. Tested-by: Ulrich Ölmann Signed-off-by: Ahmad Fatoum --- src/barebox-state/backend_bucket_direct.c | 5 +++-- src/barebox-state/backend_storage.c | 2 +- src/barebox-state/state.c | 6 +++--- src

[OSS-Tools] [PATCH 2/8] libdt: factor out u64 sysattr parsing into helper

2023-05-31 Thread Ahmad Fatoum
We will need to parse two more sysattrs in a follow-up patch, so factor this out for reuse. While at it switch to 64-bit strtoull: This may be more useful for future users and unlike atol doesn't invoke undefined behavior when parsing fails. Signed-off-by: Ahmad Fatoum --- src/libdt.c | 42

[OSS-Tools] [PATCH 0/8] state: allow lookup of barebox state partition by Type GUID

2023-05-31 Thread Ahmad Fatoum
open the disk read-only if possible and if a partition exists that fits the barebox state location, it will be opened instead. Ahmad Fatoum (8): state: backend: direct: open block device in read-only mode if possible libdt: factor out u64 sysattr parsing into helper libdt: drop broken

[OSS-Tools] [PATCH 1/5] Add meson as build system

2023-05-31 Thread Ahmad Fatoum
This adds experimental support for building dt-utils with meson. The hope is that the alternative meson.build will be easier to maintain. Signed-off-by: Ahmad Fatoum --- .gitignore| 1 + README| 20 ++ check-news.sh | 82 meson.build

[OSS-Tools] [PATCH 3/5] meson: add simple integration test

2023-05-31 Thread Ahmad Fatoum
It's straight forward to use meson as test runner, so let's compile a very simple test application that links against libdt-utils and verifies crc32 behaves as one would expect. Signed-off-by: Ahmad Fatoum --- README | 1 + meson.build | 2 ++ test/crc32.c | 18

[OSS-Tools] [PATCH 5/5] test: add barebox-state loop block device tests

2023-05-31 Thread Ahmad Fatoum
output to report which device it uses - tests check correct device was used and basic state reading and writing works. Signed-off-by: Ahmad Fatoum --- .gitignore| 1 + test/01-fixed-partition-no-gpt.dts| 34 + ...2-fixed-partition-before

[OSS-Tools] [PATCH 4/5] libdt: add CONFIG_TEST_LOOPBACK

2023-05-31 Thread Ahmad Fatoum
normally, but on the upside, we have tests. :-) Signed-off-by: Ahmad Fatoum --- configure.ac | 2 ++ meson.build | 1 + src/dt/dt.h | 1 - src/libdt.c | 50 +++--- 4 files changed, 50 insertions(+), 4 deletions(-) diff --git a/configure.ac b

[OSS-Tools] [PATCH 0/5] Add meson support and first test suite

2023-05-31 Thread Ahmad Fatoum
in linker errors. I have no idea why yet, but that should only make meson-built libdt-utils a bit slower without functional change. Ahmad Fatoum (5): Add meson as build system state: add option to lock device node meson: add simple integration test libdt: add CONFIG_TEST_LOOPBACK test

[OSS-Tools] [PATCH 2/5] state: add option to lock device node

2023-05-31 Thread Ahmad Fatoum
Even if /run exists, it may not be world-writable. This is the case on NixOS. Add an alternative option to lock the device node instead. This should eventually be made the default when it has enjoyed more testing. Signed-off-by: Ahmad Fatoum --- configure.ac | 9

Re: [OSS-Tools] [PATCH fixup 1/2] libdt: remove ultimately unused variables

2023-06-05 Thread Ahmad Fatoum
On 05.06.23 11:15, Roland Hieber wrote: > On Wed, May 31, 2023 at 05:13:32PM +0200, Ahmad Fatoum wrote: >> These variables were recently added, but are unused. Drop them. >> >> Signed-off-by: Ahmad Fatoum >> --- >> src/libdt.c | 7 ++- >> 1 fil

Re: [OSS-Tools] [PATCH fixup 1/2] libdt: remove ultimately unused variables

2023-06-05 Thread Ahmad Fatoum
On 05.06.23 11:30, Ahmad Fatoum wrote: >> I'm not completely sure which version of the code you are referencing >> here because I cannot find that context, but … > > I replied on mol's series with two fixups that should be squashed. One of them > removes *outdir, which is wr

[OSS-Tools] [PATCH] libdt: generalize of_find_device_by_uuid for scoped lookup of all UUIDs

2023-06-05 Thread Ahmad Fatoum
. Signed-off-by: Ahmad Fatoum --- This patch is the missing prerequisite for my GPT Type UUID series. --- src/libdt.c | 30 +++--- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/libdt.c b/src/libdt.c index e54d7fb5649d..2c994c647ac9 100644 --- a/src

Re: [OSS-Tools] [PATCH dt-utils 00/14] Sync Barebox-State code base

2023-06-05 Thread Ahmad Fatoum
Hello Marco, On 14.10.22 18:41, Marco Felsch wrote: > Hi, > > this series sync the dt-utils barebox-state code base with a very recent > barebox version [1]. The most import patch are patch13-14, since those adding > the user-space support for the backend format. By this new > backend-format we

Re: [OSS-Tools] [PATCH v4 0/3] improve barebox-state support on EFI system

2023-06-05 Thread Ahmad Fatoum
On 11.05.22 10:21, Michael Olbrich wrote: > Hi, > > so the discussion on the barebox ML resulted in a different binding for > this. Sascha has sent patches for that[1]. This is now mainline in Barebox. > > So while this is 'v4' for this topic, all the patches except the last one > are actually

[OSS-Tools] [PATCH] libdt: fix of_get_devicepath looking up sibling if device unavailable

2023-06-07 Thread Ahmad Fatoum
will take the first matching block device across the SoC. So we could end up with the eMMC: a completely different device than what was pointed at. Fixes: 929ed64cb42f ("of_get_devicepath: make partition finding more robust") Signed-off-by: Ahmad Fatoum --- src/libdt.c | 6

Re: [OSS-Tools] [PATCH] libdt: fix of_get_devicepath looking up sibling if device unavailable

2023-06-07 Thread Ahmad Fatoum
Hello Uwe, On 07.06.23 10:55, Uwe Kleine-König wrote: > Hello Ahmad, > > On Wed, Jun 07, 2023 at 10:08:18AM +0200, Ahmad Fatoum wrote: >> of_get_devicepath code flow is split into two: >> >> A) Either the device tree node in question has a direct ude

Re: [OSS-Tools] [PATCH] libdt: generalize of_find_device_by_uuid for scoped lookup of all UUIDs

2023-06-07 Thread Ahmad Fatoum
Hello Roland, On 07.06.23 10:33, Roland Hieber wrote: > On Mon, Jun 05, 2023 at 04:32:36PM +0200, Ahmad Fatoum wrote: >> Despite the generic name, of_find_device_by_uuid only handled >> ID_PART_TABLE_UUID (diskuuid) and ID_PART_ENTRY_UUID (partuuid), >> but not ID_PART_ENTR

Re: [OSS-Tools] [PATCH] libdt: fix of_get_devicepath looking up sibling if device unavailable

2023-06-07 Thread Ahmad Fatoum
On 07.06.23 10:08, Ahmad Fatoum wrote: > of_get_devicepath code flow is split into two: > > A) Either the device tree node in question has a direct udev_device > associated with it > > B) Or we assume it's a partition and lookup udev_device for the parent >

[OSS-Tools] [PATCH v2 8/8] state: allow lookup of barebox state partition by Type GUID

2023-06-07 Thread Ahmad Fatoum
extra information on demand. Signed-off-by: Ahmad Fatoum --- src/barebox-state/state.c | 20 + src/dt/dt.h | 4 ++ src/libdt-utils.sym | 2 + src/libdt.c | 94 ++- src/linux/uuid.h | 24 ++ src/state.h

[OSS-Tools] [PATCH v2 1/8] state: backend: direct: open block device in read-only mode if possible

2023-06-07 Thread Ahmad Fatoum
, we do it only for the direct backend meant for use with block devices. Tested-by: Ulrich Ölmann Signed-off-by: Ahmad Fatoum --- src/barebox-state/backend_bucket_direct.c | 5 +++-- src/barebox-state/backend_storage.c | 2 +- src/barebox-state/state.c | 6 +++--- src

[OSS-Tools] [PATCH v2 4/8] libdt: factor out __of_cdev_find helper

2023-06-07 Thread Ahmad Fatoum
it with the same information that of_get_devicepath would return. In later commits we will define helpers that return and process a struct cdev placed in dynamic memory. Signed-off-by: Ahmad Fatoum --- src/libdt.c | 82 + 1 file changed, 52 insertions

[OSS-Tools] [PATCH v2 0/8] state: allow lookup of barebox state partition by Type GUID

2023-06-07 Thread Ahmad Fatoum
new cdev_find_child_by_gpt_typeuuid helper (Marco) - handle case of iterating over partitions before disk in cdev_from_block_device Ahmad Fatoum (8): state: backend: direct: open block device in read-only mode if possible libdt: factor out u64 sysattr parsing into helper libdt: d

[OSS-Tools] [PATCH v2 5/8] libdt: use block device partition instead of parent if found

2023-06-07 Thread Ahmad Fatoum
-by: Ulrich Ölmann Signed-off-by: Ahmad Fatoum --- src/libdt.c | 60 +++-- 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/src/libdt.c b/src/libdt.c index c8a8ea43e452..1b381ed8915b 100644 --- a/src/libdt.c +++ b/src/libdt.c @@ -2212,23

[OSS-Tools] [PATCH v2 2/8] libdt: factor out u64 sysattr parsing into helper

2023-06-07 Thread Ahmad Fatoum
We will need to parse two more sysattrs in a follow-up patch, so factor this out for reuse. While at it switch to 64-bit strtoull: This may be more useful for future users and unlike atol doesn't invoke undefined behavior when parsing fails. Signed-off-by: Ahmad Fatoum --- src/libdt.c | 42

[OSS-Tools] [PATCH v2 6/8] state: align with barebox use of of_cdev_find

2023-06-07 Thread Ahmad Fatoum
. Unlike __of_cdev_find, the new external function will return dynamically allocated memory to avoid consumer code having to know the struct cdev layout. Signed-off-by: Ahmad Fatoum --- src/barebox-state/state.c | 26 +++--- src/dt/common.h | 8 src/dt/dt.h

[OSS-Tools] [PATCH v2 7/8] libdt: use of_find_device_by_uuid for partuuid lookup

2023-06-07 Thread Ahmad Fatoum
with the other code paths, where we determine the device path through the struct udev_device. Signed-off-by: Ahmad Fatoum --- src/libdt.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/libdt.c b/src/libdt.c index ae98543400b6..a55bc9b8d27d 100644

[OSS-Tools] [PATCH v2 3/8] libdt: drop broken if-branch

2023-06-07 Thread Ahmad Fatoum
in a way that works. Fixes: 929ed64cb42f ("of_get_devicepath: make partition finding more robust") Reviewed-by: Uwe Kleine-König Signed-off-by: Ahmad Fatoum --- src/libdt.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/libdt.c b/src/libdt.c index 3f

Re: [OSS-Tools] [PATCH v2 0/8] state: allow lookup of barebox state partition by Type GUID

2023-06-12 Thread Ahmad Fatoum
On 07.06.23 14:16, Ahmad Fatoum wrote: > This implements the binding extension introduced to barebox here: > https://lore.barebox.org/barebox/20230607120714.3083182-1-a.fat...@pengutronix.de/T/#t > > With this, barebox,state backend can optionally point at a device > instead

Re: [OSS-Tools] [PATCH 4/5] libdt: add CONFIG_TEST_LOOPBACK

2023-06-12 Thread Ahmad Fatoum
On 31.05.23 17:31, Ahmad Fatoum wrote: > We have quite a bit of tricky udev and device tree parsing code that is > only tested manually. Best case we would have tests for this in QEMU, > but until we do, let's test it with loop devices: > > The downside is that we can only tes

Re: [OSS-Tools] [PATCH 0/5] Add meson support and first test suite

2023-06-12 Thread Ahmad Fatoum
On 05.06.23 12:17, Roland Hieber wrote: > On Wed, May 31, 2023 at 05:31:20PM +0200, Ahmad Fatoum wrote: >> The barebox,state binding is quite complex and we have a lot of udev >> parsing code that can only be exercised by manually running >> barebox-state on the target. Make d

[OSS-Tools] [PATCH 3/3] meson: set optimization level to -O2 by default

2023-06-12 Thread Ahmad Fatoum
From: Ahmad Fatoum We shouldn't expect users to override optimization levels, so let's have a sensible default. Signed-off-by: Ahmad Fatoum --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index be92446f137a..e03e1dbf6e85 100644 --- a/meson.build

[OSS-Tools] [PATCH 1/3] meson: options: use defaults of type boolean for boolean options

2023-06-12 Thread Ahmad Fatoum
From: Ahmad Fatoum Building with newer meson versions alerts us that specifying defaults with a string type for non-string types is deprecated. This type confusion was not intentional, so fix that. Signed-off-by: Ahmad Fatoum --- meson_options.txt | 8 1 file changed, 4 insertions

[OSS-Tools] [PATCH 2/3] test: add test case with non-existent /dev/file

2023-06-12 Thread Ahmad Fatoum
From: Ahmad Fatoum When backend points at a device that couldn't be resolved, barebox-state should fail instead of taking another device. This is meant to address issues like the one fixed by commit e7d71f099659 ("libdt: fix of_get_devicepath looking up sibling if device unavai

Re: [OSS-Tools] [PATCH dt-utils] README: clarify the need for "real names" with the DCO process

2023-07-31 Thread Ahmad Fatoum
anguage"). In fact, we already credit contributors in our Git history > by names that are probably not their "real names". Follow the reasoning > in the kernel guidelines in that regard, and adapt our wording > accordingly. > > Link: https://git.kernel.org/torvalds/c/d4

Re: [OSS-Tools] [PATCH dt-utils v2 5/9] treewide: add CC0-1.0 SPDX identifiers for trivial files

2023-07-31 Thread Ahmad Fatoum
On 31.07.23 11:11, Roland Hieber wrote: > Add license text from the SPDX website [1]. > > [1]: https://spdx.org/licenses/CC0-1.0.html > > Signed-off-by: Roland Hieber I don't think it's necessary to add a SPDX-License-Identifier to empy files, but I can live with it: Acked-b

Re: [OSS-Tools] [PATCH dt-utils v2 1/9] treewide: add SPDX identifiers to files with GPL-2.0-only license

2023-07-31 Thread Ahmad Fatoum
and-licensing > Signed-off-by: Roland Hieber Reviewed-by: Ahmad Fatoum > -- > PATCH v2: > * move COPYING to LICENSES/GPL-2.0-only.txt > * use the complete GPL-2.0 text > * don't remove boilerplate license headers from files > > PATCH v1: > https://lore.p

Re: [OSS-Tools] [PATCH dt-utils v2 6/9] treewide: add GPL-2.0-only SPDX identifiers to files without license

2023-07-31 Thread Ahmad Fatoum
case files get copied around. > > Link: > https://git.pengutronix.de/cgit/tools/dt-utils/commit/?id=2b39a389428224d96bbb > Signed-off-by: Roland Hieber Reviewed-by: Ahmad Fatoum > --- > PATCH v2: > * rebase to next branch and add remaining files > > PA

Re: [OSS-Tools] [PATCH dt-utils v2 3/9] treewide: add SPDX identifiers to files with GPL-3.0-or-later license

2023-07-31 Thread Ahmad Fatoum
On 31.07.23 11:11, Roland Hieber wrote: > Use GPL-3.0-or-later license text from the SPDX website [1], and add the > boilerplate headers. > > [1]: https://spdx.org/licenses/GPL-3.0-or-later > > Signed-off-by: Roland Hieber Acked-by: Ahmad Fatoum > --- > PA

Re: [OSS-Tools] [PATCH dt-utils v2 2/9] treewide: add SPDX identifiers to files with GPL-2.0-or-later license

2023-07-31 Thread Ahmad Fatoum
On 31.07.23 11:11, Roland Hieber wrote: > Use the same license text as for GPL-2.0-only, but with different > boilerplate headers. > > Signed-off-by: Roland Hieber Acked-by: Ahmad Fatoum > -- > PATCH v2: > * add LICENSES/GPL-2.0-or-later.txt > * don't remove boilerpl

Re: [OSS-Tools] [PATCH dt-utils v2 4/9] treewide: add SPDX identifier to file with Zlib license

2023-07-31 Thread Ahmad Fatoum
and Hieber Reviewed-by: Ahmad Fatoum > --- > PATCH v2: > * add LICENSES/Zlib.txt > > PATCH v1: > https://lore.pengutronix.org/oss-tools/20210326210647.8648-3-...@pengutronix.de > --- > LICENSES/Zlib.txt | 19 +++ > src/crc32.c | 2 +- > 2 files

Re: [OSS-Tools] [PATCH dt-utils v2 7/9] treewide: add trivial copyright headers

2023-07-31 Thread Ahmad Fatoum
On 31.07.23 11:11, Roland Hieber wrote: > 'reuse lint' warns about files without copyright information, and > refuses to give us the spec compliance checkmark. Add trivial copyright > lines to all remaining files that don't have any yet. Acked-by: Ahmad Fatoum > > Signed-off-by

Re: [OSS-Tools] [PATCH dt-utils v2 8/9] DCO: add SPDX license information

2023-07-31 Thread Ahmad Fatoum
On 31.07.23 11:11, Roland Hieber wrote: > There is nothing prefabricated yet, so use a custom LicenseRef instead. > > Signed-off-by: Roland Hieber Acked-by: Ahmad Fatoum > --- > PATCH v2: new in series v2 > --- > DCO | 2 ++ > LICENSES/Licens

Re: [OSS-Tools] [PATCH dt-utils v2 9/9] README: mention compatibility with the REUSE specification

2023-07-31 Thread Ahmad Fatoum
On 31.07.23 11:11, Roland Hieber wrote: > Signed-off-by: Roland Hieber Acked-by: Ahmad Fatoum > --- > PATCH v2: new in series v2 > --- > README | 4 > 1 file changed, 4 insertions(+) > > diff --git a/README b/README > index 3f53b47c03f8..9a0ab79c0167 100644 &g

Re: [OSS-Tools] [dt-utils] Release 2023.11.0

2023-11-24 Thread Ahmad Fatoum
ovide git format.subjectPrefix line to copy" > * commit 1cd62596dbd7 "meson: align libdt-utils version with autotools'" > > This release includes contributions by Ahmad Fatoum, Enrico Jörns, Leonard > Göhrs, and Roland Hieber. Thank you to all contributors! >

Re: [OSS-Tools] [PATCH dt-utils] dtblint: add support for fsl, imx8mp-iomuxc

2024-04-02 Thread Ahmad Fatoum
Hello Uwe, thanks for your patch. On 02.04.24 15:09, Uwe Kleine-König wrote: > Signed-off-by: Uwe Kleine-König Please add the version of the reference manual you took these values from. > --- > src/dtblint-imx-pinmux.c | 1317 ++ > 1 file changed, 1317

Re: [OSS-Tools] [PATCH v2] dtblint: add support for fsl, imx8mp-iomuxc

2024-04-02 Thread Ahmad Fatoum
Hello Uwe, On 02.04.24 16:51, Uwe Kleine-König wrote: > Signed-off-by: Uwe Kleine-König please address the other v1 feedback and mention what changes between revisions. Thanks, Ahmad > --- > src/dtblint-imx-pinmux.c | 1315 ++ > 1 file changed, 1315

Re: [OSS-Tools] [PATCH dt-utils] dtblint: add support for fsl, imx8mp-iomuxc

2024-04-02 Thread Ahmad Fatoum
Hello Uwe, On 02.04.24 17:08, Uwe Kleine-König wrote: >>> + /* regname="AUDIOMIX_PDM_MIC_PDM_BITSTREAM_SELECT_INPUT_0" >>> regoffset=0x4c0 reset_default=0x */ >>> + /* regname="AUDIOMIX_PDM_MIC_PDM_BITSTREAM_SELECT_INPUT_1" >>> regoffset=0x4c4 reset_default=0x */ >>> + /*