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_sp.c b/components/common/crc32/crc32_sp.c
new file mode 100644
index 0000000..9e2db8e
--- /dev/null
+++ b/components/common/crc32/crc32_sp.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2023, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#include <stdbool.h>
+#include <stdint.h>
+
+#include "config/interface/config_store.h"
+#include "crc32_discovery.h"
+
+bool crc32_armv8a_hw_available(void)
+{
+	uint32_t value = 0;
+
+	if (!config_store_query(CONFIG_CLASSIFIER_HW_FEATURE, "crc32", 0, &value, sizeof(value)))
+		return false;
+
+	return value != 0;
+}