Add platform support

TS project structure and build system extended to accommodate
hardware specific drivers. The concept of a platform is introduced
to allow hardware specific drivers from external providers to be
used. This change implements the Portability Model described in
the project documentation.

Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I61e678ae103e0bf139f2c440ba6cd010620af37e
diff --git a/platform/interface/entropy.h b/platform/interface/entropy.h
new file mode 100644
index 0000000..d81cd60
--- /dev/null
+++ b/platform/interface/entropy.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef TS_PLATFORM_INTERFACE_ENTROPY_H
+#define TS_PLATFORM_INTERFACE_ENTROPY_H
+
+/*
+ * Interface definintion for a platform entropy driver.  A platform provider will
+ * provide concrete implementations of this interface for each alternative
+ * implementation supported.
+ */
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Virtual interface for a platform entropy driver.  A platform will provide
+ * one or more concrete implementations of this interface.
+ */
+struct ts_plat_entropy_iface
+{
+   /**
+    * \brief Poll for bytes of entropy from a platform entropy source
+    *
+    * \param context     Platform driver context
+    * \param output      Buffer for output
+    * \param nbyte       Desired number of bytes
+    * \param len         The number of bytes returned (could be zero)
+    *
+    * \return            0 if successful.
+    */
+    int (*poll)(void *context, unsigned char *output, size_t nbyte, size_t *len);
+};
+
+/*
+ * A platform entropy driver instance.
+ */
+struct ts_plat_entropy_driver
+{
+    void *context;                              /**< Opaque driver context */
+    const struct ts_plat_entropy_iface *iface;  /**< Interface methods */
+};
+
+/**
+ * \brief Factory method to construct a platform specific entropy driver
+ *
+ * \param driver    Pointer to driver structure to initialize on construction.
+ * \param config    Driver specific configuration or NULL if none.
+ *
+ * \return          0 if successful.
+ */
+int ts_plat_entropy_create(struct ts_plat_entropy_driver *driver, void *config);
+
+/**
+ * \brief Destroy a driver constructed using the factory method
+ *
+ * \param driver    Pointer to driver structure for constructed driver.
+ */
+void ts_plat_entropy_destroy(struct ts_plat_entropy_driver *driver);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* TS_PLATFORM_INTERFACE_ENTROPY_H */