Re: [PATCH v3 1/1] of: unittest: overlay: ensure proper alignment of copied FDT

2021-04-08 Thread Guenter Roeck
On 4/8/21 1:06 PM, Frank Rowand wrote: >>> +#define FDT_ALIGN_SIZE 8 >>> + >> >> Use existing define ? Or was that local in libfdt ? > > I don't see a define in libfdt. If anyone finds one, > I'll switch to it. > Turns out that was hardcoded in scripts/dtc/libfdt/fdt.c + /* The device

Re: [PATCH v3 1/1] of: unittest: overlay: ensure proper alignment of copied FDT

2021-04-08 Thread Frank Rowand
On 4/8/21 1:27 PM, Rob Herring wrote: > On Thu, Apr 8, 2021 at 10:17 AM wrote: >> >> From: Frank Rowand >> >> The Devicetree standard specifies an 8 byte alignment of the FDT. >> Code in libfdt expects this alignment for an FDT image in memory. >> kmemdup() returns 4 byte alignment on openrisc.

Re: [PATCH v3 1/1] of: unittest: overlay: ensure proper alignment of copied FDT

2021-04-08 Thread Frank Rowand
Hi Guenter, Thanks for the review! On 4/8/21 10:32 AM, Guenter Roeck wrote: > On 4/8/21 8:17 AM, frowand.l...@gmail.com wrote: >> From: Frank Rowand >> >> The Devicetree standard specifies an 8 byte alignment of the FDT. >> Code in libfdt expects this alignment for an FDT image in memory. >>

Re: [PATCH v3 1/1] of: unittest: overlay: ensure proper alignment of copied FDT

2021-04-08 Thread Rob Herring
On Thu, Apr 8, 2021 at 10:17 AM wrote: > > From: Frank Rowand > > The Devicetree standard specifies an 8 byte alignment of the FDT. > Code in libfdt expects this alignment for an FDT image in memory. > kmemdup() returns 4 byte alignment on openrisc. Replace kmemdup() > with kmalloc(), align

Re: [PATCH v3 1/1] of: unittest: overlay: ensure proper alignment of copied FDT

2021-04-08 Thread Guenter Roeck
On 4/8/21 8:17 AM, frowand.l...@gmail.com wrote: > From: Frank Rowand > > The Devicetree standard specifies an 8 byte alignment of the FDT. > Code in libfdt expects this alignment for an FDT image in memory. > kmemdup() returns 4 byte alignment on openrisc. Replace kmemdup() > with kmalloc(),

[PATCH v3 1/1] of: unittest: overlay: ensure proper alignment of copied FDT

2021-04-08 Thread frowand . list
From: Frank Rowand The Devicetree standard specifies an 8 byte alignment of the FDT. Code in libfdt expects this alignment for an FDT image in memory. kmemdup() returns 4 byte alignment on openrisc. Replace kmemdup() with kmalloc(), align pointer, memcpy() to get proper alignment. The 4 byte