Add support for using the Armv8-A CRC32 feature

The Armv8-A architecture specifies a CRC32 hardware feature, it can be
used through an intrinsic specified by ACLE. However, the HW feature is
mandatory only starting from v8.1, so for v8.0 CPUs we have to check its
availability. This commit implements a mechanism to do this check for
both Linux and SP environments, and override the default software CRC32
implementation when the HW feature is present.

Signed-off-by: Balint Dobszay <balint.dobszay@arm.com>
Change-Id: Ia15fe1db9890b8aa076deec44c71639a4382cb35
diff --git a/components/common/crc32/crc32.h b/components/common/crc32/crc32.h
index a04e380..ae185cc 100644
--- a/components/common/crc32/crc32.h
+++ b/components/common/crc32/crc32.h
@@ -15,15 +15,20 @@
 #endif
 
 /**
+ * \brief Initialize CRC32 to use HW acceleration if available
+ */
+void crc32_init(void);
+
+/**
  * \brief Calculate a CRC32 over the provided data
  *
- * \param[in]  	crc		    The starting CRC for previous data
- * \param[in]  	buf  		The buffer to calculate the CRC over
- * \param[in]  	size		Number of bytes in the buffer
+ * \param[in]	crc_prev	The starting CRC for previous data
+ * \param[in]	buf		The buffer to calculate the CRC over
+ * \param[in]	size		Number of bytes in the buffer
  *
  * \return	The calculated CRC32
  */
-uint32_t crc32(uint32_t crc, const unsigned char *buf, size_t size);
+extern uint32_t (*crc32)(uint32_t crc_prev, const uint8_t *buf, size_t size);
 
 #ifdef __cplusplus
 }