diff options
Diffstat (limited to 'arch/arm/include/asm/memory.h')
-rw-r--r-- | arch/arm/include/asm/memory.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 2279306179..765b089beb 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -1,14 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef __ASM_ARM_MEMORY_H #define __ASM_ARM_MEMORY_H +#include <linux/sizes.h> + +#ifndef __ASSEMBLY__ #include <memory.h> #include <linux/const.h> -/* - * Allow for constants defined here to be used from assembly code - * by prepending the UL suffix only with actual C code compilation. - */ -#define UL(x) _AC(x, UL) static inline int arm_add_mem_device(const char* name, resource_size_t start, resource_size_t size) @@ -16,4 +16,21 @@ static inline int arm_add_mem_device(const char* name, resource_size_t start, return barebox_add_memory_bank(name, start, size); } +#endif + + +/* + * Alignment of barebox PBL segments (e.g. .text, .data). + * + * 4 B granule: Same flat rwx mapping for everything + * 4 KB granule: 16 level 3 entries, with contiguous bit + * 16 KB granule: 4 level 3 entries, without contiguous bit + * 64 KB granule: 1 level 3 entry + */ +#ifdef CONFIG_EFI_PAYLOAD +#define PBL_SEGMENT_ALIGN SZ_64K +#else +#define PBL_SEGMENT_ALIGN 4 +#endif + #endif /* __ASM_ARM_MEMORY_H */ |