drivers/gpu/drm/amd/amdgpu/nbif_v6_3_1.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/nbif_v6_3_1.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/nbif_v6_3_1.c- Extension
.c- Size
- 30991 bytes
- Lines
- 739
- 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.hnbif_v6_3_1.hnbif/nbif_6_3_1_offset.hnbif/nbif_6_3_1_sh_mask.hpcie/pcie_6_1_0_offset.hpcie/pcie_6_1_0_sh_mask.hivsrcid/nbio/irqsrcs_nbif_7_4.huapi/linux/kfd_ioctl.h
Detected Declarations
function filesfunction nbif_v6_3_1_get_rev_idfunction nbif_v6_3_1_mc_access_enablefunction nbif_v6_3_1_get_memsizefunction nbif_v6_3_1_sdma_doorbell_rangefunction nbif_v6_3_1_vcn_doorbell_rangefunction nbif_v6_3_1_vpe_doorbell_rangefunction nbif_v6_3_1_gc_doorbell_initfunction nbif_v6_3_1_enable_doorbell_aperturefunction nbif_v6_3_1_enable_doorbell_selfring_aperturefunction nbif_v6_3_1_ih_doorbell_rangefunction nbif_v6_3_1_ih_controlfunction nbif_v6_3_1_update_medium_grain_clock_gatingfunction nbif_v6_3_1_get_hdp_flush_done_offsetfunction nbif_v6_3_1_get_pcie_index_offsetfunction nbif_v6_3_1_get_pcie_data_offsetfunction nbif_v6_3_1_init_registersfunction nbif_v6_3_1_get_rom_offsetfunction nbif_v6_3_1_program_ltrfunction nbif_v6_3_1_program_aspmfunction nbif_v6_3_1_set_reg_remapfunction nbif_v6_3_1_set_ras_err_event_athub_irq_statefunction nbif_v6_3_1_process_err_event_athub_irqfunction nbif_v6_3_1_handle_ras_err_event_athub_intr_no_bifringfunction nbif_v6_3_1_init_ras_err_event_athub_interrupt
Annotated Snippet
if (use_doorbell) {
doorbell_range = REG_SET_FIELD(doorbell_range,
GDC_S2A0_S2A_DOORBELL_ENTRY_2_CTRL,
S2A_DOORBELL_PORT2_ENABLE,
0x1);
doorbell_range = REG_SET_FIELD(doorbell_range,
GDC_S2A0_S2A_DOORBELL_ENTRY_2_CTRL,
S2A_DOORBELL_PORT2_AWID,
0xe);
doorbell_range = REG_SET_FIELD(doorbell_range,
GDC_S2A0_S2A_DOORBELL_ENTRY_2_CTRL,
S2A_DOORBELL_PORT2_RANGE_OFFSET,
doorbell_index);
doorbell_range = REG_SET_FIELD(doorbell_range,
GDC_S2A0_S2A_DOORBELL_ENTRY_2_CTRL,
S2A_DOORBELL_PORT2_RANGE_SIZE,
doorbell_size);
doorbell_range = REG_SET_FIELD(doorbell_range,
GDC_S2A0_S2A_DOORBELL_ENTRY_2_CTRL,
S2A_DOORBELL_PORT2_AWADDR_31_28_VALUE,
0x3);
} else
doorbell_range = REG_SET_FIELD(doorbell_range,
GDC_S2A0_S2A_DOORBELL_ENTRY_2_CTRL,
S2A_DOORBELL_PORT2_RANGE_SIZE,
0);
if (amdgpu_ip_version(adev, NBIO_HWIP, 0) >= IP_VERSION(7, 11, 4))
WREG32_SOC15(NBIO, 0, regGDC_S2A0_S2A_DOORBELL_ENTRY_2_CTRL_nbif_4_10, doorbell_range);
else
WREG32_SOC15(NBIO, 0, regGDC_S2A0_S2A_DOORBELL_ENTRY_2_CTRL, doorbell_range);
}
}
static void nbif_v6_3_1_vcn_doorbell_range(struct amdgpu_device *adev,
bool use_doorbell, int doorbell_index,
int instance)
{
u32 doorbell_range;
if (instance) {
if (amdgpu_ip_version(adev, NBIO_HWIP, 0) == IP_VERSION(7, 11, 4))
return;
doorbell_range = RREG32_SOC15(NBIO, 0, regGDC_S2A0_S2A_DOORBELL_ENTRY_5_CTRL);
} else {
doorbell_range = RREG32_SOC15(NBIO, 0, regGDC_S2A0_S2A_DOORBELL_ENTRY_4_CTRL);
}
if (use_doorbell) {
doorbell_range = REG_SET_FIELD(doorbell_range,
GDC_S2A0_S2A_DOORBELL_ENTRY_4_CTRL,
S2A_DOORBELL_PORT4_ENABLE,
0x1);
doorbell_range = REG_SET_FIELD(doorbell_range,
GDC_S2A0_S2A_DOORBELL_ENTRY_4_CTRL,
S2A_DOORBELL_PORT4_AWID,
instance ? 0x7 : 0x4);
doorbell_range = REG_SET_FIELD(doorbell_range,
GDC_S2A0_S2A_DOORBELL_ENTRY_4_CTRL,
S2A_DOORBELL_PORT4_RANGE_OFFSET,
doorbell_index);
doorbell_range = REG_SET_FIELD(doorbell_range,
GDC_S2A0_S2A_DOORBELL_ENTRY_4_CTRL,
S2A_DOORBELL_PORT4_RANGE_SIZE,
8);
doorbell_range = REG_SET_FIELD(doorbell_range,
GDC_S2A0_S2A_DOORBELL_ENTRY_4_CTRL,
S2A_DOORBELL_PORT4_AWADDR_31_28_VALUE,
instance ? 0x7 : 0x4);
} else
doorbell_range = REG_SET_FIELD(doorbell_range,
GDC_S2A0_S2A_DOORBELL_ENTRY_4_CTRL,
S2A_DOORBELL_PORT4_RANGE_SIZE,
0);
if (amdgpu_ip_version(adev, NBIO_HWIP, 0) >= IP_VERSION(7, 11, 4))
WREG32_SOC15(NBIO, 0,
regGDC_S2A0_S2A_DOORBELL_ENTRY_4_CTRL_nbif_4_10,
doorbell_range);
else
if (instance)
WREG32_SOC15(NBIO, 0, regGDC_S2A0_S2A_DOORBELL_ENTRY_5_CTRL, doorbell_range);
else
WREG32_SOC15(NBIO, 0, regGDC_S2A0_S2A_DOORBELL_ENTRY_4_CTRL, doorbell_range);
}
static void nbif_v6_3_1_vpe_doorbell_range(struct amdgpu_device *adev,
int instance, bool use_doorbell,
int doorbell_index,
int doorbell_size)
Annotation
- Immediate include surface: `amdgpu.h`, `nbif_v6_3_1.h`, `nbif/nbif_6_3_1_offset.h`, `nbif/nbif_6_3_1_sh_mask.h`, `pcie/pcie_6_1_0_offset.h`, `pcie/pcie_6_1_0_sh_mask.h`, `ivsrcid/nbio/irqsrcs_nbif_7_4.h`, `uapi/linux/kfd_ioctl.h`.
- Detected declarations: `function files`, `function nbif_v6_3_1_get_rev_id`, `function nbif_v6_3_1_mc_access_enable`, `function nbif_v6_3_1_get_memsize`, `function nbif_v6_3_1_sdma_doorbell_range`, `function nbif_v6_3_1_vcn_doorbell_range`, `function nbif_v6_3_1_vpe_doorbell_range`, `function nbif_v6_3_1_gc_doorbell_init`, `function nbif_v6_3_1_enable_doorbell_aperture`, `function nbif_v6_3_1_enable_doorbell_selfring_aperture`.
- 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.