mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: uol@pengutronix.de, Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v2 07/10] ARM: mmu: define attrs_uncached_mem() helper
Date: Wed, 17 Aug 2022 13:42:41 +0200	[thread overview]
Message-ID: <20220817114244.1810531-8-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20220817114244.1810531-1-a.fatoum@pengutronix.de>

We already have a helper with the same name for ARMv8, so define it here
for reuse in the follow-up commit.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/cpu/mmu.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/mmu.h b/arch/arm/cpu/mmu.h
index d48522d166f7..1499b70dd649 100644
--- a/arch/arm/cpu/mmu.h
+++ b/arch/arm/cpu/mmu.h
@@ -73,15 +73,20 @@ create_sections(uint32_t *ttb, unsigned long first,
 #define PMD_SECT_DEF_UNCACHED (PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT)
 #define PMD_SECT_DEF_CACHED (PMD_SECT_WB | PMD_SECT_DEF_UNCACHED)
 
-static inline void create_flat_mapping(uint32_t *ttb)
+static inline unsigned long attrs_uncached_mem(void)
 {
 	unsigned int flags = PMD_SECT_DEF_UNCACHED;
 
 	if (cpu_architecture() >= CPU_ARCH_ARMv7)
 		flags |= PMD_SECT_XN;
 
+	return flags;
+}
+
+static inline void create_flat_mapping(uint32_t *ttb)
+{
 	/* create a flat mapping using 1MiB sections */
-	create_sections(ttb, 0, 0xffffffff, flags);
+	create_sections(ttb, 0, 0xffffffff, attrs_uncached_mem());
 }
 
 #endif /* __ARM_MMU_H */
-- 
2.30.2




  parent reply	other threads:[~2022-08-17 11:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17 11:42 [PATCH v2 00/10] ARM: mmu: inhibit speculation into secure memory Ahmad Fatoum
2022-08-17 11:42 ` [PATCH v2 01/10] resource: add flags parameter to __request_region Ahmad Fatoum
2022-08-17 11:42 ` [PATCH v2 02/10] common: allow requesting SDRAM regions with custom flags Ahmad Fatoum
2022-08-17 11:42 ` [PATCH v2 03/10] memory: define reserve_sdram_region helper Ahmad Fatoum
2022-08-17 11:42 ` [PATCH v2 04/10] init: define new postmem_initcall() Ahmad Fatoum
2022-08-17 11:42 ` [PATCH v2 05/10] of: reserved-mem: reserve regions prior to mmu_initcall() Ahmad Fatoum
2022-08-17 11:42 ` [PATCH v2 06/10] ARM: mmu64: map reserved regions uncached Ahmad Fatoum
2022-08-17 11:42 ` Ahmad Fatoum [this message]
2022-08-17 11:42 ` [PATCH v2 08/10] ARM: mmu: use reserve mem entries to modify maps Ahmad Fatoum
2022-09-12 12:01   ` Sascha Hauer
2022-09-12 15:15     ` Ahmad Fatoum
2022-09-12 16:36       ` Sascha Hauer
2022-08-17 11:42 ` [PATCH v2 09/10] ARM: early-mmu: don't cache/prefetch OPTEE_SIZE bytes from end of memory Ahmad Fatoum
2022-08-17 11:42 ` [PATCH v2 10/10] commands: iomem: point out [R]eserved regions Ahmad Fatoum
2022-08-18 12:39 ` [PATCH v2 00/10] ARM: mmu: inhibit speculation into secure memory Sascha Hauer

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=20220817114244.1810531-8-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=uol@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox