diff options
Diffstat (limited to 'drivers/gpu/nvgpu/include/nvgpu/acr/nvgpu_acr.h')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/acr/nvgpu_acr.h | 108 |
1 files changed, 91 insertions, 17 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/acr/nvgpu_acr.h b/drivers/gpu/nvgpu/include/nvgpu/acr/nvgpu_acr.h index a9ed6e68..5fb26e1a 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/acr/nvgpu_acr.h +++ b/drivers/gpu/nvgpu/include/nvgpu/acr/nvgpu_acr.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -23,6 +23,8 @@ | |||
23 | #ifndef __NVGPU_ACR_H__ | 23 | #ifndef __NVGPU_ACR_H__ |
24 | #define __NVGPU_ACR_H__ | 24 | #define __NVGPU_ACR_H__ |
25 | 25 | ||
26 | #include <nvgpu/falcon.h> | ||
27 | |||
26 | #include "gk20a/mm_gk20a.h" | 28 | #include "gk20a/mm_gk20a.h" |
27 | 29 | ||
28 | #include "acr_lsfm.h" | 30 | #include "acr_lsfm.h" |
@@ -31,6 +33,13 @@ | |||
31 | #include "acr_objflcn.h" | 33 | #include "acr_objflcn.h" |
32 | 34 | ||
33 | struct nvgpu_firmware; | 35 | struct nvgpu_firmware; |
36 | struct gk20a; | ||
37 | struct hs_acr_ops; | ||
38 | struct hs_acr; | ||
39 | struct nvgpu_acr; | ||
40 | |||
41 | #define HSBIN_ACR_BL_UCODE_IMAGE "pmu_bl.bin" | ||
42 | #define HSBIN_ACR_UCODE_IMAGE "acr_ucode.bin" | ||
34 | 43 | ||
35 | #define MAX_SUPPORTED_LSFM 3 /*PMU, FECS, GPCCS*/ | 44 | #define MAX_SUPPORTED_LSFM 3 /*PMU, FECS, GPCCS*/ |
36 | 45 | ||
@@ -77,29 +86,94 @@ struct wpr_carveout_info { | |||
77 | u64 size; | 86 | u64 size; |
78 | }; | 87 | }; |
79 | 88 | ||
80 | struct acr_desc { | 89 | /* ACR interfaces */ |
81 | struct nvgpu_mem ucode_blob; | 90 | |
82 | struct nvgpu_mem wpr_dummy; | 91 | struct hs_flcn_bl { |
83 | struct bin_hdr *bl_bin_hdr; | 92 | char *bl_fw_name; |
84 | struct hsflcn_bl_desc *pmu_hsbl_desc; | 93 | struct nvgpu_firmware *hs_bl_fw; |
85 | struct bin_hdr *hsbin_hdr; | 94 | struct hsflcn_bl_desc *hs_bl_desc; |
86 | struct acr_fw_header *fw_hdr; | 95 | struct bin_hdr *hs_bl_bin_hdr; |
87 | u32 pmu_args; | 96 | struct nvgpu_mem hs_bl_ucode; |
97 | }; | ||
98 | |||
99 | struct hs_acr { | ||
100 | u32 acr_type; | ||
101 | |||
102 | /* HS bootloader to validate & load ACR ucode */ | ||
103 | struct hs_flcn_bl acr_hs_bl; | ||
104 | |||
105 | /* ACR ucode */ | ||
106 | char *acr_fw_name; | ||
88 | struct nvgpu_firmware *acr_fw; | 107 | struct nvgpu_firmware *acr_fw; |
89 | union{ | ||
90 | struct flcn_acr_desc *acr_dmem_desc; | ||
91 | struct flcn_acr_desc_v1 *acr_dmem_desc_v1; | ||
92 | }; | ||
93 | struct nvgpu_mem acr_ucode; | 108 | struct nvgpu_mem acr_ucode; |
94 | struct nvgpu_firmware *hsbl_fw; | 109 | |
95 | struct nvgpu_mem hsbl_ucode; | ||
96 | union { | 110 | union { |
97 | struct flcn_bl_dmem_desc bl_dmem_desc; | 111 | struct flcn_bl_dmem_desc bl_dmem_desc; |
98 | struct flcn_bl_dmem_desc_v1 bl_dmem_desc_v1; | 112 | struct flcn_bl_dmem_desc_v1 bl_dmem_desc_v1; |
99 | }; | 113 | }; |
114 | |||
115 | void *ptr_bl_dmem_desc; | ||
116 | u32 bl_dmem_desc_size; | ||
117 | |||
118 | union{ | ||
119 | struct flcn_acr_desc *acr_dmem_desc; | ||
120 | struct flcn_acr_desc_v1 *acr_dmem_desc_v1; | ||
121 | }; | ||
122 | |||
123 | /* Falcon used to execute ACR ucode */ | ||
124 | struct nvgpu_falcon *acr_flcn; | ||
125 | |||
126 | int (*acr_flcn_setup_hw_and_bl_bootstrap)(struct gk20a *g, | ||
127 | struct hs_acr *acr_desc, | ||
128 | struct nvgpu_falcon_bl_info *bl_info); | ||
129 | }; | ||
130 | |||
131 | #define ACR_DEFAULT 0U | ||
132 | #define ACR_AHESASC 1U | ||
133 | #define ACR_ASB 2U | ||
134 | |||
135 | struct nvgpu_acr { | ||
136 | struct gk20a *g; | ||
137 | |||
138 | u32 bootstrap_owner; | ||
139 | u32 max_supported_lsfm; | ||
140 | u32 capabilities; | ||
141 | |||
142 | /* | ||
143 | * non-wpr space to hold LSF ucodes, | ||
144 | * ACR does copy ucode from non-wpr to wpr | ||
145 | */ | ||
146 | struct nvgpu_mem ucode_blob; | ||
147 | /* | ||
148 | * Even though this mem_desc wouldn't be used, | ||
149 | * the wpr region needs to be reserved in the | ||
150 | * allocator in dGPU case. | ||
151 | */ | ||
152 | struct nvgpu_mem wpr_dummy; | ||
153 | |||
154 | /* ACR member for different types of ucode */ | ||
155 | /* For older dgpu/tegra ACR cuode */ | ||
156 | struct hs_acr acr; | ||
157 | /* ACR load split feature support */ | ||
158 | struct hs_acr acr_ahesasc; | ||
159 | struct hs_acr acr_asb; | ||
160 | |||
161 | u32 pmu_args; | ||
100 | struct nvgpu_firmware *pmu_fw; | 162 | struct nvgpu_firmware *pmu_fw; |
101 | struct nvgpu_firmware *pmu_desc; | 163 | struct nvgpu_firmware *pmu_desc; |
102 | u32 capabilities; | ||
103 | }; | ||
104 | 164 | ||
165 | int (*prepare_ucode_blob)(struct gk20a *g, struct nvgpu_acr *acr); | ||
166 | void (*get_wpr_info)(struct gk20a *g, struct wpr_carveout_info *inf); | ||
167 | int (*alloc_blob_space)(struct gk20a *g, size_t size, | ||
168 | struct nvgpu_mem *mem); | ||
169 | int (*patch_wpr_info_to_ucode)(struct gk20a *g, struct nvgpu_acr *acr, | ||
170 | struct hs_acr *acr_desc, bool is_recovery); | ||
171 | int (*acr_fill_bl_dmem_desc)(struct gk20a *g, | ||
172 | struct nvgpu_acr *acr, struct hs_acr *acr_desc, | ||
173 | u32 *acr_ucode_header); | ||
174 | int (*bootstrap_hs_acr)(struct gk20a *g, struct nvgpu_acr *acr, | ||
175 | struct hs_acr *acr_desc); | ||
176 | |||
177 | void (*remove_support)(struct nvgpu_acr *acr); | ||
178 | }; | ||
105 | #endif /*__NVGPU_ACR_H__*/ | 179 | #endif /*__NVGPU_ACR_H__*/ |