* [U-Boot] [PATCH] ftd_support: Fix regression causes by "fdt: Try to use fdt_address_cells()/fdt_size_cells()"
@ 2014-11-27 10:16 Hans de Goede
2014-11-27 14:25 ` Simon Glass
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Hans de Goede @ 2014-11-27 10:16 UTC (permalink / raw)
To: u-boot
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 <hdegoede@redhat.com>
---
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;
--
2.1.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [U-Boot] [PATCH] ftd_support: Fix regression causes by "fdt: Try to use fdt_address_cells()/fdt_size_cells()"
2014-11-27 10:16 [U-Boot] [PATCH] ftd_support: Fix regression causes by "fdt: Try to use fdt_address_cells()/fdt_size_cells()" Hans de Goede
@ 2014-11-27 14:25 ` Simon Glass
2014-11-27 16:13 ` Simon Glass
2014-11-28 6:12 ` Jan Kiszka
2014-11-30 3:44 ` Stephen Warren
2 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2014-11-27 14:25 UTC (permalink / raw)
To: u-boot
Hi Hans,
On 27 November 2014 at 03:16, Hans de Goede <hdegoede@redhat.com> 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 <hdegoede@redhat.com>
Thanks for the patch.
Nit time - can you please tweak the patch subject? Should be fdt: for
the tag and try to keep under 60 chars, so something like "fdt: Fix
regression in fdt_pack_reg()"
Regards,
Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] ftd_support: Fix regression causes by "fdt: Try to use fdt_address_cells()/fdt_size_cells()"
2014-11-27 14:25 ` Simon Glass
@ 2014-11-27 16:13 ` Simon Glass
0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2014-11-27 16:13 UTC (permalink / raw)
To: u-boot
On 27 November 2014 at 07:25, Simon Glass <sjg@chromium.org> wrote:
> Hi Hans,
>
> On 27 November 2014 at 03:16, Hans de Goede <hdegoede@redhat.com> 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 <hdegoede@redhat.com>
>
> Thanks for the patch.
>
> Nit time - can you please tweak the patch subject? Should be fdt: for
> the tag and try to keep under 60 chars, so something like "fdt: Fix
> regression in fdt_pack_reg()"
Should have said I'm happy to do then when I apply it if you prefer.
- Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] ftd_support: Fix regression causes by "fdt: Try to use fdt_address_cells()/fdt_size_cells()"
2014-11-27 10:16 [U-Boot] [PATCH] ftd_support: Fix regression causes by "fdt: Try to use fdt_address_cells()/fdt_size_cells()" Hans de Goede
2014-11-27 14:25 ` Simon Glass
@ 2014-11-28 6:12 ` Jan Kiszka
2014-11-28 7:43 ` Masahiro Yamada
2014-11-30 3:44 ` Stephen Warren
2 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2014-11-28 6:12 UTC (permalink / raw)
To: u-boot
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 <hdegoede@redhat.com>
> ---
> 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: <http://lists.denx.de/pipermail/u-boot/attachments/20141128/90e6294d/attachment.pgp>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] ftd_support: Fix regression causes by "fdt: Try to use fdt_address_cells()/fdt_size_cells()"
2014-11-28 6:12 ` Jan Kiszka
@ 2014-11-28 7:43 ` Masahiro Yamada
0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2014-11-28 7:43 UTC (permalink / raw)
To: u-boot
Hi.
> 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 <hdegoede@redhat.com>
This patch solved my Linux-boot problem as well.
Tested-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
>
> I would suggest to fix the variable names, too: address_cells and
> size_cells.
Agreed.
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] ftd_support: Fix regression causes by "fdt: Try to use fdt_address_cells()/fdt_size_cells()"
2014-11-27 10:16 [U-Boot] [PATCH] ftd_support: Fix regression causes by "fdt: Try to use fdt_address_cells()/fdt_size_cells()" Hans de Goede
2014-11-27 14:25 ` Simon Glass
2014-11-28 6:12 ` Jan Kiszka
@ 2014-11-30 3:44 ` Stephen Warren
2 siblings, 0 replies; 6+ messages in thread
From: Stephen Warren @ 2014-11-30 3:44 UTC (permalink / raw)
To: u-boot
On 11/27/2014 03:16 AM, 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.
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
This fixes kernel booting on the RPi too.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-11-30 3:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-27 10:16 [U-Boot] [PATCH] ftd_support: Fix regression causes by "fdt: Try to use fdt_address_cells()/fdt_size_cells()" Hans de Goede
2014-11-27 14:25 ` Simon Glass
2014-11-27 16:13 ` Simon Glass
2014-11-28 6:12 ` Jan Kiszka
2014-11-28 7:43 ` Masahiro Yamada
2014-11-30 3:44 ` Stephen Warren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox