| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* |
| 3 | * Copyright (C) 2020-2025 Intel Corporation |
| 4 | */ |
| 5 | |
| 6 | #ifndef __IVPU_HW_BTRS_H__ |
| 7 | #define __IVPU_HW_BTRS_H__ |
| 8 | |
| 9 | #include "ivpu_drv.h" |
| 10 | #include "ivpu_hw_37xx_reg.h" |
| 11 | #include "ivpu_hw_40xx_reg.h" |
| 12 | #include "ivpu_hw_reg_io.h" |
| 13 | |
| 14 | #define PLL_PROFILING_FREQ_DEFAULT 38400000 |
| 15 | #define PLL_PROFILING_FREQ_HIGH 400000000 |
| 16 | |
| 17 | #define DCT_DEFAULT_ACTIVE_PERCENT 30u |
| 18 | #define DCT_PERIOD_US 35300u |
| 19 | |
| 20 | int ivpu_hw_btrs_info_init(struct ivpu_device *vdev); |
| 21 | void ivpu_hw_btrs_freq_ratios_init(struct ivpu_device *vdev); |
| 22 | int ivpu_hw_btrs_irqs_clear_with_0_mtl(struct ivpu_device *vdev); |
| 23 | int ivpu_hw_btrs_wp_drive(struct ivpu_device *vdev, bool enable); |
| 24 | int ivpu_hw_btrs_wait_for_clock_res_own_ack(struct ivpu_device *vdev); |
| 25 | int ivpu_hw_btrs_d0i3_enable(struct ivpu_device *vdev); |
| 26 | int ivpu_hw_btrs_d0i3_disable(struct ivpu_device *vdev); |
| 27 | void ivpu_hw_btrs_set_port_arbitration_weights_lnl(struct ivpu_device *vdev); |
| 28 | bool ivpu_hw_btrs_is_idle(struct ivpu_device *vdev); |
| 29 | int ivpu_hw_btrs_wait_for_idle(struct ivpu_device *vdev); |
| 30 | int ivpu_hw_btrs_ip_reset(struct ivpu_device *vdev); |
| 31 | void ivpu_hw_btrs_profiling_freq_reg_set_lnl(struct ivpu_device *vdev); |
| 32 | void ivpu_hw_btrs_ats_print_lnl(struct ivpu_device *vdev); |
| 33 | void ivpu_hw_btrs_clock_relinquish_disable_lnl(struct ivpu_device *vdev); |
| 34 | u32 ivpu_hw_btrs_dpu_max_freq_get(struct ivpu_device *vdev); |
| 35 | u32 ivpu_hw_btrs_dpu_freq_get(struct ivpu_device *vdev); |
| 36 | bool ivpu_hw_btrs_irq_handler_mtl(struct ivpu_device *vdev, int irq); |
| 37 | bool ivpu_hw_btrs_irq_handler_lnl(struct ivpu_device *vdev, int irq); |
| 38 | int ivpu_hw_btrs_dct_get_request(struct ivpu_device *vdev, bool *enable); |
| 39 | void ivpu_hw_btrs_dct_set_status(struct ivpu_device *vdev, bool enable, u8 active_percent); |
| 40 | u32 ivpu_hw_btrs_telemetry_offset_get(struct ivpu_device *vdev); |
| 41 | u32 ivpu_hw_btrs_telemetry_size_get(struct ivpu_device *vdev); |
| 42 | u32 ivpu_hw_btrs_telemetry_enable_get(struct ivpu_device *vdev); |
| 43 | void ivpu_hw_btrs_global_int_enable(struct ivpu_device *vdev); |
| 44 | void ivpu_hw_btrs_global_int_disable(struct ivpu_device *vdev); |
| 45 | void ivpu_hw_btrs_irq_enable(struct ivpu_device *vdev); |
| 46 | void ivpu_hw_btrs_irq_disable(struct ivpu_device *vdev); |
| 47 | void ivpu_hw_btrs_diagnose_failure(struct ivpu_device *vdev); |
| 48 | int ivpu_hw_btrs_platform_read(struct ivpu_device *vdev); |
| 49 | |
| 50 | #endif /* __IVPU_HW_BTRS_H__ */ |
| 51 | |