aboutsummaryrefslogtreecommitdiff
path: root/product/sgm775/module/sgm775_system
diff options
context:
space:
mode:
Diffstat (limited to 'product/sgm775/module/sgm775_system')
-rw-r--r--product/sgm775/module/sgm775_system/include/mod_sgm775_system.h44
-rw-r--r--product/sgm775/module/sgm775_system/src/Makefile11
-rw-r--r--product/sgm775/module/sgm775_system/src/mod_sgm775_system.c59
3 files changed, 114 insertions, 0 deletions
diff --git a/product/sgm775/module/sgm775_system/include/mod_sgm775_system.h b/product/sgm775/module/sgm775_system/include/mod_sgm775_system.h
new file mode 100644
index 00000000..c3cfb498
--- /dev/null
+++ b/product/sgm775/module/sgm775_system/include/mod_sgm775_system.h
@@ -0,0 +1,44 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2015-2018, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Description:
+ * SGM775 System Support
+ */
+
+#ifndef MOD_SGM775_SYSTEM_H
+#define MOD_SGM775_SYSTEM_H
+
+/*!
+ * \addtogroup GroupSGM775Module SGM775 Product Modules
+ * @{
+ */
+
+/*!
+ * \defgroup GroupSGM775System SGM775 System Support
+ *
+ * @{
+ */
+
+/*!
+ * \brief API indices.
+ */
+enum mod_sgm775_system_api_idx {
+ /*! API index for the driver interface of the SYSTEM POWER module */
+ MOD_SGM775_SYSTEM_API_IDX_SYSTEM_POWER_DRIVER,
+
+ /*! Number of defined APIs */
+ MOD_SGM775_SYSTEM_API_COUNT
+};
+
+/*!
+ * @}
+ */
+
+/*!
+ * @}
+ */
+
+#endif /* MOD_SGM775_SYSTEM_H */
diff --git a/product/sgm775/module/sgm775_system/src/Makefile b/product/sgm775/module/sgm775_system/src/Makefile
new file mode 100644
index 00000000..77ad18c1
--- /dev/null
+++ b/product/sgm775/module/sgm775_system/src/Makefile
@@ -0,0 +1,11 @@
+#
+# Arm SCP/MCP Software
+# Copyright (c) 2017-2018, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+BS_LIB_NAME := SGM775 SYSTEM
+BS_LIB_SOURCES = mod_sgm775_system.c
+
+include $(BS_DIR)/lib.mk
diff --git a/product/sgm775/module/sgm775_system/src/mod_sgm775_system.c b/product/sgm775/module/sgm775_system/src/mod_sgm775_system.c
new file mode 100644
index 00000000..dc1459e4
--- /dev/null
+++ b/product/sgm775/module/sgm775_system/src/mod_sgm775_system.c
@@ -0,0 +1,59 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2015-2018, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Description:
+ * SGM775 System Support.
+ */
+
+#include <fmw_cmsis.h>
+#include <fwk_module.h>
+#include <mod_system_power.h>
+#include <mod_sgm775_system.h>
+
+/*
+ * Functions fulfilling the framework's module interface
+ */
+
+static int sgm775_system_shutdown(enum mod_pd_system_shutdown system_shutdown)
+{
+ NVIC_SystemReset();
+
+ return FWK_E_DEVICE;
+}
+
+static const struct mod_system_power_driver_api
+ sgm775_system_system_power_driver_api = {
+ .system_shutdown = sgm775_system_shutdown
+};
+
+/*
+ * Functions fulfilling the framework's module interface
+ */
+
+static int sgm775_system_init(fwk_id_t module_id, unsigned int unused,
+ const void *unused2)
+{
+ return FWK_SUCCESS;
+}
+
+static int sgm775_system_process_bind_request(fwk_id_t source_id,
+ fwk_id_t target_id, fwk_id_t api_id, const void **api)
+{
+ *api = &sgm775_system_system_power_driver_api;
+
+ return FWK_SUCCESS;
+}
+
+const struct fwk_module module_sgm775_system = {
+ .name = "SGM775_SYSTEM",
+ .api_count = MOD_SGM775_SYSTEM_API_COUNT,
+ .type = FWK_MODULE_TYPE_DRIVER,
+ .init = sgm775_system_init,
+ .process_bind_request = sgm775_system_process_bind_request,
+};
+
+/* No elements, no module configuration data */
+struct fwk_module_config config_sgm775_system = {};