summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchin Gupta <achin.gupta@arm.com>2019-10-28 08:39:50 +0000
committerMarc Bonnici <marc.bonnici@arm.com>2020-06-01 15:25:18 +0100
commit8639e4620165b1a424f09a7ca8a09c16134fcfec (patch)
tree654a01334d1d6022c80bdcb5c154bc3990120dd5
parentfc721f830855ab05f45d8f2024325601bbb4c783 (diff)
downloadarm-trusted-firmware-8639e4620165b1a424f09a7ca8a09c16134fcfec.tar.gz
SPMD: [EXP] Groundwork for PSCI usage to initialise SPMC
This is a temporary solution, all secure world PSCI calls are meant to be handled within S-EL2 which means the PSCI SPD callbacks need to be routed to S-EL2 appropriately. This patch is the first in a series to demonstrate experimental support for use of PSCI functions to initialise the SPMC on secondary CPUs. This patch enables a SPMD to register a handler for PSCI calls invoked by the SPMC. It also moves a couple of utility functions from a private PSCI header to a public header. These functions will be used by the secure PSCI call handler. Change-Id: I6c412d21e4c66937c55024c91ef93baaaa061438 Signed-off-by: Achin Gupta <achin.gupta@arm.com>
-rw-r--r--include/lib/psci/psci.h5
-rw-r--r--include/lib/psci/psci_lib.h11
-rw-r--r--lib/psci/psci_private.h3
3 files changed, 14 insertions, 5 deletions
diff --git a/include/lib/psci/psci.h b/include/lib/psci/psci.h
index b56e98b5f..2279de879 100644
--- a/include/lib/psci/psci.h
+++ b/include/lib/psci/psci.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -330,6 +330,9 @@ typedef struct plat_psci_ops {
/*******************************************************************************
* Function & Data prototypes
******************************************************************************/
+int psci_validate_power_state(unsigned int power_state,
+ psci_power_state_t *state_info);
+int psci_validate_mpidr(u_register_t mpidr);
unsigned int psci_version(void);
int psci_cpu_on(u_register_t target_cpu,
uintptr_t entrypoint,
diff --git a/include/lib/psci/psci_lib.h b/include/lib/psci/psci_lib.h
index 76c1a8dcf..b17a66476 100644
--- a/include/lib/psci/psci_lib.h
+++ b/include/lib/psci/psci_lib.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -19,8 +19,17 @@
* chance to perform any bookkeeping before PSCI executes a power management
* operation. It also allows PSCI to determine certain properties of the SP e.g.
* migrate capability etc.
+ * The psci_sec_smc_handler() is exported by a dispatcher to handle PSCI calls
+ * that originate from the Secure world. These calls do not result in any
+ * physical power state transitions. They should be used by SPs to ensure that
+ * their run time state is not disrupted by any physical power state transitions
+ * initiated by the Normal world.
******************************************************************************/
typedef struct spd_pm_ops {
+ uint64_t (*psci_sec_smc_handler)(uint32_t smc_fid, uint64_t x1,
+ uint64_t x2, uint64_t x3,
+ uint64_t x4, void *cookie,
+ void *handle, uint64_t flags);
void (*svc_on)(u_register_t target_cpu);
int32_t (*svc_off)(u_register_t __unused unused);
void (*svc_suspend)(u_register_t max_off_pwrlvl);
diff --git a/lib/psci/psci_private.h b/lib/psci/psci_private.h
index e2dcfa8b1..bdaea1895 100644
--- a/lib/psci/psci_private.h
+++ b/lib/psci/psci_private.h
@@ -262,10 +262,7 @@ extern const spd_pm_ops_t *psci_spd_pm;
* Function prototypes
******************************************************************************/
/* Private exported functions from psci_common.c */
-int psci_validate_power_state(unsigned int power_state,
- psci_power_state_t *state_info);
void psci_query_sys_suspend_pwrstate(psci_power_state_t *state_info);
-int psci_validate_mpidr(u_register_t mpidr);
void psci_init_req_local_pwr_states(void);
void psci_get_target_local_pwr_states(unsigned int end_pwrlvl,
psci_power_state_t *target_state);