| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/arch/arm/kernel/head.S |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * Copyright (c) 2003 ARM Limited |
|---|
| 6 | 7 | * All Rights Reserved |
|---|
| 7 | 8 | * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 10 | | - * published by the Free Software Foundation. |
|---|
| 11 | | - * |
|---|
| 12 | 9 | * Kernel startup code for all 32-bit CPUs |
|---|
| 13 | 10 | */ |
|---|
| 14 | 11 | #include <linux/linkage.h> |
|---|
| 15 | 12 | #include <linux/init.h> |
|---|
| 13 | +#include <linux/pgtable.h> |
|---|
| 16 | 14 | |
|---|
| 17 | 15 | #include <asm/assembler.h> |
|---|
| 18 | 16 | #include <asm/cp15.h> |
|---|
| .. | .. |
|---|
| 21 | 19 | #include <asm/asm-offsets.h> |
|---|
| 22 | 20 | #include <asm/memory.h> |
|---|
| 23 | 21 | #include <asm/thread_info.h> |
|---|
| 24 | | -#include <asm/pgtable.h> |
|---|
| 25 | 22 | |
|---|
| 26 | 23 | #if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING) |
|---|
| 27 | 24 | #include CONFIG_DEBUG_LL_INCLUDE |
|---|
| .. | .. |
|---|
| 278 | 275 | * We map 2 sections in case the ATAGs/DTB crosses a section boundary. |
|---|
| 279 | 276 | */ |
|---|
| 280 | 277 | mov r0, r2, lsr #SECTION_SHIFT |
|---|
| 281 | | - movs r0, r0, lsl #SECTION_SHIFT |
|---|
| 282 | | - subne r3, r0, r8 |
|---|
| 283 | | - addne r3, r3, #PAGE_OFFSET |
|---|
| 284 | | - addne r3, r4, r3, lsr #(SECTION_SHIFT - PMD_ORDER) |
|---|
| 285 | | - orrne r6, r7, r0 |
|---|
| 278 | + cmp r2, #0 |
|---|
| 279 | + ldrne r3, =FDT_FIXED_BASE >> (SECTION_SHIFT - PMD_ORDER) |
|---|
| 280 | + addne r3, r3, r4 |
|---|
| 281 | + orrne r6, r7, r0, lsl #SECTION_SHIFT |
|---|
| 286 | 282 | strne r6, [r3], #1 << PMD_ORDER |
|---|
| 287 | 283 | addne r6, r6, #1 << SECTION_SHIFT |
|---|
| 288 | 284 | strne r6, [r3] |
|---|
| .. | .. |
|---|
| 399 | 395 | ldmia r4, {r5, r7, r12} @ address to jump to after |
|---|
| 400 | 396 | sub lr, r4, r5 @ mmu has been enabled |
|---|
| 401 | 397 | add r3, r7, lr |
|---|
| 402 | | - ldrd r4, [r3, #0] @ get secondary_data.pgdir |
|---|
| 398 | + ldrd r4, r5, [r3, #0] @ get secondary_data.pgdir |
|---|
| 403 | 399 | ARM_BE8(eor r4, r4, r5) @ Swap r5 and r4 in BE: |
|---|
| 404 | 400 | ARM_BE8(eor r5, r4, r5) @ it can be done in 3 steps |
|---|
| 405 | 401 | ARM_BE8(eor r4, r4, r5) @ without using a temp reg. |
|---|