From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Date: Fri, 28 Nov 2014 07:12:22 +0100 Subject: [U-Boot] [PATCH] ftd_support: Fix regression causes by "fdt: Try to use fdt_address_cells()/fdt_size_cells()" In-Reply-To: <1417083397-7396-1-git-send-email-hdegoede@redhat.com> References: <1417083397-7396-1-git-send-email-hdegoede@redhat.com> Message-ID: <54781246.5050504@web.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2014-11-27 11:16, Hans de Goede wrote: > After commit 933cdbb479: "fdt: Try to use fdt_address_cells()/fdt_size_cells()" > I noticed that allwinner boards would no longer boot. > > Switching to fdt_address_cells / fdt_size_cells changes the result from > bytes to 32 bit words, so when we increment pointers into the blob, we must > do so by 32 bit words now. > > This commit makes allwinner boards boot again. > > Signed-off-by: Hans de Goede > --- > common/fdt_support.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/common/fdt_support.c b/common/fdt_support.c > index ea42c63..9e84937 100644 > --- a/common/fdt_support.c > +++ b/common/fdt_support.c > @@ -379,13 +379,13 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size, > *(fdt64_t *)p = cpu_to_fdt64(address[i]); > else > *(fdt32_t *)p = cpu_to_fdt32(address[i]); > - p += address_len; > + p += 4 * address_len; > > if (size_len == 2) > *(fdt64_t *)p = cpu_to_fdt64(size[i]); > else > *(fdt32_t *)p = cpu_to_fdt32(size[i]); > - p += size_len; > + p += 4 * size_len; > } > > return p - (char *)buf; > Just debugged this as well... I would suggest to fix the variable names, too: address_cells and size_cells. Jan -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature URL: