1 1.1 riastrad /* $NetBSD: amdgpu_df.h,v 1.2 2021/12/18 23:44:58 riastradh Exp $ */ 2 1.1 riastrad 3 1.1 riastrad /* 4 1.1 riastrad * Copyright 2020 Advanced Micro Devices, Inc. 5 1.1 riastrad * 6 1.1 riastrad * Permission is hereby granted, free of charge, to any person obtaining a 7 1.1 riastrad * copy of this software and associated documentation files (the "Software"), 8 1.1 riastrad * to deal in the Software without restriction, including without limitation 9 1.1 riastrad * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 1.1 riastrad * and/or sell copies of the Software, and to permit persons to whom the 11 1.1 riastrad * Software is furnished to do so, subject to the following conditions: 12 1.1 riastrad * 13 1.1 riastrad * The above copyright notice and this permission notice shall be included in 14 1.1 riastrad * all copies or substantial portions of the Software. 15 1.1 riastrad * 16 1.1 riastrad * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 1.1 riastrad * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 1.1 riastrad * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 1.1 riastrad * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 1.1 riastrad * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 1.1 riastrad * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 1.1 riastrad * OTHER DEALINGS IN THE SOFTWARE. 23 1.1 riastrad * 24 1.1 riastrad */ 25 1.1 riastrad 26 1.1 riastrad #ifndef __AMDGPU_DF_H__ 27 1.1 riastrad #define __AMDGPU_DF_H__ 28 1.1 riastrad 29 1.1 riastrad struct amdgpu_df_hash_status { 30 1.1 riastrad bool hash_64k; 31 1.1 riastrad bool hash_2m; 32 1.1 riastrad bool hash_1g; 33 1.1 riastrad }; 34 1.1 riastrad 35 1.1 riastrad struct amdgpu_df_funcs { 36 1.1 riastrad void (*sw_init)(struct amdgpu_device *adev); 37 1.1 riastrad void (*sw_fini)(struct amdgpu_device *adev); 38 1.1 riastrad void (*enable_broadcast_mode)(struct amdgpu_device *adev, 39 1.1 riastrad bool enable); 40 1.1 riastrad u32 (*get_fb_channel_number)(struct amdgpu_device *adev); 41 1.1 riastrad u32 (*get_hbm_channel_number)(struct amdgpu_device *adev); 42 1.1 riastrad void (*update_medium_grain_clock_gating)(struct amdgpu_device *adev, 43 1.1 riastrad bool enable); 44 1.1 riastrad void (*get_clockgating_state)(struct amdgpu_device *adev, 45 1.1 riastrad u32 *flags); 46 1.1 riastrad void (*enable_ecc_force_par_wr_rmw)(struct amdgpu_device *adev, 47 1.1 riastrad bool enable); 48 1.1 riastrad int (*pmc_start)(struct amdgpu_device *adev, uint64_t config, 49 1.1 riastrad int is_enable); 50 1.1 riastrad int (*pmc_stop)(struct amdgpu_device *adev, uint64_t config, 51 1.1 riastrad int is_disable); 52 1.1 riastrad void (*pmc_get_count)(struct amdgpu_device *adev, uint64_t config, 53 1.1 riastrad uint64_t *count); 54 1.1 riastrad uint64_t (*get_fica)(struct amdgpu_device *adev, uint32_t ficaa_val); 55 1.1 riastrad void (*set_fica)(struct amdgpu_device *adev, uint32_t ficaa_val, 56 1.1 riastrad uint32_t ficadl_val, uint32_t ficadh_val); 57 1.1 riastrad uint64_t (*get_dram_base_addr)(struct amdgpu_device *adev, 58 1.1 riastrad uint32_t df_inst); 59 1.1 riastrad uint32_t (*get_df_inst_id)(struct amdgpu_device *adev); 60 1.1 riastrad }; 61 1.1 riastrad 62 1.1 riastrad struct amdgpu_df { 63 1.1 riastrad struct amdgpu_df_hash_status hash_status; 64 1.1 riastrad const struct amdgpu_df_funcs *funcs; 65 1.1 riastrad }; 66 1.1 riastrad 67 1.1 riastrad #endif /* __AMDGPU_DF_H__ */ 68