Microchip-Ethernet / EVB-KSZ9477

Repository for using Microchip EVB-KSZ9477 board. Product Supported: KSZ9477, KSZ9567, KSZ9897, KSZ9896, KSZ8567, KSZ8565, KSZ9893, KSZ9563, KSZ8563, LAN9646, Phys(KSZ9031/9131, LAN8770
76 stars 78 forks source link

KSZ8463 Kernel 4.14 PTP_CLK_ENABLE never set #28

Closed monkeyman79 closed 5 years ago

monkeyman79 commented 5 years ago

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.

monkeyman79 commented 5 years ago

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.