drivers/accel/ivpu/ivpu_hw_ip.c
Source file repositories/reference/linux-study-clean/drivers/accel/ivpu/ivpu_hw_ip.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/accel/ivpu/ivpu_hw_ip.c- Extension
.c- Size
- 36200 bytes
- Lines
- 1227
- Domain
- Driver Families
- Bucket
- drivers/accel
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
ivpu_drv.hivpu_fw.hivpu_gem.hivpu_hw.hivpu_hw_37xx_reg.hivpu_hw_40xx_reg.hivpu_hw_btrs.hivpu_hw_ip.hivpu_hw_reg_io.hivpu_mmu.hivpu_pm.h
Detected Declarations
function Copyrightfunction host_ss_rst_clrfunction host_ss_noc_qreqn_check_37xxfunction host_ss_noc_qreqn_check_40xxfunction host_ss_noc_qreqn_checkfunction host_ss_noc_qacceptn_check_37xxfunction host_ss_noc_qacceptn_check_40xxfunction host_ss_noc_qacceptn_checkfunction host_ss_noc_qdeny_check_37xxfunction host_ss_noc_qdeny_check_40xxfunction host_ss_noc_qdeny_checkfunction top_noc_qrenqn_check_37xxfunction top_noc_qrenqn_check_40xxfunction top_noc_qreqn_checkfunction ivpu_hw_ip_host_ss_configurefunction idle_gen_drive_37xxfunction idle_gen_drive_40xxfunction ivpu_hw_ip_idle_gen_enablefunction ivpu_hw_ip_idle_gen_disablefunction pwr_island_delay_set_50xxfunction pwr_island_trickle_drive_37xxfunction pwr_island_trickle_drive_40xxfunction pwr_island_drive_37xxfunction pwr_island_drive_40xxfunction pwr_island_enablefunction wait_for_pwr_island_statusfunction pwr_island_isolation_drive_37xxfunction pwr_island_isolation_drive_40xxfunction pwr_island_isolation_drivefunction pwr_island_isolation_disablefunction host_ss_clk_drive_37xxfunction host_ss_clk_drive_40xxfunction host_ss_clk_drivefunction host_ss_clk_enablefunction host_ss_rst_drive_37xxfunction host_ss_rst_drive_40xxfunction host_ss_rst_drivefunction host_ss_rst_enablefunction host_ss_noc_qreqn_top_socmmio_drive_37xxfunction host_ss_noc_qreqn_top_socmmio_drive_40xxfunction host_ss_noc_qreqn_top_socmmio_drivefunction host_ss_axi_drivefunction top_noc_qreqn_drive_40xxfunction top_noc_qreqn_drive_37xxfunction top_noc_qreqn_drivefunction ivpu_hw_ip_host_ss_axi_enablefunction top_noc_qacceptn_check_37xxfunction top_noc_qacceptn_check_40xx
Annotated Snippet
if (ret) {
ivpu_err(vdev, "Timed out waiting for NPU IP bar\n");
return ret;
}
host_ss_rst_clr(vdev);
}
ret = host_ss_noc_qreqn_check(vdev, 0x0);
if (ret) {
ivpu_err(vdev, "Failed qreqn check: %d\n", ret);
return ret;
}
ret = host_ss_noc_qacceptn_check(vdev, 0x0);
if (ret) {
ivpu_err(vdev, "Failed qacceptn check: %d\n", ret);
return ret;
}
ret = host_ss_noc_qdeny_check(vdev, 0x0);
if (ret)
ivpu_err(vdev, "Failed qdeny check %d\n", ret);
return ret;
}
static void idle_gen_drive_37xx(struct ivpu_device *vdev, bool enable)
{
u32 val = REGV_RD32(VPU_37XX_HOST_SS_AON_VPU_IDLE_GEN);
if (enable)
val = REG_SET_FLD(VPU_37XX_HOST_SS_AON_VPU_IDLE_GEN, EN, val);
else
val = REG_CLR_FLD(VPU_37XX_HOST_SS_AON_VPU_IDLE_GEN, EN, val);
REGV_WR32(VPU_37XX_HOST_SS_AON_VPU_IDLE_GEN, val);
}
static void idle_gen_drive_40xx(struct ivpu_device *vdev, bool enable)
{
u32 val = REGV_RD32(VPU_40XX_HOST_SS_AON_IDLE_GEN);
if (enable)
val = REG_SET_FLD(VPU_40XX_HOST_SS_AON_IDLE_GEN, EN, val);
else
val = REG_CLR_FLD(VPU_40XX_HOST_SS_AON_IDLE_GEN, EN, val);
REGV_WR32(VPU_40XX_HOST_SS_AON_IDLE_GEN, val);
}
void ivpu_hw_ip_idle_gen_enable(struct ivpu_device *vdev)
{
if (ivpu_hw_ip_gen(vdev) == IVPU_HW_IP_37XX)
idle_gen_drive_37xx(vdev, true);
else
idle_gen_drive_40xx(vdev, true);
}
void ivpu_hw_ip_idle_gen_disable(struct ivpu_device *vdev)
{
if (ivpu_hw_ip_gen(vdev) == IVPU_HW_IP_37XX)
idle_gen_drive_37xx(vdev, false);
else
idle_gen_drive_40xx(vdev, false);
}
static void
pwr_island_delay_set_50xx(struct ivpu_device *vdev, u32 post, u32 post1, u32 post2, u32 status)
{
u32 val;
val = REGV_RD32(VPU_50XX_HOST_SS_AON_PWR_ISLAND_EN_POST_DLY);
val = REG_SET_FLD_NUM(VPU_50XX_HOST_SS_AON_PWR_ISLAND_EN_POST_DLY, POST_DLY, post, val);
val = REG_SET_FLD_NUM(VPU_50XX_HOST_SS_AON_PWR_ISLAND_EN_POST_DLY, POST1_DLY, post1, val);
val = REG_SET_FLD_NUM(VPU_50XX_HOST_SS_AON_PWR_ISLAND_EN_POST_DLY, POST2_DLY, post2, val);
REGV_WR32(VPU_50XX_HOST_SS_AON_PWR_ISLAND_EN_POST_DLY, val);
val = REGV_RD32(VPU_50XX_HOST_SS_AON_PWR_ISLAND_STATUS_DLY);
val = REG_SET_FLD_NUM(VPU_50XX_HOST_SS_AON_PWR_ISLAND_STATUS_DLY, STATUS_DLY, status, val);
REGV_WR32(VPU_50XX_HOST_SS_AON_PWR_ISLAND_STATUS_DLY, val);
}
static void pwr_island_trickle_drive_37xx(struct ivpu_device *vdev, bool enable)
{
u32 val = REGV_RD32(VPU_37XX_HOST_SS_AON_PWR_ISLAND_TRICKLE_EN0);
if (enable)
val = REG_SET_FLD(VPU_37XX_HOST_SS_AON_PWR_ISLAND_TRICKLE_EN0, MSS_CPU, val);
else
val = REG_CLR_FLD(VPU_37XX_HOST_SS_AON_PWR_ISLAND_TRICKLE_EN0, MSS_CPU, val);
Annotation
- Immediate include surface: `ivpu_drv.h`, `ivpu_fw.h`, `ivpu_gem.h`, `ivpu_hw.h`, `ivpu_hw_37xx_reg.h`, `ivpu_hw_40xx_reg.h`, `ivpu_hw_btrs.h`, `ivpu_hw_ip.h`.
- Detected declarations: `function Copyright`, `function host_ss_rst_clr`, `function host_ss_noc_qreqn_check_37xx`, `function host_ss_noc_qreqn_check_40xx`, `function host_ss_noc_qreqn_check`, `function host_ss_noc_qacceptn_check_37xx`, `function host_ss_noc_qacceptn_check_40xx`, `function host_ss_noc_qacceptn_check`, `function host_ss_noc_qdeny_check_37xx`, `function host_ss_noc_qdeny_check_40xx`.
- Atlas domain: Driver Families / drivers/accel.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.