drivers/gpu/drm/amd/amdgpu/umc_v8_10.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/umc_v8_10.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/umc_v8_10.c- Extension
.c- Size
- 14886 bytes
- Lines
- 459
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
umc_v8_10.hamdgpu_ras.hamdgpu_umc.hamdgpu.humc/umc_8_10_0_offset.humc/umc_8_10_0_sh_mask.h
Detected Declarations
struct channelnum_map_colbitfunction get_umc_v8_10_reg_offsetfunction umc_v8_10_clear_error_count_per_channelfunction umc_v8_10_clear_error_countfunction umc_v8_10_query_correctable_error_countfunction umc_v8_10_query_uncorrectable_error_countfunction umc_v8_10_query_ecc_error_countfunction umc_v8_10_query_ras_error_countfunction umc_v8_10_get_col_bitfunction umc_v8_10_swizzle_mode_na_to_pafunction umc_v8_10_convert_error_addressfunction umc_v8_10_query_error_addressfunction REG_GET_FIELDfunction umc_v8_10_query_ras_error_addressfunction umc_v8_10_err_cnt_init_per_channelfunction umc_v8_10_err_cnt_initfunction umc_v8_10_query_ras_poison_modefunction umc_v8_10_ecc_info_query_correctable_error_countfunction umc_v8_10_ecc_info_query_uncorrectable_error_countfunction REG_GET_FIELDfunction umc_v8_10_ecc_info_query_ecc_error_countfunction umc_v8_10_ecc_info_query_ras_error_countfunction umc_v8_10_ecc_info_query_error_addressfunction REG_GET_FIELDfunction umc_v8_10_ecc_info_query_ras_error_address
Annotated Snippet
struct channelnum_map_colbit {
uint32_t channel_num;
uint32_t col_bit;
};
const struct channelnum_map_colbit umc_v8_10_channelnum_map_colbit_table[] = {
{24, 13},
{20, 13},
{16, 12},
{14, 12},
{12, 12},
{10, 12},
{6, 11},
};
const uint32_t
umc_v8_10_channel_idx_tbl_ext0[]
[UMC_V8_10_UMC_INSTANCE_NUM]
[UMC_V8_10_CHANNEL_INSTANCE_NUM] = {
{{1, 5}, {7, 3}},
{{14, 15}, {13, 12}},
{{10, 11}, {9, 8}},
{{6, 2}, {0, 4}}
};
const uint32_t
umc_v8_10_channel_idx_tbl[]
[UMC_V8_10_UMC_INSTANCE_NUM]
[UMC_V8_10_CHANNEL_INSTANCE_NUM] = {
{{16, 18}, {17, 19}},
{{15, 11}, {3, 7}},
{{1, 5}, {13, 9}},
{{23, 21}, {22, 20}},
{{0, 4}, {12, 8}},
{{14, 10}, {2, 6}}
};
static inline uint32_t get_umc_v8_10_reg_offset(struct amdgpu_device *adev,
uint32_t node_inst,
uint32_t umc_inst,
uint32_t ch_inst)
{
return adev->umc.channel_offs * ch_inst + UMC_8_INST_DIST * umc_inst +
UMC_8_NODE_DIST * node_inst;
}
static int umc_v8_10_clear_error_count_per_channel(struct amdgpu_device *adev,
uint32_t node_inst, uint32_t umc_inst,
uint32_t ch_inst, void *data)
{
uint32_t ecc_err_cnt_addr;
uint32_t umc_reg_offset =
get_umc_v8_10_reg_offset(adev, node_inst, umc_inst, ch_inst);
ecc_err_cnt_addr =
SOC15_REG_OFFSET(UMC, 0, regUMCCH0_0_GeccErrCnt);
/* clear error count */
WREG32_PCIE((ecc_err_cnt_addr + umc_reg_offset) * 4,
UMC_V8_10_CE_CNT_INIT);
return 0;
}
static void umc_v8_10_clear_error_count(struct amdgpu_device *adev)
{
amdgpu_umc_loop_channels(adev,
umc_v8_10_clear_error_count_per_channel, NULL);
}
static void umc_v8_10_query_correctable_error_count(struct amdgpu_device *adev,
uint32_t umc_reg_offset,
unsigned long *error_count)
{
uint64_t mc_umc_status;
uint32_t mc_umc_status_addr;
/* UMC 8_10 registers */
mc_umc_status_addr =
SOC15_REG_OFFSET(UMC, 0, regMCA_UMC_UMC0_MCUMC_STATUST0);
/* Rely on MCUMC_STATUS for correctable error counter
* MCUMC_STATUS is a 64 bit register
*/
mc_umc_status = RREG64_PCIE((mc_umc_status_addr + umc_reg_offset) * 4);
if (REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, Val) == 1 &&
REG_GET_FIELD(mc_umc_status, MCA_UMC_UMC0_MCUMC_STATUST0, CECC) == 1)
*error_count += 1;
}
Annotation
- Immediate include surface: `umc_v8_10.h`, `amdgpu_ras.h`, `amdgpu_umc.h`, `amdgpu.h`, `umc/umc_8_10_0_offset.h`, `umc/umc_8_10_0_sh_mask.h`.
- Detected declarations: `struct channelnum_map_colbit`, `function get_umc_v8_10_reg_offset`, `function umc_v8_10_clear_error_count_per_channel`, `function umc_v8_10_clear_error_count`, `function umc_v8_10_query_correctable_error_count`, `function umc_v8_10_query_uncorrectable_error_count`, `function umc_v8_10_query_ecc_error_count`, `function umc_v8_10_query_ras_error_count`, `function umc_v8_10_get_col_bit`, `function umc_v8_10_swizzle_mode_na_to_pa`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.