Skip to content

Commit 5d2f09c

Browse files
ardbiesheuvelgregkh
authored andcommitted
ARM: 9027/1: head.S: explicitly map DT even if it lives in the first physical section
commit 10fce53 upstream 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 7a1be31 ("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. Reported-by: "kernelci.org bot" <bot@kernelci.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ac421c7 commit 5d2f09c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎arch/arm/kernel/head.S‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,10 @@ __create_page_tables:
274274
* We map 2 sections in case the ATAGs/DTB crosses a section boundary.
275275
*/
276276
mov r0, r2, lsr #SECTION_SHIFT
277-
movs r0, r0, lsl #SECTION_SHIFT
277+
cmp r2, #0
278278
ldrne r3, =FDT_FIXED_BASE >> (SECTION_SHIFT - PMD_ORDER)
279279
addne r3, r3, r4
280-
orrne r6, r7, r0
280+
orrne r6, r7, r0, lsl #SECTION_SHIFT
281281
strne r6, [r3], #1 << PMD_ORDER
282282
addne r6, r6, #1 << SECTION_SHIFT
283283
strne r6, [r3]

0 commit comments

Comments
 (0)