Files
nuttx/include/sys
dongjiuzhu1 31eb339356 drivers/timers/ptp: support ptp clock driver model
This patch introduces the foundational PTP (Precision Time Protocol) clock
driver framework for NuttX, enabling precise time synchronization support
based on IEEE 1588 standard.

Key changes include:

1. New PTP clock driver infrastructure:
   - Added drivers/timers/ptp_clock.c implementing upper-half driver
   - Created include/nuttx/timers/ptp_clock.h with PTP clock interfaces
   - Implemented upper/lower half driver architecture for hardware abstraction

2. Core functionality:
   - Clock time get/set operations (gettime, settime)
   - Frequency adjustment support (adjtime, adjfine)
   - Phase adjustment capabilities
   - System-device cross-timestamping for precise synchronization

3. IOCTL commands:
   - PTP_CLOCK_SETTIME/GETTIME for time manipulation
   - PTP_CLOCK_GETRES for resolution queries
   - PTP_CLOCK_ADJTIME for time adjustment
   - PTP_CLOCK_GETCAPS for capability queries
   - PTP_SYS_OFFSET* for system offset measurements

4. Supporting structures:
   - struct ptp_lowerhalf_s: lower-half driver interface
   - struct ptp_clock_caps: clock capabilities descriptor
   - struct ptp_sys_offset: system time offset measurement
   - Added timex structures in include/sys/timex.h for ADJ_* operations

5. Build system integration:
   - Added CONFIG_PTP_CLOCK Kconfig option
   - Updated CMakeLists.txt and Make.defs
   - Added PTPCLK debug macros in include/debug.h

This framework provides the base for PTP clock implementations, allowing
hardware-specific drivers to register and provide precise time services
through a standardized interface.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-30 10:22:09 -03:00
..
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-12-20 11:46:14 -03:00
2024-10-04 08:18:42 +08:00
2024-10-10 18:46:51 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2025-05-26 18:49:45 +08:00
2024-12-20 11:46:14 -03:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-12-20 11:46:14 -03:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00