aboutsummaryrefslogtreecommitdiff
path: root/product/sgi575
diff options
context:
space:
mode:
authorAmit Daniel Kachhap <amit.kachhap@arm.com>2018-07-19 15:25:23 +0530
committerronald-cron-arm <39518861+ronald-cron-arm@users.noreply.github.com>2018-10-18 17:22:34 +0000
commitba55cdcbefdd1f5f4e5b8789eca93a3c4876d975 (patch)
tree579be086c540f95ab0801f06bbbe680cb9a18fae /product/sgi575
parent4102c08df350404298f9e9acb49e3c259b3661ea (diff)
sgi575/scp_ramfw: Add config for system_power module
This enables system shutdown/sleep support. Change-Id: I1a65aa8cb05cd392ec61880b7e20414e8f6bcafd Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Diffstat (limited to 'product/sgi575')
-rw-r--r--product/sgi575/scp_ramfw/config_system_power.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/product/sgi575/scp_ramfw/config_system_power.c b/product/sgi575/scp_ramfw/config_system_power.c
new file mode 100644
index 00000000..173ad0e2
--- /dev/null
+++ b/product/sgi575/scp_ramfw/config_system_power.c
@@ -0,0 +1,58 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <fwk_id.h>
+#include <fwk_macros.h>
+#include <fwk_module.h>
+#include <fwk_module_idx.h>
+#include <mod_ppu_v1.h>
+#include <mod_sgi575_system.h>
+#include <mod_system_power.h>
+#include <scp_sgi575_irq.h>
+#include <sgi575_core.h>
+
+/* Table with only a terminator */
+static const struct fwk_element sgi575_system_element_table = { 0 };
+
+static struct mod_system_power_config system_power_config = {
+ .soc_wakeup_irq = SOC_WAKEUP0_IRQ,
+
+ /* PPU settings */
+ .ppu_sys_api_id = FWK_ID_API_INIT(
+ FWK_MODULE_IDX_PPU_V1,
+ MOD_PPU_V1_API_IDX_POWER_DOMAIN_DRIVER),
+
+ /* System driver */
+ .driver_id = FWK_ID_MODULE_INIT(FWK_MODULE_IDX_SGI575_SYSTEM),
+ .driver_api_id = FWK_ID_API_INIT(FWK_MODULE_IDX_SGI575_SYSTEM,
+ MOD_SGI575_SYSTEM_API_IDX_SYSTEM_POWER_DRIVER),
+};
+
+static const struct fwk_element *sgi575_system_get_element_table(
+ fwk_id_t unused)
+{
+ /* The system PPUs are placed after the core and cluster PPUs */
+ unsigned int ppu_idx_base = sgi575_core_get_core_count() +
+ sgi575_core_get_cluster_count();
+
+ /* Set the system PPU elements */
+ system_power_config.ppu_sys0_id = fwk_id_build_element_id(
+ fwk_module_id_ppu_v1, ppu_idx_base);
+ system_power_config.ppu_sys1_id = fwk_id_build_element_id(
+ fwk_module_id_ppu_v1, ppu_idx_base + 1);
+
+ /*
+ * Return table with only a terminator as this function is only used to
+ * setup the dynamic module data.
+ */
+ return &sgi575_system_element_table;
+}
+
+const struct fwk_module_config config_system_power = {
+ .get_element_table = sgi575_system_get_element_table,
+ .data = &system_power_config,
+};