diff options
author | Jordan Crouse <jcrouse@codeaurora.org> | 2016-11-28 12:28:34 -0700 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2016-11-28 15:14:16 -0500 |
commit | 2401a008461481387741bacf7318d13af2c2055f (patch) | |
tree | 265b4b900cf83397cffb0385c68650e28a1760fc /drivers/gpu/drm/msm/adreno/a5xx_gpu.h | |
parent | b5f103ab98c77ca5998b39533c2b46959fbd37d9 (diff) | |
download | blackbird-obmc-linux-2401a008461481387741bacf7318d13af2c2055f.tar.gz blackbird-obmc-linux-2401a008461481387741bacf7318d13af2c2055f.zip |
drm/msm: gpu: Add support for the GPMU
Most 5XX targets have GPMU (Graphics Power Management Unit) that
handles a lot of the heavy lifting for power management including
thermal and limits management and dynamic power collapse. While
the GPMU itself is optional, it is usually nessesary to hit
aggressive power targets.
The GPMU firmware needs to be loaded into the GPMU at init time via a
shared hardware block of registers. Using the GPU to write the microcode
is more efficient than using the CPU so at first load create an indirect
buffer that can be executed during subsequent initalization sequences.
After loading the GPMU gets initalized through a shared register
interface and then we mostly get out of its way and let it do
its thing.
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/adreno/a5xx_gpu.h')
-rw-r--r-- | drivers/gpu/drm/msm/adreno/a5xx_gpu.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.h b/drivers/gpu/drm/msm/adreno/a5xx_gpu.h index 39a07f400b35..1590f845d554 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.h +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.h @@ -30,8 +30,31 @@ struct a5xx_gpu { struct drm_gem_object *pfp_bo; uint64_t pfp_iova; + + struct drm_gem_object *gpmu_bo; + uint64_t gpmu_iova; + uint32_t gpmu_dwords; + + uint32_t lm_leakage; }; #define to_a5xx_gpu(x) container_of(x, struct a5xx_gpu, base) +int a5xx_power_init(struct msm_gpu *gpu); +void a5xx_gpmu_ucode_init(struct msm_gpu *gpu); + +static inline int spin_usecs(struct msm_gpu *gpu, uint32_t usecs, + uint32_t reg, uint32_t mask, uint32_t value) +{ + while (usecs--) { + udelay(1); + if ((gpu_read(gpu, reg) & mask) == value) + return 0; + cpu_relax(); + } + + return -ETIMEDOUT; +} + + #endif /* __A5XX_GPU_H__ */ |