• Gerhard Engleder's avatar
    ptp: Add cycles support for virtual clocks · 42704b26
    Gerhard Engleder authored
    ptp vclocks require a free running time for their timecounter.
    Currently only a physical clock forced to free running is supported.
    If vclocks are used, then the physical clock cannot be synchronized
    anymore. The synchronized time is not available in hardware in this
    case. As a result, timed transmission with TAPRIO hardware support
    is not possible anymore.
    
    If hardware would support a free running time additionally to the
    physical clock, then the physical clock does not need to be forced to
    free running. Thus, the physical clocks can still be synchronized
    while vclocks are in use.
    
    The physical clock could be used to synchronize the time domain of the
    TSN network and trigger TAPRIO. In parallel vclocks can be used to
    synchronize other time domains.
    
    Introduce support for a free running cycle counter called cycles to
    physical clocks. Rework ptp vclocks to use this free running cycle
    counter. Default implementation is based on time of physical clock.
    Thus, behavior of ptp vclocks based on physical clocks without free
    running cycle counter is identical to previous behavior.
    Signed-off-by: default avatarGerhard Engleder <gerhard@engleder-embedded.com>
    Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    42704b26
ptp_clock.c 11.4 KB