Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * Copyright (C) 2016 Freescale Semiconductor, Inc.
0004  * Copyright 2017-2020 NXP
0005  *
0006  * Header file containing the public API for the System Controller (SC)
0007  * Resource Management (RM) function. This includes functions for
0008  * partitioning resources, pads, and memory regions.
0009  *
0010  * RM_SVC (SVC) Resource Management Service
0011  *
0012  * Module for the Resource Management (RM) service.
0013  */
0014 
0015 #ifndef _SC_RM_API_H
0016 #define _SC_RM_API_H
0017 
0018 #include <linux/firmware/imx/sci.h>
0019 
0020 /*
0021  * This type is used to indicate RPC RM function calls.
0022  */
0023 enum imx_sc_rm_func {
0024     IMX_SC_RM_FUNC_UNKNOWN = 0,
0025     IMX_SC_RM_FUNC_PARTITION_ALLOC = 1,
0026     IMX_SC_RM_FUNC_SET_CONFIDENTIAL = 31,
0027     IMX_SC_RM_FUNC_PARTITION_FREE = 2,
0028     IMX_SC_RM_FUNC_GET_DID = 26,
0029     IMX_SC_RM_FUNC_PARTITION_STATIC = 3,
0030     IMX_SC_RM_FUNC_PARTITION_LOCK = 4,
0031     IMX_SC_RM_FUNC_GET_PARTITION = 5,
0032     IMX_SC_RM_FUNC_SET_PARENT = 6,
0033     IMX_SC_RM_FUNC_MOVE_ALL = 7,
0034     IMX_SC_RM_FUNC_ASSIGN_RESOURCE = 8,
0035     IMX_SC_RM_FUNC_SET_RESOURCE_MOVABLE = 9,
0036     IMX_SC_RM_FUNC_SET_SUBSYS_RSRC_MOVABLE = 28,
0037     IMX_SC_RM_FUNC_SET_MASTER_ATTRIBUTES = 10,
0038     IMX_SC_RM_FUNC_SET_MASTER_SID = 11,
0039     IMX_SC_RM_FUNC_SET_PERIPHERAL_PERMISSIONS = 12,
0040     IMX_SC_RM_FUNC_IS_RESOURCE_OWNED = 13,
0041     IMX_SC_RM_FUNC_GET_RESOURCE_OWNER = 33,
0042     IMX_SC_RM_FUNC_IS_RESOURCE_MASTER = 14,
0043     IMX_SC_RM_FUNC_IS_RESOURCE_PERIPHERAL = 15,
0044     IMX_SC_RM_FUNC_GET_RESOURCE_INFO = 16,
0045     IMX_SC_RM_FUNC_MEMREG_ALLOC = 17,
0046     IMX_SC_RM_FUNC_MEMREG_SPLIT = 29,
0047     IMX_SC_RM_FUNC_MEMREG_FRAG = 32,
0048     IMX_SC_RM_FUNC_MEMREG_FREE = 18,
0049     IMX_SC_RM_FUNC_FIND_MEMREG = 30,
0050     IMX_SC_RM_FUNC_ASSIGN_MEMREG = 19,
0051     IMX_SC_RM_FUNC_SET_MEMREG_PERMISSIONS = 20,
0052     IMX_SC_RM_FUNC_IS_MEMREG_OWNED = 21,
0053     IMX_SC_RM_FUNC_GET_MEMREG_INFO = 22,
0054     IMX_SC_RM_FUNC_ASSIGN_PAD = 23,
0055     IMX_SC_RM_FUNC_SET_PAD_MOVABLE = 24,
0056     IMX_SC_RM_FUNC_IS_PAD_OWNED = 25,
0057     IMX_SC_RM_FUNC_DUMP = 27,
0058 };
0059 
0060 #if IS_ENABLED(CONFIG_IMX_SCU)
0061 bool imx_sc_rm_is_resource_owned(struct imx_sc_ipc *ipc, u16 resource);
0062 int imx_sc_rm_get_resource_owner(struct imx_sc_ipc *ipc, u16 resource, u8 *pt);
0063 #else
0064 static inline bool
0065 imx_sc_rm_is_resource_owned(struct imx_sc_ipc *ipc, u16 resource)
0066 {
0067     return true;
0068 }
0069 static inline int imx_sc_rm_get_resource_owner(struct imx_sc_ipc *ipc, u16 resource, u8 *pt)
0070 {
0071     return -EOPNOTSUPP;
0072 }
0073 #endif
0074 #endif