• Horatiu Vultur's avatar
    net: phy: micrel: lan8814: Add support for PTP_PF_PEROUT · 9e63941b
    Horatiu Vultur authored
    Lan8814 has 24 GPIOs but only 2 GPIOs (GPIO 0 and GPIO 1) can be
    configured to generate period signals. And there are 2 events (EVENT_A
    and EVENT_B) but these events are hardcoded to the GPIO 0 and GPIO 1.
    These events are used to generate period signals. It is possible to
    configure the length, the start time and the period of the signal by
    configuring the event.
    
    These events are generated by comparing the target time with the PHC
    time. In case the PHC time is changed to a value bigger than the target
    time + reload time, then it would generate only 1 event and then it
    would stop because target time + reload time is smaller than PHC time.
    Therefore it is required to change also the target time every time when
    the PHC is changed. The same will apply also when the PHC time is
    changed to a smaller value.
    
    This was tested using:
    testptp -i 1 -L 1,2
    testptp -i 1 -p 1000000000 -w 200000000
    Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
    Reviewed-by: default avatarDivya Koppera <divya.koppera@microchip.com>
    Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    9e63941b
micrel.c 147 KB