drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c- Extension
.c- Size
- 56328 bytes
- Lines
- 2348
- 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
subdev/bios.hsubdev/bios/bit.hsubdev/bios/bmp.hsubdev/bios/conn.hsubdev/bios/dcb.hsubdev/bios/dp.hsubdev/bios/gpio.hsubdev/bios/init.hsubdev/bios/ramcfg.hsubdev/devinit.hsubdev/gpio.hsubdev/i2c.hsubdev/vga.hlinux/kernel.h
Detected Declarations
function init_execfunction init_exec_setfunction init_exec_invfunction init_exec_forcefunction init_orfunction init_linkfunction init_headfunction init_connfunction init_nvregfunction init_rd32function init_wr32function init_maskfunction init_rdportfunction init_wrportfunction init_rdvgaifunction init_wrvgaifunction init_i2cfunction init_rdi2crfunction init_wri2crfunction init_auxfunction init_rdauxrfunction init_wrauxrfunction init_prog_pllfunction init_tablefunction init_table_function init_scriptfunction init_unknown_scriptfunction init_ram_restrict_group_countfunction init_ram_restrictfunction init_xlat_function init_condition_metfunction init_io_condition_metfunction init_io_flag_condition_metfunction init_shiftfunction init_tmds_regfunction init_reservedfunction init_donefunction init_io_restrict_progfunction init_repeatfunction init_io_restrict_pllfunction init_end_repeatfunction init_copyfunction init_notfunction init_io_flag_conditionfunction init_generic_conditionfunction init_io_mask_orfunction init_io_orfunction init_andn_reg
Annotated Snippet
if (init->outp) {
conn = init->outp->connector;
conn = nvbios_connEp(bios, conn, &ver, &hdr, &connE);
if (conn)
return connE.type;
}
error("script needs connector type\n");
}
return 0xff;
}
static inline u32
init_nvreg(struct nvbios_init *init, u32 reg)
{
struct nvkm_devinit *devinit = init->subdev->device->devinit;
/* C51 (at least) sometimes has the lower bits set which the VBIOS
* interprets to mean that access needs to go through certain IO
* ports instead. The NVIDIA binary driver has been seen to access
* these through the NV register address, so lets assume we can
* do the same
*/
reg &= ~0x00000003;
/* GF8+ display scripts need register addresses mangled a bit to
* select a specific CRTC/OR
*/
if (init->subdev->device->card_type >= NV_50) {
if (reg & 0x80000000) {
reg += init_head(init) * 0x800;
reg &= ~0x80000000;
}
if (reg & 0x40000000) {
reg += init_or(init) * 0x800;
reg &= ~0x40000000;
if (reg & 0x20000000) {
reg += init_link(init) * 0x80;
reg &= ~0x20000000;
}
}
}
if (reg & ~0x00fffffc)
warn("unknown bits in register 0x%08x\n", reg);
return nvkm_devinit_mmio(devinit, reg);
}
static u32
init_rd32(struct nvbios_init *init, u32 reg)
{
struct nvkm_device *device = init->subdev->device;
reg = init_nvreg(init, reg);
if (reg != ~0 && init_exec(init))
return nvkm_rd32(device, reg);
return 0x00000000;
}
static void
init_wr32(struct nvbios_init *init, u32 reg, u32 val)
{
struct nvkm_device *device = init->subdev->device;
reg = init_nvreg(init, reg);
if (reg != ~0 && init_exec(init))
nvkm_wr32(device, reg, val);
}
static u32
init_mask(struct nvbios_init *init, u32 reg, u32 mask, u32 val)
{
struct nvkm_device *device = init->subdev->device;
reg = init_nvreg(init, reg);
if (reg != ~0 && init_exec(init)) {
u32 tmp = nvkm_rd32(device, reg);
nvkm_wr32(device, reg, (tmp & ~mask) | val);
return tmp;
}
return 0x00000000;
}
static u8
init_rdport(struct nvbios_init *init, u16 port)
{
if (init_exec(init))
return nvkm_rdport(init->subdev->device, init->head, port);
return 0x00;
}
Annotation
- Immediate include surface: `subdev/bios.h`, `subdev/bios/bit.h`, `subdev/bios/bmp.h`, `subdev/bios/conn.h`, `subdev/bios/dcb.h`, `subdev/bios/dp.h`, `subdev/bios/gpio.h`, `subdev/bios/init.h`.
- Detected declarations: `function init_exec`, `function init_exec_set`, `function init_exec_inv`, `function init_exec_force`, `function init_or`, `function init_link`, `function init_head`, `function init_conn`, `function init_nvreg`, `function init_rd32`.
- 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.