summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/armv7/uniphier/init_page_table.S
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2015-01-19 22:30:23 +0900
committerMasahiro Yamada <yamada.m@jp.panasonic.com>2015-01-23 00:50:21 +0900
commit061ae4c0bbe8df9aeedfa4a1e6a6dc122a4c157f (patch)
tree263370dacf10c98df09925c82b12d4638609b879 /arch/arm/cpu/armv7/uniphier/init_page_table.S
parent89a7c773eabf4a3f2c23c2df95501723fef5e5a7 (diff)
downloadtalos-obmc-uboot-061ae4c0bbe8df9aeedfa4a1e6a6dc122a4c157f.tar.gz
talos-obmc-uboot-061ae4c0bbe8df9aeedfa4a1e6a6dc122a4c157f.zip
ARM: UniPhier: describe init_page_table shorter
The assembly directive ".rept ... .endr" allows us to write the init_page_table much shorter. To make things further simpler, set the text and stack area as Normal Memory, and the other sections as Device attribute. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Diffstat (limited to 'arch/arm/cpu/armv7/uniphier/init_page_table.S')
-rw-r--r--arch/arm/cpu/armv7/uniphier/init_page_table.S26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/uniphier/init_page_table.S b/arch/arm/cpu/armv7/uniphier/init_page_table.S
new file mode 100644
index 0000000000..2638bcd779
--- /dev/null
+++ b/arch/arm/cpu/armv7/uniphier/init_page_table.S
@@ -0,0 +1,26 @@
+#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))
+#define STACK_SECTION ((CONFIG_SYS_INIT_SP_ADDR) >> (SECTION_SHIFT))
+
+ .section ".rodata"
+ .align 14
+ENTRY(init_page_table)
+ section = 0
+ .rept NR_SECTIONS
+ .if section == TEXT_SECTION || section == STACK_SECTION
+ attr = NORMAL
+ .else
+ attr = DEVICE
+ .endif
+ .word (section << SECTION_SHIFT) | attr
+ section = section + 1
+ .endr
+END(init_page_table)
OpenPOWER on IntegriCloud