blob: 000f198ebeda8532cf5b1824b27127e4a493707e [file] [log] [blame]
Tejas Patel354fe572018-12-14 00:55:37 -08001/*
Venkatesh Yadav Abbarapuc8bbedc2021-04-19 07:49:57 -06002 * Copyright (c) 2019-2022, Xilinx, Inc. All rights reserved.
Jay Buddhabhatti665bc922024-06-24 02:10:29 -07003 * Copyright (c) 2022-2024, Advanced Micro Devices, Inc. All rights reserved.
Tejas Patel354fe572018-12-14 00:55:37 -08004 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8#ifndef PM_SVC_MAIN_H
9#define PM_SVC_MAIN_H
10
11#include <pm_common.h>
12
Jay Buddhabhatti10e71e42023-06-19 05:08:54 -070013extern bool pwrdwn_req_received;
14
Jay Buddhabhatti665bc922024-06-24 02:10:29 -070015#define PASS_THROUGH_FW_CMD_ID U(0xfff)
16
Jay Buddhabhatti10498a22023-07-31 00:11:00 -070017/******************************************************************************/
18/**
19 * SECURE_REDUNDANT_CALL() - Adds redundancy to the function call. This is to
20 * avoid glitches which can skip a function call
21 * and cause altering of the code flow in security
22 * critical functions.
23 * @status: Variable which holds the return value of function executed
24 * @status_tmp: Variable which holds the return value of redundant function
25 * call executed
26 * @function: Function to be executed
27 *
28 * Return: None
29 *
30 ******************************************************************************/
31#define SECURE_REDUNDANT_CALL(status, status_tmp, function, ...) \
32 { \
33 status = function(__VA_ARGS__); \
34 status_tmp = function(__VA_ARGS__); \
35 }
36
Jay Buddhabhatti10e71e42023-06-19 05:08:54 -070037void request_cpu_pwrdwn(void);
Venkatesh Yadav Abbarapubde87592022-05-24 11:11:12 +053038int32_t pm_setup(void);
Tejas Patel59c608a2019-01-09 04:10:29 -080039uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
Venkatesh Yadav Abbarapud3c0eb42022-05-24 14:02:52 +053040 uint64_t x4, const void *cookie, void *handle,
Tejas Patel59c608a2019-01-09 04:10:29 -080041 uint64_t flags);
Tejas Patel354fe572018-12-14 00:55:37 -080042
Venkatesh Yadav Abbarapubde87592022-05-24 11:11:12 +053043int32_t pm_register_sgi(uint32_t sgi_num, uint32_t reset);
Tejas Patel354fe572018-12-14 00:55:37 -080044#endif /* PM_SVC_MAIN_H */