aarch64: mmu: Enable CONFIG_MMU

Enable CONFIG_MMU for AArch64 and add the new arch_mem_map() required
function.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This commit is contained in:
Carlo Caione 2020-10-26 12:08:37 +01:00 committed by Anas Nashif
commit e710d36f77
5 changed files with 62 additions and 11 deletions

View file

@ -19,12 +19,14 @@
#define MT_DEVICE_GRE 2U
#define MT_NORMAL_NC 3U
#define MT_NORMAL 4U
#define MT_NORMAL_WT 5U
#define MEMORY_ATTRIBUTES ((0x00 << (MT_DEVICE_nGnRnE * 8)) | \
(0x04 << (MT_DEVICE_nGnRE * 8)) | \
(0x0c << (MT_DEVICE_GRE * 8)) | \
(0x44 << (MT_NORMAL_NC * 8)) | \
(0xffUL << (MT_NORMAL * 8)))
(0xffUL << (MT_NORMAL * 8)) | \
(0xbbUL << (MT_NORMAL_WT * 8)))
/* More flags from user's perpective are supported using remaining bits
* of "attrs" field, i.e. attrs[31:3], underlying code will take care

View file

@ -39,12 +39,6 @@
#define ROM_ADDR (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET)
#endif
/*
* MMU currently supports 4 kB translation granule size,
* so all regions are required to be 4 kB aligned
*/
#define PAGE_SIZE 0x1000
#if CONFIG_FLASH_LOAD_SIZE > 0
#define ROM_SIZE CONFIG_FLASH_LOAD_SIZE
#else
@ -66,7 +60,7 @@
#endif
#if defined(CONFIG_ARM_MMU)
_region_min_align = PAGE_SIZE;
_region_min_align = CONFIG_MMU_PAGE_SIZE;
#else
/* If building without MMU support, use default 4-byte alignment. */
_region_min_align = 4;