drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c- Extension
.c- Size
- 20294 bytes
- Lines
- 591
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
amdgpu.hnbio_v2_3.hnbio/nbio_2_3_default.hnbio/nbio_2_3_offset.hnbio/nbio_2_3_sh_mask.huapi/linux/kfd_ioctl.hlinux/device.hlinux/pci.h
Detected Declarations
function filesfunction nbio_v2_3_get_rev_idfunction nbio_v2_3_mc_access_enablefunction nbio_v2_3_get_memsizefunction nbio_v2_3_sdma_doorbell_rangefunction nbio_v2_3_vcn_doorbell_rangefunction nbio_v2_3_enable_doorbell_aperturefunction nbio_v2_3_enable_doorbell_selfring_aperturefunction nbio_v2_3_ih_doorbell_rangefunction nbio_v2_3_ih_controlfunction nbio_v2_3_update_medium_grain_clock_gatingfunction nbio_v2_3_update_medium_grain_light_sleepfunction nbio_v2_3_get_clockgating_statefunction nbio_v2_3_get_hdp_flush_req_offsetfunction nbio_v2_3_get_hdp_flush_done_offsetfunction nbio_v2_3_get_pcie_index_offsetfunction nbio_v2_3_get_pcie_data_offsetfunction nbio_v2_3_init_registersfunction nbio_v2_3_enable_aspmfunction nbio_v2_3_program_ltrfunction nbio_v2_3_program_aspmfunction nbio_v2_3_apply_lc_spc_mode_wafunction nbio_v2_3_apply_l1_link_width_reconfig_wafunction nbio_v2_3_clear_doorbell_interruptfunction nbio_v2_3_set_reg_remap
Annotated Snippet
if (reg & BIF_DOORBELL_INT_CNTL__DOORBELL_INTERRUPT_STATUS_MASK) {
reg_data = 1 << BIF_DOORBELL_INT_CNTL__DOORBELL_INTERRUPT_CLEAR__SHIFT;
WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, reg_data);
}
}
}
#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE)
static void nbio_v2_3_set_reg_remap(struct amdgpu_device *adev)
{
if (!amdgpu_sriov_vf(adev) && (PAGE_SIZE <= 4096)) {
adev->rmmio_remap.reg_offset = MMIO_REG_HOLE_OFFSET;
adev->rmmio_remap.bus_addr = adev->rmmio_base + MMIO_REG_HOLE_OFFSET;
} else {
adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
adev->rmmio_remap.bus_addr = 0;
}
}
const struct amdgpu_nbio_funcs nbio_v2_3_funcs = {
.get_hdp_flush_req_offset = nbio_v2_3_get_hdp_flush_req_offset,
.get_hdp_flush_done_offset = nbio_v2_3_get_hdp_flush_done_offset,
.get_pcie_index_offset = nbio_v2_3_get_pcie_index_offset,
.get_pcie_data_offset = nbio_v2_3_get_pcie_data_offset,
.get_rev_id = nbio_v2_3_get_rev_id,
.mc_access_enable = nbio_v2_3_mc_access_enable,
.get_memsize = nbio_v2_3_get_memsize,
.sdma_doorbell_range = nbio_v2_3_sdma_doorbell_range,
.vcn_doorbell_range = nbio_v2_3_vcn_doorbell_range,
.enable_doorbell_aperture = nbio_v2_3_enable_doorbell_aperture,
.enable_doorbell_selfring_aperture = nbio_v2_3_enable_doorbell_selfring_aperture,
.ih_doorbell_range = nbio_v2_3_ih_doorbell_range,
.update_medium_grain_clock_gating = nbio_v2_3_update_medium_grain_clock_gating,
.update_medium_grain_light_sleep = nbio_v2_3_update_medium_grain_light_sleep,
.get_clockgating_state = nbio_v2_3_get_clockgating_state,
.ih_control = nbio_v2_3_ih_control,
.init_registers = nbio_v2_3_init_registers,
.remap_hdp_registers = nbio_v2_3_remap_hdp_registers,
.enable_aspm = nbio_v2_3_enable_aspm,
.program_aspm = nbio_v2_3_program_aspm,
.apply_lc_spc_mode_wa = nbio_v2_3_apply_lc_spc_mode_wa,
.apply_l1_link_width_reconfig_wa = nbio_v2_3_apply_l1_link_width_reconfig_wa,
.clear_doorbell_interrupt = nbio_v2_3_clear_doorbell_interrupt,
.set_reg_remap = nbio_v2_3_set_reg_remap,
};
Annotation
- Immediate include surface: `amdgpu.h`, `nbio_v2_3.h`, `nbio/nbio_2_3_default.h`, `nbio/nbio_2_3_offset.h`, `nbio/nbio_2_3_sh_mask.h`, `uapi/linux/kfd_ioctl.h`, `linux/device.h`, `linux/pci.h`.
- Detected declarations: `function files`, `function nbio_v2_3_get_rev_id`, `function nbio_v2_3_mc_access_enable`, `function nbio_v2_3_get_memsize`, `function nbio_v2_3_sdma_doorbell_range`, `function nbio_v2_3_vcn_doorbell_range`, `function nbio_v2_3_enable_doorbell_aperture`, `function nbio_v2_3_enable_doorbell_selfring_aperture`, `function nbio_v2_3_ih_doorbell_range`, `function nbio_v2_3_ih_control`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.