From: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
To: Russell King <linux@arm.linux.org.uk>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 2/3] ARM: enable TTBR0/TTBR1 split in short mode
Date: Tue, 18 Nov 2014 19:53:19 +0400 [thread overview]
Message-ID: <20141118165319.9958.67009.stgit@buzz> (raw)
In-Reply-To: <20141118165313.9958.1242.stgit@buzz>
This feature was partially implemented long time ago. All cpus load
swapper_pg_dir into TTBR1 since commit d427958a46af24f75d0017c45eadd172273bbf33
("ARM: 6942/1: mm: make TTBR1 always point to swapper_pg_dir on ARMv6/7").
But TTBRx split is never been enabled in TTBCR.
This patch enables TTBRx split for 2Gb/2Gb and 1Gb/3Gb combinations.
Area covered by TTBR0 must be power of two, thus 3Gb/1Gb mode is unsupported.
Signed-off-by: Konstantin Khlebnikov <k.khlebnikov@samsung.com>
---
arch/arm/include/asm/pgtable-2level-hwdef.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/arm/include/asm/pgtable-2level-hwdef.h b/arch/arm/include/asm/pgtable-2level-hwdef.h
index c2ed1fa..605652c 100644
--- a/arch/arm/include/asm/pgtable-2level-hwdef.h
+++ b/arch/arm/include/asm/pgtable-2level-hwdef.h
@@ -90,6 +90,19 @@
#define PHYS_MASK (~0UL)
+/*
+ * TTBR0/TTBR1 split (PAGE_OFFSET):
+ * 0x40000000: TTBCR.N = 2
+ * 0x80000000: TTBCR.N = 1
+ * 0xc0000000: TTBCR.N = 0 (not used)
+ */
+
+#ifdef CONFIG_VMSPLIT_1G
+#define TTBR1_SIZE 2
+#elif defined CONFIG_VMSPLIT_2G
+#define TTBR1_SIZE 1
+#elif defined CONFIG_VMSPLIT_3G
#define TTBR1_SIZE 0
+#endif
#endif
next prev parent reply other threads:[~2014-11-18 16:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 15:53 [PATCH RFC 1/3] ARM: LPAE: rework TTBR0/TTBR1 split Konstantin Khlebnikov
2014-11-18 15:53 ` Konstantin Khlebnikov [this message]
2014-11-18 18:04 ` [PATCH RFC 2/3] ARM: enable TTBR0/TTBR1 split in short mode Catalin Marinas
2014-11-18 15:53 ` [PATCH RFC 3/3] ARM: reduce size of page table directory for " Konstantin Khlebnikov
2014-11-18 18:14 ` Catalin Marinas
2014-11-18 19:11 ` Russell King - ARM Linux
2014-11-18 23:02 ` Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141118165319.9958.67009.stgit@buzz \
--to=k.khlebnikov@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox