All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 06/12] arm: Disable LPAE if not enabled
Date: Mon, 22 May 2017 05:17:26 -0600	[thread overview]
Message-ID: <20170522111732.11265-7-sjg@chromium.org> (raw)
In-Reply-To: <20170522111732.11265-1-sjg@chromium.org>

If CONFIG_ARMV7_LPAE is not defined we should make sure that the feature
is disabled. This can happen if U-Boot is chain-loaded from another boot
loader which does enable LPAE.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/arm/lib/cache-cp15.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
index f293573601..cf852c061b 100644
--- a/arch/arm/lib/cache-cp15.c
+++ b/arch/arm/lib/cache-cp15.c
@@ -172,6 +172,15 @@ static inline void mmu_setup(void)
 			: : "r" (MEMORY_ATTRIBUTES) : "memory");
 	}
 #elif defined(CONFIG_CPU_V7)
+	if (is_hyp()) {
+		/* Set HTCR to disable LPAE */
+		asm volatile("mcr p15, 4, %0, c2, c0, 2"
+			: : "r" (0) : "memory");
+	} else {
+		/* Set TTBCR to disable LPAE */
+		asm volatile("mcr p15, 0, %0, c2, c0, 2"
+			: : "r" (0) : "memory");
+	}
 	/* Set TTBR0 */
 	reg = gd->arch.tlb_addr & TTBR0_BASE_ADDR_MASK;
 #if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
-- 
2.13.0.303.g4ebf302169-goog

  parent reply	other threads:[~2017-05-22 11:17 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22 11:17 [U-Boot] [PATCH 00/12] tegra: nyan-big: Support chainloading and add documentation Simon Glass
2017-05-22 11:17 ` [U-Boot] [PATCH 01/12] arm: arm720t: Support CONFIG_SKIP_LOWLEVEL_INIT_ONLY Simon Glass
2017-05-23  1:15   ` Tom Rini
2017-05-22 11:17 ` [U-Boot] [PATCH 02/12] tegra: Init clocks even when SPL did not run Simon Glass
2017-05-22 11:17 ` [U-Boot] [PATCH 03/12] tegra: dts: Add cros-ec SPI settings Simon Glass
2017-05-22 11:17 ` [U-Boot] [PATCH 04/12] arm: Rename HCTR to HTCR Simon Glass
2017-05-23  1:15   ` Tom Rini
2017-05-22 11:17 ` [U-Boot] [PATCH 05/12] arm: Don't try to support CONFIG_ARMV7_LPAE on ARMv4T Simon Glass
2017-05-23  1:15   ` Tom Rini
2017-06-09  3:00     ` Simon Glass
2017-06-09 11:16       ` Tom Rini
2017-05-22 11:17 ` Simon Glass [this message]
2017-05-23  1:15   ` [U-Boot] [PATCH 06/12] arm: Disable LPAE if not enabled Tom Rini
2017-05-22 11:17 ` [U-Boot] [PATCH 07/12] tegra: spi: Wait a little after setting the clocks Simon Glass
2017-05-22 11:17 ` [U-Boot] [PATCH 08/12] tegra: nyan-big: Enable the dhrystone benchmark Simon Glass
2017-05-22 11:17 ` [U-Boot] [PATCH 09/12] tegra: video: Don't power up the SOR twice Simon Glass
2017-06-07 12:52   ` Anatolij Gustschin
2017-05-22 11:17 ` [U-Boot] [PATCH 10/12] tegra: Enable CP15 init Simon Glass
2017-05-22 11:17 ` [U-Boot] [PATCH 11/12] tegra: clock: Avoid a divide-by-zero error Simon Glass
2017-05-22 11:17 ` [U-Boot] [PATCH 12/12] README: Add instructions for chain-loading U-Boot Simon Glass
2017-05-29 13:29   ` Peter Robinson
2017-06-01  3:11     ` Simon Glass
2017-05-31 18:28 ` [U-Boot] [PATCH 00/12] tegra: nyan-big: Support chainloading and add documentation Matthew Gorski
2017-05-31 18:40   ` Matthew Gorski
2017-05-31 19:19     ` Simon Glass
2017-06-01 13:52   ` Matthew Gorski
2017-06-07 11:58     ` Simon Glass
2017-06-07 15:32       ` Tom Warren
2017-06-07 15:41         ` Stephen Warren
2017-06-09 12:27           ` Simon Glass
2017-06-27 20:09             ` Thomas Hoff
2017-07-07  3:58               ` Simon Glass
2017-07-07  7:27                 ` Thomas Hoff
2017-07-08 16:09                   ` Simon Glass
2017-07-09 13:59                     ` Tom Warren

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=20170522111732.11265-7-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.