phytium_cpu.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. * 2022-10-26 huanghe first commit
  11. *
  12. */
  13. #ifndef __PHYTIUM_CPU_H__
  14. #define __PHYTIUM_CPU_H__
  15. #include <rthw.h>
  16. #include <rtthread.h>
  17. #include "fparameters.h"
  18. #include "fio.h"
  19. #ifdef RT_USING_SMART
  20. #include"ioremap.h"
  21. #endif
  22. #define ARM_GIC_MAX_NR 1
  23. #if defined(TARGET_FT2000_4) || defined(TARGET_D2000)
  24. #define MAX_HANDLERS 160
  25. #endif
  26. #if defined(TARGET_E2000)
  27. #define MAX_HANDLERS 270
  28. #endif
  29. #define GIC_IRQ_START 0
  30. #define GIC_ACK_INTID_MASK 0x000003ff
  31. rt_uint64_t get_main_cpu_affval(void);
  32. rt_inline rt_uint32_t platform_get_gic_dist_base(void)
  33. {
  34. return GICV3_DISTRIBUTOR_BASE_ADDR;
  35. }
  36. #if defined(TARGET_ARMV8_AARCH64)
  37. /* the basic constants and interfaces needed by gic */
  38. rt_inline rt_uint32_t platform_get_gic_redist_base(void)
  39. {
  40. return 0;
  41. }
  42. rt_inline rt_uint32_t platform_get_gic_cpu_base(void)
  43. {
  44. return 0; /* unused in gicv3 */
  45. }
  46. #endif
  47. int phytium_cpu_id_mapping(int cpu_id);
  48. #endif // !