Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * Copyright (C) 2016 Freescale Semiconductor, Inc.
0004  * Copyright 2017~2018 NXP
0005  *
0006  * Header file containing the public API for the System Controller (SC)
0007  * Miscellaneous (MISC) function.
0008  *
0009  * MISC_SVC (SVC) Miscellaneous Service
0010  *
0011  * Module for the Miscellaneous (MISC) service.
0012  */
0013 
0014 #ifndef _SC_MISC_API_H
0015 #define _SC_MISC_API_H
0016 
0017 #include <linux/firmware/imx/sci.h>
0018 
0019 /*
0020  * This type is used to indicate RPC MISC function calls.
0021  */
0022 enum imx_misc_func {
0023     IMX_SC_MISC_FUNC_UNKNOWN = 0,
0024     IMX_SC_MISC_FUNC_SET_CONTROL = 1,
0025     IMX_SC_MISC_FUNC_GET_CONTROL = 2,
0026     IMX_SC_MISC_FUNC_SET_MAX_DMA_GROUP = 4,
0027     IMX_SC_MISC_FUNC_SET_DMA_GROUP = 5,
0028     IMX_SC_MISC_FUNC_SECO_IMAGE_LOAD = 8,
0029     IMX_SC_MISC_FUNC_SECO_AUTHENTICATE = 9,
0030     IMX_SC_MISC_FUNC_DEBUG_OUT = 10,
0031     IMX_SC_MISC_FUNC_WAVEFORM_CAPTURE = 6,
0032     IMX_SC_MISC_FUNC_BUILD_INFO = 15,
0033     IMX_SC_MISC_FUNC_UNIQUE_ID = 19,
0034     IMX_SC_MISC_FUNC_SET_ARI = 3,
0035     IMX_SC_MISC_FUNC_BOOT_STATUS = 7,
0036     IMX_SC_MISC_FUNC_BOOT_DONE = 14,
0037     IMX_SC_MISC_FUNC_OTP_FUSE_READ = 11,
0038     IMX_SC_MISC_FUNC_OTP_FUSE_WRITE = 17,
0039     IMX_SC_MISC_FUNC_SET_TEMP = 12,
0040     IMX_SC_MISC_FUNC_GET_TEMP = 13,
0041     IMX_SC_MISC_FUNC_GET_BOOT_DEV = 16,
0042     IMX_SC_MISC_FUNC_GET_BUTTON_STATUS = 18,
0043 };
0044 
0045 /*
0046  * Control Functions
0047  */
0048 
0049 #ifdef CONFIG_IMX_SCU
0050 int imx_sc_misc_set_control(struct imx_sc_ipc *ipc, u32 resource,
0051                 u8 ctrl, u32 val);
0052 
0053 int imx_sc_misc_get_control(struct imx_sc_ipc *ipc, u32 resource,
0054                 u8 ctrl, u32 *val);
0055 
0056 int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource,
0057             bool enable, u64 phys_addr);
0058 #else
0059 static inline int imx_sc_misc_set_control(struct imx_sc_ipc *ipc,
0060                       u32 resource, u8 ctrl, u32 val)
0061 {
0062     return -ENOTSUPP;
0063 }
0064 
0065 static inline int imx_sc_misc_get_control(struct imx_sc_ipc *ipc,
0066                       u32 resource, u8 ctrl, u32 *val)
0067 {
0068     return -ENOTSUPP;
0069 }
0070 
0071 static inline int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource,
0072                       bool enable, u64 phys_addr)
0073 {
0074     return -ENOTSUPP;
0075 }
0076 #endif
0077 #endif /* _SC_MISC_API_H */