board.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) 2006-2021, 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. * 2022-10-26 huanghe first commit
  11. * 2022-04-13 zhugengyu support RT-Smart
  12. *
  13. */
  14. #ifndef __BOARD_H__
  15. #define __BOARD_H__
  16. #include "fparameters.h"
  17. #include "phytium_cpu.h"
  18. #include "mmu.h"
  19. #ifdef RT_USING_SMART
  20. #include "ioremap.h"
  21. #endif
  22. #if defined(__CC_ARM)
  23. extern int Image$$RW_IRAM1$$ZI$$Limit;
  24. #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
  25. #elif defined(__GNUC__)
  26. extern int __bss_end;
  27. #define HEAP_BEGIN ((void *)&__bss_end)
  28. #endif
  29. #ifdef RT_USING_SMART
  30. #define HEAP_END (rt_size_t)((rt_size_t)KERNEL_VADDR_START + 64 * 1024 * 1024)
  31. #define PAGE_START HEAP_END + 1 * 1024 * 1024
  32. #define PAGE_END (rt_size_t)((rt_size_t)KERNEL_VADDR_START + 128 * 1024 * 1024)
  33. #else
  34. #define HEAP_END (rt_size_t)(HEAP_BEGIN + 64*1024*1024)
  35. #define KERNEL_VADDR_START (rt_size_t)0x80000000
  36. #define DDR_END_ADDRESS (KERNEL_VADDR_START + 1024*1024*1024 - 1 )
  37. #define PAGE_POOL_SIZE (8ul << 20)
  38. #define PAGE_START (rt_size_t)(HEAP_END)
  39. #define PAGE_END (PAGE_START +PAGE_POOL_SIZE)
  40. #endif
  41. void rt_hw_board_init(void);
  42. #endif