2015-03-22 15:07:26 +00:00
|
|
|
/*
|
2015-09-21 15:27:42 +00:00
|
|
|
* Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
|
2015-03-22 15:07:26 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
|
2015-01-19 13:30:23 +00:00
|
|
|
#include <config.h>
|
|
|
|
#include <linux/linkage.h>
|
|
|
|
|
|
|
|
/* page table */
|
|
|
|
#define NR_SECTIONS 4096
|
|
|
|
#define SECTION_SHIFT 20
|
|
|
|
#define DEVICE 0x00002002 /* Non-shareable Device */
|
|
|
|
#define NORMAL 0x0000000e /* Normal Memory Write-Back, No Write-Allocate */
|
|
|
|
|
|
|
|
#define TEXT_SECTION ((CONFIG_SPL_TEXT_BASE) >> (SECTION_SHIFT))
|
2015-03-22 15:07:26 +00:00
|
|
|
#define STACK_SECTION ((CONFIG_SPL_STACK) >> (SECTION_SHIFT))
|
2015-01-19 13:30:23 +00:00
|
|
|
|
|
|
|
.section ".rodata"
|
|
|
|
.align 14
|
|
|
|
ENTRY(init_page_table)
|
|
|
|
section = 0
|
|
|
|
.rept NR_SECTIONS
|
2015-09-21 15:27:42 +00:00
|
|
|
.if section == 0 || section == 1 || section == STACK_SECTION
|
2015-01-19 13:30:23 +00:00
|
|
|
attr = NORMAL
|
|
|
|
.else
|
|
|
|
attr = DEVICE
|
|
|
|
.endif
|
|
|
|
.word (section << SECTION_SHIFT) | attr
|
|
|
|
section = section + 1
|
|
|
|
.endr
|
|
|
|
END(init_page_table)
|