Re: [PATCH] libfdt: Fix build with swig 4.3.0

2024-11-05 Thread David Gibson
On Thu, Oct 31, 2024 at 07:36:15AM -0500, Rob Herring wrote: > On Tue, Oct 29, 2024 at 8:10 PM David Gibson > wrote: > > > > On Tue, Oct 29, 2024 at 08:52:52PM +0800, Xi Ruoyao wrote: > > > On Sat, 2024-10-26 at 12:34 +, Rudi Heitbaum wrote: > > >

Re: [PATCH] libfdt: Fix build with swig 4.3.0

2024-10-29 Thread David Gibson
; > >     if (PyTuple_GET_SIZE(resultobj) == 0) > >    resultobj = val; > >     else > > -  resultobj = SWIG_Python_AppendOutput(resultobj, val); > > +  resultobj = SWIG_AppendOutput(resultobj, val); > > } > >  } > >   > -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson signature.asc Description: PGP signature

Re: [U-Boot] [PATCH 03/12] libfdt: Safer access to strings section

2018-04-16 Thread David Gibson
On Tue, Apr 17, 2018 at 12:03:19PM +0900, Masahiro Yamada wrote: > 2018-04-14 23:42 GMT+09:00 Warner Losh : > > On Fri, Apr 13, 2018 at 9:43 PM, David Gibson > > wrote: > > > >> On Fri, Apr 13, 2018 at 12:53:19PM -0400, Tom Rini wrote: > >> > On Thu, Apr

Re: [U-Boot] [PATCH 03/12] libfdt: Safer access to strings section

2018-04-15 Thread David Gibson
On Sat, Apr 14, 2018 at 08:42:23AM -0600, Warner Losh wrote: > On Fri, Apr 13, 2018 at 9:43 PM, David Gibson > wrote: > > > On Fri, Apr 13, 2018 at 12:53:19PM -0400, Tom Rini wrote: > > > On Thu, Apr 12, 2018 at 02:39:19PM +1000, David Gibson wrote: > > > >

Re: [U-Boot] [PATCH 03/12] libfdt: Safer access to strings section

2018-04-13 Thread David Gibson
On Fri, Apr 13, 2018 at 12:53:19PM -0400, Tom Rini wrote: > On Thu, Apr 12, 2018 at 02:39:19PM +1000, David Gibson wrote: > > On Tue, Apr 10, 2018 at 10:42:45AM -0400, Simon Glass wrote: > > > +U-Boot, Tom, Masahiro > > > > > > Hi David, > > >

Re: [U-Boot] [PATCH 03/12] libfdt: Safer access to strings section

2018-04-12 Thread David Gibson
On Thu, Apr 12, 2018 at 03:00:17PM -0400, Tom Rini wrote: > On Thu, Apr 12, 2018 at 02:01:05PM +1000, David Gibson wrote: > > On Tue, Apr 10, 2018 at 06:36:06PM -0400, Tom Rini wrote: > > > On Tue, Apr 10, 2018 at 10:42:45AM -0400, Simon Glass wrote: > > &g

Re: [U-Boot] [PATCH 03/12] libfdt: Safer access to strings section

2018-04-11 Thread David Gibson
On Tue, Apr 10, 2018 at 10:42:45AM -0400, Simon Glass wrote: > +U-Boot, Tom, Masahiro > > Hi David, > > On 10 April 2018 at 01:22, David Gibson wrote: > > On Wed, Apr 04, 2018 at 01:21:10AM +0800, Simon Glass wrote: > >> Hi David, > >> > >&g

Re: [U-Boot] [PATCH 03/12] libfdt: Safer access to strings section

2018-04-11 Thread David Gibson
On Tue, Apr 10, 2018 at 06:36:06PM -0400, Tom Rini wrote: > On Tue, Apr 10, 2018 at 10:42:45AM -0400, Simon Glass wrote: > > +U-Boot, Tom, Masahiro > > > > Hi David, > > > > On 10 April 2018 at 01:22, David Gibson wrote: > > > On Wed, Apr 04, 2

Re: [U-Boot] [PATCH v4 09/13] libfdt: Add fdt_getprop_namelen_w

