mtk_ptp3_common.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2020, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef MTK_PTP3_H
  7. #define MTK_PTP3_H
  8. #include <lib/mmio.h>
  9. #include <lib/utils_def.h>
  10. /************************************************
  11. * BIT Operation and REG r/w
  12. ************************************************/
  13. #define ptp3_read(addr) mmio_read_32((uintptr_t)addr)
  14. #define ptp3_write(addr, val) mmio_write_32((uintptr_t)addr, val)
  15. /************************************************
  16. * CPU info
  17. ************************************************/
  18. #define NR_PTP3_CFG1_CPU U(8)
  19. #define PTP3_CFG1_CPU_START_ID U(0)
  20. #define PTP3_CFG1_MASK 0x00100000
  21. #define NR_PTP3_CFG2_CPU U(4)
  22. #define PTP3_CFG2_CPU_START_ID U(4)
  23. #define NR_PTP3_CFG3_CPU U(4)
  24. #define PTP3_CFG3_CPU_START_ID U(4)
  25. /************************************************
  26. * config enum
  27. ************************************************/
  28. enum PTP3_CFG {
  29. PTP3_CFG_ADDR,
  30. PTP3_CFG_VALUE,
  31. NR_PTP3_CFG,
  32. };
  33. /************************************
  34. * prototype
  35. ************************************/
  36. /* init trigger for ptp3 feature */
  37. extern void ptp3_init(unsigned int core);
  38. extern void ptp3_deinit(unsigned int core);
  39. #endif /* MTK_PTP3_H */