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