I just read a blog post today from an embedded systems engineer with a interesting perspective on how to best leverage Linux on embedded sysetems:
Getting the most out of an SoC
http://www.hy-research.com/blog/BEWear.html
Thu Nov 5 14:20:17 PST 2015
Use the correct driver/subsystem in Linux rather then try to bypass them.
If there are problems with the driver or a lack of understanding of the subsystem, look into fixing it. You're still spending time figuring out the hardware and how to bypass it. Chances are you will get much more back if the driver is fixed.
For example, in the BEWear project, audio is generated using the PWM hardware. Linux already have drivers to drive the PWM hardware in the kernel. The bypass way is to try to use the userland interface or to get the PRU to control it. The better way is to write a little ALSA driver (which is what was done) that leverages the existing PWM driver. Now audio output works with ALSA utilities. The PWM driver provides a common interface so the PWM hardware itself is taken care of. Contrast this with figuring out timing, interface for the PRU along with how to disconnect the driver from Linux.