diff options
author | Mahantesh Kumbar <mkumbar@nvidia.com> | 2017-04-25 02:52:56 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-23 04:14:18 -0400 |
commit | be04b9b1b56d6dd478fe521277c079367c03f39d (patch) | |
tree | 779f867a3511743ca776064e09ee88d59f2d24ce /drivers/gpu/nvgpu/include | |
parent | 5efa7c8d5ef74eba4fa33881eb64176f5a97de11 (diff) |
gpu: nvgpu: falcon reset support
- Added flacon reset dependent interface & HAL
methods to perform falcon reset.
- method to wait for idle
- method to reset falcon
- method to set irq
- method to read status of CPU
- Updated falcon ops pointer to point gk20a
falcon HAL methods
- Added members to know support of falcon
& interrupt.
- Added falcon dependency ops member to support
flacon speicifc methods
JIRA NVGPU-99
JIRA NVGPU-101
Change-Id: I411477e5696a61ee73caebfdab625763b522c255
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1469453
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/falcon.h | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/falcon.h b/drivers/gpu/nvgpu/include/nvgpu/falcon.h index 17b811dd..860efa1b 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/falcon.h +++ b/drivers/gpu/nvgpu/include/nvgpu/falcon.h | |||
@@ -14,6 +14,9 @@ | |||
14 | #ifndef __FALCON_H__ | 14 | #ifndef __FALCON_H__ |
15 | #define __FALCON_H__ | 15 | #define __FALCON_H__ |
16 | 16 | ||
17 | #include <nvgpu/types.h> | ||
18 | #include <nvgpu/lock.h> | ||
19 | |||
17 | /* | 20 | /* |
18 | * Falcon Id Defines | 21 | * Falcon Id Defines |
19 | */ | 22 | */ |
@@ -86,16 +89,6 @@ enum flcn_hwcfg_write { | |||
86 | FALCON_ITF_EN | 89 | FALCON_ITF_EN |
87 | }; | 90 | }; |
88 | 91 | ||
89 | /* | ||
90 | * Falcon sub unit Id Defines | ||
91 | */ | ||
92 | enum flcn_unit_status { | ||
93 | IS_FALCON_IN_RESET = 0x0, | ||
94 | IS_FALCON_CPU_HALTED, | ||
95 | IS_FALCON_IDLE, | ||
96 | IS_FALCON_MEM_SURBBING_DONE | ||
97 | }; | ||
98 | |||
99 | #define FALCON_MEM_SCRUBBING_TIMEOUT_MAX 1000 | 92 | #define FALCON_MEM_SCRUBBING_TIMEOUT_MAX 1000 |
100 | #define FALCON_MEM_SCRUBBING_TIMEOUT_DEFAULT 10 | 93 | #define FALCON_MEM_SCRUBBING_TIMEOUT_DEFAULT 10 |
101 | 94 | ||
@@ -128,16 +121,17 @@ struct nvgpu_falcon_version_ops { | |||
128 | void (*write_dmatrfbase)(struct nvgpu_falcon *flcn, u32 addr); | 121 | void (*write_dmatrfbase)(struct nvgpu_falcon *flcn, u32 addr); |
129 | }; | 122 | }; |
130 | 123 | ||
124 | /* ops which are falcon engine specific */ | ||
125 | struct nvgpu_falcon_engine_dependency_ops { | ||
126 | int (*reset_eng)(struct gk20a *g); | ||
127 | }; | ||
128 | |||
131 | struct nvgpu_falcon_ops { | 129 | struct nvgpu_falcon_ops { |
132 | void (*reset)(struct nvgpu_falcon *flcn, bool enable); | 130 | int (*reset)(struct nvgpu_falcon *flcn); |
133 | void (*enable_irq)(struct nvgpu_falcon *flcn, bool enable); | 131 | void (*set_irq)(struct nvgpu_falcon *flcn, bool enable); |
134 | void (*fbif_transcfg)(struct nvgpu_falcon *flcn); | 132 | bool (*is_falcon_cpu_halted)(struct nvgpu_falcon *flcn); |
135 | u32 (*read_hwcfg)(struct nvgpu_falcon *flcn, | 133 | bool (*is_falcon_idle)(struct nvgpu_falcon *flcn); |
136 | enum flcn_hwcfg_read cfg_type); | 134 | bool (*is_falcon_scrubbing_done)(struct nvgpu_falcon *flcn); |
137 | void (*write_hwcfg)(struct nvgpu_falcon *flcn, | ||
138 | enum flcn_hwcfg_write cfg_type, u32 cfg_data); | ||
139 | bool (*get_unit_status)(struct nvgpu_falcon *flcn, | ||
140 | enum flcn_unit_status unit_id); | ||
141 | int (*copy_from_dmem)(struct nvgpu_falcon *flcn, u32 src, u8 *dst, | 135 | int (*copy_from_dmem)(struct nvgpu_falcon *flcn, u32 src, u8 *dst, |
142 | u32 size, u8 port); | 136 | u32 size, u8 port); |
143 | int (*copy_to_dmem)(struct nvgpu_falcon *flcn, u32 dst, u8 *src, | 137 | int (*copy_to_dmem)(struct nvgpu_falcon *flcn, u32 dst, u8 *src, |
@@ -159,20 +153,25 @@ struct nvgpu_falcon { | |||
159 | u32 flcn_id; | 153 | u32 flcn_id; |
160 | u32 flcn_base; | 154 | u32 flcn_base; |
161 | u32 flcn_core_rev; | 155 | u32 flcn_core_rev; |
156 | bool is_falcon_supported; | ||
157 | bool is_interrupt_enabled; | ||
158 | u32 intr_mask; | ||
159 | u32 intr_dest; | ||
162 | bool isr_enabled; | 160 | bool isr_enabled; |
163 | struct nvgpu_mutex isr_mutex; | 161 | struct nvgpu_mutex isr_mutex; |
164 | struct nvgpu_mutex copy_lock; | 162 | struct nvgpu_mutex copy_lock; |
165 | struct nvgpu_falcon_ops flcn_ops; | 163 | struct nvgpu_falcon_ops flcn_ops; |
166 | struct nvgpu_falcon_version_ops flcn_vops; | 164 | struct nvgpu_falcon_version_ops flcn_vops; |
165 | struct nvgpu_falcon_engine_dependency_ops flcn_engine_dep_ops; | ||
167 | }; | 166 | }; |
168 | 167 | ||
169 | int nvgpu_flcn_wait_idle(struct nvgpu_falcon *flcn); | 168 | int nvgpu_flcn_wait_idle(struct nvgpu_falcon *flcn); |
170 | int nvgpu_flcn_enable_hw(struct nvgpu_falcon *flcn, bool enable); | ||
171 | int nvgpu_flcn_reset(struct nvgpu_falcon *flcn); | 169 | int nvgpu_flcn_reset(struct nvgpu_falcon *flcn); |
172 | void nvgpu_flcn_enable_irq(struct nvgpu_falcon *flcn, bool enable); | 170 | void nvgpu_flcn_set_irq(struct nvgpu_falcon *flcn, bool enable, |
173 | void nvgpu_flcn_fbif_transcfg(struct nvgpu_falcon *flcn); | 171 | u32 intr_mask, u32 intr_dest); |
174 | bool nvgpu_flcn_get_unit_status(struct nvgpu_falcon *flcn, | 172 | bool nvgpu_flcn_get_mem_scrubbing_status(struct nvgpu_falcon *flcn); |
175 | enum flcn_unit_status unit_id); | 173 | bool nvgpu_flcn_get_cpu_halted_status(struct nvgpu_falcon *flcn); |
174 | bool nvgpu_flcn_get_idle_status(struct nvgpu_falcon *flcn); | ||
176 | int nvgpu_flcn_copy_from_mem(struct nvgpu_falcon *flcn, | 175 | int nvgpu_flcn_copy_from_mem(struct nvgpu_falcon *flcn, |
177 | enum flcn_mem_type mem_type, u32 src, u8 *dst, u32 size, u8 port); | 176 | enum flcn_mem_type mem_type, u32 src, u8 *dst, u32 size, u8 port); |
178 | int nvgpu_flcn_copy_to_mem(struct nvgpu_falcon *flcn, | 177 | int nvgpu_flcn_copy_to_mem(struct nvgpu_falcon *flcn, |