xref: /OK3568_Linux_fs/u-boot/arch/sandbox/include/asm/scmi_test.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2020, Linaro Limited
4  */
5 
6 #ifndef __SANDBOX_SCMI_TEST_H
7 #define __SANDBOX_SCMI_TEST_H
8 
9 struct udevice;
10 struct sandbox_scmi_agent;
11 struct sandbox_scmi_service;
12 
13 /**
14  * struct sandbox_scmi_agent - Simulated SCMI service seen by SCMI agent
15  * @idx:	Identifier for the SCMI agent, its index
16  */
17 struct sandbox_scmi_agent {
18 	uint idx;
19 };
20 
21 /**
22  * struct sandbox_scmi_service - Reference to simutaed SCMI agents/services
23  * @agent:		Pointer to SCMI sandbox agent pointers array
24  * @agent_count:	Number of emulated agents exposed in array @agent.
25  */
26 struct sandbox_scmi_service {
27 	struct sandbox_scmi_agent **agent;
28 	size_t agent_count;
29 };
30 
31 #ifdef CONFIG_SCMI_FIRMWARE
32 /**
33  * sandbox_scmi_service_context - Get the simulated SCMI services context
34  * @return:	Reference to backend simulated resources state
35  */
36 struct sandbox_scmi_service *sandbox_scmi_service_ctx(void);
37 #else
sandbox_scmi_service_ctx(void)38 static inline struct sandbox_scmi_service *sandbox_scmi_service_ctx(void)
39 {
40 	return NULL;
41 }
42 #endif /* CONFIG_SCMI_FIRMWARE */
43 #endif /* __SANDBOX_SCMI_TEST_H */
44