2019-07-23 18:42:03 +07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Advanced Micro Devices, Inc.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included
|
|
|
|
* in all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
|
|
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
#ifndef __AMDGPU_UMC_H__
|
|
|
|
#define __AMDGPU_UMC_H__
|
|
|
|
|
|
|
|
struct amdgpu_umc_funcs {
|
2019-09-06 13:32:14 +07:00
|
|
|
void (*err_cnt_init)(struct amdgpu_device *adev);
|
2019-09-12 17:54:33 +07:00
|
|
|
int (*ras_late_init)(struct amdgpu_device *adev);
|
2019-07-23 18:42:03 +07:00
|
|
|
void (*query_ras_error_count)(struct amdgpu_device *adev,
|
|
|
|
void *ras_error_status);
|
2019-07-22 17:30:59 +07:00
|
|
|
void (*query_ras_error_address)(struct amdgpu_device *adev,
|
|
|
|
void *ras_error_status);
|
2019-09-24 15:08:00 +07:00
|
|
|
void (*init_registers)(struct amdgpu_device *adev);
|
2019-07-23 18:42:03 +07:00
|
|
|
};
|
|
|
|
|
2019-07-23 11:18:39 +07:00
|
|
|
struct amdgpu_umc {
|
|
|
|
/* max error count in one ras query call */
|
|
|
|
uint32_t max_ras_err_cnt_per_query;
|
2019-07-29 13:10:54 +07:00
|
|
|
/* number of umc channel instance with memory map register access */
|
|
|
|
uint32_t channel_inst_num;
|
|
|
|
/* number of umc instance with memory map register access */
|
|
|
|
uint32_t umc_inst_num;
|
|
|
|
/* UMC regiser per channel offset */
|
|
|
|
uint32_t channel_offs;
|
|
|
|
/* channel index table of interleaved memory */
|
|
|
|
const uint32_t *channel_idx_tbl;
|
2019-09-12 15:34:08 +07:00
|
|
|
struct ras_common_if *ras_if;
|
2019-07-29 13:10:54 +07:00
|
|
|
|
2019-07-23 11:18:39 +07:00
|
|
|
const struct amdgpu_umc_funcs *funcs;
|
|
|
|
};
|
|
|
|
|
2019-09-12 17:54:33 +07:00
|
|
|
int amdgpu_umc_ras_late_init(struct amdgpu_device *adev);
|
2019-09-18 16:46:42 +07:00
|
|
|
void amdgpu_umc_ras_fini(struct amdgpu_device *adev);
|
2019-09-12 10:11:25 +07:00
|
|
|
int amdgpu_umc_process_ras_data_cb(struct amdgpu_device *adev,
|
|
|
|
void *ras_error_status,
|
|
|
|
struct amdgpu_iv_entry *entry);
|
|
|
|
int amdgpu_umc_process_ecc_irq(struct amdgpu_device *adev,
|
|
|
|
struct amdgpu_irq_src *source,
|
|
|
|
struct amdgpu_iv_entry *entry);
|
2019-07-23 18:42:03 +07:00
|
|
|
#endif
|