ddr_parameter.h 931 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef DDR_PARAMETER_H
  7. #define DDR_PARAMETER_H
  8. #include <string.h>
  9. #include <platform_def.h>
  10. #include <arch_helpers.h>
  11. #include <common/debug.h>
  12. #include <drivers/console.h>
  13. #include <drivers/delay_timer.h>
  14. #include <lib/mmio.h>
  15. #include <plat_private.h>
  16. #include <soc.h>
  17. #define DDR_REGION_NR_MAX 10
  18. #define REGION_NR_OFFSET 0
  19. #define REGION_ADDR_OFFSET 8
  20. #define REGION_DATA_PER_BYTES 8
  21. #define RG_SIZE_MB(byte) ((byte) >> 20)
  22. /* unit: MB */
  23. struct param_ddr_usage {
  24. uint64_t boundary;
  25. uint32_t ns_nr;
  26. uint64_t ns_base[DDR_REGION_NR_MAX];
  27. uint64_t ns_top[DDR_REGION_NR_MAX];
  28. uint32_t s_nr;
  29. uint64_t s_base[DDR_REGION_NR_MAX + 1];
  30. uint64_t s_top[DDR_REGION_NR_MAX + 1];
  31. };
  32. struct param_ddr_usage ddr_region_usage_parse(uint64_t addr, uint64_t max_mb);
  33. #endif /* DDR_PARAMETER_H */