drivers/gpu/drm/amd/amdgpu/mmhub_v1_7.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/mmhub_v1_7.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/mmhub_v1_7.c- Extension
.c- Size
- 51081 bytes
- Lines
- 1372
- 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
amdgpu.hamdgpu_ras.hmmhub_v1_7.hmmhub/mmhub_1_7_offset.hmmhub/mmhub_1_7_sh_mask.hvega10_enum.hsoc15_common.hsoc15.h
Detected Declarations
function filesfunction mmhub_v1_7_setup_vm_pt_regsfunction mmhub_v1_7_init_gart_aperture_regsfunction memoryfunction mmhub_v1_7_init_system_aperture_regsfunction mmhub_v1_7_init_tlb_regsfunction mmhub_v1_7_init_snoop_override_regsfunction mmhub_v1_7_init_cache_regsfunction mmhub_v1_7_enable_system_domainfunction mmhub_v1_7_disable_identity_aperturefunction mmhub_v1_7_setup_vmid_configfunction mmhub_v1_7_program_invalidationfunction mmhub_v1_7_gart_enablefunction mmhub_v1_7_gart_disablefunction mmhub_v1_7_set_fault_enable_defaultfunction mmhub_v1_7_initfunction mmhub_v1_7_update_medium_grain_clock_gatingfunction mmhub_v1_7_update_medium_grain_light_sleepfunction mmhub_v1_7_set_clockgatingfunction mmhub_v1_7_get_clockgatingfunction mmhub_v1_7_get_ras_error_countfunction mmhub_v1_7_query_ras_error_countfunction mmhub_v1_7_reset_ras_error_countfunction mmhub_v1_7_query_ras_error_statusfunction mmhub_v1_7_reset_ras_error_status
Annotated Snippet
if (sec_cnt) {
dev_info(adev->dev, "MMHUB SubBlock %s, SEC %d\n",
mmhub_v1_7_ras_fields[i].name,
sec_cnt);
*sec_count += sec_cnt;
}
ded_cnt = (value &
mmhub_v1_7_ras_fields[i].ded_count_mask) >>
mmhub_v1_7_ras_fields[i].ded_count_shift;
if (ded_cnt) {
dev_info(adev->dev, "MMHUB SubBlock %s, DED %d\n",
mmhub_v1_7_ras_fields[i].name,
ded_cnt);
*ded_count += ded_cnt;
}
}
return 0;
}
static void mmhub_v1_7_query_ras_error_count(struct amdgpu_device *adev,
void *ras_error_status)
{
struct ras_err_data *err_data = (struct ras_err_data *)ras_error_status;
uint32_t sec_count = 0, ded_count = 0;
uint32_t i;
uint32_t reg_value;
err_data->ue_count = 0;
err_data->ce_count = 0;
for (i = 0; i < ARRAY_SIZE(mmhub_v1_7_edc_cnt_regs); i++) {
reg_value =
RREG32(SOC15_REG_ENTRY_OFFSET(mmhub_v1_7_edc_cnt_regs[i]));
if (reg_value)
mmhub_v1_7_get_ras_error_count(adev, &mmhub_v1_7_edc_cnt_regs[i],
reg_value, &sec_count, &ded_count);
}
err_data->ce_count += sec_count;
err_data->ue_count += ded_count;
}
static void mmhub_v1_7_reset_ras_error_count(struct amdgpu_device *adev)
{
uint32_t i;
/* write 0 to reset the edc counters */
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__MMHUB)) {
for (i = 0; i < ARRAY_SIZE(mmhub_v1_7_edc_cnt_regs); i++)
WREG32(SOC15_REG_ENTRY_OFFSET(mmhub_v1_7_edc_cnt_regs[i]), 0);
}
}
static const struct soc15_reg_entry mmhub_v1_7_ea_err_status_regs[] = {
{ SOC15_REG_ENTRY(MMHUB, 0, regMMEA0_ERR_STATUS), 0, 0, 0 },
{ SOC15_REG_ENTRY(MMHUB, 0, regMMEA1_ERR_STATUS), 0, 0, 0 },
{ SOC15_REG_ENTRY(MMHUB, 0, regMMEA2_ERR_STATUS), 0, 0, 0 },
{ SOC15_REG_ENTRY(MMHUB, 0, regMMEA3_ERR_STATUS), 0, 0, 0 },
{ SOC15_REG_ENTRY(MMHUB, 0, regMMEA4_ERR_STATUS), 0, 0, 0 },
{ SOC15_REG_ENTRY(MMHUB, 0, regMMEA5_ERR_STATUS), 0, 0, 0 },
};
static void mmhub_v1_7_query_ras_error_status(struct amdgpu_device *adev)
{
int i;
uint32_t reg_value;
if (!amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__MMHUB))
return;
for (i = 0; i < ARRAY_SIZE(mmhub_v1_7_ea_err_status_regs); i++) {
reg_value =
RREG32(SOC15_REG_ENTRY_OFFSET(mmhub_v1_7_ea_err_status_regs[i]));
if (REG_GET_FIELD(reg_value, MMEA0_ERR_STATUS, SDP_RDRSP_STATUS) ||
REG_GET_FIELD(reg_value, MMEA0_ERR_STATUS, SDP_WRRSP_STATUS) ||
REG_GET_FIELD(reg_value, MMEA0_ERR_STATUS, SDP_RDRSP_DATAPARITY_ERROR)) {
dev_warn(adev->dev, "MMHUB EA err detected at instance: %d, status: 0x%x!\n",
i, reg_value);
}
}
}
static void mmhub_v1_7_reset_ras_error_status(struct amdgpu_device *adev)
{
int i;
uint32_t reg_value;
if (!amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__MMHUB))
Annotation
- Immediate include surface: `amdgpu.h`, `amdgpu_ras.h`, `mmhub_v1_7.h`, `mmhub/mmhub_1_7_offset.h`, `mmhub/mmhub_1_7_sh_mask.h`, `vega10_enum.h`, `soc15_common.h`, `soc15.h`.
- Detected declarations: `function files`, `function mmhub_v1_7_setup_vm_pt_regs`, `function mmhub_v1_7_init_gart_aperture_regs`, `function memory`, `function mmhub_v1_7_init_system_aperture_regs`, `function mmhub_v1_7_init_tlb_regs`, `function mmhub_v1_7_init_snoop_override_regs`, `function mmhub_v1_7_init_cache_regs`, `function mmhub_v1_7_enable_system_domain`, `function mmhub_v1_7_disable_identity_aperture`.
- 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.