sparsemem.h 747 B

1234567891011121314151617181920212223242526272829303132
  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. #include <asm/pgtable-prot.h>
  8. #define MAX_PHYSMEM_BITS PHYS_MASK_SHIFT
  9. #define MAX_POSSIBLE_PHYSMEM_BITS (52)
  10. /*
  11. * Section size must be at least 512MB for 64K base
  12. * page size config. Otherwise it will be less than
  13. * MAX_PAGE_ORDER and the build process will fail.
  14. */
  15. #ifdef CONFIG_ARM64_64K_PAGES
  16. #define SECTION_SIZE_BITS 29
  17. #else
  18. /*
  19. * Section size must be at least 128MB for 4K base
  20. * page size config. Otherwise PMD based huge page
  21. * entries could not be created for vmemmap mappings.
  22. * 16K follows 4K for simplicity.
  23. */
  24. #define SECTION_SIZE_BITS 27
  25. #endif /* CONFIG_ARM64_64K_PAGES */
  26. #endif