drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c- Extension
.c- Size
- 30094 bytes
- Lines
- 851
- 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_0.hmmhub/mmhub_1_0_offset.hmmhub/mmhub_1_0_sh_mask.hmmhub/mmhub_1_0_default.hvega10_enum.hsoc15.hsoc15_common.h
Detected Declarations
function filesfunction mmhub_v1_0_setup_vm_pt_regsfunction mmhub_v1_0_init_gart_aperture_regsfunction mmhub_v1_0_init_system_aperture_regsfunction mmhub_v1_0_init_tlb_regsfunction mmhub_v1_0_init_cache_regsfunction mmhub_v1_0_enable_system_domainfunction mmhub_v1_0_disable_identity_aperturefunction mmhub_v1_0_init_sawfunction mmhub_v1_0_setup_vmid_configfunction mmhub_v1_0_program_invalidationfunction mmhub_v1_0_update_power_gatingfunction mmhub_v1_0_gart_enablefunction mmhub_v1_0_gart_disablefunction mmhub_v1_0_set_fault_enable_defaultfunction mmhub_v1_0_initfunction mmhub_v1_0_update_medium_grain_clock_gatingfunction mmhub_v1_0_update_medium_grain_light_sleepfunction mmhub_v1_0_set_clockgatingfunction mmhub_v1_0_get_clockgatingfunction mmhub_v1_0_get_ras_error_countfunction mmhub_v1_0_query_ras_error_countfunction mmhub_v1_0_reset_ras_error_count
Annotated Snippet
if (sec_cnt) {
dev_info(adev->dev,
"MMHUB SubBlock %s, SEC %d\n",
mmhub_v1_0_ras_fields[i].name,
sec_cnt);
*sec_count += sec_cnt;
}
ded_cnt = (value &
mmhub_v1_0_ras_fields[i].ded_count_mask) >>
mmhub_v1_0_ras_fields[i].ded_count_shift;
if (ded_cnt) {
dev_info(adev->dev,
"MMHUB SubBlock %s, DED %d\n",
mmhub_v1_0_ras_fields[i].name,
ded_cnt);
*ded_count += ded_cnt;
}
}
return 0;
}
static void mmhub_v1_0_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_0_edc_cnt_regs); i++) {
reg_value =
RREG32(SOC15_REG_ENTRY_OFFSET(mmhub_v1_0_edc_cnt_regs[i]));
if (reg_value)
mmhub_v1_0_get_ras_error_count(adev,
&mmhub_v1_0_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_0_reset_ras_error_count(struct amdgpu_device *adev)
{
uint32_t i;
/* read back edc counter registers to reset the counters to 0 */
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__MMHUB)) {
for (i = 0; i < ARRAY_SIZE(mmhub_v1_0_edc_cnt_regs); i++)
RREG32(SOC15_REG_ENTRY_OFFSET(mmhub_v1_0_edc_cnt_regs[i]));
}
}
struct amdgpu_ras_block_hw_ops mmhub_v1_0_ras_hw_ops = {
.query_ras_error_count = mmhub_v1_0_query_ras_error_count,
.reset_ras_error_count = mmhub_v1_0_reset_ras_error_count,
};
struct amdgpu_mmhub_ras mmhub_v1_0_ras = {
.ras_block = {
.hw_ops = &mmhub_v1_0_ras_hw_ops,
},
};
const struct amdgpu_mmhub_funcs mmhub_v1_0_funcs = {
.get_fb_location = mmhub_v1_0_get_fb_location,
.init = mmhub_v1_0_init,
.gart_enable = mmhub_v1_0_gart_enable,
.set_fault_enable_default = mmhub_v1_0_set_fault_enable_default,
.gart_disable = mmhub_v1_0_gart_disable,
.set_clockgating = mmhub_v1_0_set_clockgating,
.get_clockgating = mmhub_v1_0_get_clockgating,
.setup_vm_pt_regs = mmhub_v1_0_setup_vm_pt_regs,
.update_power_gating = mmhub_v1_0_update_power_gating,
};
Annotation
- Immediate include surface: `amdgpu.h`, `amdgpu_ras.h`, `mmhub_v1_0.h`, `mmhub/mmhub_1_0_offset.h`, `mmhub/mmhub_1_0_sh_mask.h`, `mmhub/mmhub_1_0_default.h`, `vega10_enum.h`, `soc15.h`.
- Detected declarations: `function files`, `function mmhub_v1_0_setup_vm_pt_regs`, `function mmhub_v1_0_init_gart_aperture_regs`, `function mmhub_v1_0_init_system_aperture_regs`, `function mmhub_v1_0_init_tlb_regs`, `function mmhub_v1_0_init_cache_regs`, `function mmhub_v1_0_enable_system_domain`, `function mmhub_v1_0_disable_identity_aperture`, `function mmhub_v1_0_init_saw`, `function mmhub_v1_0_setup_vmid_config`.
- 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.