sparsemem.h 857 B

123456789101112131415161718192021222324252627282930313233343536
  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. #define MAX_PHYSMEM_BITS CONFIG_ARM64_PA_BITS
  8. /*
  9. * Section size must be at least 512MB for 64K base
  10. * page size config. Otherwise it will be less than
  11. * (MAX_ORDER - 1) and the build process will fail.
  12. */
  13. #ifdef CONFIG_ARM64_64K_PAGES
  14. #define SECTION_SIZE_BITS 29
  15. #elif defined(CONFIG_ARM64_MEMMAP_ON_MEMORY)
  16. /*
  17. * mhp_supports_memmap_on_memory() requires memmap size to be aligned to
  18. * pageblock_order.
  19. */
  20. #define SECTION_SIZE_BITS 28
  21. #else
  22. /*
  23. * Section size must be at least 128MB for 4K base
  24. * page size config. Otherwise PMD based huge page
  25. * entries could not be created for vmemmap mappings.
  26. * 16K follows 4K for simplicity.
  27. */
  28. #define SECTION_SIZE_BITS 27
  29. #endif /* CONFIG_ARM64_64K_PAGES */
  30. #endif