board.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2024-03-11 Wangyuqiang first version
  9. */
  10. #ifndef __BOARD_H__
  11. #define __BOARD_H__
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include <rtdef.h>
  16. #include <cp15.h>
  17. #include <hal_data.h>
  18. #define RZ_SRAM_SIZE 1536 /* The SRAM size of the chip needs to be modified */
  19. #define RZ_SRAM_END (0x10000000 + RZ_SRAM_SIZE * 1024 - 1)
  20. #ifdef __ARMCC_VERSION
  21. extern int Image$$RAM_END$$ZI$$Base;
  22. #define HEAP_BEGIN ((void *)&Image$$RAM_END$$ZI$$Base)
  23. #elif __ICCARM__
  24. #pragma section="CSTACK"
  25. #define HEAP_BEGIN (__segment_end("CSTACK"))
  26. #else
  27. extern int __bss_end__;
  28. #define HEAP_BEGIN ((void *)&__bss_end__)
  29. #endif
  30. #define HEAP_END RZ_SRAM_END
  31. /***********************************************************************************************************************
  32. * Macro definitions
  33. **********************************************************************************************************************/
  34. #define MAX_HANDLERS BSP_VECTOR_TABLE_MAX_ENTRIES
  35. #define GIC_IRQ_START 0
  36. #define GIC_ACK_INTID_MASK (0x000003FFU)
  37. /* number of interrupts on board */
  38. #define ARM_GIC_NR_IRQS (448)
  39. /* only one GIC available */
  40. #define ARM_GIC_MAX_NR 1
  41. /* end defined */
  42. #define GICV3_DISTRIBUTOR_BASE_ADDR (0x100000)
  43. /* the basic constants and interfaces needed by gic */
  44. rt_inline rt_uint32_t platform_get_gic_dist_base(void)
  45. {
  46. rt_uint32_t gic_base;
  47. __get_cp(15, 1, gic_base, 15, 3, 0);
  48. return gic_base + GICV3_DISTRIBUTOR_BASE_ADDR;
  49. }
  50. #ifdef __cplusplus
  51. }
  52. #endif
  53. #endif