Fix PRU support on modern kernels
Issue by mhaberler
Fri Dec 18 16:33:14 2015
Originally opened as https://github.com/machinekit/machinekit/issues/839
The BB PRU support is currently tied to the legacy TI PRUSS driver which has been superseded by the mainstream remoteproc facility
Currently we still use the PRUSS driver on the BB xenomai 3.8 kernel.
As PRUSSv2 is being phased out in favor of remoteproc, we need to adapt the PRU support to remoteproc so we can switch to higher kernel version numbers, for instance to support the BeagleBoard X15 - which we currently cannot, as we are stuck with the 3.8 kernel.
Affected code: mostly hal_pru_generic (stepgen, pwmgen, encoder etc): https://github.com/machinekit/machinekit/tree/master/src/hal/drivers/hal_pru_generic
Rough outline:
- understand how the current PRU support on the 3.8 kernel with PRUSS works - exercise some of the sample PRU programs on the net until you get the hang of it
- read up on remoteproc
- find a recent BB kernel which has remoteproc support (3.14+ I guess)
- make the example programs work with remoteproc loading/starting/stopping of the PRU
- adapt the hal_pru_generic code to alternatively support both methods (ideally with autodetection of the kernel facility provided)
- proof of function - an example or - even better - regression test would be great
- update the documentation as needed
Prerequisites:
- basic kernel skills: building a kernel and device drivers, adapting build support
Effort:
- 1-2 weeks of wee hour work if proficient with kernels
Potential coaches: @cdsteinkuehler @mhaberler (possibly @RobertCNelson, did not ask yet..)
Large issue with many comments, use original at https://github.com/machinekit/machinekit/issues/839