[PATCH] ARM: head.S: explicitly map DT even if it lives in the first physical section

Ard Biesheuvel ardb at kernel.org
Tue Nov 17 03:21:35 EST 2020


On Tue, 17 Nov 2020 at 00:33, Linus Walleij <linus.walleij at linaro.org> wrote:
>
> On Mon, Nov 16, 2020 at 3:57 PM Ard Biesheuvel <ardb at kernel.org> wrote:
>
> > The early ATAGS/DT mapping code uses SECTION_SHIFT to mask low order
> > bits of R2, and decides that no ATAGS/DTB were provided if the resulting
> > value is 0x0.
> >
> > This means that on systems where DRAM starts at 0x0 (such as Raspberry
> > Pi), no explicit mapping of the DT will be created if R2 points into the
> > first 1 MB section of memory. This was not a problem before, because the
> > decompressed kernel is loaded at the base of DRAM and mapped using
> > sections as well, and so as long as the DT is referenced via a virtual
> > address that uses the same translation (the linear map, in this case),
> > things work fine.
> >
> > However, commit 149a3ffe62b9dbc3 ("9012/1: move device tree mapping out of
> > linear region") changes this, and now the DT is referenced via a virtual
> > address that is disjoint from the linear mapping of DRAM, and so we need
> > the early code to create the DT mapping unconditionally.
> >
> > So let's create the early DT mapping for any value of R2 != 0x0.
> >
> > Fixes: 149a3ffe62b9dbc3 ("9012/1: move device tree mapping out of linear region")
> > Reported-by: Guillaume Tucker <guillaume.tucker at collabora.com>
> > Signed-off-by: Ard Biesheuvel <ardb at kernel.org>
>
> That's a good catch!
> Reviewed-by: Linus Walleij <linus.walleij at linaro.org>
>

I have dropped this into rmk's patch system as 9027/1.



More information about the linux-arm-kernel mailing list