mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 09:34:18 +00:00
chore(xilinx): follow kernel doc format for functional documentation
For TF-A, there is no format specified for functional documentation. For AMD-Xilinx platforms, following kernel-doc format for the functional documentation to make sure AMD-xilinx documentation is align with actual code. For example use kernel-doc from linux to call: <linux>/scripts/kernel-doc -man -v 1 >/dev/null file... Signed-off-by: Prasad Kummari <prasad.kummari@amd.com> Change-Id: Idcc9def408b6c8da35b36f67ef82fc00890e998c
This commit is contained in:
parent
e09b8aa5a5
commit
de7ed953e3
28 changed files with 1229 additions and 971 deletions
|
@ -68,7 +68,7 @@ enum pm_ret_status pm_register_notifier(uint32_t device_id, uint32_t event,
|
|||
uint32_t flag);
|
||||
enum pm_ret_status pm_get_chipid(uint32_t *value);
|
||||
|
||||
/**
|
||||
/*
|
||||
* Assigning of argument values into array elements.
|
||||
*/
|
||||
#define PM_PACK_PAYLOAD1(pl, mid, flag, arg0) { \
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2018, Arm Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -33,10 +34,11 @@
|
|||
TZ_VERSION_MINOR)
|
||||
|
||||
/**
|
||||
* pm_ipi - struct for capturing IPI-channel specific info
|
||||
* @local_ipi_id Local IPI agent ID
|
||||
* @remote_ipi_id Remote IPI Agent ID
|
||||
* @buffer_base base address for payload buffer
|
||||
* struct pm_ipi - struct for capturing IPI-channel specific info.
|
||||
* @local_ipi_id: Local IPI agent ID.
|
||||
* @remote_ipi_id: Remote IPI Agent ID.
|
||||
* @buffer_base: base address for payload buffer.
|
||||
*
|
||||
*/
|
||||
struct pm_ipi {
|
||||
const uint32_t local_ipi_id;
|
||||
|
@ -45,11 +47,12 @@ struct pm_ipi {
|
|||
};
|
||||
|
||||
/**
|
||||
* pm_proc - struct for capturing processor related info
|
||||
* @node_id node-ID of the processor
|
||||
* @pwrdn_mask cpu-specific mask to be used for power control register
|
||||
* @ipi pointer to IPI channel structure
|
||||
* (in APU all processors share one IPI channel)
|
||||
* struct pm_proc - struct for capturing processor related info.
|
||||
* @node_id: node-ID of the processor.
|
||||
* @pwrdn_mask: cpu-specific mask to be used for power control register.
|
||||
* @ipi: pointer to IPI channel structure.
|
||||
* (in APU all processors share one IPI channel)
|
||||
*
|
||||
*/
|
||||
struct pm_proc {
|
||||
const uint32_t node_id;
|
||||
|
|
|
@ -59,7 +59,9 @@
|
|||
* Enum definitions
|
||||
********************************************************************/
|
||||
|
||||
//ioctl id
|
||||
/*
|
||||
* ioctl id
|
||||
*/
|
||||
enum {
|
||||
IOCTL_GET_RPU_OPER_MODE = 0,
|
||||
IOCTL_SET_RPU_OPER_MODE = 1,
|
||||
|
@ -98,16 +100,18 @@ enum {
|
|||
};
|
||||
|
||||
/**
|
||||
* @PM_PLL_PARAM_DIV2: Enable for divide by 2 function inside the PLL
|
||||
* @PM_PLL_PARAM_FBDIV: Feedback divisor integer portion for the PLL
|
||||
* @PM_PLL_PARAM_DATA: Feedback divisor fractional portion for the PLL
|
||||
* @PM_PLL_PARAM_PRE_SRC: Clock source for PLL input
|
||||
* @PM_PLL_PARAM_POST_SRC: Clock source for PLL Bypass mode
|
||||
* @PM_PLL_PARAM_LOCK_DLY: Lock circuit config settings for lock windowsize
|
||||
* @PM_PLL_PARAM_LOCK_CNT: Lock circuit counter setting
|
||||
* @PM_PLL_PARAM_LFHF: PLL loop filter high frequency capacitor control
|
||||
* @PM_PLL_PARAM_CP: PLL charge pump control
|
||||
* @PM_PLL_PARAM_RES: PLL loop filter resistor control
|
||||
* enum pm_pll_param - enum represents the parameters for a phase-locked loop.
|
||||
* @PM_PLL_PARAM_DIV2: Enable for divide by 2 function inside the PLL.
|
||||
* @PM_PLL_PARAM_FBDIV: Feedback divisor integer portion for the PLL.
|
||||
* @PM_PLL_PARAM_DATA: Feedback divisor fractional portion for the PLL.
|
||||
* @PM_PLL_PARAM_PRE_SRC: Clock source for PLL input.
|
||||
* @PM_PLL_PARAM_POST_SRC: Clock source for PLL Bypass mode.
|
||||
* @PM_PLL_PARAM_LOCK_DLY: Lock circuit config settings for lock windowsize.
|
||||
* @PM_PLL_PARAM_LOCK_CNT: Lock circuit counter setting.
|
||||
* @PM_PLL_PARAM_LFHF: PLL loop filter high frequency capacitor control.
|
||||
* @PM_PLL_PARAM_CP: PLL charge pump control.
|
||||
* @PM_PLL_PARAM_RES: PLL loop filter resistor control.
|
||||
* @PM_PLL_PARAM_MAX: Represents the maximum parameter value for the PLL
|
||||
*/
|
||||
enum pm_pll_param {
|
||||
PM_PLL_PARAM_DIV2,
|
||||
|
@ -205,7 +209,7 @@ enum pm_opchar_type {
|
|||
PM_OPCHAR_TYPE_LATENCY,
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* Subsystem IDs
|
||||
*/
|
||||
typedef enum {
|
||||
|
@ -223,20 +227,24 @@ typedef enum {
|
|||
|
||||
/* TODO: move pm_ret_status from device specific location to common location */
|
||||
/**
|
||||
* @PM_RET_SUCCESS: success
|
||||
* @PM_RET_ERROR_ARGS: illegal arguments provided (deprecated)
|
||||
* @PM_RET_ERROR_NOTSUPPORTED: feature not supported (deprecated)
|
||||
* @PM_RET_ERROR_NOFEATURE: feature is not available
|
||||
* @PM_RET_ERROR_INVALID_CRC: invalid crc in IPI communication
|
||||
* @PM_RET_ERROR_NOT_ENABLED: feature is not enabled
|
||||
* @PM_RET_ERROR_INTERNAL: internal error
|
||||
* @PM_RET_ERROR_CONFLICT: conflict
|
||||
* @PM_RET_ERROR_ACCESS: access rights violation
|
||||
* @PM_RET_ERROR_INVALID_NODE: invalid node
|
||||
* @PM_RET_ERROR_DOUBLE_REQ: duplicate request for same node
|
||||
* @PM_RET_ERROR_ABORT_SUSPEND: suspend procedure has been aborted
|
||||
* @PM_RET_ERROR_TIMEOUT: timeout in communication with PMU
|
||||
* @PM_RET_ERROR_NODE_USED: node is already in use
|
||||
* enum pm_ret_status - enum represents the return status codes for a PM
|
||||
* operation.
|
||||
* @PM_RET_SUCCESS: success.
|
||||
* @PM_RET_ERROR_ARGS: illegal arguments provided (deprecated).
|
||||
* @PM_RET_ERROR_NOTSUPPORTED: feature not supported (deprecated).
|
||||
* @PM_RET_ERROR_NOFEATURE: feature is not available.
|
||||
* @PM_RET_ERROR_INVALID_CRC: invalid crc in IPI communication.
|
||||
* @PM_RET_ERROR_NOT_ENABLED: feature is not enabled.
|
||||
* @PM_RET_ERROR_INTERNAL: internal error.
|
||||
* @PM_RET_ERROR_CONFLICT: conflict.
|
||||
* @PM_RET_ERROR_ACCESS: access rights violation.
|
||||
* @PM_RET_ERROR_INVALID_NODE: invalid node.
|
||||
* @PM_RET_ERROR_DOUBLE_REQ: duplicate request for same node.
|
||||
* @PM_RET_ERROR_ABORT_SUSPEND: suspend procedure has been aborted.
|
||||
* @PM_RET_ERROR_TIMEOUT: timeout in communication with PMU.
|
||||
* @PM_RET_ERROR_NODE_USED: node is already in use.
|
||||
* @PM_RET_ERROR_NO_FEATURE: indicates that the requested feature is not
|
||||
* supported.
|
||||
*/
|
||||
enum pm_ret_status {
|
||||
PM_RET_SUCCESS,
|
||||
|
@ -256,7 +264,7 @@ enum pm_ret_status {
|
|||
PM_RET_ERROR_NO_FEATURE = 2008
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* Qids
|
||||
*/
|
||||
enum pm_query_id {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2017-2020, Arm Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2020-2022, Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -45,10 +46,9 @@ static const struct ipi_config *ipi_table;
|
|||
static uint32_t ipi_total;
|
||||
|
||||
/**
|
||||
* ipi_config_init() - Initialize IPI configuration data
|
||||
*
|
||||
* @ipi_config_table - IPI configuration table
|
||||
* @ipi_total - Total number of IPI available
|
||||
* ipi_config_table_init() - Initialize IPI configuration data.
|
||||
* @ipi_config_table: IPI configuration table.
|
||||
* @total_ipi: Total number of IPI available.
|
||||
*
|
||||
*/
|
||||
void ipi_config_table_init(const struct ipi_config *ipi_config_table,
|
||||
|
@ -58,12 +58,13 @@ void ipi_config_table_init(const struct ipi_config *ipi_config_table,
|
|||
ipi_total = total_ipi;
|
||||
}
|
||||
|
||||
/* is_ipi_mb_within_range() - verify if IPI mailbox is within range
|
||||
/**
|
||||
* is_ipi_mb_within_range() - verify if IPI mailbox is within range.
|
||||
* @local: local IPI ID.
|
||||
* @remote: remote IPI ID.
|
||||
*
|
||||
* @local - local IPI ID
|
||||
* @remote - remote IPI ID
|
||||
* Return: - 1 if within range, 0 if not.
|
||||
*
|
||||
* return - 1 if within range, 0 if not
|
||||
*/
|
||||
static inline int is_ipi_mb_within_range(uint32_t local, uint32_t remote)
|
||||
{
|
||||
|
@ -77,13 +78,13 @@ static inline int is_ipi_mb_within_range(uint32_t local, uint32_t remote)
|
|||
}
|
||||
|
||||
/**
|
||||
* ipi_mb_validate() - validate IPI mailbox access
|
||||
* ipi_mb_validate() - validate IPI mailbox access.
|
||||
* @local: local IPI ID.
|
||||
* @remote: remote IPI ID.
|
||||
* @is_secure: indicate if the requester is from secure software.
|
||||
*
|
||||
* @local - local IPI ID
|
||||
* @remote - remote IPI ID
|
||||
* @is_secure - indicate if the requester is from secure software
|
||||
* Return: 0 success, negative value for errors.
|
||||
*
|
||||
* return - 0 success, negative value for errors
|
||||
*/
|
||||
int ipi_mb_validate(uint32_t local, uint32_t remote, unsigned int is_secure)
|
||||
{
|
||||
|
@ -104,9 +105,8 @@ int ipi_mb_validate(uint32_t local, uint32_t remote, unsigned int is_secure)
|
|||
|
||||
/**
|
||||
* ipi_mb_open() - Open IPI mailbox.
|
||||
*
|
||||
* @local - local IPI ID
|
||||
* @remote - remote IPI ID
|
||||
* @local: local IPI ID.
|
||||
* @remote: remote IPI ID.
|
||||
*
|
||||
*/
|
||||
void ipi_mb_open(uint32_t local, uint32_t remote)
|
||||
|
@ -119,9 +119,8 @@ void ipi_mb_open(uint32_t local, uint32_t remote)
|
|||
|
||||
/**
|
||||
* ipi_mb_release() - Open IPI mailbox.
|
||||
*
|
||||
* @local - local IPI ID
|
||||
* @remote - remote IPI ID
|
||||
* @local: local IPI ID.
|
||||
* @remote: remote IPI ID.
|
||||
*
|
||||
*/
|
||||
void ipi_mb_release(uint32_t local, uint32_t remote)
|
||||
|
@ -131,13 +130,13 @@ void ipi_mb_release(uint32_t local, uint32_t remote)
|
|||
}
|
||||
|
||||
/**
|
||||
* ipi_mb_enquire_status() - Enquire IPI mailbox status
|
||||
* ipi_mb_enquire_status() - Enquire IPI mailbox status.
|
||||
* @local: local IPI ID.
|
||||
* @remote: remote IPI ID.
|
||||
*
|
||||
* @local - local IPI ID
|
||||
* @remote - remote IPI ID
|
||||
* Return: 0 idle, positive value for pending sending or receiving,
|
||||
* negative value for errors.
|
||||
*
|
||||
* return - 0 idle, positive value for pending sending or receiving,
|
||||
* negative value for errors
|
||||
*/
|
||||
int ipi_mb_enquire_status(uint32_t local, uint32_t remote)
|
||||
{
|
||||
|
@ -156,11 +155,11 @@ int ipi_mb_enquire_status(uint32_t local, uint32_t remote)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* ipi_mb_notify() - Trigger IPI mailbox notification
|
||||
*
|
||||
* @local - local IPI ID
|
||||
* @remote - remote IPI ID
|
||||
* @is_blocking - if to trigger the notification in blocking mode or not.
|
||||
/**
|
||||
* ipi_mb_notify() - Trigger IPI mailbox notification.
|
||||
* @local: local IPI ID.
|
||||
* @remote: remote IPI ID.
|
||||
* @is_blocking: if to trigger the notification in blocking mode or not.
|
||||
*
|
||||
* It sets the remote bit in the IPI agent trigger register.
|
||||
*
|
||||
|
@ -179,10 +178,10 @@ void ipi_mb_notify(uint32_t local, uint32_t remote, uint32_t is_blocking)
|
|||
}
|
||||
}
|
||||
|
||||
/* ipi_mb_ack() - Ack IPI mailbox notification from the other end
|
||||
*
|
||||
* @local - local IPI ID
|
||||
* @remote - remote IPI ID
|
||||
/**
|
||||
* ipi_mb_ack() - Ack IPI mailbox notification from the other end.
|
||||
* @local: local IPI ID.
|
||||
* @remote: remote IPI ID.
|
||||
*
|
||||
* It will clear the remote bit in the isr register.
|
||||
*
|
||||
|
@ -193,10 +192,10 @@ void ipi_mb_ack(uint32_t local, uint32_t remote)
|
|||
IPI_BIT_MASK(remote));
|
||||
}
|
||||
|
||||
/* ipi_mb_disable_irq() - Disable IPI mailbox notification interrupt
|
||||
*
|
||||
* @local - local IPI ID
|
||||
* @remote - remote IPI ID
|
||||
/**
|
||||
* ipi_mb_disable_irq() - Disable IPI mailbox notification interrupt.
|
||||
* @local: local IPI ID.
|
||||
* @remote: remote IPI ID.
|
||||
*
|
||||
* It will mask the remote bit in the idr register.
|
||||
*
|
||||
|
@ -207,10 +206,10 @@ void ipi_mb_disable_irq(uint32_t local, uint32_t remote)
|
|||
IPI_BIT_MASK(remote));
|
||||
}
|
||||
|
||||
/* ipi_mb_enable_irq() - Enable IPI mailbox notification interrupt
|
||||
*
|
||||
* @local - local IPI ID
|
||||
* @remote - remote IPI ID
|
||||
/**
|
||||
* ipi_mb_enable_irq() - Enable IPI mailbox notification interrupt.
|
||||
* @local: local IPI ID.
|
||||
* @remote: remote IPI ID.
|
||||
*
|
||||
* It will mask the remote bit in the idr register.
|
||||
*
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2017-2019, Arm Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -46,21 +47,25 @@
|
|||
#define UNSIGNED32_MASK 0xFFFFFFFFU /* 32bit mask */
|
||||
|
||||
/**
|
||||
* ipi_smc_handler() - SMC handler for IPI SMC calls
|
||||
* ipi_smc_handler() - SMC handler for IPI SMC calls.
|
||||
* @smc_fid: Function identifier.
|
||||
* @x1: Arguments.
|
||||
* @x2: Arguments.
|
||||
* @x3: Arguments.
|
||||
* @x4: Arguments.
|
||||
* @cookie: Unused.
|
||||
* @handle: Pointer to caller's context structure.
|
||||
* @flags: SECURE_FLAG or NON_SECURE_FLAG.
|
||||
*
|
||||
* @smc_fid - Function identifier
|
||||
* @x1 - x4 - Arguments
|
||||
* @cookie - Unused
|
||||
* @handler - Pointer to caller's context structure
|
||||
*
|
||||
* @return - Unused
|
||||
* Return: Unused.
|
||||
*
|
||||
* Determines that smc_fid is valid and supported PM SMC Function ID from the
|
||||
* list of pm_api_ids, otherwise completes the request with
|
||||
* the unknown SMC Function ID
|
||||
* the unknown SMC Function ID.
|
||||
*
|
||||
* The SMC calls for PM service are forwarded from SIP Service SMC handler
|
||||
* function with rt_svc_handle signature
|
||||
* function with rt_svc_handle signature.
|
||||
*
|
||||
*/
|
||||
uint64_t ipi_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2,
|
||||
uint64_t x3, uint64_t x4, const void *cookie,
|
||||
|
|
|
@ -55,11 +55,12 @@
|
|||
#define FSBL_FLAGS_A53_3 3U
|
||||
|
||||
/**
|
||||
* @partition: Pointer to partition struct
|
||||
* get_fsbl_cpu() - Get the target CPU for partition.
|
||||
* @partition: Pointer to partition struct.
|
||||
*
|
||||
* Get the target CPU for @partition.
|
||||
* Return: FSBL_FLAGS_A53_0, FSBL_FLAGS_A53_1, FSBL_FLAGS_A53_2 or
|
||||
* FSBL_FLAGS_A53_3.
|
||||
*
|
||||
* Return: FSBL_FLAGS_A53_0, FSBL_FLAGS_A53_1, FSBL_FLAGS_A53_2 or FSBL_FLAGS_A53_3
|
||||
*/
|
||||
static int32_t get_fsbl_cpu(const struct xfsbl_partition *partition)
|
||||
{
|
||||
|
@ -69,11 +70,11 @@ static int32_t get_fsbl_cpu(const struct xfsbl_partition *partition)
|
|||
}
|
||||
|
||||
/**
|
||||
* @partition: Pointer to partition struct
|
||||
* get_fsbl_el() - Get the target exception level for partition.
|
||||
* @partition: Pointer to partition struct.
|
||||
*
|
||||
* Get the target exception level for @partition.
|
||||
* Return: FSBL_FLAGS_EL0, FSBL_FLAGS_EL1, FSBL_FLAGS_EL2 or FSBL_FLAGS_EL3.
|
||||
*
|
||||
* Return: FSBL_FLAGS_EL0, FSBL_FLAGS_EL1, FSBL_FLAGS_EL2 or FSBL_FLAGS_EL3
|
||||
*/
|
||||
static int32_t get_fsbl_el(const struct xfsbl_partition *partition)
|
||||
{
|
||||
|
@ -83,11 +84,11 @@ static int32_t get_fsbl_el(const struct xfsbl_partition *partition)
|
|||
}
|
||||
|
||||
/**
|
||||
* @partition: Pointer to partition struct
|
||||
* get_fsbl_ss() - Get the target security state for partition.
|
||||
* @partition: Pointer to partition struct.
|
||||
*
|
||||
* Get the target security state for @partition.
|
||||
* Return: FSBL_FLAGS_NON_SECURE or FSBL_FLAGS_SECURE.
|
||||
*
|
||||
* Return: FSBL_FLAGS_NON_SECURE or FSBL_FLAGS_SECURE
|
||||
*/
|
||||
static int32_t get_fsbl_ss(const struct xfsbl_partition *partition)
|
||||
{
|
||||
|
@ -97,11 +98,11 @@ static int32_t get_fsbl_ss(const struct xfsbl_partition *partition)
|
|||
}
|
||||
|
||||
/**
|
||||
* @partition: Pointer to partition struct
|
||||
* get_fsbl_endian() - Get the target endianness for partition.
|
||||
* @partition: Pointer to partition struct.
|
||||
*
|
||||
* Get the target endianness for @partition.
|
||||
* Return: SPSR_E_LITTLE or SPSR_E_BIG.
|
||||
*
|
||||
* Return: SPSR_E_LITTLE or SPSR_E_BIG
|
||||
*/
|
||||
static int32_t get_fsbl_endian(const struct xfsbl_partition *partition)
|
||||
{
|
||||
|
@ -117,11 +118,11 @@ static int32_t get_fsbl_endian(const struct xfsbl_partition *partition)
|
|||
}
|
||||
|
||||
/**
|
||||
* @partition: Pointer to partition struct
|
||||
* get_fsbl_estate() - Get the target execution state for partition.
|
||||
* @partition: Pointer to partition struct.
|
||||
*
|
||||
* Get the target execution state for @partition.
|
||||
* Return: FSBL_FLAGS_ESTATE_A32 or FSBL_FLAGS_ESTATE_A64.
|
||||
*
|
||||
* Return: FSBL_FLAGS_ESTATE_A32 or FSBL_FLAGS_ESTATE_A64
|
||||
*/
|
||||
static int32_t get_fsbl_estate(const struct xfsbl_partition *partition)
|
||||
{
|
||||
|
@ -131,16 +132,17 @@ static int32_t get_fsbl_estate(const struct xfsbl_partition *partition)
|
|||
}
|
||||
|
||||
/**
|
||||
* Populates the bl32 and bl33 image info structures
|
||||
* @bl32: BL32 image info structure
|
||||
* @bl33: BL33 image info structure
|
||||
* tfa_handoff_addr: TF-A handoff address
|
||||
* fsbl_tfa_handover() - Populates the bl32 and bl33 image info structures.
|
||||
* @bl32: BL32 image info structure.
|
||||
* @bl33: BL33 image info structure.
|
||||
* @tfa_handoff_addr: TF-A handoff address.
|
||||
*
|
||||
* Process the handoff parameters from the FSBL and populate the BL32 and BL33
|
||||
* image info structures accordingly.
|
||||
*
|
||||
* Return: Return the status of the handoff. The value will be from the
|
||||
* fsbl_handoff enum.
|
||||
*
|
||||
*/
|
||||
enum fsbl_handoff fsbl_tfa_handover(entry_point_info_t *bl32,
|
||||
entry_point_info_t *bl33,
|
||||
|
|
|
@ -28,9 +28,10 @@
|
|||
static uint32_t pm_shutdown_scope = XPM_SHUTDOWN_SUBTYPE_RST_SYSTEM;
|
||||
|
||||
/**
|
||||
* pm_get_shutdown_scope() - Get the currently set shutdown scope
|
||||
* pm_get_shutdown_scope() - Get the currently set shutdown scope.
|
||||
*
|
||||
* Return: Shutdown scope value.
|
||||
*
|
||||
* @return Shutdown scope value
|
||||
*/
|
||||
uint32_t pm_get_shutdown_scope(void)
|
||||
{
|
||||
|
@ -42,7 +43,8 @@ uint32_t pm_get_shutdown_scope(void)
|
|||
/**
|
||||
* pm_client_set_wakeup_sources - Set all devices with enabled interrupts as
|
||||
* wake sources in the XilPM.
|
||||
* @node_id: Node id of processor
|
||||
* @node_id: Node id of processor.
|
||||
*
|
||||
*/
|
||||
void pm_client_set_wakeup_sources(uint32_t node_id)
|
||||
{
|
||||
|
@ -91,13 +93,19 @@ void pm_client_set_wakeup_sources(uint32_t node_id)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_handle_eemi_call() - PM call for processor to send eemi payload
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* @x0 to x5 Arguments received per SMC64 standard
|
||||
* @result Payload received from firmware
|
||||
* pm_handle_eemi_call() - PM call for processor to send eemi payload.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
* @x0: Arguments received per SMC64 standard.
|
||||
* @x1: Arguments received per SMC64 standard.
|
||||
* @x2: Arguments received per SMC64 standard.
|
||||
* @x3: Arguments received per SMC64 standard.
|
||||
* @x4: Arguments received per SMC64 standard.
|
||||
* @x5: Arguments received per SMC64 standard.
|
||||
* @result: Payload received from firmware.
|
||||
*
|
||||
* Return: PM_RET_SUCCESS on success or error code.
|
||||
*
|
||||
* @return PM_RET_SUCCESS on success or error code
|
||||
*/
|
||||
enum pm_ret_status pm_handle_eemi_call(uint32_t flag, uint32_t x0, uint32_t x1,
|
||||
uint32_t x2, uint32_t x3, uint32_t x4,
|
||||
|
@ -119,17 +127,18 @@ enum pm_ret_status pm_handle_eemi_call(uint32_t flag, uint32_t x0, uint32_t x1,
|
|||
|
||||
/**
|
||||
* pm_self_suspend() - PM call for processor to suspend itself
|
||||
* @nid Node id of the processor or subsystem
|
||||
* @latency Requested maximum wakeup latency (not supported)
|
||||
* @state Requested state
|
||||
* @address Resume address
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* @nid: Node id of the processor or subsystem.
|
||||
* @latency: Requested maximum wakeup latency (not supported).
|
||||
* @state: Requested state.
|
||||
* @address: Resume address.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
*
|
||||
* This is a blocking call, it will return only once PMU has responded.
|
||||
* On a wakeup, resume address will be automatically set by PMU.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_self_suspend(uint32_t nid,
|
||||
uint32_t latency,
|
||||
|
@ -160,15 +169,16 @@ enum pm_ret_status pm_self_suspend(uint32_t nid,
|
|||
|
||||
/**
|
||||
* pm_abort_suspend() - PM call to announce that a prior suspend request
|
||||
* is to be aborted.
|
||||
* @reason Reason for the abort
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* is to be aborted.
|
||||
* @reason: Reason for the abort.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
*
|
||||
* Calling PU expects the PMU to abort the initiated suspend procedure.
|
||||
* This is a non-blocking call without any acknowledge.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_abort_suspend(enum pm_abort_reason reason, uint32_t flag)
|
||||
{
|
||||
|
@ -188,15 +198,16 @@ enum pm_ret_status pm_abort_suspend(enum pm_abort_reason reason, uint32_t flag)
|
|||
|
||||
/**
|
||||
* pm_req_suspend() - PM call to request for another PU or subsystem to
|
||||
* be suspended gracefully.
|
||||
* @target Node id of the targeted PU or subsystem
|
||||
* @ack Flag to specify whether acknowledge is requested
|
||||
* @latency Requested wakeup latency (not supported)
|
||||
* @state Requested state (not supported)
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* be suspended gracefully.
|
||||
* @target: Node id of the targeted PU or subsystem.
|
||||
* @ack: Flag to specify whether acknowledge is requested.
|
||||
* @latency: Requested wakeup latency (not supported)
|
||||
* @state: Requested state (not supported).
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
enum pm_ret_status pm_req_suspend(uint32_t target, uint8_t ack,
|
||||
uint32_t latency, uint32_t state,
|
||||
|
@ -216,21 +227,22 @@ enum pm_ret_status pm_req_suspend(uint32_t target, uint8_t ack,
|
|||
|
||||
/**
|
||||
* pm_req_wakeup() - PM call for processor to wake up selected processor
|
||||
* or subsystem
|
||||
* @target Device ID of the processor or subsystem to wake up
|
||||
* @set_address Resume address presence indicator
|
||||
* 1 - resume address specified, 0 - otherwise
|
||||
* @address Resume address
|
||||
* @ack Flag to specify whether acknowledge requested
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* or subsystem.
|
||||
* @target: Device ID of the processor or subsystem to wake up.
|
||||
* @set_address: Resume address presence indicator.
|
||||
* 1 - resume address specified, 0 - otherwise.
|
||||
* @address: Resume address.
|
||||
* @ack: Flag to specify whether acknowledge requested.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
*
|
||||
* This API function is either used to power up another APU core for SMP
|
||||
* (by PSCI) or to power up an entirely different PU or subsystem, such
|
||||
* as RPU0, RPU, or PL_CORE_xx. Resume address for the target PU will be
|
||||
* automatically set by PMC.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_req_wakeup(uint32_t target, uint32_t set_address,
|
||||
uintptr_t address, uint8_t ack, uint32_t flag)
|
||||
|
@ -245,15 +257,17 @@ enum pm_ret_status pm_req_wakeup(uint32_t target, uint32_t set_address,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_get_callbackdata() - Read from IPI response buffer
|
||||
* @data - array of PAYLOAD_ARG_CNT elements
|
||||
* @flag - 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* @ack - 0 - Do not ack IPI after reading payload
|
||||
* 1 - Ack IPI after reading payload
|
||||
* pm_get_callbackdata() - Read from IPI response buffer.
|
||||
* @data: array of PAYLOAD_ARG_CNT elements.
|
||||
* @count: Number of values to return.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
* @ack: 0 - Do not ack IPI after reading payload.
|
||||
* 1 - Ack IPI after reading payload.
|
||||
*
|
||||
* Read value from ipi buffer response buffer.
|
||||
* @return Returns status, either success or error
|
||||
* Return: Returns status, either success or error.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_get_callbackdata(uint32_t *data, size_t count, uint32_t flag, uint32_t ack)
|
||||
{
|
||||
|
@ -273,19 +287,19 @@ enum pm_ret_status pm_get_callbackdata(uint32_t *data, size_t count, uint32_t fl
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_pll_set_param() - Set PLL parameter
|
||||
* pm_pll_set_param() - Set PLL parameter.
|
||||
* @clk_id: PLL clock ID.
|
||||
* @param: PLL parameter ID.
|
||||
* @value: Value to set for PLL parameter.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
*
|
||||
* This API is deprecated and maintained here for backward compatibility.
|
||||
* New use of this API should be avoided for versal platform.
|
||||
* This API and its use cases will be removed for versal platform.
|
||||
*
|
||||
* @clk_id PLL clock ID
|
||||
* @param PLL parameter ID
|
||||
* @value Value to set for PLL parameter
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
enum pm_ret_status pm_pll_set_param(uint32_t clk_id, uint32_t param,
|
||||
uint32_t value, uint32_t flag)
|
||||
|
@ -300,19 +314,19 @@ enum pm_ret_status pm_pll_set_param(uint32_t clk_id, uint32_t param,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_pll_get_param() - Get PLL parameter value
|
||||
* pm_pll_get_param() - Get PLL parameter value.
|
||||
* @clk_id: PLL clock ID.
|
||||
* @param: PLL parameter ID.
|
||||
* @value: Buffer to store PLL parameter value.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
*
|
||||
* This API is deprecated and maintained here for backward compatibility.
|
||||
* New use of this API should be avoided for versal platform.
|
||||
* This API and its use cases will be removed for versal platform.
|
||||
*
|
||||
* @clk_id PLL clock ID
|
||||
* @param PLL parameter ID
|
||||
* @value: Buffer to store PLL parameter value
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
enum pm_ret_status pm_pll_get_param(uint32_t clk_id, uint32_t param,
|
||||
uint32_t *value, uint32_t flag)
|
||||
|
@ -327,18 +341,18 @@ enum pm_ret_status pm_pll_get_param(uint32_t clk_id, uint32_t param,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_pll_set_mode() - Set PLL mode
|
||||
* pm_pll_set_mode() - Set PLL mode.
|
||||
* @clk_id: PLL clock ID.
|
||||
* @mode: PLL mode.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
*
|
||||
* This API is deprecated and maintained here for backward compatibility.
|
||||
* New use of this API should be avoided for versal platform.
|
||||
* This API and its use cases will be removed for versal platform.
|
||||
*
|
||||
* @clk_id PLL clock ID
|
||||
* @mode PLL mode
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
enum pm_ret_status pm_pll_set_mode(uint32_t clk_id, uint32_t mode,
|
||||
uint32_t flag)
|
||||
|
@ -353,18 +367,18 @@ enum pm_ret_status pm_pll_set_mode(uint32_t clk_id, uint32_t mode,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_pll_get_mode() - Get PLL mode
|
||||
* pm_pll_get_mode() - Get PLL mode.
|
||||
* @clk_id: PLL clock ID.
|
||||
* @mode: Buffer to store PLL mode.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
*
|
||||
* This API is deprecated and maintained here for backward compatibility.
|
||||
* New use of this API should be avoided for versal platform.
|
||||
* This API and its use cases will be removed for versal platform.
|
||||
*
|
||||
* @clk_id PLL clock ID
|
||||
* @mode: Buffer to store PLL mode
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
enum pm_ret_status pm_pll_get_mode(uint32_t clk_id, uint32_t *mode,
|
||||
uint32_t flag)
|
||||
|
@ -380,13 +394,14 @@ enum pm_ret_status pm_pll_get_mode(uint32_t clk_id, uint32_t *mode,
|
|||
|
||||
/**
|
||||
* pm_force_powerdown() - PM call to request for another PU or subsystem to
|
||||
* be powered down forcefully
|
||||
* @target Device ID of the PU node to be forced powered down.
|
||||
* @ack Flag to specify whether acknowledge is requested
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* be powered down forcefully.
|
||||
* @target: Device ID of the PU node to be forced powered down.
|
||||
* @ack: Flag to specify whether acknowledge is requested
|
||||
* @flag: 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
enum pm_ret_status pm_force_powerdown(uint32_t target, uint8_t ack,
|
||||
uint32_t flag)
|
||||
|
@ -405,13 +420,14 @@ enum pm_ret_status pm_force_powerdown(uint32_t target, uint8_t ack,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_system_shutdown() - PM call to request a system shutdown or restart
|
||||
* @type Shutdown or restart? 0=shutdown, 1=restart, 2=setscope
|
||||
* @subtype Scope: 0=APU-subsystem, 1=PS, 2=system
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* pm_system_shutdown() - PM call to request a system shutdown or restart.
|
||||
* @type: Shutdown or restart? 0=shutdown, 1=restart, 2=setscope.
|
||||
* @subtype: Scope: 0=APU-subsystem, 1=PS, 2=system.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
enum pm_ret_status pm_system_shutdown(uint32_t type, uint32_t subtype,
|
||||
uint32_t flag)
|
||||
|
@ -432,22 +448,22 @@ enum pm_ret_status pm_system_shutdown(uint32_t type, uint32_t subtype,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_query_data() - PM API for querying firmware data
|
||||
* pm_query_data() - PM API for querying firmware data.
|
||||
* @qid: The type of data to query.
|
||||
* @arg1: Argument 1 to requested query data call.
|
||||
* @arg2: Argument 2 to requested query data call.
|
||||
* @arg3: Argument 3 to requested query data call.
|
||||
* @data: Returned output data.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
*
|
||||
* This API is deprecated and maintained here for backward compatibility.
|
||||
* New use of this API should be avoided for versal platform.
|
||||
* This API and its use cases will be removed for versal platform.
|
||||
*
|
||||
* @qid The type of data to query
|
||||
* @arg1 Argument 1 to requested query data call
|
||||
* @arg2 Argument 2 to requested query data call
|
||||
* @arg3 Argument 3 to requested query data call
|
||||
* @data Returned output data
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* Return: 0 if success else non-zero error code of type
|
||||
* enum pm_ret_status.
|
||||
*
|
||||
* @retur - 0 if success else non-zero error code of type
|
||||
* enum pm_ret_status
|
||||
*/
|
||||
enum pm_ret_status pm_query_data(uint32_t qid, uint32_t arg1, uint32_t arg2,
|
||||
uint32_t arg3, uint32_t *data, uint32_t flag)
|
||||
|
@ -481,25 +497,25 @@ enum pm_ret_status pm_query_data(uint32_t qid, uint32_t arg1, uint32_t arg2,
|
|||
return ret;
|
||||
}
|
||||
/**
|
||||
* pm_api_ioctl() - PM IOCTL API for device control and configs
|
||||
* pm_api_ioctl() - PM IOCTL API for device control and configs.
|
||||
* @device_id: Device ID.
|
||||
* @ioctl_id: ID of the requested IOCTL.
|
||||
* @arg1: Argument 1 to requested IOCTL call.
|
||||
* @arg2: Argument 2 to requested IOCTL call.
|
||||
* @arg3: Argument 3 to requested IOCTL call.
|
||||
* @value: Returned output value.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
*
|
||||
* This API is deprecated and maintained here for backward compatibility.
|
||||
* New use of this API should be avoided for versal platform.
|
||||
* This API and its use cases will be removed for versal platform.
|
||||
*
|
||||
* @device_id Device ID
|
||||
* @ioctl_id ID of the requested IOCTL
|
||||
* @arg1 Argument 1 to requested IOCTL call
|
||||
* @arg2 Argument 2 to requested IOCTL call
|
||||
* @arg3 Argument 3 to requested IOCTL call
|
||||
* @value Returned output value
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
*
|
||||
* This function calls IOCTL to firmware for device control and configuration.
|
||||
*
|
||||
* @return Returns status, either 0 on success or non-zero error code
|
||||
* of type enum pm_ret_status
|
||||
* Return: Returns status, either 0 on success or non-zero error code
|
||||
* of type enum pm_ret_status.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_api_ioctl(uint32_t device_id, uint32_t ioctl_id,
|
||||
uint32_t arg1, uint32_t arg2, uint32_t arg3,
|
||||
|
@ -536,14 +552,16 @@ enum pm_ret_status pm_api_ioctl(uint32_t device_id, uint32_t ioctl_id,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_set_wakeup_source() - PM call to specify the wakeup source while suspended
|
||||
* @target Device id of the targeted PU or subsystem
|
||||
* @wkup_node Device id of the wakeup peripheral
|
||||
* @enable Enable or disable the specified peripheral as wake source
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* pm_set_wakeup_source() - PM call to specify the wakeup source while
|
||||
* suspended.
|
||||
* @target: Device id of the targeted PU or subsystem
|
||||
* @wkup_device: Device id of the wakeup peripheral
|
||||
* @enable: Enable or disable the specified peripheral as wake source
|
||||
* @flag: 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
enum pm_ret_status pm_set_wakeup_source(uint32_t target, uint32_t wkup_device,
|
||||
uint8_t enable, uint32_t flag)
|
||||
|
@ -556,15 +574,16 @@ enum pm_ret_status pm_set_wakeup_source(uint32_t target, uint32_t wkup_device,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_feature_check() - Returns the supported API version if supported
|
||||
* @api_id API ID to check
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* @ret_payload pointer to array of PAYLOAD_ARG_CNT number of
|
||||
* words Returned supported API version and bitmasks
|
||||
* for IOCTL and QUERY ID
|
||||
* pm_feature_check() - Returns the supported API version if supported.
|
||||
* @api_id: API ID to check.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
* @ret_payload: pointer to array of PAYLOAD_ARG_CNT number of
|
||||
* words Returned supported API version and bitmasks
|
||||
* for IOCTL and QUERY ID
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
enum pm_ret_status pm_feature_check(uint32_t api_id, uint32_t *ret_payload,
|
||||
uint32_t flag)
|
||||
|
@ -601,17 +620,17 @@ enum pm_ret_status pm_feature_check(uint32_t api_id, uint32_t *ret_payload,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_load_pdi() - Load the PDI
|
||||
* pm_load_pdi() - Load the PDI. This function provides support to load
|
||||
* PDI from linux.
|
||||
*
|
||||
* This function provides support to load PDI from linux
|
||||
* @src: Source device of pdi(DDR, OCM, SD etc).
|
||||
* @address_low: lower 32-bit Linear memory space address.
|
||||
* @address_high: higher 32-bit Linear memory space address.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
*
|
||||
* src: Source device of pdi(DDR, OCM, SD etc)
|
||||
* address_low: lower 32-bit Linear memory space address
|
||||
* address_high: higher 32-bit Linear memory space address
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
enum pm_ret_status pm_load_pdi(uint32_t src, uint32_t address_low,
|
||||
uint32_t address_high, uint32_t flag)
|
||||
|
@ -626,15 +645,16 @@ enum pm_ret_status pm_load_pdi(uint32_t src, uint32_t address_low,
|
|||
|
||||
/**
|
||||
* pm_register_notifier() - PM call to register a subsystem to be notified
|
||||
* about the device event
|
||||
* @device_id Device ID for the Node to which the event is related
|
||||
* @event Event in question
|
||||
* @wake Wake subsystem upon capturing the event if value 1
|
||||
* @enable Enable the registration for value 1, disable for value 0
|
||||
* @flag 0 - Call from secure source
|
||||
* 1 - Call from non-secure source
|
||||
* about the device event.
|
||||
* @device_id: Device ID for the Node to which the event is related.
|
||||
* @event: Event in question.
|
||||
* @wake: Wake subsystem upon capturing the event if value 1.
|
||||
* @enable: Enable the registration for value 1, disable for value 0.
|
||||
* @flag: 0 - Call from secure source.
|
||||
* 1 - Call from non-secure source.
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
enum pm_ret_status pm_register_notifier(uint32_t device_id, uint32_t event,
|
||||
uint32_t wake, uint32_t enable,
|
||||
|
@ -650,11 +670,11 @@ enum pm_ret_status pm_register_notifier(uint32_t device_id, uint32_t event,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_get_chipid() - Read silicon ID registers
|
||||
* @value: Buffer for two 32bit words.
|
||||
* pm_get_chipid() - Read silicon ID registers.
|
||||
* @value: Buffer for two 32bit words.
|
||||
*
|
||||
* @return: Returns status, either success or error+reason and,
|
||||
* optionally, @value.
|
||||
* Return: Returns status, either success or error+reason and,
|
||||
* optionally, @value.
|
||||
*/
|
||||
enum pm_ret_status pm_get_chipid(uint32_t *value)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2020, Arm Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2019-2022, Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022, Advanced Micro Devices, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -52,14 +52,14 @@ static inline void pm_ipi_lock_release(void)
|
|||
|
||||
/**
|
||||
* pm_ipi_init() - Initialize IPI peripheral for communication with
|
||||
* remote processor
|
||||
* remote processor.
|
||||
* @proc: Pointer to the processor who is initiating request.
|
||||
*
|
||||
* @proc Pointer to the processor who is initiating request
|
||||
* @return On success, the initialization function must return 0.
|
||||
* Any other return value will cause the framework to ignore
|
||||
* the service
|
||||
* Return: On success, the initialization function must return 0.
|
||||
* Any other return value will cause the framework to ignore
|
||||
* the service.
|
||||
*
|
||||
* Called from pm_setup initialization function
|
||||
* Called from pm_setup initialization function.
|
||||
*/
|
||||
void pm_ipi_init(const struct pm_proc *proc)
|
||||
{
|
||||
|
@ -67,14 +67,16 @@ void pm_ipi_init(const struct pm_proc *proc)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ipi_send_common() - Sends IPI request to the remote processor
|
||||
* @proc Pointer to the processor who is initiating request
|
||||
* @payload API id and call arguments to be written in IPI buffer
|
||||
* pm_ipi_send_common() - Sends IPI request to the remote processor.
|
||||
* @proc: Pointer to the processor who is initiating request.
|
||||
* @payload: API id and call arguments to be written in IPI buffer.
|
||||
* @is_blocking: if to trigger the notification in blocking mode or not.
|
||||
*
|
||||
* Send an IPI request to the power controller. Caller needs to hold
|
||||
* the 'pm_secure_lock' lock.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ipi_send_common(const struct pm_proc *proc,
|
||||
uint32_t payload[PAYLOAD_ARG_CNT],
|
||||
|
@ -103,13 +105,14 @@ static enum pm_ret_status pm_ipi_send_common(const struct pm_proc *proc,
|
|||
|
||||
/**
|
||||
* pm_ipi_send_non_blocking() - Sends IPI request to the remote processor
|
||||
* without blocking notification
|
||||
* @proc Pointer to the processor who is initiating request
|
||||
* @payload API id and call arguments to be written in IPI buffer
|
||||
* without blocking notification.
|
||||
* @proc: Pointer to the processor who is initiating request.
|
||||
* @payload: API id and call arguments to be written in IPI buffer.
|
||||
*
|
||||
* Send an IPI request to the power controller.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_ipi_send_non_blocking(const struct pm_proc *proc,
|
||||
uint32_t payload[PAYLOAD_ARG_CNT])
|
||||
|
@ -126,13 +129,14 @@ enum pm_ret_status pm_ipi_send_non_blocking(const struct pm_proc *proc,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ipi_send() - Sends IPI request to the remote processor
|
||||
* @proc Pointer to the processor who is initiating request
|
||||
* @payload API id and call arguments to be written in IPI buffer
|
||||
* pm_ipi_send() - Sends IPI request to the remote processor.
|
||||
* @proc: Pointer to the processor who is initiating request.
|
||||
* @payload: API id and call arguments to be written in IPI buffer.
|
||||
*
|
||||
* Send an IPI request to the power controller.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_ipi_send(const struct pm_proc *proc,
|
||||
uint32_t payload[PAYLOAD_ARG_CNT])
|
||||
|
@ -151,12 +155,13 @@ enum pm_ret_status pm_ipi_send(const struct pm_proc *proc,
|
|||
|
||||
/**
|
||||
* pm_ipi_buff_read() - Reads IPI response after remote processor has handled
|
||||
* interrupt
|
||||
* @proc Pointer to the processor who is waiting and reading response
|
||||
* @value Used to return value from IPI buffer element (optional)
|
||||
* @count Number of values to return in @value
|
||||
* interrupt.
|
||||
* @proc: Pointer to the processor who is waiting and reading response.
|
||||
* @value: Used to return value from IPI buffer element (optional).
|
||||
* @count: Number of values to return in @value.
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
static enum pm_ret_status pm_ipi_buff_read(const struct pm_proc *proc,
|
||||
uint32_t *value, size_t count)
|
||||
|
@ -208,13 +213,15 @@ static enum pm_ret_status pm_ipi_buff_read(const struct pm_proc *proc,
|
|||
|
||||
/**
|
||||
* pm_ipi_buff_read_callb() - Callback function that reads value from
|
||||
* ipi response buffer
|
||||
* @value Used to return value from IPI buffer element
|
||||
* @count Number of values to return in @value
|
||||
* ipi response buffer.
|
||||
* @value: Used to return value from IPI buffer element.
|
||||
* @count: Number of values to return in @value.
|
||||
*
|
||||
* This callback function fills requested data in @value from ipi response
|
||||
* buffer.
|
||||
* @return Returns status, either success or error
|
||||
*
|
||||
* Return: Returns status, either success or error.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_ipi_buff_read_callb(uint32_t *value, size_t count)
|
||||
{
|
||||
|
@ -258,16 +265,17 @@ enum pm_ret_status pm_ipi_buff_read_callb(uint32_t *value, size_t count)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ipi_send_sync() - Sends IPI request to the remote processor
|
||||
* @proc Pointer to the processor who is initiating request
|
||||
* @payload API id and call arguments to be written in IPI buffer
|
||||
* @value Used to return value from IPI buffer element (optional)
|
||||
* @count Number of values to return in @value
|
||||
* pm_ipi_send_sync() - Sends IPI request to the remote processor.
|
||||
* @proc: Pointer to the processor who is initiating request.
|
||||
* @payload: API id and call arguments to be written in IPI buffer.
|
||||
* @value: Used to return value from IPI buffer element (optional).
|
||||
* @count: Number of values to return in @value.
|
||||
*
|
||||
* Send an IPI request to the power controller and wait for it to be handled.
|
||||
*
|
||||
* @return Returns status, either success or error+reason and, optionally,
|
||||
* @value
|
||||
* Return: Returns status, either success or error+reason and, optionally,
|
||||
* @value.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_ipi_send_sync(const struct pm_proc *proc,
|
||||
uint32_t payload[PAYLOAD_ARG_CNT],
|
||||
|
|
|
@ -84,13 +84,13 @@ static uint64_t ipi_fiq_handler(uint32_t id, uint32_t flags, void *handle,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_register_sgi() - PM register the IPI interrupt
|
||||
* pm_register_sgi() - PM register the IPI interrupt.
|
||||
* @sgi_num: SGI number to be used for communication.
|
||||
* @reset: Reset to invalid SGI when reset=1.
|
||||
*
|
||||
* @sgi - SGI number to be used for communication.
|
||||
* @reset - Reset to invalid SGI when reset=1.
|
||||
* @return On success, the initialization function must return 0.
|
||||
* Any other return value will cause the framework to ignore
|
||||
* the service
|
||||
* Return: On success, the initialization function must return 0.
|
||||
* Any other return value will cause the framework to ignore
|
||||
* the service.
|
||||
*
|
||||
* Update the SGI number to be used.
|
||||
*
|
||||
|
@ -115,17 +115,18 @@ int32_t pm_register_sgi(uint32_t sgi_num, uint32_t reset)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_setup() - PM service setup
|
||||
* pm_setup() - PM service setup.
|
||||
*
|
||||
* @return On success, the initialization function must return 0.
|
||||
* Any other return value will cause the framework to ignore
|
||||
* the service
|
||||
* Return: On success, the initialization function must return 0.
|
||||
* Any other return value will cause the framework to ignore
|
||||
* the service.
|
||||
*
|
||||
* Initialization functions for Versal power management for
|
||||
* communicaton with PMC.
|
||||
*
|
||||
* Called from sip_svc_setup initialization function with the
|
||||
* rt_svc_init signature.
|
||||
*
|
||||
*/
|
||||
int32_t pm_setup(void)
|
||||
{
|
||||
|
@ -152,14 +153,19 @@ int32_t pm_setup(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* eemi_for_compatibility() - EEMI calls handler for deprecated calls
|
||||
* eemi_for_compatibility() - EEMI calls handler for deprecated calls.
|
||||
* @api_id: identifier for the API being called.
|
||||
* @pm_arg: pointer to the argument data for the API call.
|
||||
* @handle: Pointer to caller's context structure.
|
||||
* @security_flag: SECURE_FLAG or NON_SECURE_FLAG.
|
||||
*
|
||||
* @return - If EEMI API found then, uintptr_t type address, else 0
|
||||
* Return: If EEMI API found then, uintptr_t type address, else 0.
|
||||
*
|
||||
* Some EEMI API's use case needs to be changed in Linux driver, so they
|
||||
* can take advantage of common EEMI handler in TF-A. As of now the old
|
||||
* implementation of these APIs are required to maintain backward compatibility
|
||||
* until their use case in linux driver changes.
|
||||
*
|
||||
*/
|
||||
static uintptr_t eemi_for_compatibility(uint32_t api_id, uint32_t *pm_arg,
|
||||
void *handle, uint32_t security_flag)
|
||||
|
@ -214,14 +220,21 @@ static uintptr_t eemi_for_compatibility(uint32_t api_id, uint32_t *pm_arg,
|
|||
}
|
||||
|
||||
/**
|
||||
* eemi_psci_debugfs_handler() - EEMI API invoked from PSCI
|
||||
* eemi_psci_debugfs_handler() - EEMI API invoked from PSCI.
|
||||
* @api_id: identifier for the API being called.
|
||||
* @pm_arg: pointer to the argument data for the API call.
|
||||
* @handle: Pointer to caller's context structure.
|
||||
* @security_flag: SECURE_FLAG or NON_SECURE_FLAG.
|
||||
*
|
||||
* These EEMI APIs performs CPU specific power management tasks.
|
||||
* These EEMI APIs are invoked either from PSCI or from debugfs in kernel.
|
||||
* These calls require CPU specific processing before sending IPI request to
|
||||
* Platform Management Controller. For example enable/disable CPU specific
|
||||
* interrupts. This requires separate handler for these calls and may not be
|
||||
* handled using common eemi handler
|
||||
* handled using common eemi handler.
|
||||
*
|
||||
* Return: If EEMI API found then, uintptr_t type address, else 0.
|
||||
*
|
||||
*/
|
||||
static uintptr_t eemi_psci_debugfs_handler(uint32_t api_id, uint32_t *pm_arg,
|
||||
void *handle, uint32_t security_flag)
|
||||
|
@ -258,11 +271,18 @@ static uintptr_t eemi_psci_debugfs_handler(uint32_t api_id, uint32_t *pm_arg,
|
|||
}
|
||||
|
||||
/**
|
||||
* TF_A_specific_handler() - SMC handler for TF-A specific functionality
|
||||
* TF_A_specific_handler() - SMC handler for TF-A specific functionality.
|
||||
* @api_id: identifier for the API being called.
|
||||
* @pm_arg: pointer to the argument data for the API call.
|
||||
* @handle: Pointer to caller's context structure.
|
||||
* @security_flag: SECURE_FLAG or NON_SECURE_FLAG.
|
||||
*
|
||||
* These EEMI calls performs functionality that does not require
|
||||
* IPI transaction. The handler ends in TF-A and returns requested data to
|
||||
* kernel from TF-A.
|
||||
*
|
||||
* Return: If TF-A specific API found then, uintptr_t type address, else 0
|
||||
*
|
||||
*/
|
||||
static uintptr_t TF_A_specific_handler(uint32_t api_id, uint32_t *pm_arg,
|
||||
void *handle, uint32_t security_flag)
|
||||
|
@ -306,7 +326,11 @@ static uintptr_t TF_A_specific_handler(uint32_t api_id, uint32_t *pm_arg,
|
|||
}
|
||||
|
||||
/**
|
||||
* eemi_handler() - Prepare EEMI payload and perform IPI transaction
|
||||
* eemi_handler() - Prepare EEMI payload and perform IPI transaction.
|
||||
* @api_id: identifier for the API being called.
|
||||
* @pm_arg: pointer to the argument data for the API call.
|
||||
* @handle: Pointer to caller's context structure.
|
||||
* @security_flag: SECURE_FLAG or NON_SECURE_FLAG.
|
||||
*
|
||||
* EEMI - Embedded Energy Management Interface is Xilinx proprietary protocol
|
||||
* to allow communication between power management controller and different
|
||||
|
@ -314,6 +338,9 @@ static uintptr_t TF_A_specific_handler(uint32_t api_id, uint32_t *pm_arg,
|
|||
*
|
||||
* This handler prepares EEMI protocol payload received from kernel and performs
|
||||
* IPI transaction.
|
||||
*
|
||||
* Return: If EEMI API found then, uintptr_t type address, else 0
|
||||
*
|
||||
*/
|
||||
static uintptr_t eemi_handler(uint32_t api_id, uint32_t *pm_arg,
|
||||
void *handle, uint32_t security_flag)
|
||||
|
@ -345,20 +372,24 @@ static uintptr_t eemi_handler(uint32_t api_id, uint32_t *pm_arg,
|
|||
|
||||
/**
|
||||
* pm_smc_handler() - SMC handler for PM-API calls coming from EL1/EL2.
|
||||
* @smc_fid - Function Identifier
|
||||
* @x1 - x4 - SMC64 Arguments from kernel
|
||||
* x3 (upper 32-bits) and x4 are Unused
|
||||
* @cookie - Unused
|
||||
* @handler - Pointer to caller's context structure
|
||||
* @smc_fid: Function Identifier.
|
||||
* @x1: SMC64 Arguments from kernel.
|
||||
* @x2: SMC64 Arguments from kernel.
|
||||
* @x3: SMC64 Arguments from kernel (upper 32-bits).
|
||||
* @x4: Unused.
|
||||
* @cookie: Unused.
|
||||
* @handle: Pointer to caller's context structure.
|
||||
* @flags: SECURE_FLAG or NON_SECURE_FLAG.
|
||||
*
|
||||
* @return - Unused
|
||||
* Return: Unused.
|
||||
*
|
||||
* Determines that smc_fid is valid and supported PM SMC Function ID from the
|
||||
* list of pm_api_ids, otherwise completes the request with
|
||||
* the unknown SMC Function ID
|
||||
* the unknown SMC Function ID.
|
||||
*
|
||||
* The SMC calls for PM service are forwarded from SIP Service SMC handler
|
||||
* function with rt_svc_handle signature
|
||||
* function with rt_svc_handle signature.
|
||||
*
|
||||
*/
|
||||
uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
|
||||
uint64_t x4, const void *cookie, void *handle, uint64_t flags)
|
||||
|
|
|
@ -15,12 +15,12 @@
|
|||
|
||||
/**
|
||||
* plat_is_smccc_feature_available() - This function checks whether SMCCC
|
||||
* feature is availabile for platform.
|
||||
* @fid: SMCCC function id
|
||||
* feature is availabile for platform.
|
||||
* @fid: SMCCC function id.
|
||||
*
|
||||
* Return: SMC_ARCH_CALL_SUCCESS - if SMCCC feature is available.
|
||||
* SMC_ARCH_CALL_NOT_SUPPORTED - Otherwise.
|
||||
*
|
||||
* Return:
|
||||
* * SMC_ARCH_CALL_SUCCESS - if SMCCC feature is available
|
||||
* * SMC_ARCH_CALL_NOT_SUPPORTED - Otherwise
|
||||
*/
|
||||
int32_t plat_is_smccc_feature_available(u_register_t fid)
|
||||
{
|
||||
|
@ -33,12 +33,12 @@ int32_t plat_is_smccc_feature_available(u_register_t fid)
|
|||
}
|
||||
|
||||
/**
|
||||
* plat_get_soc_version() - Get the SOC version of the platform
|
||||
* plat_get_soc_version() - Get the SOC version of the platform.
|
||||
*
|
||||
* Return: SiP defined SoC version in JEP-106.
|
||||
*
|
||||
* This function is called when the SoC_ID_type == 0.
|
||||
* For further details please refer to section 7.4 of SMC Calling Convention
|
||||
*
|
||||
* Return: SiP defined SoC version in JEP-106
|
||||
* For further details please refer to section 7.4 of SMC Calling Convention.
|
||||
*/
|
||||
int32_t plat_get_soc_version(void)
|
||||
{
|
||||
|
@ -50,12 +50,12 @@ int32_t plat_get_soc_version(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* plat_get_soc_revision() - Get the SOC revision for the platform
|
||||
* plat_get_soc_revision() - Get the SOC revision for the platform.
|
||||
*
|
||||
* Return: SiP defined SoC revision.
|
||||
*
|
||||
* This function is called when the SoC_ID_type == 1
|
||||
* For further details please refer to section 7.4 of SMC Calling Convention
|
||||
*
|
||||
* Return: SiP defined SoC revision
|
||||
*/
|
||||
int32_t plat_get_soc_revision(void)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -44,9 +45,9 @@ static int32_t versal_pwr_domain_on(u_register_t mpidr)
|
|||
|
||||
/**
|
||||
* versal_pwr_domain_suspend() - This function sends request to PMC to suspend
|
||||
* core.
|
||||
* core.
|
||||
* @target_state: Targated state.
|
||||
*
|
||||
* @target_state Targated state
|
||||
*/
|
||||
static void versal_pwr_domain_suspend(const psci_power_state_t *target_state)
|
||||
{
|
||||
|
@ -81,9 +82,9 @@ static void versal_pwr_domain_suspend(const psci_power_state_t *target_state)
|
|||
|
||||
/**
|
||||
* versal_pwr_domain_suspend_finish() - This function performs actions to finish
|
||||
* suspend procedure.
|
||||
* suspend procedure.
|
||||
* @target_state: Targated state.
|
||||
*
|
||||
* @target_state Targated state
|
||||
*/
|
||||
static void versal_pwr_domain_suspend_finish(
|
||||
const psci_power_state_t *target_state)
|
||||
|
@ -120,8 +121,9 @@ void versal_pwr_domain_on_finish(const psci_power_state_t *target_state)
|
|||
}
|
||||
|
||||
/**
|
||||
* versal_system_off() - This function sends the system off request
|
||||
* to firmware. This function does not return.
|
||||
* versal_system_off() - This function sends the system off request to firmware.
|
||||
* This function does not return.
|
||||
*
|
||||
*/
|
||||
static void __dead2 versal_system_off(void)
|
||||
{
|
||||
|
@ -135,8 +137,10 @@ static void __dead2 versal_system_off(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* versal_system_reset() - This function sends the reset request
|
||||
* to firmware for the system to reset. This function does not return.
|
||||
* versal_system_reset() - This function sends the reset request to firmware
|
||||
* for the system to reset. This function does not
|
||||
* return.
|
||||
*
|
||||
*/
|
||||
static void __dead2 versal_system_reset(void)
|
||||
{
|
||||
|
@ -150,9 +154,9 @@ static void __dead2 versal_system_reset(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* versal_pwr_domain_off() - This function performs actions to turn off core
|
||||
* versal_pwr_domain_off() - This function performs actions to turn off core.
|
||||
* @target_state: Targated state.
|
||||
*
|
||||
* @target_state Targated state
|
||||
*/
|
||||
static void versal_pwr_domain_off(const psci_power_state_t *target_state)
|
||||
{
|
||||
|
@ -181,12 +185,12 @@ static void versal_pwr_domain_off(const psci_power_state_t *target_state)
|
|||
|
||||
/**
|
||||
* versal_validate_power_state() - This function ensures that the power state
|
||||
* parameter in request is valid.
|
||||
* parameter in request is valid.
|
||||
* @power_state: Power state of core.
|
||||
* @req_state: Requested state.
|
||||
*
|
||||
* @power_state Power state of core
|
||||
* @req_state Requested state
|
||||
* Return: Returns status, either success or reason.
|
||||
*
|
||||
* @return Returns status, either success or reason
|
||||
*/
|
||||
static int32_t versal_validate_power_state(uint32_t power_state,
|
||||
psci_power_state_t *req_state)
|
||||
|
@ -213,9 +217,9 @@ static int32_t versal_validate_power_state(uint32_t power_state,
|
|||
}
|
||||
|
||||
/**
|
||||
* versal_get_sys_suspend_power_state() - Get power state for system suspend
|
||||
* versal_get_sys_suspend_power_state() - Get power state for system suspend.
|
||||
* @req_state: Requested state.
|
||||
*
|
||||
* @req_state Requested state
|
||||
*/
|
||||
static void versal_get_sys_suspend_power_state(psci_power_state_t *req_state)
|
||||
{
|
||||
|
|
|
@ -51,10 +51,11 @@ static const struct pm_proc pm_procs_all[] = {
|
|||
const struct pm_proc *primary_proc = &pm_procs_all[0];
|
||||
|
||||
/**
|
||||
* irq_to_pm_node_idx - Get PM node index corresponding to the interrupt number
|
||||
* @irq: Interrupt number
|
||||
* irq_to_pm_node_idx - Get PM node index corresponding to the interrupt number.
|
||||
* @irq: Interrupt number
|
||||
*
|
||||
* Return: PM node index corresponding to the specified interrupt.
|
||||
*
|
||||
* Return: PM node index corresponding to the specified interrupt
|
||||
*/
|
||||
enum pm_device_node_idx irq_to_pm_node_idx(uint32_t irq)
|
||||
{
|
||||
|
@ -172,11 +173,14 @@ enum pm_device_node_idx irq_to_pm_node_idx(uint32_t irq)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_client_suspend() - Client-specific suspend actions
|
||||
* pm_client_suspend() - Client-specific suspend actions.
|
||||
* @proc: processor which need to suspend.
|
||||
* @state: desired suspend state.
|
||||
*
|
||||
* This function should contain any PU-specific actions
|
||||
* required prior to sending suspend request to PMU
|
||||
* Actions taken depend on the state system is suspending to.
|
||||
*
|
||||
*/
|
||||
void pm_client_suspend(const struct pm_proc *proc, uint32_t state)
|
||||
{
|
||||
|
@ -194,10 +198,11 @@ void pm_client_suspend(const struct pm_proc *proc, uint32_t state)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_client_abort_suspend() - Client-specific abort-suspend actions
|
||||
* pm_client_abort_suspend() - Client-specific abort-suspend actions.
|
||||
*
|
||||
* This function should contain any PU-specific actions
|
||||
* required for aborting a prior suspend request
|
||||
* required for aborting a prior suspend request.
|
||||
*
|
||||
*/
|
||||
void pm_client_abort_suspend(void)
|
||||
{
|
||||
|
@ -214,10 +219,11 @@ void pm_client_abort_suspend(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_get_cpuid() - get the local cpu ID for a global node ID
|
||||
* @nid: node id of the processor
|
||||
* pm_get_cpuid() - get the local cpu ID for a global node ID.
|
||||
* @nid: node id of the processor.
|
||||
*
|
||||
* Return: the cpu ID (starting from 0) for the subsystem.
|
||||
*
|
||||
* Return: the cpu ID (starting from 0) for the subsystem
|
||||
*/
|
||||
static uint32_t pm_get_cpuid(uint32_t nid)
|
||||
{
|
||||
|
@ -230,10 +236,12 @@ static uint32_t pm_get_cpuid(uint32_t nid)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_client_wakeup() - Client-specific wakeup actions
|
||||
* pm_client_wakeup() - Client-specific wakeup actions.
|
||||
* @proc: Processor which need to wakeup.
|
||||
*
|
||||
* This function should contain any PU-specific actions
|
||||
* required for waking up another APU core
|
||||
* required for waking up another APU core.
|
||||
*
|
||||
*/
|
||||
void pm_client_wakeup(const struct pm_proc *proc)
|
||||
{
|
||||
|
@ -254,10 +262,11 @@ void pm_client_wakeup(const struct pm_proc *proc)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_get_proc() - returns pointer to the proc structure
|
||||
* @cpuid: id of the cpu whose proc struct pointer should be returned
|
||||
* pm_get_proc() - returns pointer to the proc structure.
|
||||
* @cpuid: id of the cpu whose proc struct pointer should be returned.
|
||||
*
|
||||
* Return: pointer to a proc structure if proc is found, otherwise NULL.
|
||||
*
|
||||
* Return: pointer to a proc structure if proc is found, otherwise NULL
|
||||
*/
|
||||
const struct pm_proc *pm_get_proc(uint32_t cpuid)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Arm Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -40,7 +41,9 @@ DEFINE_SVC_UUID2(versal_sip_uuid,
|
|||
/**
|
||||
* sip_svc_setup() - Setup SiP Service
|
||||
*
|
||||
* Invokes PM setup
|
||||
* Return: 0 on success,negative error code on failure.
|
||||
*
|
||||
* Invokes PM setup.
|
||||
*/
|
||||
static int32_t sip_svc_setup(void)
|
||||
{
|
||||
|
@ -51,10 +54,20 @@ static int32_t sip_svc_setup(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* sip_svc_smc_handler() - Top-level SiP Service SMC handler
|
||||
* sip_svc_smc_handler() - Top-level SiP Service SMC handler.
|
||||
* @smc_fid: Function Identifier.
|
||||
* @x1: SMC64 Arguments 1 from kernel.
|
||||
* @x2: SMC64 Arguments 2 from kernel.
|
||||
* @x3: SMC64 Arguments 3 from kernel(upper 32-bits).
|
||||
* @x4: SMC64 Arguments 4 from kernel.
|
||||
* @cookie: Unused
|
||||
* @handle: Pointer to caller's context structure.
|
||||
* @flags: SECURE_FLAG or NON_SECURE_FLAG.
|
||||
*
|
||||
* Handler for all SiP SMC calls. Handles standard SIP requests
|
||||
* and calls PM SMC handler if the call is for a PM-API function.
|
||||
*
|
||||
* Return: Unused.
|
||||
*/
|
||||
uintptr_t sip_svc_smc_handler(uint32_t smc_fid,
|
||||
u_register_t x1,
|
||||
|
|
|
@ -65,10 +65,9 @@ static const struct ipi_config versal_ipi_table[] = {
|
|||
},
|
||||
};
|
||||
|
||||
/* versal_ipi_config_table_init() - Initialize versal IPI configuration data
|
||||
*
|
||||
* @ipi_config_table - IPI configuration table
|
||||
* @ipi_total - Total number of IPI available
|
||||
/* versal_ipi_config_table_init() - Initialize versal IPI configuration data.
|
||||
* @ipi_config_table: IPI configuration table.
|
||||
* @ipi_total: Total number of IPI available.
|
||||
*
|
||||
*/
|
||||
void versal_ipi_config_table_init(void)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Xilinx, Inc. All rights reserved.
|
||||
* Copyright (c) 2022, Advanced Micro Devices, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -50,9 +50,10 @@ static int32_t versal_net_pwr_domain_on(u_register_t mpidr)
|
|||
}
|
||||
|
||||
/**
|
||||
* versal_net_pwr_domain_off() - This function performs actions to turn off core
|
||||
* versal_net_pwr_domain_off() - This function performs actions to turn off
|
||||
* core.
|
||||
* @target_state: Targeted state.
|
||||
*
|
||||
* @param target_state Targeted state
|
||||
*/
|
||||
static void versal_net_pwr_domain_off(const psci_power_state_t *target_state)
|
||||
{
|
||||
|
@ -80,8 +81,10 @@ static void versal_net_pwr_domain_off(const psci_power_state_t *target_state)
|
|||
}
|
||||
|
||||
/**
|
||||
* versal_net_system_reset() - This function sends the reset request
|
||||
* to firmware for the system to reset. This function does not return.
|
||||
* versal_net_system_reset() - This function sends the reset request to firmware
|
||||
* for the system to reset. This function does not
|
||||
* return.
|
||||
*
|
||||
*/
|
||||
static void __dead2 versal_net_system_reset(void)
|
||||
{
|
||||
|
@ -96,9 +99,9 @@ static void __dead2 versal_net_system_reset(void)
|
|||
|
||||
/**
|
||||
* versal_net_pwr_domain_suspend() - This function sends request to PMC to suspend
|
||||
* core.
|
||||
* core.
|
||||
* @target_state: Targeted state.
|
||||
*
|
||||
* @param target_state Targeted state
|
||||
*/
|
||||
static void versal_net_pwr_domain_suspend(const psci_power_state_t *target_state)
|
||||
{
|
||||
|
@ -140,9 +143,9 @@ static void versal_net_pwr_domain_on_finish(const psci_power_state_t *target_sta
|
|||
|
||||
/**
|
||||
* versal_net_pwr_domain_suspend_finish() - This function performs actions to finish
|
||||
* suspend procedure.
|
||||
* suspend procedure.
|
||||
* @target_state: Targeted state.
|
||||
*
|
||||
* @param target_state Targeted state
|
||||
*/
|
||||
static void versal_net_pwr_domain_suspend_finish(const psci_power_state_t *target_state)
|
||||
{
|
||||
|
@ -168,7 +171,8 @@ static void versal_net_pwr_domain_suspend_finish(const psci_power_state_t *targe
|
|||
|
||||
/**
|
||||
* versal_net_system_off() - This function sends the system off request
|
||||
* to firmware. This function does not return.
|
||||
* to firmware. This function does not return.
|
||||
*
|
||||
*/
|
||||
static void __dead2 versal_net_system_off(void)
|
||||
{
|
||||
|
@ -183,12 +187,12 @@ static void __dead2 versal_net_system_off(void)
|
|||
|
||||
/**
|
||||
* versal_net_validate_power_state() - This function ensures that the power state
|
||||
* parameter in request is valid.
|
||||
* parameter in request is valid.
|
||||
* @power_state: Power state of core.
|
||||
* @req_state: Requested state.
|
||||
*
|
||||
* @param power_state Power state of core
|
||||
* @param req_state Requested state
|
||||
* Return: Returns status, either PSCI_E_SUCCESS or reason.
|
||||
*
|
||||
* @return Returns status, either PSCI_E_SUCCESS or reason
|
||||
*/
|
||||
static int32_t versal_net_validate_power_state(unsigned int power_state,
|
||||
psci_power_state_t *req_state)
|
||||
|
@ -215,9 +219,10 @@ static int32_t versal_net_validate_power_state(unsigned int power_state,
|
|||
}
|
||||
|
||||
/**
|
||||
* versal_net_get_sys_suspend_power_state() - Get power state for system suspend
|
||||
* versal_net_get_sys_suspend_power_state() - Get power state for system
|
||||
* suspend.
|
||||
* @req_state: Requested state.
|
||||
*
|
||||
* @param req_state Requested state
|
||||
*/
|
||||
static void versal_net_get_sys_suspend_power_state(psci_power_state_t *req_state)
|
||||
{
|
||||
|
|
|
@ -152,10 +152,11 @@ static const struct pm_proc pm_procs_all[] = {
|
|||
const struct pm_proc *primary_proc = &pm_procs_all[0];
|
||||
|
||||
/**
|
||||
* pm_get_proc() - returns pointer to the proc structure
|
||||
* @param cpuid id of the cpu whose proc struct pointer should be returned
|
||||
* pm_get_proc() - returns pointer to the proc structure.
|
||||
* @cpuid: id of the cpu whose proc struct pointer should be returned.
|
||||
*
|
||||
* Return: Pointer to a proc structure if proc is found, otherwise NULL.
|
||||
*
|
||||
* @return pointer to a proc structure if proc is found, otherwise NULL
|
||||
*/
|
||||
const struct pm_proc *pm_get_proc(uint32_t cpuid)
|
||||
{
|
||||
|
@ -168,10 +169,11 @@ const struct pm_proc *pm_get_proc(uint32_t cpuid)
|
|||
}
|
||||
|
||||
/**
|
||||
* irq_to_pm_node_idx - Get PM node index corresponding to the interrupt number
|
||||
* @irq: Interrupt number
|
||||
* irq_to_pm_node_idx - Get PM node index corresponding to the interrupt number.
|
||||
* @irq: Interrupt number.
|
||||
*
|
||||
* Return: PM node index corresponding to the specified interrupt.
|
||||
*
|
||||
* Return: PM node index corresponding to the specified interrupt
|
||||
*/
|
||||
enum pm_device_node_idx irq_to_pm_node_idx(uint32_t irq)
|
||||
{
|
||||
|
@ -295,14 +297,13 @@ enum pm_device_node_idx irq_to_pm_node_idx(uint32_t irq)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_client_suspend() - Client-specific suspend actions
|
||||
* pm_client_suspend() - Client-specific suspend actions. This function
|
||||
* should contain any PU-specific actions required
|
||||
* prior to sending suspend request to PMU. Actions
|
||||
* taken depend on the state system is suspending to.
|
||||
* @proc: processor which need to suspend.
|
||||
* @state: desired suspend state.
|
||||
*
|
||||
* This function should contain any PU-specific actions
|
||||
* required prior to sending suspend request to PMU
|
||||
* Actions taken depend on the state system is suspending to.
|
||||
*
|
||||
* @param proc processor which need to suspend
|
||||
* @param state desired suspend state
|
||||
*/
|
||||
void pm_client_suspend(const struct pm_proc *proc, uint32_t state)
|
||||
{
|
||||
|
@ -338,10 +339,11 @@ void pm_client_suspend(const struct pm_proc *proc, uint32_t state)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_get_cpuid() - get the local cpu ID for a global node ID
|
||||
* @param nid node id of the processor
|
||||
* pm_get_cpuid() - get the local cpu ID for a global node ID.
|
||||
* @nid: node id of the processor.
|
||||
*
|
||||
* Return: the cpu ID (starting from 0) for the subsystem.
|
||||
*
|
||||
* @return the cpu ID (starting from 0) for the subsystem
|
||||
*/
|
||||
static uint32_t pm_get_cpuid(uint32_t nid)
|
||||
{
|
||||
|
@ -354,12 +356,12 @@ static uint32_t pm_get_cpuid(uint32_t nid)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_client_wakeup() - Client-specific wakeup actions
|
||||
* pm_client_wakeup() - Client-specific wakeup actions.
|
||||
* @proc: Processor which need to wakeup.
|
||||
*
|
||||
* This function should contain any PU-specific actions
|
||||
* required for waking up another APU core
|
||||
* required for waking up another APU core.
|
||||
*
|
||||
* @param proc Processor which need to wakeup
|
||||
*/
|
||||
void pm_client_wakeup(const struct pm_proc *proc)
|
||||
{
|
||||
|
@ -393,10 +395,11 @@ void pm_client_wakeup(const struct pm_proc *proc)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_client_abort_suspend() - Client-specific abort-suspend actions
|
||||
* pm_client_abort_suspend() - Client-specific abort-suspend actions.
|
||||
*
|
||||
* This function should contain any PU-specific actions
|
||||
* required for aborting a prior suspend request
|
||||
* required for aborting a prior suspend request.
|
||||
*
|
||||
*/
|
||||
void pm_client_abort_suspend(void)
|
||||
{
|
||||
|
|
|
@ -43,6 +43,9 @@ DEFINE_SVC_UUID2(versal_net_sip_uuid,
|
|||
|
||||
/**
|
||||
* sip_svc_setup() - Setup SiP Service
|
||||
*
|
||||
* Return: 0 on success, negative error code on failure.
|
||||
*
|
||||
*/
|
||||
static int32_t sip_svc_setup(void)
|
||||
{
|
||||
|
|
|
@ -65,10 +65,10 @@ static const struct ipi_config versal_net_ipi_table[IPI_ID_MAX] = {
|
|||
},
|
||||
};
|
||||
|
||||
/* versal_net_ipi_config_table_init() - Initialize versal_net IPI configuration data
|
||||
*
|
||||
* @ipi_config_table - IPI configuration table
|
||||
* @ipi_total - Total number of IPI available
|
||||
/* versal_net_ipi_config_table_init() - Initialize versal_net IPI configuration
|
||||
* data.
|
||||
* @ipi_config_table: IPI configuration table.
|
||||
* @ipi_total: Total number of IPI available.
|
||||
*
|
||||
*/
|
||||
void versal_net_ipi_config_table_init(void)
|
||||
|
|
|
@ -198,14 +198,15 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* struct pm_clock_node - Clock topology node information
|
||||
* @type: Topology type (mux/div1/div2/gate/pll/fixed factor)
|
||||
* @offset: Offset in control register
|
||||
* @width: Width of the specific type in control register
|
||||
* @clkflags: Clk specific flags
|
||||
* @typeflags: Type specific flags
|
||||
* @mult: Multiplier for fixed factor
|
||||
* @div: Divisor for fixed factor
|
||||
* struct pm_clock_node - Clock topology node information.
|
||||
* @type: Topology type (mux/div1/div2/gate/pll/fixed factor).
|
||||
* @offset: Offset in control register.
|
||||
* @width: Width of the specific type in control register.
|
||||
* @clkflags: Clk specific flags.
|
||||
* @typeflags: Type specific flags.
|
||||
* @mult: Multiplier for fixed factor.
|
||||
* @div: Divisor for fixed factor.
|
||||
*
|
||||
*/
|
||||
struct pm_clock_node {
|
||||
uint16_t clkflags;
|
||||
|
@ -218,13 +219,15 @@ struct pm_clock_node {
|
|||
};
|
||||
|
||||
/**
|
||||
* struct pm_clock - Clock structure
|
||||
* @name: Clock name
|
||||
* @control_reg: Control register address
|
||||
* @status_reg: Status register address
|
||||
* @parents: Parents for first clock node. Lower byte indicates parent
|
||||
* clock id and upper byte indicate flags for that id.
|
||||
* pm_clock_node: Clock nodes
|
||||
* struct pm_clock - Clock structure.
|
||||
* @name: Clock name.
|
||||
* @num_nodes: number of nodes.
|
||||
* @control_reg: Control register address.
|
||||
* @status_reg: Status register address.
|
||||
* @parents: Parents for first clock node. Lower byte indicates parent
|
||||
* clock id and upper byte indicate flags for that id.
|
||||
* @nodes: Clock nodes.
|
||||
*
|
||||
*/
|
||||
struct pm_clock {
|
||||
char name[CLK_NAME_LEN];
|
||||
|
@ -236,8 +239,9 @@ struct pm_clock {
|
|||
};
|
||||
|
||||
/**
|
||||
* struct pm_clock - Clock structure
|
||||
* @name: Clock name
|
||||
* struct pm_ext_clock - Clock structure.
|
||||
* @name: Clock name.
|
||||
*
|
||||
*/
|
||||
struct pm_ext_clock {
|
||||
char name[CLK_NAME_LEN];
|
||||
|
@ -2386,8 +2390,8 @@ static uint32_t pm_clk_invalid_list[] = {CLK_USB0, CLK_USB1, CLK_CSU_SPB,
|
|||
};
|
||||
|
||||
/**
|
||||
* pm_clock_valid - Check if clock is valid or not
|
||||
* @clock_id Id of the clock to be queried
|
||||
* pm_clock_valid - Check if clock is valid or not.
|
||||
* @clock_id: Id of the clock to be queried.
|
||||
*
|
||||
* This function is used to check if given clock is valid
|
||||
* or not for the chip variant.
|
||||
|
@ -2396,6 +2400,7 @@ static uint32_t pm_clk_invalid_list[] = {CLK_USB0, CLK_USB1, CLK_CSU_SPB,
|
|||
* different variants.
|
||||
*
|
||||
* Return: Returns 1 if clock is valid else 0.
|
||||
*
|
||||
*/
|
||||
static bool pm_clock_valid(uint32_t clock_id)
|
||||
{
|
||||
|
@ -2409,12 +2414,13 @@ static bool pm_clock_valid(uint32_t clock_id)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_clock_type - Get clock's type
|
||||
* @clock_id Id of the clock to be queried
|
||||
* pm_clock_type - Get clock's type.
|
||||
* @clock_id: Id of the clock to be queried.
|
||||
*
|
||||
* This function is used to check type of clock (OUTPUT/EXTERNAL).
|
||||
*
|
||||
* Return: Returns type of clock (OUTPUT/EXTERNAL).
|
||||
*
|
||||
*/
|
||||
static uint32_t pm_clock_type(uint32_t clock_id)
|
||||
{
|
||||
|
@ -2423,12 +2429,13 @@ static uint32_t pm_clock_type(uint32_t clock_id)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_api_clock_get_num_clocks() - PM call to request number of clocks
|
||||
* @nclocks Number of clocks
|
||||
* pm_api_clock_get_num_clocks() - PM call to request number of clocks.
|
||||
* @nclocks: Number of clocks.
|
||||
*
|
||||
* This function is used by master to get number of clocks.
|
||||
*
|
||||
* @return Returns success.
|
||||
* Return: Returns success.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_api_clock_get_num_clocks(uint32_t *nclocks)
|
||||
{
|
||||
|
@ -2438,12 +2445,13 @@ enum pm_ret_status pm_api_clock_get_num_clocks(uint32_t *nclocks)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_api_clock_get_name() - PM call to request a clock's name
|
||||
* @clock_id Clock ID
|
||||
* @name Name of clock (max 16 bytes)
|
||||
* pm_api_clock_get_name() - PM call to request a clock's name.
|
||||
* @clock_id: Clock ID.
|
||||
* @name: Name of clock (max 16 bytes).
|
||||
*
|
||||
* This function is used by master to get nmae of clock specified
|
||||
* by given clock ID.
|
||||
*
|
||||
*/
|
||||
void pm_api_clock_get_name(uint32_t clock_id, char *name)
|
||||
{
|
||||
|
@ -2461,17 +2469,18 @@ void pm_api_clock_get_name(uint32_t clock_id, char *name)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_api_clock_get_topology() - PM call to request a clock's topology
|
||||
* @clock_id Clock ID
|
||||
* @index Topology index for next toplogy node
|
||||
* @topology Buffer to store nodes in topology and flags
|
||||
* pm_api_clock_get_topology() - PM call to request a clock's topology.
|
||||
* @clock_id: Clock ID.
|
||||
* @index: Topology index for next toplogy node.
|
||||
* @topology: Buffer to store nodes in topology and flags.
|
||||
*
|
||||
* This function is used by master to get topology information for the
|
||||
* clock specified by given clock ID. Each response would return 3
|
||||
* topology nodes. To get next nodes, caller needs to call this API with
|
||||
* index of next node. Index starts from 0.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_api_clock_get_topology(uint32_t clock_id,
|
||||
uint32_t index,
|
||||
|
@ -2519,15 +2528,16 @@ enum pm_ret_status pm_api_clock_get_topology(uint32_t clock_id,
|
|||
|
||||
/**
|
||||
* pm_api_clock_get_fixedfactor_params() - PM call to request a clock's fixed
|
||||
* factor parameters for fixed clock
|
||||
* @clock_id Clock ID
|
||||
* @mul Multiplication value
|
||||
* @div Divisor value
|
||||
* factor parameters for fixed clock.
|
||||
* @clock_id: Clock ID.
|
||||
* @mul: Multiplication value.
|
||||
* @div: Divisor value.
|
||||
*
|
||||
* This function is used by master to get fixed factor parameers for the
|
||||
* fixed clock. This API is application only for the fixed clock.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_api_clock_get_fixedfactor_params(uint32_t clock_id,
|
||||
uint32_t *mul,
|
||||
|
@ -2566,10 +2576,10 @@ enum pm_ret_status pm_api_clock_get_fixedfactor_params(uint32_t clock_id,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_api_clock_get_parents() - PM call to request a clock's first 3 parents
|
||||
* @clock_id Clock ID
|
||||
* @index Index of next parent
|
||||
* @parents Parents of the given clock
|
||||
* pm_api_clock_get_parents() - PM call to request a clock's first 3 parents.
|
||||
* @clock_id: Clock ID.
|
||||
* @index: Index of next parent.
|
||||
* @parents: Parents of the given clock.
|
||||
*
|
||||
* This function is used by master to get clock's parents information.
|
||||
* This API will return 3 parents with a single response. To get other
|
||||
|
@ -2580,7 +2590,8 @@ enum pm_ret_status pm_api_clock_get_fixedfactor_params(uint32_t clock_id,
|
|||
* 2. Next call, index should be 3 which will return parent 3,4 and 5 and
|
||||
* so on.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_api_clock_get_parents(uint32_t clock_id,
|
||||
uint32_t index,
|
||||
|
@ -2622,14 +2633,15 @@ enum pm_ret_status pm_api_clock_get_parents(uint32_t clock_id,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_api_clock_get_attributes() - PM call to request a clock's attributes
|
||||
* @clock_id Clock ID
|
||||
* @attr Clock attributes
|
||||
* pm_api_clock_get_attributes() - PM call to request a clock's attributes.
|
||||
* @clock_id: Clock ID.
|
||||
* @attr: Clock attributes.
|
||||
*
|
||||
* This function is used by master to get clock's attributes
|
||||
* (e.g. valid, clock type, etc).
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_api_clock_get_attributes(uint32_t clock_id,
|
||||
uint32_t *attr)
|
||||
|
@ -2648,14 +2660,15 @@ enum pm_ret_status pm_api_clock_get_attributes(uint32_t clock_id,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_api_clock_get_max_divisor - PM call to get max divisor
|
||||
* @clock_id Clock ID
|
||||
* @div_type Divisor Type (TYPE_DIV1 or TYPE_DIV2)
|
||||
* @max_div Maximum supported divisor
|
||||
* pm_api_clock_get_max_divisor - PM call to get max divisor.
|
||||
* @clock_id: Clock ID.
|
||||
* @div_type: Divisor Type (TYPE_DIV1 or TYPE_DIV2).
|
||||
* @max_div: Maximum supported divisor.
|
||||
*
|
||||
* This function is used by master to get maximum supported value.
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_api_clock_get_max_divisor(enum clock_id clock_id,
|
||||
uint8_t div_type,
|
||||
|
@ -2685,15 +2698,16 @@ enum pm_ret_status pm_api_clock_get_max_divisor(enum clock_id clock_id,
|
|||
}
|
||||
|
||||
/**
|
||||
* struct pm_pll - PLL related data required to map IOCTL-based PLL control
|
||||
* implemented by linux to system-level EEMI APIs
|
||||
* @nid: PLL node ID
|
||||
* @cid: PLL clock ID
|
||||
* @pre_src: Pre-source PLL clock ID
|
||||
* @post_src: Post-source PLL clock ID
|
||||
* @div2: DIV2 PLL clock ID
|
||||
* @bypass: PLL output clock ID that maps to bypass select output
|
||||
* @mode: PLL mode currently set via IOCTL (PLL_FRAC_MODE/PLL_INT_MODE)
|
||||
* struct pm_pll - PLL related data required to map IOCTL-based PLL control.
|
||||
* implemented by linux to system-level EEMI APIs.
|
||||
* @nid: PLL node ID.
|
||||
* @cid: PLL clock ID.
|
||||
* @pre_src: Pre-source PLL clock ID.
|
||||
* @post_src: Post-source PLL clock ID.
|
||||
* @div2: DIV2 PLL clock ID.
|
||||
* @bypass: PLL output clock ID that maps to bypass select output.
|
||||
* @mode: PLL mode currently set via IOCTL (PLL_FRAC_MODE/PLL_INT_MODE).
|
||||
*
|
||||
*/
|
||||
struct pm_pll {
|
||||
const enum pm_node_id nid;
|
||||
|
@ -2745,10 +2759,11 @@ static struct pm_pll pm_plls[] = {
|
|||
};
|
||||
|
||||
/**
|
||||
* pm_clock_get_pll() - Get PLL structure by PLL clock ID
|
||||
* @clock_id Clock ID of the target PLL
|
||||
* pm_clock_get_pll() - Get PLL structure by PLL clock ID.
|
||||
* @clock_id: Clock ID of the target PLL.
|
||||
*
|
||||
* Return: Pointer to PLL structure if found, NULL otherwise.
|
||||
*
|
||||
* @return Pointer to PLL structure if found, NULL otherwise
|
||||
*/
|
||||
struct pm_pll *pm_clock_get_pll(enum clock_id clock_id)
|
||||
{
|
||||
|
@ -2764,11 +2779,12 @@ struct pm_pll *pm_clock_get_pll(enum clock_id clock_id)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_clock_get_pll_node_id() - Get PLL node ID by PLL clock ID
|
||||
* @clock_id Clock ID of the target PLL
|
||||
* @node_id Location to store node ID of the target PLL
|
||||
* pm_clock_get_pll_node_id() - Get PLL node ID by PLL clock ID.
|
||||
* @clock_id: Clock ID of the target PLL.
|
||||
* @node_id: Location to store node ID of the target PLL.
|
||||
*
|
||||
* Return: PM_RET_SUCCESS if node ID is found, PM_RET_ERROR_ARGS otherwise.
|
||||
*
|
||||
* @return PM_RET_SUCCESS if node ID is found, PM_RET_ERROR_ARGS otherwise
|
||||
*/
|
||||
enum pm_ret_status pm_clock_get_pll_node_id(enum clock_id clock_id,
|
||||
enum pm_node_id *node_id)
|
||||
|
@ -2784,10 +2800,12 @@ enum pm_ret_status pm_clock_get_pll_node_id(enum clock_id clock_id,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_clock_get_pll_by_related_clk() - Get PLL structure by PLL-related clock ID
|
||||
* @clock_id Clock ID
|
||||
* pm_clock_get_pll_by_related_clk() - Get PLL structure by PLL-related clock
|
||||
* ID.
|
||||
* @clock_id: Clock ID.
|
||||
*
|
||||
* Return: Pointer to PLL structure if found, NULL otherwise.
|
||||
*
|
||||
* @return Pointer to PLL structure if found, NULL otherwise
|
||||
*/
|
||||
struct pm_pll *pm_clock_get_pll_by_related_clk(enum clock_id clock_id)
|
||||
{
|
||||
|
@ -2806,13 +2824,14 @@ struct pm_pll *pm_clock_get_pll_by_related_clk(enum clock_id clock_id)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_clock_pll_enable() - "Enable" the PLL clock (lock the PLL)
|
||||
* @pll: PLL to be locked
|
||||
* pm_clock_pll_enable() - "Enable" the PLL clock (lock the PLL).
|
||||
* @pll: PLL to be locked.
|
||||
*
|
||||
* This function is used to map IOCTL/linux-based PLL handling to system-level
|
||||
* EEMI APIs
|
||||
* EEMI APIs.
|
||||
*
|
||||
* Return: Error if the argument is not valid or status as returned by PMU.
|
||||
*
|
||||
* Return: Error if the argument is not valid or status as returned by PMU
|
||||
*/
|
||||
enum pm_ret_status pm_clock_pll_enable(struct pm_pll *pll)
|
||||
{
|
||||
|
@ -2829,13 +2848,14 @@ enum pm_ret_status pm_clock_pll_enable(struct pm_pll *pll)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_clock_pll_disable - "Disable" the PLL clock (bypass/reset the PLL)
|
||||
* @pll PLL to be bypassed/reset
|
||||
* pm_clock_pll_disable - "Disable" the PLL clock (bypass/reset the PLL).
|
||||
* @pll: PLL to be bypassed/reset.
|
||||
*
|
||||
* This function is used to map IOCTL/linux-based PLL handling to system-level
|
||||
* EEMI APIs
|
||||
* EEMI APIs.
|
||||
*
|
||||
* Return: Error if the argument is not valid or status as returned by PMU.
|
||||
*
|
||||
* Return: Error if the argument is not valid or status as returned by PMU
|
||||
*/
|
||||
enum pm_ret_status pm_clock_pll_disable(struct pm_pll *pll)
|
||||
{
|
||||
|
@ -2847,15 +2867,15 @@ enum pm_ret_status pm_clock_pll_disable(struct pm_pll *pll)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_clock_pll_get_state - Get state of the PLL
|
||||
* @pll Pointer to the target PLL structure
|
||||
* @state Location to store the state: 1/0 ("Enabled"/"Disabled")
|
||||
* pm_clock_pll_get_state - Get state of the PLL.
|
||||
* @pll: Pointer to the target PLL structure.
|
||||
* @state: Location to store the state: 1/0 ("Enabled"/"Disabled").
|
||||
*
|
||||
* "Enable" actually means that the PLL is locked and its bypass is deasserted,
|
||||
* "Disable" means that it is bypassed.
|
||||
*
|
||||
* Return: PM_RET_ERROR_ARGS error if the argument is not valid, success if
|
||||
* returned state value is valid or an error if returned by PMU
|
||||
* returned state value is valid or an error if returned by PMU.
|
||||
*/
|
||||
enum pm_ret_status pm_clock_pll_get_state(struct pm_pll *pll,
|
||||
uint32_t *state)
|
||||
|
@ -2882,16 +2902,17 @@ enum pm_ret_status pm_clock_pll_get_state(struct pm_pll *pll,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_clock_pll_set_parent - Set the clock parent for PLL-related clock id
|
||||
* @pll Target PLL structure
|
||||
* @clock_id Id of the clock
|
||||
* @parent_index parent index (=mux select value)
|
||||
* pm_clock_pll_set_parent - Set the clock parent for PLL-related clock id.
|
||||
* @pll: Target PLL structure.
|
||||
* @clock_id: Id of the clock.
|
||||
* @parent_index: parent index (=mux select value).
|
||||
*
|
||||
* The whole clock-tree implementation relies on the fact that parent indexes
|
||||
* match to the multiplexer select values. This function has to rely on that
|
||||
* assumption as well => parent_index is actually the mux select value.
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_clock_pll_set_parent(struct pm_pll *pll,
|
||||
enum clock_id clock_id,
|
||||
|
@ -2917,14 +2938,15 @@ enum pm_ret_status pm_clock_pll_set_parent(struct pm_pll *pll,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_clock_pll_get_parent - Get mux select value of PLL-related clock parent
|
||||
* @pll Target PLL structure
|
||||
* @clock_id Id of the clock
|
||||
* @parent_index parent index (=mux select value)
|
||||
* pm_clock_pll_get_parent - Get mux select value of PLL-related clock parent.
|
||||
* @pll: Target PLL structure.
|
||||
* @clock_id: Id of the clock.
|
||||
* @parent_index: parent index (=mux select value).
|
||||
*
|
||||
* This function is used by master to get parent index for PLL-related clock.
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_clock_pll_get_parent(struct pm_pll *pll,
|
||||
enum clock_id clock_id,
|
||||
|
@ -2954,13 +2976,14 @@ enum pm_ret_status pm_clock_pll_get_parent(struct pm_pll *pll,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_clock_set_pll_mode() - Set PLL mode
|
||||
* @clock_id PLL clock id
|
||||
* @mode Mode fractional/integer
|
||||
* pm_clock_set_pll_mode() - Set PLL mode.
|
||||
* @clock_id: PLL clock id.
|
||||
* @mode: Mode fractional/integer.
|
||||
*
|
||||
* This function buffers/saves the PLL mode that is set.
|
||||
*
|
||||
* @return Success if mode is buffered or error if an argument is invalid
|
||||
* Return: Success if mode is buffered or error if an argument is invalid.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_clock_set_pll_mode(enum clock_id clock_id,
|
||||
uint32_t mode)
|
||||
|
@ -2976,13 +2999,14 @@ enum pm_ret_status pm_clock_set_pll_mode(enum clock_id clock_id,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_clock_get_pll_mode() - Get PLL mode
|
||||
* @clock_id PLL clock id
|
||||
* @mode Location to store the mode (fractional/integer)
|
||||
* pm_clock_get_pll_mode() - Get PLL mode.
|
||||
* @clock_id: PLL clock id.
|
||||
* @mode: Location to store the mode (fractional/integer).
|
||||
*
|
||||
* This function returns buffered PLL mode.
|
||||
*
|
||||
* @return Success if mode is stored or error if an argument is invalid
|
||||
* Return: Success if mode is stored or error if an argument is invalid.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_clock_get_pll_mode(enum clock_id clock_id,
|
||||
uint32_t *mode)
|
||||
|
@ -2998,10 +3022,11 @@ enum pm_ret_status pm_clock_get_pll_mode(enum clock_id clock_id,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_clock_id_is_valid() - Check if given clock ID is valid
|
||||
* @clock_id ID of the clock to be checked
|
||||
* pm_clock_id_is_valid() - Check if given clock ID is valid.
|
||||
* @clock_id: ID of the clock to be checked.
|
||||
*
|
||||
* Return: Returns success if clock_id is valid, otherwise an error.
|
||||
*
|
||||
* @return Returns success if clock_id is valid, otherwise an error
|
||||
*/
|
||||
enum pm_ret_status pm_clock_id_is_valid(uint32_t clock_id)
|
||||
{
|
||||
|
@ -3017,11 +3042,12 @@ enum pm_ret_status pm_clock_id_is_valid(uint32_t clock_id)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_clock_has_div() - Check if the clock has divider with given ID
|
||||
* @clock_id Clock ID
|
||||
* @div_id Divider ID
|
||||
* pm_clock_has_div() - Check if the clock has divider with given ID.
|
||||
* @clock_id: Clock ID.
|
||||
* @div_id: Divider ID.
|
||||
*
|
||||
* Return: True(1)=clock has the divider, false(0)=otherwise.
|
||||
*
|
||||
* @return True(1)=clock has the divider, false(0)=otherwise
|
||||
*/
|
||||
uint8_t pm_clock_has_div(uint32_t clock_id, enum pm_clock_div_id div_id)
|
||||
{
|
||||
|
|
|
@ -23,12 +23,13 @@
|
|||
#include "zynqmp_pm_api_sys.h"
|
||||
|
||||
/**
|
||||
* pm_ioctl_get_rpu_oper_mode () - Get current RPU operation mode
|
||||
* @mode Buffer to store value of oper mode(Split/Lock-step)
|
||||
* pm_ioctl_get_rpu_oper_mode () - Get current RPU operation mode.
|
||||
* @mode: Buffer to store value of oper mode(Split/Lock-step)
|
||||
*
|
||||
* This function provides current configured RPU operational mode.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_get_rpu_oper_mode(uint32_t *mode)
|
||||
{
|
||||
|
@ -46,15 +47,16 @@ static enum pm_ret_status pm_ioctl_get_rpu_oper_mode(uint32_t *mode)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_set_rpu_oper_mode () - Configure RPU operation mode
|
||||
* @mode Value to set for oper mode(Split/Lock-step)
|
||||
* pm_ioctl_set_rpu_oper_mode () - Configure RPU operation mode.
|
||||
* @mode: Value to set for oper mode(Split/Lock-step).
|
||||
*
|
||||
* This function configures RPU operational mode(Split/Lock-step).
|
||||
* It also sets TCM combined mode in RPU lock-step and TCM non-combined
|
||||
* mode for RPU split mode. In case of Lock step mode, RPU1's output is
|
||||
* clamped.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_set_rpu_oper_mode(uint32_t mode)
|
||||
{
|
||||
|
@ -84,13 +86,14 @@ static enum pm_ret_status pm_ioctl_set_rpu_oper_mode(uint32_t mode)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_config_boot_addr() - Configure RPU boot address
|
||||
* @nid Node ID of RPU
|
||||
* @value Value to set for boot address (TCM/OCM)
|
||||
* pm_ioctl_config_boot_addr() - Configure RPU boot address.
|
||||
* @nid: Node ID of RPU.
|
||||
* @value: Value to set for boot address (TCM/OCM).
|
||||
*
|
||||
* This function configures RPU boot address(memory).
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_config_boot_addr(enum pm_node_id nid,
|
||||
uint32_t value)
|
||||
|
@ -121,13 +124,14 @@ static enum pm_ret_status pm_ioctl_config_boot_addr(enum pm_node_id nid,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_config_tcm_comb() - Configure TCM combined mode
|
||||
* @value Value to set (Split/Combined)
|
||||
* pm_ioctl_config_tcm_comb() - Configure TCM combined mode.
|
||||
* @value: Value to set (Split/Combined).
|
||||
*
|
||||
* This function configures TCM to be in split mode or combined
|
||||
* mode.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_config_tcm_comb(uint32_t value)
|
||||
{
|
||||
|
@ -149,13 +153,14 @@ static enum pm_ret_status pm_ioctl_config_tcm_comb(uint32_t value)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_set_tapdelay_bypass() - Enable/Disable tap delay bypass
|
||||
* @type Type of tap delay to enable/disable (e.g. QSPI)
|
||||
* @value Enable/Disable
|
||||
* pm_ioctl_set_tapdelay_bypass() - Enable/Disable tap delay bypass.
|
||||
* @type: Type of tap delay to enable/disable (e.g. QSPI).
|
||||
* @value: Enable/Disable.
|
||||
*
|
||||
* This function enable/disable tap delay bypass.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_set_tapdelay_bypass(uint32_t type,
|
||||
uint32_t value)
|
||||
|
@ -169,15 +174,16 @@ static enum pm_ret_status pm_ioctl_set_tapdelay_bypass(uint32_t type,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_set_sgmii_mode() - Set SGMII mode for the GEM device
|
||||
* @nid Node ID of the device
|
||||
* @value Enable/Disable
|
||||
* pm_ioctl_set_sgmii_mode() - Set SGMII mode for the GEM device.
|
||||
* @nid: Node ID of the device.
|
||||
* @value: Enable/Disable.
|
||||
*
|
||||
* This function enable/disable SGMII mode for the GEM device.
|
||||
* While enabling SGMII mode, it also ties the GEM PCS Signal
|
||||
* Detect to 1 and selects EMIO for RX clock generation.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_set_sgmii_mode(enum pm_node_id nid,
|
||||
uint32_t value)
|
||||
|
@ -229,13 +235,14 @@ static enum pm_ret_status pm_ioctl_set_sgmii_mode(enum pm_node_id nid,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_sd_dll_reset() - Reset DLL logic
|
||||
* @nid Node ID of the device
|
||||
* @type Reset type
|
||||
* pm_ioctl_sd_dll_reset() - Reset DLL logic.
|
||||
* @nid: Node ID of the device.
|
||||
* @type: Reset type.
|
||||
*
|
||||
* This function resets DLL logic for the SD device.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_sd_dll_reset(enum pm_node_id nid,
|
||||
uint32_t type)
|
||||
|
@ -278,14 +285,15 @@ static enum pm_ret_status pm_ioctl_sd_dll_reset(enum pm_node_id nid,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_sd_set_tapdelay() - Set tap delay for the SD device
|
||||
* @nid Node ID of the device
|
||||
* @type Type of tap delay to set (input/output)
|
||||
* @value Value to set fot the tap delay
|
||||
* pm_ioctl_sd_set_tapdelay() - Set tap delay for the SD device.
|
||||
* @nid: Node ID of the device.
|
||||
* @type: Type of tap delay to set (input/output).
|
||||
* @value: Value to set fot the tap delay.
|
||||
*
|
||||
* This function sets input/output tap delay for the SD device.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_sd_set_tapdelay(enum pm_node_id nid,
|
||||
enum tap_delay_type type,
|
||||
|
@ -375,14 +383,14 @@ reset_release:
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_set_pll_frac_mode() - Ioctl function for
|
||||
* setting pll mode
|
||||
* @pll PLL clock id
|
||||
* @mode Mode fraction/integar
|
||||
* pm_ioctl_set_pll_frac_mode() - Ioctl function for setting pll mode.
|
||||
* @pll: PLL clock id.
|
||||
* @mode: Mode fraction/integar.
|
||||
*
|
||||
* This function sets PLL mode
|
||||
* This function sets PLL mode.
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_set_pll_frac_mode
|
||||
(uint32_t pll, uint32_t mode)
|
||||
|
@ -391,14 +399,14 @@ static enum pm_ret_status pm_ioctl_set_pll_frac_mode
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_get_pll_frac_mode() - Ioctl function for
|
||||
* getting pll mode
|
||||
* @pll PLL clock id
|
||||
* @mode Mode fraction/integar
|
||||
* pm_ioctl_get_pll_frac_mode() - Ioctl function for getting pll mode.
|
||||
* @pll: PLL clock id.
|
||||
* @mode: Mode fraction/integar.
|
||||
*
|
||||
* This function return current PLL mode
|
||||
* This function return current PLL mode.
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_get_pll_frac_mode
|
||||
(uint32_t pll, uint32_t *mode)
|
||||
|
@ -407,15 +415,15 @@ static enum pm_ret_status pm_ioctl_get_pll_frac_mode
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_set_pll_frac_data() - Ioctl function for
|
||||
* setting pll fraction data
|
||||
* @pll PLL clock id
|
||||
* @data fraction data
|
||||
* pm_ioctl_set_pll_frac_data() - Ioctl function for setting pll fraction data.
|
||||
* @pll: PLL clock id.
|
||||
* @data: fraction data.
|
||||
*
|
||||
* This function sets fraction data.
|
||||
* It is valid for fraction mode only.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_set_pll_frac_data
|
||||
(uint32_t pll, uint32_t data)
|
||||
|
@ -433,14 +441,14 @@ static enum pm_ret_status pm_ioctl_set_pll_frac_data
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_get_pll_frac_data() - Ioctl function for
|
||||
* getting pll fraction data
|
||||
* @pll PLL clock id
|
||||
* @data fraction data
|
||||
* pm_ioctl_get_pll_frac_data() - Ioctl function for getting pll fraction data.
|
||||
* @pll: PLL clock id.
|
||||
* @data: fraction data.
|
||||
*
|
||||
* This function returns fraction data value.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_get_pll_frac_data
|
||||
(uint32_t pll, uint32_t *data)
|
||||
|
@ -458,14 +466,15 @@ static enum pm_ret_status pm_ioctl_get_pll_frac_data
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_write_ggs() - Ioctl function for writing
|
||||
* global general storage (ggs)
|
||||
* @index GGS register index
|
||||
* @value Register value to be written
|
||||
* pm_ioctl_write_ggs() - Ioctl function for writing global general storage
|
||||
* (ggs).
|
||||
* @index: GGS register index.
|
||||
* @value: Register value to be written.
|
||||
*
|
||||
* This function writes value to GGS register.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_write_ggs(uint32_t index,
|
||||
uint32_t value)
|
||||
|
@ -479,14 +488,15 @@ static enum pm_ret_status pm_ioctl_write_ggs(uint32_t index,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_read_ggs() - Ioctl function for reading
|
||||
* global general storage (ggs)
|
||||
* @index GGS register index
|
||||
* @value Register value
|
||||
* pm_ioctl_read_ggs() - Ioctl function for reading global general storage
|
||||
* (ggs).
|
||||
* @index: GGS register index.
|
||||
* @value: Register value.
|
||||
*
|
||||
* This function returns GGS register value.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_read_ggs(uint32_t index,
|
||||
uint32_t *value)
|
||||
|
@ -499,14 +509,15 @@ static enum pm_ret_status pm_ioctl_read_ggs(uint32_t index,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_write_pggs() - Ioctl function for writing persistent
|
||||
* global general storage (pggs)
|
||||
* @index PGGS register index
|
||||
* @value Register value to be written
|
||||
* pm_ioctl_write_pggs() - Ioctl function for writing persistent global general
|
||||
* storage (pggs).
|
||||
* @index: PGGS register index.
|
||||
* @value: Register value to be written.
|
||||
*
|
||||
* This function writes value to PGGS register.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_write_pggs(uint32_t index,
|
||||
uint32_t value)
|
||||
|
@ -520,13 +531,12 @@ static enum pm_ret_status pm_ioctl_write_pggs(uint32_t index,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_afi() - Ioctl function for writing afi values
|
||||
* pm_ioctl_afi() - Ioctl function for writing afi values.
|
||||
* @index: AFI register index.
|
||||
* @value: Register value to be written.
|
||||
*
|
||||
* @index AFI register index
|
||||
* @value Register value to be written
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_afi(uint32_t index,
|
||||
uint32_t value)
|
||||
|
@ -564,14 +574,15 @@ static enum pm_ret_status pm_ioctl_afi(uint32_t index,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_read_pggs() - Ioctl function for reading persistent
|
||||
* global general storage (pggs)
|
||||
* @index PGGS register index
|
||||
* @value Register value
|
||||
* pm_ioctl_read_pggs() - Ioctl function for reading persistent global general
|
||||
* storage (pggs).
|
||||
* @index: PGGS register index.
|
||||
* @value: Register value.
|
||||
*
|
||||
* This function returns PGGS register value.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_read_pggs(uint32_t index,
|
||||
uint32_t *value)
|
||||
|
@ -584,12 +595,12 @@ static enum pm_ret_status pm_ioctl_read_pggs(uint32_t index,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_ulpi_reset() - Ioctl function for performing ULPI reset
|
||||
* pm_ioctl_ulpi_reset() - Ioctl function for performing ULPI reset.
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
* This function peerforms the ULPI reset sequence for resetting
|
||||
* the ULPI transceiver.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_ulpi_reset(void)
|
||||
{
|
||||
|
@ -620,12 +631,14 @@ static enum pm_ret_status pm_ioctl_ulpi_reset(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_ioctl_set_boot_health_status() - Ioctl for setting healthy boot status
|
||||
* pm_ioctl_set_boot_health_status() - Ioctl for setting healthy boot status.
|
||||
* @value: Value to write.
|
||||
*
|
||||
* This function sets healthy bit value to indicate boot health status
|
||||
* to firmware.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
static enum pm_ret_status pm_ioctl_set_boot_health_status(uint32_t value)
|
||||
{
|
||||
|
@ -634,16 +647,17 @@ static enum pm_ret_status pm_ioctl_set_boot_health_status(uint32_t value)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_api_ioctl() - PM IOCTL API for device control and configs
|
||||
* @node_id Node ID of the device
|
||||
* @ioctl_id ID of the requested IOCTL
|
||||
* @arg1 Argument 1 to requested IOCTL call
|
||||
* @arg2 Argument 2 to requested IOCTL call
|
||||
* @value Returned output value
|
||||
* pm_api_ioctl() - PM IOCTL API for device control and configs.
|
||||
* @nid: Node ID of the device.
|
||||
* @ioctl_id: ID of the requested IOCTL.
|
||||
* @arg1: Argument 1 to requested IOCTL call.
|
||||
* @arg2: Argument 2 to requested IOCTL call.
|
||||
* @value: Returned output value.
|
||||
*
|
||||
* This function calls IOCTL to firmware for device control and configuration.
|
||||
*
|
||||
* @return Returns status, either success or error+reason
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_api_ioctl(enum pm_node_id nid,
|
||||
uint32_t ioctl_id,
|
||||
|
@ -724,8 +738,11 @@ enum pm_ret_status pm_api_ioctl(enum pm_node_id nid,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_update_ioctl_bitmask() - API to get supported IOCTL ID mask
|
||||
* @bit_mask Returned bit mask of supported IOCTL IDs
|
||||
* tfa_ioctl_bitmask() - API to get supported IOCTL ID mask.
|
||||
* @bit_mask: Returned bit mask of supported IOCTL IDs.
|
||||
*
|
||||
* Return: 0 success, negative value for errors.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status tfa_ioctl_bitmask(uint32_t *bit_mask)
|
||||
{
|
||||
|
|
|
@ -1946,12 +1946,13 @@ static struct zynqmp_pin_group zynqmp_pin_groups[MAX_PIN] = {
|
|||
};
|
||||
|
||||
/**
|
||||
* pm_api_pinctrl_get_num_pins() - PM call to request number of pins
|
||||
* @npins Number of pins
|
||||
* pm_api_pinctrl_get_num_pins() - PM call to request number of pins.
|
||||
* @npins: Number of pins.
|
||||
*
|
||||
* This function is used by master to get number of pins
|
||||
* This function is used by master to get number of pins.
|
||||
*
|
||||
* Return: Returns success.
|
||||
*
|
||||
* @return Returns success.
|
||||
*/
|
||||
enum pm_ret_status pm_api_pinctrl_get_num_pins(uint32_t *npins)
|
||||
{
|
||||
|
@ -1961,12 +1962,13 @@ enum pm_ret_status pm_api_pinctrl_get_num_pins(uint32_t *npins)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_api_pinctrl_get_num_functions() - PM call to request number of functions
|
||||
* @nfuncs Number of functions
|
||||
* pm_api_pinctrl_get_num_functions() - PM call to request number of functions.
|
||||
* @nfuncs: Number of functions.
|
||||
*
|
||||
* This function is used by master to get number of functions
|
||||
* This function is used by master to get number of functions.
|
||||
*
|
||||
* Return: Returns success.
|
||||
*
|
||||
* @return Returns success.
|
||||
*/
|
||||
enum pm_ret_status pm_api_pinctrl_get_num_functions(uint32_t *nfuncs)
|
||||
{
|
||||
|
@ -1977,13 +1979,14 @@ enum pm_ret_status pm_api_pinctrl_get_num_functions(uint32_t *nfuncs)
|
|||
|
||||
/**
|
||||
* pm_api_pinctrl_get_num_func_groups() - PM call to request number of
|
||||
* function groups
|
||||
* @fid Function Id
|
||||
* @ngroups Number of function groups
|
||||
* function groups.
|
||||
* @fid: Function Id.
|
||||
* @ngroups: Number of function groups.
|
||||
*
|
||||
* This function is used by master to get number of function groups
|
||||
* This function is used by master to get number of function groups.
|
||||
*
|
||||
* Return: Returns success.
|
||||
*
|
||||
* @return Returns success.
|
||||
*/
|
||||
enum pm_ret_status pm_api_pinctrl_get_num_func_groups(uint32_t fid,
|
||||
uint32_t *ngroups)
|
||||
|
@ -1998,12 +2001,13 @@ enum pm_ret_status pm_api_pinctrl_get_num_func_groups(uint32_t fid,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_api_pinctrl_get_function_name() - PM call to request a function name
|
||||
* @fid Function ID
|
||||
* @name Name of function (max 16 bytes)
|
||||
* pm_api_pinctrl_get_function_name() - PM call to request a function name.
|
||||
* @fid: Function ID.
|
||||
* @name: Name of function (max 16 bytes).
|
||||
*
|
||||
* This function is used by master to get name of function specified
|
||||
* by given function ID.
|
||||
*
|
||||
*/
|
||||
void pm_api_pinctrl_get_function_name(uint32_t fid, char *name)
|
||||
{
|
||||
|
@ -2016,10 +2020,10 @@ void pm_api_pinctrl_get_function_name(uint32_t fid, char *name)
|
|||
|
||||
/**
|
||||
* pm_api_pinctrl_get_function_groups() - PM call to request first 6 function
|
||||
* groups of function Id
|
||||
* @fid Function ID
|
||||
* @index Index of next function groups
|
||||
* @groups Function groups
|
||||
* groups of function Id.
|
||||
* @fid: Function ID.
|
||||
* @index: Index of next function groups.
|
||||
* @groups: Function groups.
|
||||
*
|
||||
* This function is used by master to get function groups specified
|
||||
* by given function Id. This API will return 6 function groups with
|
||||
|
@ -2031,6 +2035,7 @@ void pm_api_pinctrl_get_function_name(uint32_t fid, char *name)
|
|||
* function groups 6, 7, 8, 9, 10 and 11 and so on.
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_api_pinctrl_get_function_groups(uint32_t fid,
|
||||
uint32_t index,
|
||||
|
@ -2061,10 +2066,10 @@ enum pm_ret_status pm_api_pinctrl_get_function_groups(uint32_t fid,
|
|||
|
||||
/**
|
||||
* pm_api_pinctrl_get_pin_groups() - PM call to request first 6 pin
|
||||
* groups of pin
|
||||
* @pin Pin
|
||||
* @index Index of next pin groups
|
||||
* @groups pin groups
|
||||
* groups of pin.
|
||||
* @pin: Pin.
|
||||
* @index: Index of next pin groups.
|
||||
* @groups: pin groups.
|
||||
*
|
||||
* This function is used by master to get pin groups specified
|
||||
* by given pin Id. This API will return 6 pin groups with
|
||||
|
@ -2076,6 +2081,7 @@ enum pm_ret_status pm_api_pinctrl_get_function_groups(uint32_t fid,
|
|||
* pin groups 6, 7, 8, 9, 10 and 11 and so on.
|
||||
*
|
||||
* Return: Returns status, either success or error+reason.
|
||||
*
|
||||
*/
|
||||
enum pm_ret_status pm_api_pinctrl_get_pin_groups(uint32_t pin,
|
||||
uint32_t index,
|
||||
|
|
|
@ -157,10 +157,11 @@ static enum pm_node_id irq_node_map[IRQ_MAX + 1U] = {
|
|||
};
|
||||
|
||||
/**
|
||||
* irq_to_pm_node - Get PM node ID corresponding to the interrupt number
|
||||
* @irq: Interrupt number
|
||||
* irq_to_pm_node - Get PM node ID corresponding to the interrupt number.
|
||||
* @irq: Interrupt number.
|
||||
*
|
||||
* Return: PM node ID corresponding to the specified interrupt.
|
||||
*
|
||||
* Return: PM node ID corresponding to the specified interrupt
|
||||
*/
|
||||
static enum pm_node_id irq_to_pm_node(uint32_t irq)
|
||||
{
|
||||
|
@ -170,7 +171,8 @@ static enum pm_node_id irq_to_pm_node(uint32_t irq)
|
|||
|
||||
/**
|
||||
* pm_client_set_wakeup_sources - Set all slaves with enabled interrupts as wake
|
||||
* sources in the PMU firmware
|
||||
* sources in the PMU firmware.
|
||||
*
|
||||
*/
|
||||
static void pm_client_set_wakeup_sources(void)
|
||||
{
|
||||
|
@ -227,10 +229,11 @@ static void pm_client_set_wakeup_sources(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_get_proc() - returns pointer to the proc structure
|
||||
* @cpuid: id of the cpu whose proc struct pointer should be returned
|
||||
* pm_get_proc() - returns pointer to the proc structure.
|
||||
* @cpuid: id of the cpu whose proc struct pointer should be returned.
|
||||
*
|
||||
* Return: pointer to a proc structure if proc is found, otherwise NULL.
|
||||
*
|
||||
* Return: pointer to a proc structure if proc is found, otherwise NULL
|
||||
*/
|
||||
const struct pm_proc *pm_get_proc(uint32_t cpuid)
|
||||
{
|
||||
|
@ -242,10 +245,11 @@ const struct pm_proc *pm_get_proc(uint32_t cpuid)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_get_proc_by_node() - returns pointer to the proc structure
|
||||
* @nid: node id of the processor
|
||||
* pm_get_proc_by_node() - returns pointer to the proc structure.
|
||||
* @nid: node id of the processor.
|
||||
*
|
||||
* Return: pointer to a proc structure if proc is found, otherwise NULL.
|
||||
*
|
||||
* Return: pointer to a proc structure if proc is found, otherwise NULL
|
||||
*/
|
||||
const struct pm_proc *pm_get_proc_by_node(enum pm_node_id nid)
|
||||
{
|
||||
|
@ -258,10 +262,11 @@ const struct pm_proc *pm_get_proc_by_node(enum pm_node_id nid)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_get_cpuid() - get the local cpu ID for a global node ID
|
||||
* @nid: node id of the processor
|
||||
* pm_get_cpuid() - get the local cpu ID for a global node ID.
|
||||
* @nid: node id of the processor.
|
||||
*
|
||||
* Return: the cpu ID (starting from 0) for the subsystem.
|
||||
*
|
||||
* Return: the cpu ID (starting from 0) for the subsystem
|
||||
*/
|
||||
static uint32_t pm_get_cpuid(enum pm_node_id nid)
|
||||
{
|
||||
|
@ -276,11 +281,14 @@ static uint32_t pm_get_cpuid(enum pm_node_id nid)
|
|||
const struct pm_proc *primary_proc = &pm_procs_all[0];
|
||||
|
||||
/**
|
||||
* pm_client_suspend() - Client-specific suspend actions
|
||||
* pm_client_suspend() - Client-specific suspend actions.
|
||||
* @proc: processor which need to suspend.
|
||||
* @state: desired suspend state.
|
||||
*
|
||||
* This function should contain any PU-specific actions
|
||||
* required prior to sending suspend request to PMU
|
||||
* Actions taken depend on the state system is suspending to.
|
||||
*
|
||||
*/
|
||||
void pm_client_suspend(const struct pm_proc *proc, uint32_t state)
|
||||
{
|
||||
|
@ -298,10 +306,11 @@ void pm_client_suspend(const struct pm_proc *proc, uint32_t state)
|
|||
|
||||
|
||||
/**
|
||||
* pm_client_abort_suspend() - Client-specific abort-suspend actions
|
||||
* pm_client_abort_suspend() - Client-specific abort-suspend actions.
|
||||
*
|
||||
* This function should contain any PU-specific actions
|
||||
* required for aborting a prior suspend request
|
||||
* required for aborting a prior suspend request.
|
||||
*
|
||||
*/
|
||||
void pm_client_abort_suspend(void)
|
||||
{
|
||||
|
@ -318,10 +327,12 @@ void pm_client_abort_suspend(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_client_wakeup() - Client-specific wakeup actions
|
||||
* pm_client_wakeup() - Client-specific wakeup actions.
|
||||
* @proc: Processor which need to wakeup.
|
||||
*
|
||||
* This function should contain any PU-specific actions
|
||||
* required for waking up another APU core
|
||||
* required for waking up another APU core.
|
||||
*
|
||||
*/
|
||||
void pm_client_wakeup(const struct pm_proc *proc)
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -35,7 +35,7 @@ enum pm_register_access_id {
|
|||
CONFIG_REG_READ,
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* Assigning of argument values into array elements.
|
||||
*/
|
||||
#define PM_PACK_PAYLOAD1(pl, arg0) { \
|
||||
|
|
|
@ -23,9 +23,10 @@
|
|||
|
||||
#define PM_VERSION ((PM_VERSION_MAJOR << 16U) | PM_VERSION_MINOR)
|
||||
|
||||
/**
|
||||
/*
|
||||
* PM API versions
|
||||
*/
|
||||
|
||||
/* Expected version of firmware APIs */
|
||||
#define FW_API_BASE_VERSION (1U)
|
||||
/* Expected version of firmware API for feature check */
|
||||
|
@ -153,9 +154,11 @@ enum pm_ram_state {
|
|||
};
|
||||
|
||||
/**
|
||||
* @PM_INITIAL_BOOT: boot is a fresh system startup
|
||||
* @PM_RESUME: boot is a resume
|
||||
* @PM_BOOT_ERROR: error, boot cause cannot be identified
|
||||
* enum pm_boot_status - enum represents the boot status of the PM.
|
||||
* @PM_INITIAL_BOOT: boot is a fresh system startup.
|
||||
* @PM_RESUME: boot is a resume.
|
||||
* @PM_BOOT_ERROR: error, boot cause cannot be identified.
|
||||
*
|
||||
*/
|
||||
enum pm_boot_status {
|
||||
PM_INITIAL_BOOT,
|
||||
|
@ -164,9 +167,11 @@ enum pm_boot_status {
|
|||
};
|
||||
|
||||
/**
|
||||
* @PMF_SHUTDOWN_TYPE_SHUTDOWN: shutdown
|
||||
* @PMF_SHUTDOWN_TYPE_RESET: reset/reboot
|
||||
* @PMF_SHUTDOWN_TYPE_SETSCOPE_ONLY: set the shutdown/reboot scope
|
||||
* enum pm_shutdown_type - enum represents the shutdown type of the PM.
|
||||
* @PMF_SHUTDOWN_TYPE_SHUTDOWN: shutdown.
|
||||
* @PMF_SHUTDOWN_TYPE_RESET: reset/reboot.
|
||||
* @PMF_SHUTDOWN_TYPE_SETSCOPE_ONLY: set the shutdown/reboot scope.
|
||||
*
|
||||
*/
|
||||
enum pm_shutdown_type {
|
||||
PMF_SHUTDOWN_TYPE_SHUTDOWN,
|
||||
|
@ -175,9 +180,11 @@ enum pm_shutdown_type {
|
|||
};
|
||||
|
||||
/**
|
||||
* @PMF_SHUTDOWN_SUBTYPE_SUBSYSTEM: shutdown/reboot APU subsystem only
|
||||
* @PMF_SHUTDOWN_SUBTYPE_PS_ONLY: shutdown/reboot entire PS (but not PL)
|
||||
* @PMF_SHUTDOWN_SUBTYPE_SYSTEM: shutdown/reboot entire system
|
||||
* enum pm_shutdown_subtype - enum represents the shutdown subtype of the PM.
|
||||
* @PMF_SHUTDOWN_SUBTYPE_SUBSYSTEM: shutdown/reboot APU subsystem only.
|
||||
* @PMF_SHUTDOWN_SUBTYPE_PS_ONLY: shutdown/reboot entire PS (but not PL).
|
||||
* @PMF_SHUTDOWN_SUBTYPE_SYSTEM: shutdown/reboot entire system.
|
||||
*
|
||||
*/
|
||||
enum pm_shutdown_subtype {
|
||||
PMF_SHUTDOWN_SUBTYPE_SUBSYSTEM,
|
||||
|
@ -186,9 +193,11 @@ enum pm_shutdown_subtype {
|
|||
};
|
||||
|
||||
/**
|
||||
* @PM_PLL_MODE_RESET: PLL is in reset (not locked)
|
||||
* @PM_PLL_MODE_INTEGER: PLL is locked in integer mode
|
||||
* @PM_PLL_MODE_FRACTIONAL: PLL is locked in fractional mode
|
||||
* enum pm_pll_mode - enum represents the mode of the PLL.
|
||||
* @PM_PLL_MODE_RESET: PLL is in reset (not locked).
|
||||
* @PM_PLL_MODE_INTEGER: PLL is locked in integer mode.
|
||||
* @PM_PLL_MODE_FRACTIONAL: PLL is locked in fractional mode.
|
||||
* @PM_PLL_MODE_MAX: Represents the maximum mode value for the PLL.
|
||||
*/
|
||||
enum pm_pll_mode {
|
||||
PM_PLL_MODE_RESET,
|
||||
|
@ -198,8 +207,10 @@ enum pm_pll_mode {
|
|||
};
|
||||
|
||||
/**
|
||||
* @PM_CLOCK_DIV0_ID: Clock divider 0
|
||||
* @PM_CLOCK_DIV1_ID: Clock divider 1
|
||||
* enum pm_clock_div_id - enum represents the clock division identifiers in the
|
||||
* PM.
|
||||
* @PM_CLOCK_DIV0_ID: Clock divider 0.
|
||||
* @PM_CLOCK_DIV1_ID: Clock divider 1.
|
||||
*/
|
||||
enum pm_clock_div_id {
|
||||
PM_CLOCK_DIV0_ID,
|
||||
|
|
|
@ -36,22 +36,26 @@ static int active_cores = 0;
|
|||
#endif
|
||||
|
||||
/**
|
||||
* pm_context - Structure which contains data for power management
|
||||
* @api_version version of PM API, must match with one on PMU side
|
||||
* @payload payload array used to store received
|
||||
* data from ipi buffer registers
|
||||
* typedef pm_ctx_t - Structure which contains data for power management.
|
||||
* @api_version: version of PM API, must match with one on PMU side.
|
||||
* @payload: payload array used to store received.
|
||||
* data from ipi buffer registers.
|
||||
*
|
||||
*/
|
||||
static struct {
|
||||
typedef struct {
|
||||
uint32_t api_version;
|
||||
uint32_t payload[PAYLOAD_ARG_CNT];
|
||||
} pm_ctx;
|
||||
} pm_ctx_t;
|
||||
|
||||
static pm_ctx_t pm_ctx;
|
||||
|
||||
#if ZYNQMP_WDT_RESTART
|
||||
/**
|
||||
* trigger_wdt_restart() - Trigger warm restart event to APU cores
|
||||
* trigger_wdt_restart() - Trigger warm restart event to APU cores.
|
||||
*
|
||||
* This function triggers SGI for all active APU CPUs. SGI handler then
|
||||
* power down CPU and call system reset.
|
||||
*
|
||||
*/
|
||||
static void trigger_wdt_restart(void)
|
||||
{
|
||||
|
@ -83,15 +87,15 @@ static void trigger_wdt_restart(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* ttc_fiq_handler() - TTC Handler for timer event
|
||||
* @id number of the highest priority pending interrupt of the type
|
||||
* that this handler was registered for
|
||||
* @flags security state, bit[0]
|
||||
* @handler pointer to 'cpu_context' structure of the current CPU for the
|
||||
* security state specified in the 'flags' parameter
|
||||
* @cookie unused
|
||||
* ttc_fiq_handler() - TTC Handler for timer event.
|
||||
* @id: number of the highest priority pending interrupt of the type
|
||||
* that this handler was registered for.
|
||||
* @flags: security state, bit[0].
|
||||
* @handle: pointer to 'cpu_context' structure of the current CPU for the
|
||||
* security state specified in the 'flags' parameter.
|
||||
* @cookie: unused.
|
||||
*
|
||||
* Function registered as INTR_TYPE_EL3 interrupt handler
|
||||
* Function registered as INTR_TYPE_EL3 interrupt handler.
|
||||
*
|
||||
* When WDT event is received in PMU, PMU needs to notify master to do cleanup
|
||||
* if required. PMU sets up timer and starts timer to overflow in zero time upon
|
||||
|
@ -101,6 +105,9 @@ static void trigger_wdt_restart(void)
|
|||
* In presence of non-secure software layers (EL1/2) sets the interrupt
|
||||
* at registered entrance in GIC and informs that PMU responded or demands
|
||||
* action.
|
||||
*
|
||||
* Return: 0 on success.
|
||||
*
|
||||
*/
|
||||
static uint64_t ttc_fiq_handler(uint32_t id, uint32_t flags, void *handle,
|
||||
void *cookie)
|
||||
|
@ -121,19 +128,21 @@ static uint64_t ttc_fiq_handler(uint32_t id, uint32_t flags, void *handle,
|
|||
}
|
||||
|
||||
/**
|
||||
* zynqmp_sgi7_irq() - Handler for SGI7 IRQ
|
||||
* @id number of the highest priority pending interrupt of the type
|
||||
* that this handler was registered for
|
||||
* @flags security state, bit[0]
|
||||
* @handler pointer to 'cpu_context' structure of the current CPU for the
|
||||
* security state specified in the 'flags' parameter
|
||||
* @cookie unused
|
||||
* zynqmp_sgi7_irq() - Handler for SGI7 IRQ.
|
||||
* @id: number of the highest priority pending interrupt of the type
|
||||
* that this handler was registered for.
|
||||
* @flags: security state, bit[0].
|
||||
* @handle: pointer to 'cpu_context' structure of the current CPU for the
|
||||
* security state specified in the 'flags' parameter.
|
||||
* @cookie: unused.
|
||||
*
|
||||
* Function registered as INTR_TYPE_EL3 interrupt handler
|
||||
*
|
||||
* On receiving WDT event from PMU, TF-A generates SGI7 to all running CPUs.
|
||||
* In response to SGI7 interrupt, each CPUs do clean up if required and last
|
||||
* running CPU calls system restart.
|
||||
*
|
||||
* Return: This function does not return a value and it enters into wfi.
|
||||
*/
|
||||
static uint64_t __unused __dead2 zynqmp_sgi7_irq(uint32_t id, uint32_t flags,
|
||||
void *handle, void *cookie)
|
||||
|
@ -168,7 +177,9 @@ static uint64_t __unused __dead2 zynqmp_sgi7_irq(uint32_t id, uint32_t flags,
|
|||
}
|
||||
|
||||
/**
|
||||
* pm_wdt_restart_setup() - Setup warm restart interrupts
|
||||
* pm_wdt_restart_setup() - Setup warm restart interrupts.
|
||||
*
|
||||
* Return: Returns status, 0 on success or error+reason.
|
||||
*
|
||||
* This function sets up handler for SGI7 and TTC interrupts
|
||||
* used for warm restart.
|
||||
|
@ -194,17 +205,18 @@ err:
|
|||
#endif
|
||||
|
||||
/**
|
||||
* pm_setup() - PM service setup
|
||||
* pm_setup() - PM service setup.
|
||||
*
|
||||
* @return On success, the initialization function must return 0.
|
||||
* Any other return value will cause the framework to ignore
|
||||
* the service
|
||||
* Return: On success, the initialization function must return 0.
|
||||
* Any other return value will cause the framework to ignore
|
||||
* the service.
|
||||
*
|
||||
* Initialization functions for ZynqMP power management for
|
||||
* communicaton with PMU.
|
||||
*
|
||||
* Called from sip_svc_setup initialization function with the
|
||||
* rt_svc_init signature.
|
||||
*
|
||||
*/
|
||||
int32_t pm_setup(void)
|
||||
{
|
||||
|
@ -249,19 +261,24 @@ int32_t pm_setup(void)
|
|||
|
||||
/**
|
||||
* pm_smc_handler() - SMC handler for PM-API calls coming from EL1/EL2.
|
||||
* @smc_fid - Function Identifier
|
||||
* @x1 - x4 - Arguments
|
||||
* @cookie - Unused
|
||||
* @handler - Pointer to caller's context structure
|
||||
*
|
||||
* @return - Unused
|
||||
* @smc_fid: Function Identifier.
|
||||
* @x1: Arguments.
|
||||
* @x2: Arguments.
|
||||
* @x3: Arguments.
|
||||
* @x4: Arguments.
|
||||
* @cookie: Unused.
|
||||
* @handle: Pointer to caller's context structure.
|
||||
* @flags: SECURE_FLAG or NON_SECURE_FLAG.
|
||||
*
|
||||
* Determines that smc_fid is valid and supported PM SMC Function ID from the
|
||||
* list of pm_api_ids, otherwise completes the request with
|
||||
* the unknown SMC Function ID
|
||||
* the unknown SMC Function ID.
|
||||
*
|
||||
* The SMC calls for PM service are forwarded from SIP Service SMC handler
|
||||
* function with rt_svc_handle signature
|
||||
* function with rt_svc_handle signature.
|
||||
*
|
||||
* Return: Unused.
|
||||
*
|
||||
*/
|
||||
uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
|
||||
uint64_t x4, const void *cookie, void *handle, uint64_t flags)
|
||||
|
|
|
@ -40,9 +40,13 @@ DEFINE_SVC_UUID2(zynqmp_sip_uuid,
|
|||
0xb9, 0x25, 0x82, 0x2d, 0xe3, 0xa5);
|
||||
|
||||
/**
|
||||
* sip_svc_setup() - Setup SiP Service
|
||||
* sip_svc_setup() - Setup SiP Service.
|
||||
*
|
||||
* Invokes PM setup
|
||||
* Return: On success, the initialization function must return 0.
|
||||
* Any other return value will cause the framework to ignore
|
||||
* the service.
|
||||
*
|
||||
* Invokes PM setup.
|
||||
*/
|
||||
static int32_t sip_svc_setup(void)
|
||||
{
|
||||
|
@ -52,9 +56,19 @@ static int32_t sip_svc_setup(void)
|
|||
|
||||
/**
|
||||
* sip_svc_smc_handler() - Top-level SiP Service SMC handler
|
||||
* @smc_fid: Function Identifier.
|
||||
* @x1: SMC64 Arguments 1 from kernel.
|
||||
* @x2: SMC64 Arguments 2 from kernel.
|
||||
* @x3: SMC64 Arguments 3 from kernel(upper 32-bits).
|
||||
* @x4: SMC64 Arguments 4 from kernel.
|
||||
* @cookie: Unused
|
||||
* @handle: Pointer to caller's context structure.
|
||||
* @flags: SECURE_FLAG or NON_SECURE_FLAG.
|
||||
*
|
||||
* Handler for all SiP SMC calls. Handles standard SIP requests
|
||||
* and calls PM SMC handler if the call is for a PM-API function.
|
||||
*
|
||||
* Return: Unused.
|
||||
*/
|
||||
static uintptr_t sip_svc_smc_handler(uint32_t smc_fid,
|
||||
u_register_t x1,
|
||||
|
|
|
@ -85,7 +85,7 @@ static const struct ipi_config zynqmp_ipi_table[] = {
|
|||
};
|
||||
|
||||
/**
|
||||
* zynqmp_ipi_config_table_init() - Initialize ZynqMP IPI configuration data
|
||||
* zynqmp_ipi_config_table_init() - Initialize ZynqMP IPI configuration data.
|
||||
*
|
||||
*/
|
||||
void zynqmp_ipi_config_table_init(void)
|
||||
|
|
Loading…
Add table
Reference in a new issue