diag: Add hdlc encoding support for diag data sent from peripherals

Diag running on the peripherals currently hdlc encodes the diag
data prior to being sent to the APPS processor over the diag data
smd channels. To offload the peripherals of this workload, add support
to accept non-hdlc encoded diag data from the peripherals and
hdlc encode that data on the APPS processor. Maintain the backwards
compatability to accept and properly process hdlc encoded data.
Add ability to determine at run-time whether a peripheral is sending
hdlc or non-hdlc encoded data and process the data appropriately.

Change-Id: I09e1dce0118011e52b1634f1eac402de16a999f6
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
6 files changed