zynqmp-r5.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2020-2021, WangHuachen
  3. *
  4. * SPDX-License-Identifier: MIT
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-11-30 WangHuachen the first version
  9. */
  10. #ifndef __ZYNQMP_R5_H__
  11. #define __ZYNQMP_R5_H__
  12. #include "xparameters.h"
  13. #define __REG64(x) (*((volatile rt_uint64_t *)(x)))
  14. #define __REG32(x) (*((volatile rt_uint32_t *)(x)))
  15. #define __REG16(x) (*((volatile rt_uint16_t *)(x)))
  16. #define __REG8(x) (*((volatile rt_uint8_t *)(x)))
  17. #define ZynqMP_CRL_APB_BASEADDR XPAR_PSU_CRL_APB_S_AXI_BASEADDR
  18. #define ZynqMP_CRL_APB_IOPLL_CTRL 0x020
  19. #define ZynqMP_CRL_APB_IOPLL_CFG 0x024
  20. #define ZynqMP_CRL_APB_UART0_REF_CTRL 0x074
  21. #define ZynqMP_CRL_APB_UART1_REF_CTRL 0x078
  22. #define ZynqMP_CRL_APB_LPD_LSBUS_CTRL 0x0AC
  23. #define ZynqMP_CRL_APB_RESET_CTRL 0x218
  24. #define ZynqMP_RESET_MASK 0x10
  25. #define ZynqMP_GIC_CPU_BASE XPAR_PSU_RCPU_GIC_BASEADDR /* Generic interrupt controller CPU interface */
  26. #define ZynqMP_GIC_DIST_BASE XPAR_PSU_RCPU_GIC_DIST_BASEADDR /* Generic interrupt controller distributor */
  27. /* ZynqMP on-board gic irq sources */
  28. #define IRQ_ZynqMP_MAXNR 195
  29. #define ARM_GIC_NR_IRQS IRQ_ZynqMP_MAXNR
  30. /* only one GIC available */
  31. #define ARM_GIC_MAX_NR 1
  32. #define GIC_ACK_INTID_MASK 0x000003FF
  33. #define ZynqMP_R5_0_ID 0
  34. #define ZynqMP_R5_1_ID 1
  35. #define ZynqMP_R5_CPU_ID ZynqMP_R5_0_ID
  36. static inline unsigned long rt_cpu_get_smp_id(void)
  37. {
  38. return ZynqMP_R5_CPU_ID;
  39. }
  40. #endif