diff options
author | Mahantesh Kumbar <mkumbar@nvidia.com> | 2018-09-17 00:46:51 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-28 13:24:47 -0400 |
commit | 18f80ca25c11b21f9212c97ba5a8a26396cbf2b2 (patch) | |
tree | 4ce326467c93f4cf1838e71d702abc31aac904a8 /drivers/gpu/nvgpu/include/nvgpu/sec2if/sec2_if_acr.h | |
parent | 3bbd40366a0bdc54d882fc420e82d54b496dfad7 (diff) |
gpu: nvgpu: SEC2 RTOS interface headers
-Created command/message nv_flcn_cmd/msg_sec2
data struct to communicate between nvgpu<->sec2-rtos
in header file sec2_cmd_if.h
-Created acr command/message nv_sec2_acr_cmd/msg
to perform operation like bootstrap LSF flacon
in header file sec2_if_acr.h
-Created defines common SEC2 defines to use across
multiple operation related to SEC2-RTOS in header file
sec2_if_cmn.h
-Created data struct sec2_init_msg_sec2_init to receive
message from SEC2-RTOS to init queues, debug
data in header file sec2_if_sec2.h
JIRA NVGPUT-81
Change-Id: I4efbca20de7a2483d17de97841ada5336189e2b8
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1827806
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include/nvgpu/sec2if/sec2_if_acr.h')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/sec2if/sec2_if_acr.h | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/sec2if/sec2_if_acr.h b/drivers/gpu/nvgpu/include/nvgpu/sec2if/sec2_if_acr.h new file mode 100644 index 00000000..5b41958b --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/sec2if/sec2_if_acr.h | |||
@@ -0,0 +1,96 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
20 | * DEALINGS IN THE SOFTWARE. | ||
21 | */ | ||
22 | |||
23 | #ifndef NVGPU_SEC2_IF_ACR_H | ||
24 | #define NVGPU_SEC2_IF_ACR_H | ||
25 | |||
26 | #include <nvgpu/types.h> | ||
27 | |||
28 | /* | ||
29 | * ACR Command Types | ||
30 | * _BOOT_FALCON | ||
31 | * NVGPU sends a Falcon ID and LSB offset to SEC2 to boot | ||
32 | * the falcon in LS mode. | ||
33 | * SEC2 needs to hanlde the case since UCODE of falcons are | ||
34 | * stored in secured location on FB. | ||
35 | */ | ||
36 | #define NV_SEC2_ACR_CMD_ID_BOOTSTRAP_FALCON 0U | ||
37 | |||
38 | /* nvgpu provides the Falcon ID to bootstrap */ | ||
39 | struct nv_sec2_acr_cmd_bootstrap_falcon { | ||
40 | /* Command must be first as this struct is the part of union */ | ||
41 | u8 cmd_type; | ||
42 | |||
43 | /* Additional bootstrapping flags */ | ||
44 | u32 flags; | ||
45 | |||
46 | /* ID to identify Falcon, ref LSF_FALCON_ID_<XYZ> */ | ||
47 | u32 falcon_id; | ||
48 | }; | ||
49 | |||
50 | #define NV_SEC2_ACR_CMD_BOOTSTRAP_FALCON_FLAGS_RESET 0U | ||
51 | #define NV_SEC2_ACR_CMD_BOOTSTRAP_FALCON_FLAGS_RESET_NO 1U | ||
52 | #define NV_SEC2_ACR_CMD_BOOTSTRAP_FALCON_FLAGS_RESET_YES 0U | ||
53 | |||
54 | /* A union of all ACR Commands */ | ||
55 | union nv_sec2_acr_cmd { | ||
56 | /* Command type */ | ||
57 | u8 cmd_type; | ||
58 | |||
59 | /* Bootstrap Falcon */ | ||
60 | struct nv_sec2_acr_cmd_bootstrap_falcon bootstrap_falcon; | ||
61 | }; | ||
62 | |||
63 | /* ACR Message Status */ | ||
64 | |||
65 | /* Returns the Bootstrapped falcon ID to RM */ | ||
66 | #define NV_SEC2_ACR_MSG_ID_BOOTSTRAP_FALCON 0U | ||
67 | |||
68 | /* Returns the Error Status for Invalid Command */ | ||
69 | #define NV_SEC2_ACR_MSG_ID_INVALID_COMMAND 2U | ||
70 | |||
71 | /* | ||
72 | * SEC2 notifies nvgpu about bootstrap status of falcon | ||
73 | */ | ||
74 | struct nv_sec2_acr_msg_bootstrap_falcon { | ||
75 | /* Message must be at start */ | ||
76 | u8 msg_type; | ||
77 | |||
78 | /* Falcon Error Code returned by message */ | ||
79 | u32 error_code; | ||
80 | |||
81 | /* Bootstrapped falcon ID by ACR */ | ||
82 | u32 falcon_id; | ||
83 | } ; | ||
84 | |||
85 | /* | ||
86 | * A union of all ACR Messages. | ||
87 | */ | ||
88 | union nv_sec2_acr_msg { | ||
89 | /* Message type */ | ||
90 | u8 msg_type; | ||
91 | |||
92 | /* Bootstrap details of falcon and status code */ | ||
93 | struct nv_sec2_acr_msg_bootstrap_falcon msg_flcn; | ||
94 | }; | ||
95 | |||
96 | #endif /* NVGPU_SEC2_IF_ACR_H */ | ||