All of lore.kernel.org
 help / color / mirror / Atom feed
From: York Sun <york.sun@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 7/9] armv8: layerscape: Flush MMU tables after creattion
Date: Mon, 13 Feb 2017 19:45:34 -0800	[thread overview]
Message-ID: <1487043936-10112-8-git-send-email-york.sun@nxp.com> (raw)
In-Reply-To: <1487043936-10112-1-git-send-email-york.sun@nxp.com>

MMU tables should be flushed if current code runs with d-cache on. This
applies to early MMU tables with SPL boot, and all final MMU tables.

Signed-off-by: York Sun <york.sun@nxp.com>
---

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index ce2b140..fffc0dd 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -80,6 +80,13 @@ static inline void early_mmu_setup(void)
 	/* Create early page tables */
 	setup_pgtables();
 
+
+#if defined(CONFIG_SPL) || !defined(CONFIG_SPL_BUILD)
+	/* For SPL RAM boot, cache is enabled. MMU table needs to be flushed */
+	flush_dcache_range(gd->arch.tlb_addr,
+			   gd->arch.tlb_addr + gd->arch.tlb_size);
+#endif
+
 	/* point TTBR to the new table */
 	set_ttbr_tcr_mair(el, gd->arch.tlb_addr,
 			  get_tcr(el, NULL, NULL) &
@@ -184,6 +191,8 @@ static inline void final_mmu_setup(void)
 	/* flush new MMU table */
 	flush_dcache_range(gd->arch.tlb_addr,
 			   gd->arch.tlb_addr + gd->arch.tlb_size);
+	flush_dcache_range(gd->arch.tlb_emerg,
+			   gd->arch.tlb_emerg + gd->arch.tlb_size);
 
 	/* point TTBR to the new table */
 	set_ttbr_tcr_mair(el, gd->arch.tlb_addr, get_tcr(el, NULL, NULL),
-- 
2.7.4

  parent reply	other threads:[~2017-02-14  3:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14  3:45 [U-Boot] [PATCH 0/9] Rewrite ARMv8 layerscape MMU York Sun
2017-02-14  3:45 ` [U-Boot] [PATCH 1/9] armv8: Add global variable resv_ram York Sun
2017-02-14  3:45 ` [U-Boot] [PATCH 2/9] armv8: ls2080a: Move CONFIG_FSL_MC_ENET to Kconfig York Sun
2017-02-14  3:45 ` [U-Boot] [PATCH 3/9] armv8: ls2080a: Move CONFIG_SYS_MC_RSV_MEM_ALIGN " York Sun
2017-02-14  3:45 ` [U-Boot] [PATCH 4/9] armv8: layerscape: Rewrite memory reservation York Sun
2017-02-14 15:31   ` Alexander Graf
2017-02-14 17:00     ` york sun
     [not found]     ` <320b0ef7-c2eb-014a-b9f8-9ac538c30c3c@nxp.com>
2017-02-14 17:38       ` york sun
2017-02-14 19:55         ` Alexander Graf
2017-02-14 22:33           ` york sun
2017-02-15 18:52           ` york sun
2017-02-15 22:01             ` Alexander Graf
2017-02-14  3:45 ` [U-Boot] [PATCH 5/9] driver: net: fsl-mc: Update calculation of MC RAM York Sun
2017-02-14  3:45 ` [U-Boot] [PATCH 6/9] armv8: layerscape: Update MMU mapping with actual DDR size York Sun
2017-02-14  3:45 ` York Sun [this message]
2017-02-14  3:45 ` [U-Boot] [PATCH 8/9] armv8: mmu: Add a function to change mapping attributes York Sun
2017-02-14 15:39   ` Alexander Graf
2017-02-14 16:44     ` york sun
2017-02-14  3:45 ` [U-Boot] [PATCH 9/9] armv8: layerscape: Update early MMU for DDR after initialization York Sun

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=1487043936-10112-8-git-send-email-york.sun@nxp.com \
    --to=york.sun@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.