From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJ2cE-000669-Jq for barebox@lists.infradead.org; Wed, 16 May 2018 20:01:40 +0000 Received: by mail-pl0-x241.google.com with SMTP id w19-v6so1049918plq.4 for ; Wed, 16 May 2018 13:01:34 -0700 (PDT) From: Andrey Smirnov Date: Wed, 16 May 2018 13:00:30 -0700 Message-Id: <20180516200036.29829-23-andrew.smirnov@gmail.com> In-Reply-To: <20180516200036.29829-1-andrew.smirnov@gmail.com> References: <20180516200036.29829-1-andrew.smirnov@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v2 22/28] ARM: mmu: Pass PTE flags a parameter to arm_create_pte() To: barebox@lists.infradead.org Cc: Andrey Smirnov In order to make it possible to use this functions in contexts where creating a new PTE of uncached pages in not appropriate, pass PTE flags a parameter to arm_create_pte() and fix all of the current users as necessary. Signed-off-by: Andrey Smirnov --- arch/arm/cpu/mmu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c index 339ab8e82..eeab0a749 100644 --- a/arch/arm/cpu/mmu.c +++ b/arch/arm/cpu/mmu.c @@ -87,7 +87,7 @@ static void arm_mmu_not_initialized_error(void) * We initially create a flat uncached mapping on it. * Not yet exported, but may be later if someone finds use for it. */ -static u32 *arm_create_pte(unsigned long virt) +static u32 *arm_create_pte(unsigned long virt, uint32_t flags) { u32 *table; int i; @@ -101,7 +101,7 @@ static u32 *arm_create_pte(unsigned long virt) ttb[pgd_index(virt)] = (unsigned long)table | PMD_TYPE_TABLE; for (i = 0; i < PTRS_PER_PTE; i++) { - table[i] = virt | PTE_TYPE_SMALL | pte_flags_uncached; + table[i] = virt | PTE_TYPE_SMALL | flags; virt += PAGE_SIZE; } @@ -291,7 +291,8 @@ static void create_vector_table(unsigned long adr) vectors = xmemalign(PAGE_SIZE, PAGE_SIZE); pr_debug("Creating vector table, virt = 0x%p, phys = 0x%08lx\n", vectors, adr); - exc = arm_create_pte(ALIGN_DOWN(adr, PGDIR_SIZE)); + exc = arm_create_pte(ALIGN_DOWN(adr, PGDIR_SIZE), + pte_flags_uncached); idx = (adr & (PGDIR_SIZE - 1)) >> PAGE_SHIFT; exc[idx] = (u32)vectors | PTE_TYPE_SMALL | pte_flags_cached; } @@ -362,7 +363,7 @@ static void create_zero_page(void) */ pr_debug("zero page is in SDRAM area, currently not supported\n"); } else { - zero = arm_create_pte(0x0); + zero = arm_create_pte(0x0, pte_flags_uncached); zero[0] = 0; pr_debug("Created zero page\n"); } -- 2.17.0 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox