Masahiro Yamada | 5b01ec4 | 2015-03-23 00:07:26 +0900 | [diff] [blame] | 1 | /* |
Masahiro Yamada | a8a4672 | 2015-09-22 00:27:42 +0900 | [diff] [blame] | 2 | * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com> |
Masahiro Yamada | 5b01ec4 | 2015-03-23 00:07:26 +0900 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
Masahiro Yamada | 23aae50 | 2015-01-19 22:30:23 +0900 | [diff] [blame] | 7 | #include <config.h> |
| 8 | #include <linux/linkage.h> |
| 9 | |
| 10 | /* page table */ |
| 11 | #define NR_SECTIONS 4096 |
| 12 | #define SECTION_SHIFT 20 |
| 13 | #define DEVICE 0x00002002 /* Non-shareable Device */ |
| 14 | #define NORMAL 0x0000000e /* Normal Memory Write-Back, No Write-Allocate */ |
| 15 | |
| 16 | #define TEXT_SECTION ((CONFIG_SPL_TEXT_BASE) >> (SECTION_SHIFT)) |
Masahiro Yamada | 5b01ec4 | 2015-03-23 00:07:26 +0900 | [diff] [blame] | 17 | #define STACK_SECTION ((CONFIG_SPL_STACK) >> (SECTION_SHIFT)) |
Masahiro Yamada | 23aae50 | 2015-01-19 22:30:23 +0900 | [diff] [blame] | 18 | |
| 19 | .section ".rodata" |
| 20 | .align 14 |
| 21 | ENTRY(init_page_table) |
| 22 | section = 0 |
| 23 | .rept NR_SECTIONS |
Masahiro Yamada | a8a4672 | 2015-09-22 00:27:42 +0900 | [diff] [blame] | 24 | .if section == 0 || section == 1 || section == STACK_SECTION |
Masahiro Yamada | 23aae50 | 2015-01-19 22:30:23 +0900 | [diff] [blame] | 25 | attr = NORMAL |
| 26 | .else |
| 27 | attr = DEVICE |
| 28 | .endif |
| 29 | .word (section << SECTION_SHIFT) | attr |
| 30 | section = section + 1 |
| 31 | .endr |
| 32 | END(init_page_table) |