Re: [BUG] mpc8323_rdb platform doesn't boot since kernel 3.16

From: Rob Herring
Date: Wed Jun 10 2015 - 14:18:45 EST


On Wed, Jun 10, 2015 at 10:12 AM, leroy christophe
<christophe.leroy@xxxxxx> wrote:
> Le 06/06/2015 17:32, Rob Herring a Ãcrit :
>>
>> On Sat, Jun 6, 2015 at 6:20 AM, christophe leroy
>> <christophe.leroy@xxxxxx> wrote:
>>>
>>> I've got a MPC8323 RDB evaluation platform from freescale
>>> kernel 4.0 doesn't boot
>>> kernel 3.16 doesn't boot
>>> kernel 3.15 boots ok
>>>
>>> I disected the issue down to your commit "of/fdt: Convert FDT functions
>>> to
>>> use libfdt" (e6a6928c3ea1d0195ed75a091e345696b916c09b)
>>>
>>> Do you have an idea of what the issue could be ?
>>
>> Is your dtb older version of the dtb format (before 0x10)? libfdt
>> doesn't work on the older versions.
>
> Yes, dtb has version 0x11, which seems to be the issue (see below)

In that your bootloader doesn't understand 0x11.

>> If not, do you have logs with debug enabled in drivers/of/fdt.c?
>
> I get "unflatten: error -11 processing FDT"

Can I get the full debug prints.

> Indeed, Uboot (version 1.1.6 - installed on that evaluation board) adds a
> node called "chosen" at the end of the BLOB.
> But Uboot doesn't update the FDT len in the BLOB header, therefore the
> following test fails in fdt_offset_ptr()
>
> if (fdt_version(fdt) >= 0x11)
> if (((offset + len) < offset)
> || ((offset + len) > fdt_size_dt_struct(fdt)))
> return NULL;
>
>
> If I comment this test out, Linux 3.16 to 4.0 work properly on my evaluation
> board.
>
> Can we find a proper workaround for this issue ?

The options are:

- update the ancient bootloader
- make dtc build 0x10 version dtb for this platform (-V option will do this)
- make the kernel fix the field (I'm not sure how we get the correct
length. dt_string offset minus dt_struct offset?)
- make the kernel force the version to 0x10 (I don't think there are
any other changes from 0x10 to 0x11.)

I'd probably lean toward the 2nd option. This is what the bootloader
is compatible with and won't break if we rev the format again. I
believe there is already some plumbing to pass per platform options to
dtc. The question is what other platforms have this problem.

Rob

> Christophe
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/