zynqmp.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) 2006-2024, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2024-04-11 liYony the first version
  9. */
  10. #ifndef __ZYNQMP_H__
  11. #define __ZYNQMP_H__
  12. #include <rtdef.h>
  13. #include <ioremap.h>
  14. #ifdef RT_USING_SMART
  15. #include <mmu.h>
  16. #endif
  17. #define __REG32(x) (*((volatile unsigned int *)(x)))
  18. #define __REG16(x) (*((volatile unsigned short *)(x)))
  19. /* UART */
  20. #define ZYNQMP_UART0_BASE 0xFF000000
  21. #define ZYNQMP_UART0_SIZE 0x00010000
  22. #define ZYNQMP_UART0_IRQNUM (32 + 21)
  23. #define ZYNQMP_UART0_CLK_FREQ_HZ (99999001)
  24. /* GIC */
  25. #define MAX_HANDLERS 195
  26. #define GIC_IRQ_START 0
  27. #define ARM_GIC_NR_IRQS 195
  28. #define ARM_GIC_MAX_NR 1
  29. /* GICv2 */
  30. #define GIC400_DISTRIBUTOR_PPTR 0xF9010000U
  31. #define GIC400_CONTROLLER_PPTR 0xF9020000U
  32. #define GIC400_SIZE 0x00001000U
  33. /* the basic constants and interfaces needed by gic */
  34. rt_inline rt_ubase_t platform_get_gic_dist_base(void)
  35. {
  36. return GIC400_DISTRIBUTOR_PPTR;
  37. }
  38. rt_inline rt_ubase_t platform_get_gic_cpu_base(void)
  39. {
  40. return GIC400_CONTROLLER_PPTR;
  41. }
  42. #endif /* __ZYNQMP_H__ */