drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c- Extension
.c- Size
- 23154 bytes
- Lines
- 625
- 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.hmmhub_v2_3.hmmhub/mmhub_2_3_0_offset.hmmhub/mmhub_2_3_0_sh_mask.hmmhub/mmhub_2_3_0_default.hnavi10_enum.hsoc15_common.h
Detected Declarations
function mmhub_v2_3_get_invalidate_reqfunction mmhub_v2_3_print_l2_protection_fault_statusfunction mmhub_v2_3_setup_vm_pt_regsfunction mmhub_v2_3_init_gart_aperture_regsfunction mmhub_v2_3_init_system_aperture_regsfunction mmhub_v2_3_init_tlb_regsfunction mmhub_v2_3_init_cache_regsfunction mmhub_v2_3_enable_system_domainfunction mmhub_v2_3_disable_identity_aperturefunction mmhub_v2_3_setup_vmid_configfunction mmhub_v2_3_program_invalidationfunction mmhub_v2_3_gart_enablefunction mmhub_v2_3_gart_disablefunction mmhub_v2_3_set_fault_enable_defaultfunction mmhub_v2_3_initfunction mmhub_v2_3_update_medium_grain_clock_gatingfunction mmhub_v2_3_update_medium_grain_light_sleepfunction mmhub_v2_3_set_clockgatingfunction mmhub_v2_3_get_clockgating
Annotated Snippet
#include "amdgpu.h"
#include "mmhub_v2_3.h"
#include "mmhub/mmhub_2_3_0_offset.h"
#include "mmhub/mmhub_2_3_0_sh_mask.h"
#include "mmhub/mmhub_2_3_0_default.h"
#include "navi10_enum.h"
#include "soc15_common.h"
static const char *mmhub_client_ids_vangogh[][2] = {
[0][0] = "MP0",
[1][0] = "MP1",
[2][0] = "DCEDMC",
[3][0] = "DCEVGA",
[13][0] = "UTCL2",
[26][0] = "OSS",
[27][0] = "HDP",
[28][0] = "VCN",
[29][0] = "VCNU",
[30][0] = "JPEG",
[0][1] = "MP0",
[1][1] = "MP1",
[2][1] = "DCEDMC",
[3][1] = "DCEVGA",
[4][1] = "DCEDWB",
[5][1] = "XDP",
[26][1] = "OSS",
[27][1] = "HDP",
[28][1] = "VCN",
[29][1] = "VCNU",
[30][1] = "JPEG",
};
static uint32_t mmhub_v2_3_get_invalidate_req(unsigned int vmid,
uint32_t flush_type)
{
u32 req = 0;
/* invalidate using legacy mode on vmid*/
req = REG_SET_FIELD(req, MMVM_INVALIDATE_ENG0_REQ,
PER_VMID_INVALIDATE_REQ, 1 << vmid);
req = REG_SET_FIELD(req, MMVM_INVALIDATE_ENG0_REQ, FLUSH_TYPE, flush_type);
req = REG_SET_FIELD(req, MMVM_INVALIDATE_ENG0_REQ, INVALIDATE_L2_PTES, 1);
req = REG_SET_FIELD(req, MMVM_INVALIDATE_ENG0_REQ, INVALIDATE_L2_PDE0, 1);
req = REG_SET_FIELD(req, MMVM_INVALIDATE_ENG0_REQ, INVALIDATE_L2_PDE1, 1);
req = REG_SET_FIELD(req, MMVM_INVALIDATE_ENG0_REQ, INVALIDATE_L2_PDE2, 1);
req = REG_SET_FIELD(req, MMVM_INVALIDATE_ENG0_REQ, INVALIDATE_L1_PTES, 1);
req = REG_SET_FIELD(req, MMVM_INVALIDATE_ENG0_REQ,
CLEAR_PROTECTION_FAULT_STATUS_ADDR, 0);
return req;
}
static void
mmhub_v2_3_print_l2_protection_fault_status(struct amdgpu_device *adev,
uint32_t status)
{
uint32_t cid, rw;
const char *mmhub_cid;
cid = REG_GET_FIELD(status,
MMVM_L2_PROTECTION_FAULT_STATUS, CID);
rw = REG_GET_FIELD(status,
MMVM_L2_PROTECTION_FAULT_STATUS, RW);
dev_err(adev->dev,
"MMVM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
status);
mmhub_cid = amdgpu_mmhub_client_name(&adev->mmhub, cid, rw);
dev_err(adev->dev, "\t Faulty UTCL2 client ID: %s (0x%x)\n",
mmhub_cid ? mmhub_cid : "unknown", cid);
dev_err(adev->dev, "\t MORE_FAULTS: 0x%lx\n",
REG_GET_FIELD(status,
MMVM_L2_PROTECTION_FAULT_STATUS, MORE_FAULTS));
dev_err(adev->dev, "\t WALKER_ERROR: 0x%lx\n",
REG_GET_FIELD(status,
MMVM_L2_PROTECTION_FAULT_STATUS, WALKER_ERROR));
dev_err(adev->dev, "\t PERMISSION_FAULTS: 0x%lx\n",
REG_GET_FIELD(status,
MMVM_L2_PROTECTION_FAULT_STATUS, PERMISSION_FAULTS));
dev_err(adev->dev, "\t MAPPING_ERROR: 0x%lx\n",
REG_GET_FIELD(status,
MMVM_L2_PROTECTION_FAULT_STATUS, MAPPING_ERROR));
dev_err(adev->dev, "\t RW: 0x%x\n", rw);
}
static void mmhub_v2_3_setup_vm_pt_regs(struct amdgpu_device *adev,
uint32_t vmid,
uint64_t page_table_base)
Annotation
- Immediate include surface: `amdgpu.h`, `mmhub_v2_3.h`, `mmhub/mmhub_2_3_0_offset.h`, `mmhub/mmhub_2_3_0_sh_mask.h`, `mmhub/mmhub_2_3_0_default.h`, `navi10_enum.h`, `soc15_common.h`.
- Detected declarations: `function mmhub_v2_3_get_invalidate_req`, `function mmhub_v2_3_print_l2_protection_fault_status`, `function mmhub_v2_3_setup_vm_pt_regs`, `function mmhub_v2_3_init_gart_aperture_regs`, `function mmhub_v2_3_init_system_aperture_regs`, `function mmhub_v2_3_init_tlb_regs`, `function mmhub_v2_3_init_cache_regs`, `function mmhub_v2_3_enable_system_domain`, `function mmhub_v2_3_disable_identity_aperture`, `function mmhub_v2_3_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.