I'm trying to adapt KSZ8463 drivers for Linux 4.14 kernel with PTP support from EVB-KSZ9477/KSZ/linux-drivers/ksz8463/linux-4.14.
The communication between SOC and the switch chip goes via SPI and seems to work fine. I can set, start and read the PTP timer via direct access to PTP_CLK_CTL and PTP_RTC_xxx registers and this works fine as well.
The issue is that even though I can set and read the timer via /dev/ptp0 device, the timer always stop after doing so. It appears, that the access to the timer via ptp0 device always resets the PTP_CLK_ENABLE bit in PTP_CLK_CTL.
In case of KSZ9897 driver the PTP_CLK_ENABLE bit is set in initialization, in ptp_hw_enable function, but in case of KSZ8463 there is nothing that would set this bit.
Sorry, my bad. There is no need for setting PTP_CLK_ENABLE bit, because it's on by default. It seems that our problem is related with initialization sequence - the driver starts before the switch chip is ready.
I'm trying to adapt KSZ8463 drivers for Linux 4.14 kernel with PTP support from EVB-KSZ9477/KSZ/linux-drivers/ksz8463/linux-4.14. The communication between SOC and the switch chip goes via SPI and seems to work fine. I can set, start and read the PTP timer via direct access to PTP_CLK_CTL and PTP_RTC_xxx registers and this works fine as well. The issue is that even though I can set and read the timer via /dev/ptp0 device, the timer always stop after doing so. It appears, that the access to the timer via ptp0 device always resets the PTP_CLK_ENABLE bit in PTP_CLK_CTL. In case of KSZ9897 driver the PTP_CLK_ENABLE bit is set in initialization, in ptp_hw_enable function, but in case of KSZ8463 there is nothing that would set this bit.