xref: /openbmc/linux/arch/arm64/include/asm/sparsemem.h (revision b737eecd)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (C) 2012 ARM Ltd.
4  */
5 #ifndef __ASM_SPARSEMEM_H
6 #define __ASM_SPARSEMEM_H
7 
8 #ifdef CONFIG_SPARSEMEM
9 #define MAX_PHYSMEM_BITS	CONFIG_ARM64_PA_BITS
10 
11 /*
12  * Section size must be at least 512MB for 64K base
13  * page size config. Otherwise it will be less than
14  * (MAX_ORDER - 1) and the build process will fail.
15  */
16 #ifdef CONFIG_ARM64_64K_PAGES
17 #define SECTION_SIZE_BITS 29
18 
19 #else
20 
21 /*
22  * Section size must be at least 128MB for 4K base
23  * page size config. Otherwise PMD based huge page
24  * entries could not be created for vmemmap mappings.
25  * 16K follows 4K for simplicity.
26  */
27 #define SECTION_SIZE_BITS 27
28 #endif /* CONFIG_ARM64_64K_PAGES */
29 
30 #endif /* CONFIG_SPARSEMEM*/
31 
32 #endif
33