2016-07-11 Thread David Gibson
On Mon, Jul 11, 2016 at 09:12:27AM +0200, Maxime Ripard wrote: > On Wed, Jul 06, 2016 at 11:22:48AM +1000, David Gibson wrote: > > On Tue, Jul 05, 2016 at 10:26:42AM +0200, Maxime Ripard wrote: > > > Add a function to retrieve a writeable property only by the first > >

Re: [U-Boot] [PATCH v4 09/13] libfdt: Add fdt_getprop_namelen_w

2016-07-05 Thread David Gibson
const char *name, int namelen, > + int *lenp) > +{ > + return (void *)(uintptr_t)fdt_getprop_namelen(fdt, nodeoffset, name, > + namelen, lenp); uintptr_t ?? > +} > >

Re: [U-Boot] [PATCH v4 07/13] libfdt: Fix separator spelling

2016-07-05 Thread David Gibson
t_path_offset(const void *fdt, const char *path) > p++; > if (*p == '\0' || *p == ':') > return offset; > - q = fdt_path_next_seperator(p); > + q = fdt_path_next_separator(p); >

Re: [U-Boot] [PATCH v4 06/13] libfdt: Add max phandle retrieval function

2016-07-05 Thread David Gibson
counts as an error. Since -1 phandles are sometimes used as a placeholder, ignoring them might be a better option. > + if (phandle > max_phandle) > + max_phandle = phandle; > + } > + > + return 0; > +} > + > int fdt_get_mem_rs

Re: [U-Boot] [PATCH v4 08/13] libfdt: Add fdt_path_offset_namelen

2016-07-05 Thread David Gibson
be redundant. If you do see a \0 within the length specified by namelen, you should return FDT_ERR_BADPATH, rather than just truncating at the \0. ... and I just realised that path_offset_namelen() is already upstream, so I should fix that there too. So what the hell is this downstream fdt_path_next_separator

Re: [U-Boot] [PATCH v3 10/12] libfdt: Add overlay application function

2016-06-29 Thread David Gibson
On Wed, Jun 29, 2016 at 07:34:54PM -0700, Frank Rowand wrote: > On 06/27/16 20:12, David Gibson wrote: > > On Mon, Jun 27, 2016 at 01:40:00PM +0200, Maxime Ripard wrote: > >> Hi David, > >> > >> On Mon, Jun 27, 2016 at 03:26:07PM +1000, David G

Re: [U-Boot] [PATCH v3 10/12] libfdt: Add overlay application function

