Handles everything that's not related to the FW, the MMU or the scheduler. This is the block dealing with the GPU property retrieval, the GPU block power on/off logic, and some global operations, like global cache flushing. v6: - Add Maxime's and Heiko's acks v5: - Fix GPU_MODEL() kernel doc - Fix test in panthor_gpu_block_power_off() - Add Steve's R-b v4: - Expose CORE_FEATURES through DEV_QUERY v3: - Add acks for the MIT/GPL2 relicensing - Use macros to extract GPU ID info - Make sure we reset clear pending_reqs bits when wait_event_timeout() times out but the corresponding bit is cleared in GPU_INT_RAWSTAT (can happen if the IRQ is masked or HW takes to long to call the IRQ handler) - GPU_MODEL now takes separate arch and product majors to be more readable. - Drop GPU_IRQ_MCU_STATUS_CHANGED from interrupt mask. - Handle GPU_IRQ_PROTM_FAULT correctly (don't output registers that are not updated for protected interrupts). - Minor code tidy ups Cc: Alexey Sheplyakov <asheplyakov@basealt.ru> # MIT+GPL2 relicensing Co-developed-by: Steven Price <steven.price@arm.com> Signed-off-by: Steven Price <steven.price@arm.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Acked-by: Steven Price <steven.price@arm.com> # MIT+GPL2 relicensing,Arm Acked-by: Grant Likely <grant.likely@linaro.org> # MIT+GPL2 relicensing,Linaro Acked-by: Boris Brezillon <boris.brezillon@collabora.com> # MIT+GPL2 relicensing,Collabora Reviewed-by: Steven Price <steven.price@arm.com> Acked-by: Maxime Ripard <mripard@kernel.org> Acked-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20240229162230.2634044-5-boris.brezillon@collabora.com
52 lines
1.6 KiB
C
52 lines
1.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0 or MIT */
|
|
/* Copyright 2018 Marty E. Plummer <hanetzer@startmail.com> */
|
|
/* Copyright 2019 Collabora ltd. */
|
|
|
|
#ifndef __PANTHOR_GPU_H__
|
|
#define __PANTHOR_GPU_H__
|
|
|
|
struct panthor_device;
|
|
|
|
int panthor_gpu_init(struct panthor_device *ptdev);
|
|
void panthor_gpu_unplug(struct panthor_device *ptdev);
|
|
void panthor_gpu_suspend(struct panthor_device *ptdev);
|
|
void panthor_gpu_resume(struct panthor_device *ptdev);
|
|
|
|
int panthor_gpu_block_power_on(struct panthor_device *ptdev,
|
|
const char *blk_name,
|
|
u32 pwron_reg, u32 pwrtrans_reg,
|
|
u32 rdy_reg, u64 mask, u32 timeout_us);
|
|
int panthor_gpu_block_power_off(struct panthor_device *ptdev,
|
|
const char *blk_name,
|
|
u32 pwroff_reg, u32 pwrtrans_reg,
|
|
u64 mask, u32 timeout_us);
|
|
|
|
/**
|
|
* panthor_gpu_power_on() - Power on the GPU block.
|
|
*
|
|
* Return: 0 on success, a negative error code otherwise.
|
|
*/
|
|
#define panthor_gpu_power_on(ptdev, type, mask, timeout_us) \
|
|
panthor_gpu_block_power_on(ptdev, #type, \
|
|
type ## _PWRON_LO, \
|
|
type ## _PWRTRANS_LO, \
|
|
type ## _READY_LO, \
|
|
mask, timeout_us)
|
|
|
|
/**
|
|
* panthor_gpu_power_off() - Power off the GPU block.
|
|
*
|
|
* Return: 0 on success, a negative error code otherwise.
|
|
*/
|
|
#define panthor_gpu_power_off(ptdev, type, mask, timeout_us) \
|
|
panthor_gpu_block_power_off(ptdev, #type, \
|
|
type ## _PWROFF_LO, \
|
|
type ## _PWRTRANS_LO, \
|
|
mask, timeout_us)
|
|
|
|
int panthor_gpu_l2_power_on(struct panthor_device *ptdev);
|
|
int panthor_gpu_flush_caches(struct panthor_device *ptdev,
|
|
u32 l2, u32 lsc, u32 other);
|
|
int panthor_gpu_soft_reset(struct panthor_device *ptdev);
|
|
|
|
#endif
|