drivers/accel/habanalabs/goya/goya.c
Source file repositories/reference/linux-study-clean/drivers/accel/habanalabs/goya/goya.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/accel/habanalabs/goya/goya.c- Extension
.c- Size
- 155889 bytes
- Lines
- 5538
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
goyaP.h../include/hw_ip/mmu/mmu_general.h../include/hw_ip/mmu/mmu_v1_0.h../include/goya/asic_reg/goya_masks.h../include/goya/goya_reg_map.hlinux/pci.hlinux/hwmon.hlinux/iommu.hlinux/seq_file.h
Detected Declarations
function validate_packet_idfunction goya_set_fixed_propertiesfunction goya_pci_bars_mapfunction goya_set_ddr_bar_basefunction goya_init_iatufunction goya_get_hw_statefunction goya_early_initfunction goya_early_finifunction goya_mmu_prepare_regfunction goya_qman0_set_securityfunction goya_fetch_psoc_frequencyfunction goya_set_frequencyfunction goya_set_freq_to_low_jobfunction goya_late_initfunction goya_late_finifunction goya_set_pci_memory_regionsfunction goya_sw_initfunction goya_sw_finifunction goya_init_dma_qmanfunction goya_init_dma_chfunction goya_init_dma_qmansfunction goya_disable_external_queuesfunction goya_stop_queuefunction goya_stop_external_queuesfunction goya_init_cpu_queuesfunction goya_set_pll_refclkfunction goya_disable_clk_rlxfunction _goya_tpc_mbist_workaroundfunction goya_tpc_mbist_workaroundfunction goya_init_golden_registersfunction goya_init_mme_qmanfunction goya_init_mme_cmdqfunction goya_init_mme_qmansfunction goya_init_tpc_qmanfunction goya_init_tpc_cmdqfunction goya_init_tpc_qmansfunction goya_disable_internal_queuesfunction goya_stop_internal_queuesfunction goya_dma_stallfunction goya_tpc_stallfunction goya_mme_stallfunction goya_enable_msixfunction goya_sync_irqsfunction goya_disable_msixfunction goya_enable_timestampfunction goya_disable_timestampfunction goya_halt_enginesfunction goya_load_firmware_to_device
Annotated Snippet
.context_switch = goya_context_switch,
.restore_phase_topology = goya_restore_phase_topology,
.debugfs_read_dma = goya_debugfs_read_dma,
.add_device_attr = goya_add_device_attr,
.handle_eqe = goya_handle_eqe,
.get_events_stat = goya_get_events_stat,
.read_pte = goya_read_pte,
.write_pte = goya_write_pte,
.mmu_invalidate_cache = goya_mmu_invalidate_cache,
.mmu_invalidate_cache_range = goya_mmu_invalidate_cache_range,
.mmu_prefetch_cache_range = NULL,
.send_heartbeat = goya_send_heartbeat,
.debug_coresight = goya_debug_coresight,
.is_device_idle = goya_is_device_idle,
.compute_reset_late_init = goya_compute_reset_late_init,
.hw_queues_lock = goya_hw_queues_lock,
.hw_queues_unlock = goya_hw_queues_unlock,
.get_pci_id = goya_get_pci_id,
.get_eeprom_data = goya_get_eeprom_data,
.get_monitor_dump = goya_get_monitor_dump,
.send_cpu_message = goya_send_cpu_message,
.pci_bars_map = goya_pci_bars_map,
.init_iatu = goya_init_iatu,
.rreg = hl_rreg,
.wreg = hl_wreg,
.halt_coresight = goya_halt_coresight,
.ctx_init = goya_ctx_init,
.ctx_fini = goya_ctx_fini,
.pre_schedule_cs = goya_pre_schedule_cs,
.get_queue_id_for_cq = goya_get_queue_id_for_cq,
.load_firmware_to_device = goya_load_firmware_to_device,
.load_boot_fit_to_device = goya_load_boot_fit_to_device,
.get_signal_cb_size = goya_get_signal_cb_size,
.get_wait_cb_size = goya_get_wait_cb_size,
.gen_signal_cb = goya_gen_signal_cb,
.gen_wait_cb = goya_gen_wait_cb,
.reset_sob = goya_reset_sob,
.reset_sob_group = goya_reset_sob_group,
.get_device_time = goya_get_device_time,
.pb_print_security_errors = NULL,
.collective_wait_init_cs = goya_collective_wait_init_cs,
.collective_wait_create_jobs = goya_collective_wait_create_jobs,
.get_dec_base_addr = NULL,
.scramble_addr = hl_mmu_scramble_addr,
.descramble_addr = hl_mmu_descramble_addr,
.ack_protection_bits_errors = goya_ack_protection_bits_errors,
.get_hw_block_id = goya_get_hw_block_id,
.hw_block_mmap = goya_block_mmap,
.enable_events_from_fw = goya_enable_events_from_fw,
.ack_mmu_errors = goya_ack_mmu_page_fault_or_access_error,
.map_pll_idx_to_fw_idx = goya_map_pll_idx_to_fw_idx,
.init_firmware_preload_params = goya_init_firmware_preload_params,
.init_firmware_loader = goya_init_firmware_loader,
.init_cpu_scrambler_dram = goya_cpu_init_scrambler_dram,
.state_dump_init = goya_state_dump_init,
.get_sob_addr = &goya_get_sob_addr,
.set_pci_memory_regions = goya_set_pci_memory_regions,
.get_stream_master_qid_arr = goya_get_stream_master_qid_arr,
.check_if_razwi_happened = goya_check_if_razwi_happened,
.mmu_get_real_page_size = hl_mmu_get_real_page_size,
.access_dev_mem = hl_access_dev_mem,
.set_dram_bar_base = goya_set_ddr_bar_base,
.send_device_activity = goya_send_device_activity,
.set_dram_properties = goya_set_dram_properties,
.set_binning_masks = goya_set_binning_masks,
};
/*
* goya_set_asic_funcs - set Goya function pointers
*
* @*hdev: pointer to hl_device structure
*
*/
void goya_set_asic_funcs(struct hl_device *hdev)
{
hdev->asic_funcs = &goya_funcs;
}
Annotation
- Immediate include surface: `goyaP.h`, `../include/hw_ip/mmu/mmu_general.h`, `../include/hw_ip/mmu/mmu_v1_0.h`, `../include/goya/asic_reg/goya_masks.h`, `../include/goya/goya_reg_map.h`, `linux/pci.h`, `linux/hwmon.h`, `linux/iommu.h`.
- Detected declarations: `function validate_packet_id`, `function goya_set_fixed_properties`, `function goya_pci_bars_map`, `function goya_set_ddr_bar_base`, `function goya_init_iatu`, `function goya_get_hw_state`, `function goya_early_init`, `function goya_early_fini`, `function goya_mmu_prepare_reg`, `function goya_qman0_set_security`.
- 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.
- 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.