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