2016-06-27 Thread David Gibson
On Mon, Jun 27, 2016 at 01:40:00PM +0200, Maxime Ripard wrote: > Hi David, > > On Mon, Jun 27, 2016 at 03:26:07PM +1000, David Gibson wrote: > > > +static uint32_t overlay_get_target_phandle(const void *fdto, int > > > fragment) > > > +{ > >

Re: [U-Boot] [PATCH v3 04/12] libfdt: Add new headers and defines

2016-06-27 Thread David Gibson
On Mon, Jun 27, 2016 at 09:25:27AM +0200, Maxime Ripard wrote: > Hi David, > > On Mon, Jun 27, 2016 at 01:39:06AM +1000, David Gibson wrote: > > On Fri, Jun 24, 2016 at 04:27:49PM +0200, Maxime Ripard wrote: > > > The libfdt overlay support introduces a bunch of new incl

Re: [U-Boot] [PATCH v3 07/12] libfdt: Add fdt_setprop_inplace_by_index

2016-06-27 Thread David Gibson
On Mon, Jun 27, 2016 at 11:16:52AM +0200, Maxime Ripard wrote: > On Mon, Jun 27, 2016 at 01:45:11AM +1000, David Gibson wrote: > > On Fri, Jun 24, 2016 at 04:27:52PM +0200, Maxime Ripard wrote: > > > Add a function to modify inplace a property starting from a given index. &g

Re: [U-Boot] [PATCH v3 12/12] tests: Introduce DT overlay tests

2016-06-26 Thread David Gibson
On Mon, Jun 27, 2016 at 08:30:28AM +0200, Maxime Ripard wrote: > Hi David, > > On Mon, Jun 27, 2016 at 03:26:58PM +1000, David Gibson wrote: > > On Fri, Jun 24, 2016 at 04:27:57PM +0200, Maxime Ripard wrote: > > > This adds a bunch of unit tests for the "fdt apply&q

Re: [U-Boot] [PATCH v3 12/12] tests: Introduce DT overlay tests

2016-06-26 Thread David Gibson
ht (c) 2016 NextThing Co > + * Copyright (c) 2016 Free Electrons > + * > + * SPDX-License-Identifier: GPL-2.0+ > + */ > + > +/dts-v1/; > +/plugin/; > + > +/ { > + /* Test that we can change an int by another */ > + fragment@0 { > + target = <&test>; > + > +

Re: [U-Boot] [PATCH v3 10/12] libfdt: Add overlay application function

2016-06-26 Thread David Gibson
dt_for_each_subnode(dto, fragment, 0) { > + int overlay; > + int target; > + int ret; > + > + target = overlay_get_target(dt, dto, fragment); > + if (target < 0) > + continue; > + > +

Re: [U-Boot] [PATCH v3 00/12] cmd: fdt: Add device tree overlays support

2016-06-26 Thread David Gibson
ay/test-fdt-overlay.dts | 88 + > 20 files changed, 992 insertions(+), 22 deletions(-) > create mode 100644 include/test/overlay.h > create mode 100644 lib/libfdt/fdt_overlay.c > create mode 100644 test/overlay/Kconfig > create mode 100644 test/overlay/Mak

Re: [U-Boot] [PATCH v3 04/12] libfdt: Add new headers and defines

2016-06-26 Thread David Gibson
+#include > + > +#define strtoul(cp, endp, base) simple_strtoul(cp, endp, base) > +#endif > + > /* adding a ramdisk needs 0x44 bytes in version 2008.10 */ > #define FDT_RAMDISK_OVERHEAD 0x80 > -- David Gibson| I'll

Re: [U-Boot] [PATCH v3 07/12] libfdt: Add fdt_setprop_inplace_by_index

2016-06-26 Thread David Gibson
int len) > { > void *propval; > int proplen; > > - propval = fdt_getprop_w(fdt, nodeoffset, name, &proplen); > + propval = fdt_getprop_namelen_w(fdt, nodeoffset, name, namelen, > + &

Re: [U-Boot] [PATCH v3 08/12] libfdt: Add fdt_path_offset_namelen

2016-06-26 Thread David Gibson
> + while (*p && (p < end)) { > const char *q; > > while (*p == '/') > p++; > + > if (*p == '\0' || *p == ':') > return offset;

Re: [U-Boot] [PATCH v3 09/12] libfdt: Add fdt_getprop_namelen_w

2016-06-26 Thread David Gibson
int *lenp) > +{ > + return (void *)(uintptr_t)fdt_getprop_namelen(fdt, nodeoffset, name, > + namelen, lenp); > +} I believe you used this in your new setprop_inpace implementation. So the series needs to be re-ordered to avoid break

Re: [U-Boot] [PATCH v2 7/9] libfdt: Add overlay application function

2016-06-15 Thread David Gibson
On Wed, Jun 15, 2016 at 12:34:00PM +0300, Pantelis Antoniou wrote: > Hi David, > > > On Jun 15, 2016, at 06:14 , David Gibson > > wrote: > > > > On Tue, Jun 14, 2016 at 12:22:23PM +0300, Pantelis Antoniou wrote: > >> Hi David, > >>> On

Re: [U-Boot] [PATCH v2 7/9] libfdt: Add overlay application function

2016-06-14 Thread David Gibson
On Tue, Jun 14, 2016 at 12:22:23PM +0300, Pantelis Antoniou wrote: > Hi David, > > On Jun 14, 2016, at 03:25 , David Gibson > > wrote: > > On Fri, Jun 10, 2016 at 05:28:11PM +0300, Pantelis Antoniou wrote: [snip] > >>> +static int fdt_overlay_merge(void *dt, voi

Re: [U-Boot] [PATCH v2 7/9] libfdt: Add overlay application function

2016-06-14 Thread David Gibson
return ret; > > + } > > + > > + return 0; > > +} > > + > > +static int fdt_overlay_merge(void *dt, void *dto) > > +{ > > + int root, fragment; > > + > > + root = fdt_path_offset(dto, "/"); > > + if (root &

Re: [U-Boot] [PATCH v2 4/9] libfdt: Add new headers and defines

2016-06-12 Thread David Gibson
#define FDT_RAMDISK_OVERHEAD0x80 > > > > We need to figure out what the upstream libfdt/dtc maintainer’s take is on > this is. > For u-boot we’re fine and for now it’s OK. These were sent to the upstream dtc list as well. The concept is fine, but th

Re: [U-Boot] [PATCH] fdt: Try to read #address-cells/size-cells from parent

2016-03-20 Thread David Gibson
On Wed, Mar 16, 2016 at 05:18:25PM +0100, Michal Simek wrote: > Hi David, > > On 15.3.2016 01:27, David Gibson wrote: > > On Mon, Mar 14, 2016 at 10:10:58PM +0100, Michal Simek wrote: > >> On 13.3.2016 02:54, Simon Glass wrote: > >>> Hi Michal, > >>

Re: [U-Boot] [PATCH] fdt: Try to read #address-cells/size-cells from parent

2016-03-14 Thread David Gibson
"memory"; > >> reg = <0x0 0x0 0x8000>, <0x8 0x 0x8000>; > >> }; > >> > >> Code is in memory node I need to work with and asking for size-cells. > >> Current code returns 2 instead of error an

Re: [U-Boot] [PATCH 07/26] libfdt: Add a function to write a property placeholder

2016-01-31 Thread David Gibson
On Fri, Jan 29, 2016 at 11:23:31AM -0700, Simon Glass wrote: > Hi David, > > On 28 January 2016 at 22:29, David Gibson wrote: > > On Thu, Jan 28, 2016 at 09:39:27AM -0700, Simon Glass wrote: > >> The existing function to add a new property to a tree being built requi

Re: [U-Boot] [PATCH 07/26] libfdt: Add a function to write a property placeholder

2016-01-31 Thread David Gibson
f); > prop->len = cpu_to_fdt32(len); > - memcpy(prop->data, val, len); > + *valp = prop->data; > + return 0; > +} > + > +int fdt_property(void *fdt, const char *name, const void *val, int len) > +{ > + void *ptr; > + int ret;

Re: [U-Boot] [PATCH 1/5] treewide: include libfdt_env.h before fdt.h

2013-01-20 Thread David Gibson
On Fri, Jan 18, 2013 at 06:59:46AM -0500, Gerald Van Baren wrote: > On 01/17/2013 06:50 PM, David Gibson wrote: > > On Thu, Jan 17, 2013 at 01:32:45PM -0500, Jerry Van Baren wrote: > >> Hi Scott, Kim, David, > > [snip] > > >> libfdt_env.h is where Kim

Re: [U-Boot] [PATCH 1/5] treewide: include libfdt_env.h before fdt.h

2013-01-17 Thread David Gibson
o fdt.h? Yeah, I think just including libfdt.h instead of fdt.h is the way to go. The distinction is that fdt.h contains only "passive" declarations. That is, defines and structure/type declarations but no function prorotypes or other code. In particular that means that it

Re: [U-Boot] [PATCH 1/5] treewide: include libfdt_env.h before fdt.h

2013-01-17 Thread David Gibson
fdt_env.h, lines 51 and 53 > (above) are redundant. It sorts out OK in dtc because libfdt_env.h > includes stdint.h and defines fdt*_t, but it messes me up in u-boot > where (currently) libfdt_env.h does *not* include stdint.h... Ok, so, the uboot libfdt_env.h should be fixed to define

Re: [U-Boot] [PATCH v4 3/4] dtc/libfdt: introduce fdt types for annotation by endian checkers

2012-12-02 Thread David Gibson
to annotate its fdt variables such that sparse > can warn when mixing bitwise and regular integers. This patch adds > these new fdtXX_t types and, ifdef __CHECKER__ (a symbol sparse > defines), includes the bitwise annotation. > > Signed-off-by: Kim Phillips Much better, tha

Re: [U-Boot] [PATCH v3 3/4] dtc/libfdt: introduce fdt types for annotation by endian checkers

2012-11-18 Thread David Gibson
On Wed, Nov 14, 2012 at 11:12:04PM -0600, Kim Phillips wrote: > On Thu, 15 Nov 2012 15:43:40 +1100 > David Gibson wrote: > > > On Wed, Nov 14, 2012 at 06:59:58PM -0600, Kim Phillips wrote: > > > +#define EXTRACT_BYTE(x, n) ((unsigned long long)((uint8_t *)&x)[n

Re: [U-Boot] [PATCH v3 3/4] dtc/libfdt: introduce fdt types for annotation by endian checkers

2012-11-14 Thread David Gibson
onst uint8_t *__first_byte = (const uint8_t *)&__native; > + > +#define DEF_FDT_TO_CPU(bits) \ > +static inline uint##bits##_t fdt##bits##_to_cpu(fdt##bits##_t x) \ > +{ \ > + if (*__first_byte == 0x11) \ > + return (__force uint##bits##_t)x; \ > +

Re: [U-Boot] [PATCH] libfdt: introduce fdt type annotation for use by endian checkers

2012-11-05 Thread David Gibson
ly supply the fdt32_t etc. types when it defines _FDT_SPARSE as well, rather than defining them in terms of __beXX here then in terms of the attributes in the environment. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id

Re: [U-Boot] Merging device trees at runtime for module-based systems

2012-11-03 Thread David Gibson
On Thu, Nov 01, 2012 at 10:24:06AM +0100, Daniel Mack wrote: > On 01.11.2012 04:26, David Gibson wrote: > > On Fri, Oct 26, 2012 at 09:24:11AM +0200, Daniel Mack wrote: > > >> I would especially like to know where such a new functionality should > >> live, which d

Re: [U-Boot] Merging device trees at runtime for module-based systems

2012-11-02 Thread David Gibson
ments, > selecting the appropriate subset of those to use, parsing them into an > internal data structure (i.e. running dtc), and then generating a DTB > from it. The overall result is that the bootloader causes a DTB to be > generated at run-time, so at that level it's the same, but th

Re: [U-Boot] Merging device trees at runtime for module-based systems

2012-11-01 Thread David Gibson
On Fri, Oct 26, 2012 at 09:24:11AM +0200, Daniel Mack wrote: > On 26.10.2012 02:53, David Gibson wrote: > > On Thu, Oct 25, 2012 at 10:46:32PM +0200, Wolfgang Denk wrote: > >> Dear Daniel, > >> > >> In message <50893633.6070...@gmail.com> you wrote: >

Re: [U-Boot] [PATCH 05/14] fdt: Export fdtdec_find_alias_node() function

2012-10-25 Thread David Gibson
On Thu, Oct 25, 2012 at 07:31:02PM -0700, Simon Glass wrote: > This function is useful outside fdtdec, so export it. Hrm. fdt_path_offset() in libfdt itself will already look up aliases if given a path that doesn't start with '/'. So it's not clear why you need this func

Re: [U-Boot] Merging device trees at runtime for module-based systems

2012-10-25 Thread David Gibson
eventually be merged > > back into libfdt? > > I can't speak for the FDT custodian, but I think this makes a lot of > sense. As a rule I'm happy to see more functionality for libfdt. I've only seen bits and pieces of this thread, though, so I'd need to see a s

Re: [U-Boot] [PATCH 00/32] Initial sparse fix series

2012-10-18 Thread David Gibson
On Thu, Oct 18, 2012 at 05:30:22PM -0500, Kim Phillips wrote: > On Thu, 18 Oct 2012 23:11:12 +1100 > David Gibson wrote: > > > On Wed, Oct 17, 2012 at 08:19:23PM -0400, Jerry Van Baren wrote: > > > Hi David, Jon, > > > > > > Kim Phillips crea

Re: [U-Boot] [PATCH 00/32] Initial sparse fix series

2012-10-18 Thread David Gibson
a similar checker available can #define __FDT_ANNOTATIONS__ from their version of libfdt_env.h in which case they would also be required to define the annotated integer types as necessary for their checker. For convenience on Linux systems we can hav

Re: [U-Boot] Subject: [PATCH] libfdt: Add fdt functionality for more intuitive fdt handling

2012-05-08 Thread David Gibson
ue of a property by full path > fdt_write - create or change a property with full path and create subnodes if > needed I don't love these names (too vague). fdt_{get,set}prop_global() perhaps. > fdt_create_path - create subnode path with parents > > Signed-off-by: Peter Fe

Re: [U-Boot] [PATCH 02/14] fdt: Add functions to access phandles, arrays and bools

2011-11-28 Thread David Gibson
version more correct than the other? Using u32 is a better idea. The property formats are all defined in terms of fixed width elements, so using a vague width type like int to interact with it is a bad idea. -- David Gibson| I'll have my music baroque, and my code da

Re: [U-Boot] [PATCH 01/14] fdt: Tidy up a few fdtdec problems

2011-11-28 Thread David Gibson
that this patch changes this, but isn't "okay" also a legal > "enabled" value, and perhaps even the recommended value? See > http://lists.ozlabs.org/pipermail/devicetree-discuss/2011-July/006389.html. Yes. "okay", not "ok" is the standard value f

Re: [U-Boot] Adding new partition in uboot

2010-04-01 Thread David Gibson
there and sometimes not, it might be simpler to put all the partitions, including the not-always-present ones in the dts. Then you can use fdt_nop_subnode() to remove the extra one on systems where it's not present. -- David Gibson| I'll hav

Re: [U-Boot] dtc/u-boot tool naming, "ftdump", "mkimage"

2009-01-14 Thread David Gibson
t's a device tree problem I > tend to ftdump to see what's going on. Like I said, "dtc -I dtb -O dts" is the non-hacky way to do this. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you.

Re: [U-Boot] dtc/u-boot tool naming, "ftdump", "mkimage"

2009-01-14 Thread David Gibson
;>> "mkimage" which conflicts with jigdo. In essence, while U-Boot is > >>>> usually installed into a user's home directory (~/bin etc.) simple > >>>> path mixups, going to root shell, using another box etc. means you > >>>> may have

Re: [U-Boot] [PATCH] libfdt: Add function to explicitly expand aliases

2008-10-03 Thread David Gibson
be fdt_get_alias_namelen, right? > > It does look that way > > This patch has already been applied upstream, > so correcting patches on top of this are welcome. libfdt: Fix error in documentation for fdt_get_alias_namelen() Oops, screwed up the function name in the documenting

Re: [U-Boot] [PATCH] libfdt: Add function to explicitly expand aliases

2008-10-03 Thread David Gibson
uld be fdt_get_alias_namelen, right? >> > > It does look that way > > This patch has already been applied upstream, > so correcting patches on top of this are welcome. Crap, sorry. I'll send a fixup patch if none of you gets to it first. --

Re: [U-Boot] libfdt: Fix bugs in fdt_get_path()

2008-08-31 Thread David Gibson
n that class, since the distinction between NOSPACE and other errors typically does matter. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_

Re: [U-Boot] [PATCH 0/7] libfdt: Update to resync with dtc/libfdt

2008-08-20 Thread David Gibson
0]; > rx-clock-name = "none"; > tx-clock-name = "clk9"; > phy-handle = <0x3>; > phy-connection-type = "rgmii-id"; > pio-handle = <0x4>; > }; > > Whooo-h! > > Dereference the ethernet0

Re: [U-Boot] RFA: libfdt: using missing type uintptr_t

2008-08-19 Thread David Gibson
On Tue, Aug 19, 2008 at 08:40:27PM -0400, Jerry Van Baren wrote: > Hello all, I have a Request For Advice. > > I've pulled down the dtc/libfdt updates and applied them to my personal > working git repository. It turns out that David Gibson added a use of > the typedef