All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhiqiang Hou <Zhiqiang.Hou@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/7] armv8: fsl-layerscape: add i/d-cache enable function to enable_caches
Date: Wed, 27 Apr 2016 21:39:21 +0800	[thread overview]
Message-ID: <1461764367-7760-1-git-send-email-Zhiqiang.Hou@nxp.com> (raw)

From: Hou Zhiqiang <Zhiqiang.Hou@freescale.com>

This function assume that the d-cache and MMU has been enabled earlier,
so it just created MMU table in main memory. But the assumption is not
always correct, for example, the early setup is done in EL3, while
enable_caches() is called when the PE has turned into another EL.

Define the function mmu_setup() for fsl-layerscape to cover the weak
one.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@freescale.com>
---
V3:
 - no change

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index d939900..672a453 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -425,15 +425,21 @@ int arch_cpu_init(void)
 	return 0;
 }
 
+void mmu_setup(void)
+{
+	final_mmu_setup();
+}
+
 /*
- * This function is called from lib/board.c.
- * It recreates MMU table in main memory. MMU and d-cache are enabled earlier.
- * There is no need to disable d-cache for this operation.
+ * This function is called from common/board_r.c.
+ * It recreates MMU table in main memory.
  */
 void enable_caches(void)
 {
-	final_mmu_setup();
+	mmu_setup();
 	__asm_invalidate_tlb_all();
+	icache_enable();
+	dcache_enable();
 }
 #endif
 
-- 
2.1.0.27.g96db324

             reply	other threads:[~2016-04-27 13:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27 13:39 Zhiqiang Hou [this message]
2016-04-27 13:39 ` [U-Boot] [PATCH v3 2/7] ARMv8/layerscape: Add FSL PPA support Zhiqiang Hou
2016-04-27 13:39 ` [U-Boot] [PATCH v3 3/7] ARMv8/ls1043ardb: Integrate FSL PPA Zhiqiang Hou
2016-05-10 19:48   ` York Sun
2016-05-18  7:37     ` Zhiqiang Hou
2016-05-18 15:16       ` York Sun
2016-05-24  2:22         ` Zhiqiang Hou
2016-04-27 13:39 ` [U-Boot] [PATCH v3 4/7] ARMv8: add the sec_firmware header file Zhiqiang Hou
2016-04-27 13:39 ` [U-Boot] [PATCH v3 5/7] ARMv8/PSCI: Fixup the device tree for PSCI Zhiqiang Hou
2016-04-27 13:39 ` [U-Boot] [PATCH v3 6/7] ARMv8/Layerscape: switch SMP method to spin-table when the PSCI isn't available Zhiqiang Hou
2016-05-10 19:58   ` York Sun
2016-05-19  2:35     ` Zhiqiang Hou
2016-04-27 13:39 ` [U-Boot] [PATCH v3 7/7] ARMv8/ls1043ardb: add the CONFIG_ARMV8_PSCI when PPA is enabled Zhiqiang Hou
  -- strict thread matches above, loose matches on Subject: below --
2016-04-27 13:34 [U-Boot] [PATCH v3 1/7] armv8: fsl-layerscape: add i/d-cache enable function to enable_caches Zhiqiang Hou

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=1461764367-7760-1-git-send-email-Zhiqiang.Hou@nxp.com \
    --to=zhiqiang.hou@nxp.com \
    --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.