serial: Support Frame Check Sequence

According to DSP0253, implementing frame check sequence via
crc-16-ccitt calculation. crc-16-ccitt implementation refer
to RFC1662 Appendix C.

Tested:
Verified on sending/receiving mctp packets with mctp-serial
kernel driver.

Change-Id: I8417d521589e9f40a0ca68596cdcfd061fd919cc
Signed-off-by: John Chung <john.chung@arm.com>
diff --git a/crc-16-ccitt.h b/crc-16-ccitt.h
new file mode 100644
index 0000000..c01c370
--- /dev/null
+++ b/crc-16-ccitt.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
+
+#ifndef _CRC_16_CCITT_H
+#define _CRC_16_CCITT_H
+
+#include <stdint.h>
+
+#define FCS_INIT_16 0xFFFF /* Initial FCS value */
+
+uint16_t crc_16_ccitt(uint16_t fcs, const uint8_t *cp, uint32_t len);
+
+uint16_t crc_16_ccitt_byte(uint16_t fcs, const uint8_t c);
+
+#endif