Merge branch 'work.fdpic' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-2.6-microblaze.git] / include / linux / firmware / imx / svc / rm.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2016 Freescale Semiconductor, Inc.
4  * Copyright 2017-2020 NXP
5  *
6  * Header file containing the public API for the System Controller (SC)
7  * Resource Management (RM) function. This includes functions for
8  * partitioning resources, pads, and memory regions.
9  *
10  * RM_SVC (SVC) Resource Management Service
11  *
12  * Module for the Resource Management (RM) service.
13  */
14
15 #ifndef _SC_RM_API_H
16 #define _SC_RM_API_H
17
18 #include <linux/firmware/imx/sci.h>
19
20 /*
21  * This type is used to indicate RPC RM function calls.
22  */
23 enum imx_sc_rm_func {
24         IMX_SC_RM_FUNC_UNKNOWN = 0,
25         IMX_SC_RM_FUNC_PARTITION_ALLOC = 1,
26         IMX_SC_RM_FUNC_SET_CONFIDENTIAL = 31,
27         IMX_SC_RM_FUNC_PARTITION_FREE = 2,
28         IMX_SC_RM_FUNC_GET_DID = 26,
29         IMX_SC_RM_FUNC_PARTITION_STATIC = 3,
30         IMX_SC_RM_FUNC_PARTITION_LOCK = 4,
31         IMX_SC_RM_FUNC_GET_PARTITION = 5,
32         IMX_SC_RM_FUNC_SET_PARENT = 6,
33         IMX_SC_RM_FUNC_MOVE_ALL = 7,
34         IMX_SC_RM_FUNC_ASSIGN_RESOURCE = 8,
35         IMX_SC_RM_FUNC_SET_RESOURCE_MOVABLE = 9,
36         IMX_SC_RM_FUNC_SET_SUBSYS_RSRC_MOVABLE = 28,
37         IMX_SC_RM_FUNC_SET_MASTER_ATTRIBUTES = 10,
38         IMX_SC_RM_FUNC_SET_MASTER_SID = 11,
39         IMX_SC_RM_FUNC_SET_PERIPHERAL_PERMISSIONS = 12,
40         IMX_SC_RM_FUNC_IS_RESOURCE_OWNED = 13,
41         IMX_SC_RM_FUNC_GET_RESOURCE_OWNER = 33,
42         IMX_SC_RM_FUNC_IS_RESOURCE_MASTER = 14,
43         IMX_SC_RM_FUNC_IS_RESOURCE_PERIPHERAL = 15,
44         IMX_SC_RM_FUNC_GET_RESOURCE_INFO = 16,
45         IMX_SC_RM_FUNC_MEMREG_ALLOC = 17,
46         IMX_SC_RM_FUNC_MEMREG_SPLIT = 29,
47         IMX_SC_RM_FUNC_MEMREG_FRAG = 32,
48         IMX_SC_RM_FUNC_MEMREG_FREE = 18,
49         IMX_SC_RM_FUNC_FIND_MEMREG = 30,
50         IMX_SC_RM_FUNC_ASSIGN_MEMREG = 19,
51         IMX_SC_RM_FUNC_SET_MEMREG_PERMISSIONS = 20,
52         IMX_SC_RM_FUNC_IS_MEMREG_OWNED = 21,
53         IMX_SC_RM_FUNC_GET_MEMREG_INFO = 22,
54         IMX_SC_RM_FUNC_ASSIGN_PAD = 23,
55         IMX_SC_RM_FUNC_SET_PAD_MOVABLE = 24,
56         IMX_SC_RM_FUNC_IS_PAD_OWNED = 25,
57         IMX_SC_RM_FUNC_DUMP = 27,
58 };
59
60 #if IS_ENABLED(CONFIG_IMX_SCU)
61 bool imx_sc_rm_is_resource_owned(struct imx_sc_ipc *ipc, u16 resource);
62 #else
63 static inline bool
64 imx_sc_rm_is_resource_owned(struct imx_sc_ipc *ipc, u16 resource)
65 {
66         return true;
67 }
68 #endif
69 #endif