From e091832f25a06c9b3b5996eb22293d8f9661260a Mon Sep 17 00:00:00 2001 From: Lokesh Vutla Date: Mon, 27 Aug 2018 15:57:13 +0530 Subject: [PATCH] armv8: K3: am654: Add custom MMU support Add MMU mappings for AM654 SoC. Reviewed-by: Tom Rini Signed-off-by: Lokesh Vutla --- arch/arm/mach-k3/Makefile | 1 + arch/arm/mach-k3/arm64-mmu.c | 45 ++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 arch/arm/mach-k3/arm64-mmu.c diff --git a/arch/arm/mach-k3/Makefile b/arch/arm/mach-k3/Makefile index 356fc27b11..e9b7ee5210 100644 --- a/arch/arm/mach-k3/Makefile +++ b/arch/arm/mach-k3/Makefile @@ -4,3 +4,4 @@ # Lokesh Vutla obj-$(CONFIG_SOC_K3_AM6) += am6_init.o +obj-$(CONFIG_ARM64) += arm64-mmu.o diff --git a/arch/arm/mach-k3/arm64-mmu.c b/arch/arm/mach-k3/arm64-mmu.c new file mode 100644 index 0000000000..f8b93fe458 --- /dev/null +++ b/arch/arm/mach-k3/arm64-mmu.c @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * K3: ARM64 MMU setup + * + * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ + * Lokesh Vutla + * (This file is derived from arch/arm/cpu/armv8/zynqmp/cpu.c) + * + */ + +#include +#include +#include + +/* NR_DRAM_BANKS + 32bit IO + 64bit IO + terminator */ +#define NR_MMU_REGIONS (CONFIG_NR_DRAM_BANKS + 3) + +/* ToDo: Add 64bit IO */ +struct mm_region am654_mem_map[NR_MMU_REGIONS] = { + { + .virt = 0x0UL, + .phys = 0x0UL, + .size = 0x80000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | + PTE_BLOCK_NON_SHARE | + PTE_BLOCK_PXN | PTE_BLOCK_UXN + }, { + .virt = 0x80000000UL, + .phys = 0x80000000UL, + .size = 0x80000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | + PTE_BLOCK_INNER_SHARE + }, { + .virt = 0x880000000UL, + .phys = 0x880000000UL, + .size = 0x80000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | + PTE_BLOCK_INNER_SHARE + }, { + /* List terminator */ + 0, + } +}; + +struct mm_region *mem_map = am654_mem_map; -- 2.25.1