arm-trusted-firmware/plat/xilinx/versal/pm_service/pm_api_sys.h

60 lines
2.4 KiB
C
Raw Normal View History

/*
feat(versal): add common interfaces to handle EEMI commands This change adds common interfaces to handle commands from firmware driver to power management controller. It removes big chunk of source line of code that was handling each command separately and doing same repetitive work. EEMI - Embedded Energy Management Interface is Xilinx proprietary protocol to allow communication between power management controller and different processing clusters. As of now, Each EEMI command has its own implementation in TF-A. This is redundant. Essentially most EEMI command implementation in TF-A does same work. It prepares payload received from kernel, sends payload to firmware, receives response from firmware and send response back to kernel. The same functionality can be achieved if common interface is used among multiple EEMI commands. This change divides platform management related SMCCC requests into 4 categories. 1) EEMI commands required for backward compatibility. Some EEMI commands are still required for backward compatibility until removed completely or its use is changed to accommodate common interface 2) EEMI commands that require for PSCI interface and accessed from debugfs For example EEMI calls related to CPU suspend/resume 3) TF-A specific requests Functionality such as getting TF-A version and getting callback data for platform management is handled by this interface 4) Common interface for rest of EEMI commands This handlers performs payload and firmware response transaction job for rest of EEMI commands. Also it parses module ID from SMC payload and inserts in IPI request. If not module ID is found, then default is LIBPM_MODULE_ID. This helps in making common path in TF-A for all the modules in PLM firmware Change-Id: I57a2787c7fff9f2e1d1f9003b3daab092632d57e Signed-off-by: Tanmay Shah <tanmay.shah@xilinx.com>
2021-08-09 19:00:41 +01:00
* Copyright (c) 2019-2022, Xilinx, Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef PM_API_SYS_H
#define PM_API_SYS_H
#include <stdint.h>
#include "pm_defs.h"
/**********************************************************
* PM API function declarations
**********************************************************/
feat(versal): add common interfaces to handle EEMI commands This change adds common interfaces to handle commands from firmware driver to power management controller. It removes big chunk of source line of code that was handling each command separately and doing same repetitive work. EEMI - Embedded Energy Management Interface is Xilinx proprietary protocol to allow communication between power management controller and different processing clusters. As of now, Each EEMI command has its own implementation in TF-A. This is redundant. Essentially most EEMI command implementation in TF-A does same work. It prepares payload received from kernel, sends payload to firmware, receives response from firmware and send response back to kernel. The same functionality can be achieved if common interface is used among multiple EEMI commands. This change divides platform management related SMCCC requests into 4 categories. 1) EEMI commands required for backward compatibility. Some EEMI commands are still required for backward compatibility until removed completely or its use is changed to accommodate common interface 2) EEMI commands that require for PSCI interface and accessed from debugfs For example EEMI calls related to CPU suspend/resume 3) TF-A specific requests Functionality such as getting TF-A version and getting callback data for platform management is handled by this interface 4) Common interface for rest of EEMI commands This handlers performs payload and firmware response transaction job for rest of EEMI commands. Also it parses module ID from SMC payload and inserts in IPI request. If not module ID is found, then default is LIBPM_MODULE_ID. This helps in making common path in TF-A for all the modules in PLM firmware Change-Id: I57a2787c7fff9f2e1d1f9003b3daab092632d57e Signed-off-by: Tanmay Shah <tanmay.shah@xilinx.com>
2021-08-09 19:00:41 +01:00
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,
uint32_t x5, uint64_t *result);
enum pm_ret_status pm_self_suspend(uint32_t nid,
unsigned int latency,
unsigned int state,
uintptr_t address, uint32_t flag);
enum pm_ret_status pm_abort_suspend(enum pm_abort_reason reason, uint32_t flag);
enum pm_ret_status pm_req_suspend(uint32_t target,
uint8_t ack,
unsigned int latency,
unsigned int state, uint32_t flag);
enum pm_ret_status pm_req_wakeup(uint32_t target, uint32_t set_address,
uintptr_t address, uint8_t ack, uint32_t flag);
enum pm_ret_status pm_set_wakeup_source(uint32_t target, uint32_t device_id,
uint8_t enable, uint32_t flag);
void pm_get_callbackdata(uint32_t *data, size_t count, uint32_t flag);
enum pm_ret_status pm_pll_set_param(uint32_t clk_id, uint32_t param,
uint32_t value, uint32_t flag);
enum pm_ret_status pm_pll_get_param(uint32_t clk_id, uint32_t param,
uint32_t *value, uint32_t flag);
enum pm_ret_status pm_pll_set_mode(uint32_t clk_id, uint32_t mode,
uint32_t flag);
enum pm_ret_status pm_pll_get_mode(uint32_t clk_id, uint32_t *mode,
uint32_t flag);
enum pm_ret_status pm_force_powerdown(uint32_t target, uint8_t ack,
uint32_t flag);
enum pm_ret_status pm_system_shutdown(uint32_t type, uint32_t subtype,
uint32_t flag);
enum pm_ret_status pm_api_ioctl(uint32_t device_id, uint32_t ioctl_id,
uint32_t arg1, uint32_t arg2, uint32_t *value,
uint32_t flag);
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);
unsigned int pm_get_shutdown_scope(void);
enum pm_ret_status pm_feature_check(uint32_t api_id, unsigned int *version,
uint32_t flag);
enum pm_ret_status pm_load_pdi(uint32_t src, uint32_t address_low,
uint32_t address_high, uint32_t flag);
enum pm_ret_status pm_register_notifier(uint32_t device_id, uint32_t event,
uint32_t wake, uint32_t enable,
uint32_t flag);
#endif /* PM_API_SYS_H */