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

Reset 1PPS state #6

Open EmilWine opened 6 years ago

EmilWine commented 6 years ago

Hi,

I'm using the ptp4l tool for time syncing between devices. I need to implement a feature where the GPIO_1 output is disabled (i.e. output is 0) and when the ptp4l becomes locked I need the GPIO_1 to output 1PPS in sync with the internal clock.

By default I get the switch outputting 1PPS on this pin. I tried writing "0" to flag 3 of register 0x052F which disabled the 1PPS output but I could not get it back running by writing "1" to the same flag. Tried toggling flag "2" but with the same result.

I did notice that restarting my mac driver revives the 1PPS ouptut. Any suggestions on how to proceed?

Thanks Emil

wmoors commented 4 years ago

Bump back to life... Did you manage to solve your problem?

triha2work commented 4 years ago

You cannot change most of the unit (triggered output, timestamp input, and GPIO) related functions directly as the index pointing to those units is likely changed by the driver all the time. One way to change GPIO is to use the ptpfs sysfs. echo 0 > .../ptpfs/gpio_1 echo 1 > .../ptpfs/gpio_1