xref: /linux/include/linux/firmware/meson/meson_sm.h (revision 58d416351e6df1a41d415958ccdd8eb9c2173fed)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (C) 2016 Endless Mobile, Inc.
4  * Author: Carlo Caione <carlo@endlessm.com>
5  */
6 
7 #ifndef _MESON_SM_FW_H_
8 #define _MESON_SM_FW_H_
9 
10 enum {
11 	SM_EFUSE_READ,
12 	SM_EFUSE_WRITE,
13 	SM_EFUSE_USER_MAX,
14 	SM_GET_CHIP_ID,
15 	SM_A1_PWRC_SET,
16 	SM_A1_PWRC_GET,
17 };
18 
19 struct meson_sm_firmware;
20 
21 int meson_sm_call(struct meson_sm_firmware *fw, unsigned int cmd_index,
22 		  u32 *ret, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4);
23 int meson_sm_call_write(struct meson_sm_firmware *fw, void *buffer,
24 			unsigned int b_size, unsigned int cmd_index, u32 arg0,
25 			u32 arg1, u32 arg2, u32 arg3, u32 arg4);
26 int meson_sm_call_read(struct meson_sm_firmware *fw, void *buffer,
27 		       unsigned int bsize, unsigned int cmd_index, u32 arg0,
28 		       u32 arg1, u32 arg2, u32 arg3, u32 arg4);
29 struct meson_sm_firmware *meson_sm_get(struct device_node *firmware_node);
30 
31 #endif /* _MESON_SM_FW_H_ */
32