blob: 2d3ad15c6e2a20601c2a69b86e0b7209c6f3ff2c [file] [log] [blame]
Masahiro Yamadace3a6392015-03-23 00:07:26 +09001/*
Masahiro Yamadad47fe9b2015-09-22 00:27:42 +09002 * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamadace3a6392015-03-23 00:07:26 +09003 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
Masahiro Yamada061ae4c2015-01-19 22:30:23 +09007#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 Yamadace3a6392015-03-23 00:07:26 +090017#define STACK_SECTION ((CONFIG_SPL_STACK) >> (SECTION_SHIFT))
Masahiro Yamada061ae4c2015-01-19 22:30:23 +090018
19 .section ".rodata"
20 .align 14
21ENTRY(init_page_table)
22 section = 0
23 .rept NR_SECTIONS
Masahiro Yamadad47fe9b2015-09-22 00:27:42 +090024 .if section == 0 || section == 1 || section == STACK_SECTION
Masahiro Yamada061ae4c2015-01-19 22:30:23 +090025 attr = NORMAL
26 .else
27 attr = DEVICE
28 .endif
29 .word (section << SECTION_SHIFT) | attr
30 section = section + 1
31 .endr
32END(init_page_table)