memory_map.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Email: opensource_embedded@phytium.com.cn
  7. *
  8. * Change Logs:
  9. * Date Author Notes
  10. * 2023-04-27 huanghe first version
  11. *
  12. */
  13. #include "rtconfig.h"
  14. #include <board.h>
  15. #include <mmu.h>
  16. /* mmu config */
  17. #ifdef RT_USING_SMART
  18. #if defined(TARGET_ARMV8_AARCH64)
  19. struct mem_desc platform_mem_desc[] =
  20. {
  21. { KERNEL_VADDR_START,
  22. KERNEL_VADDR_START + 0x0fffffff,
  23. (rt_size_t)ARCH_MAP_FAILED,
  24. NORMAL_MEM
  25. }
  26. };
  27. #else
  28. struct mem_desc platform_mem_desc[] =
  29. {
  30. { KERNEL_VADDR_START,
  31. KERNEL_VADDR_START + 0x10000000,
  32. (rt_size_t)ARCH_MAP_FAILED,
  33. NORMAL_MEM
  34. }
  35. };
  36. #endif
  37. #else
  38. #if defined(TARGET_ARMV8_AARCH64)
  39. struct mem_desc platform_mem_desc[] = {
  40. {KERNEL_VADDR_START, DDR_END_ADDRESS , KERNEL_VADDR_START, NORMAL_MEM},
  41. {
  42. 0x28000000U,
  43. 0x32B36FFFU,
  44. 0x28000000U,
  45. DEVICE_MEM
  46. },
  47. };
  48. #else
  49. struct mem_desc platform_mem_desc[] =
  50. {
  51. {
  52. 0x00U,
  53. 0x00U + 0x40000000U,
  54. 0x00U,
  55. DEVICE_MEM
  56. },
  57. {
  58. 0x40000000U,
  59. 0x40000000U + 0x10000000U,
  60. 0x40000000U,
  61. DEVICE_MEM
  62. },
  63. {
  64. 0x50000000U,
  65. 0x50000000U + 0x30000000U,
  66. 0x50000000U,
  67. DEVICE_MEM
  68. },
  69. {
  70. 0x80000000U,
  71. 0xffffffffU,
  72. 0x80000000U,
  73. NORMAL_MEM
  74. },
  75. #if defined(TARGET_ARMV8_AARCH64)
  76. {
  77. 0x1000000000,
  78. 0x1000000000 + 0x1000000000,
  79. 0x1000000000,
  80. DEVICE_MEM
  81. },
  82. {
  83. 0x2000000000,
  84. 0x2000000000 + 0x2000000000,
  85. 0x2000000000,
  86. NORMAL_MEM
  87. },
  88. #endif
  89. };
  90. #endif
  91. #endif
  92. const rt_uint32_t platform_mem_desc_size = sizeof(platform_mem_desc) / sizeof(platform_mem_desc[0]);