xref: /linux/include/linux/firmware/meson/meson_sm.h (revision 0d423c4a78984dd02f6596d6fd9dd40446eec517)
13c910ecbSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
22c4ddb21SCarlo Caione /*
32c4ddb21SCarlo Caione  * Copyright (C) 2016 Endless Mobile, Inc.
42c4ddb21SCarlo Caione  * Author: Carlo Caione <carlo@endlessm.com>
52c4ddb21SCarlo Caione  */
62c4ddb21SCarlo Caione 
72c4ddb21SCarlo Caione #ifndef _MESON_SM_FW_H_
82c4ddb21SCarlo Caione #define _MESON_SM_FW_H_
92c4ddb21SCarlo Caione 
102c4ddb21SCarlo Caione enum {
112c4ddb21SCarlo Caione 	SM_EFUSE_READ,
122c4ddb21SCarlo Caione 	SM_EFUSE_WRITE,
132c4ddb21SCarlo Caione 	SM_EFUSE_USER_MAX,
140789724fSNeil Armstrong 	SM_GET_CHIP_ID,
15fe98d0ffSJianxin Pan 	SM_A1_PWRC_SET,
16fe98d0ffSJianxin Pan 	SM_A1_PWRC_GET,
172c4ddb21SCarlo Caione };
182c4ddb21SCarlo Caione 
192c4ddb21SCarlo Caione struct meson_sm_firmware;
202c4ddb21SCarlo Caione 
218cde3c21SCarlo Caione int meson_sm_call(struct meson_sm_firmware *fw, unsigned int cmd_index,
22*0d423c4aSAlexey Romanov 		  s32 *ret, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4);
238cde3c21SCarlo Caione int meson_sm_call_write(struct meson_sm_firmware *fw, void *buffer,
248cde3c21SCarlo Caione 			unsigned int b_size, unsigned int cmd_index, u32 arg0,
258cde3c21SCarlo Caione 			u32 arg1, u32 arg2, u32 arg3, u32 arg4);
268cde3c21SCarlo Caione int meson_sm_call_read(struct meson_sm_firmware *fw, void *buffer,
278cde3c21SCarlo Caione 		       unsigned int bsize, unsigned int cmd_index, u32 arg0,
288cde3c21SCarlo Caione 		       u32 arg1, u32 arg2, u32 arg3, u32 arg4);
298cde3c21SCarlo Caione struct meson_sm_firmware *meson_sm_get(struct device_node *firmware_node);
302c4ddb21SCarlo Caione 
312c4ddb21SCarlo Caione #endif /* _MESON_SM_FW_H_ */
32