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