blob: ac2959a17dbd5c16d19bf7842ffd6f2bf717edf8 [file] [log] [blame]
Masahiro Yamadace3a6392015-03-23 00:07:26 +09001/*
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 Yamada061ae4c2015-01-19 22:30:23 +09009#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 Yamadace3a6392015-03-23 00:07:26 +090019#define STACK_SECTION ((CONFIG_SPL_STACK) >> (SECTION_SHIFT))
Masahiro Yamada061ae4c2015-01-19 22:30:23 +090020
21 .section ".rodata"
22 .align 14
23ENTRY(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
34END(init_page_table)