This week, I worked on the PRU integration for the Servo and the Encoder APIs. For the PRU to work as a pulse generator, I wrote the firmware and compile it into an elf form. Note that I am using the pru_remoteproc framework and the kernel driver only supports elf format now.
The firmware has to send pulses at 50 hz with the dutycycle given by the user. There are 7 servo channels and the firmware should make sure that all the channels work independently,
I also wrote a kernel driver which includes the remoteproc api, to generate a sysfs entry to take the duty cycle and passes it onto the firmware. The sysfs entry just takes the duty-cycle and writes to the kernel memory space, which is mapped to the address 0x4a310000 which is nothing but the shared memory of the PRU. This shared memory is mapped to the kernel virtual space by ioremap.
Finally, I wrote the servo API which takes input from the user and writes it to the sysfs entry.