sound/soc/sof/intel/hda-loader-skl.c
Source file repositories/reference/linux-study-clean/sound/soc/sof/intel/hda-loader-skl.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sof/intel/hda-loader-skl.c- Extension
.c- Size
- 16695 bytes
- Lines
- 579
- Domain
- Driver Families
- Bucket
- sound/soc
- 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.
- 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
linux/delay.hlinux/device.hlinux/dma-mapping.hlinux/firmware.hlinux/fs.hlinux/interrupt.hlinux/mm.hlinux/module.hlinux/pci.hlinux/slab.hsound/hdaudio_ext.hsound/sof.hsound/pcm_params.h../sof-priv.h../ops.hhda.h
Detected Declarations
function HDA_CL_SD_CTL_FEIEfunction cl_skl_cldma_stream_runfunction cl_skl_cldma_stream_clearfunction cl_skl_cldma_setup_spbfunction cl_skl_cldma_set_intrfunction cl_skl_cldma_cleanup_spbfunction cl_skl_cldma_setup_controllerfunction cl_stream_prepare_sklfunction cl_cleanup_sklfunction cl_dsp_init_sklfunction cl_skl_cldma_fill_bufferfunction cl_skl_cldma_wait_interruptiblefunction msecs_to_jiffiesfunction cl_skl_cldma_copy_to_buffunction cl_copy_fw_sklfunction hda_dsp_cl_boot_firmware_skl
Annotated Snippet
if (ret < 0) {
dev_err(sdev->dev, "%s: dsp core start failed %d\n", __func__, ret);
goto err;
}
} else {
/* if not enabled, power down it first and then powerup and run
* the init_core.
*/
ret = hda_dsp_core_reset_power_down(sdev, chip->init_core_mask);
if (ret < 0) {
dev_err(sdev->dev, "%s: dsp core0 disable fail: %d\n", __func__, ret);
goto err;
}
ret = hda_dsp_enable_core(sdev, chip->init_core_mask);
if (ret < 0) {
dev_err(sdev->dev, "%s: dsp core0 enable fail: %d\n", __func__, ret);
goto err;
}
}
/* prepare DMA for code loader stream */
ret = cl_stream_prepare_skl(sdev, dmab, dmab_bdl);
if (ret < 0) {
dev_err(sdev->dev, "%s: dma prepare fw loading err: %x\n", __func__, ret);
return ret;
}
/* enable the interrupt */
snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIC,
HDA_DSP_ADSPIC_IPC, HDA_DSP_ADSPIC_IPC);
/* enable IPC DONE interrupt */
snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, chip->ipc_ctl,
HDA_DSP_REG_HIPCCTL_DONE,
HDA_DSP_REG_HIPCCTL_DONE);
/* enable IPC BUSY interrupt */
snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, chip->ipc_ctl,
HDA_DSP_REG_HIPCCTL_BUSY,
HDA_DSP_REG_HIPCCTL_BUSY);
/* polling the ROM init status information. */
ret = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR,
chip->rom_status_reg, status,
(FSR_TO_STATE_CODE(status)
== FSR_STATE_INIT_DONE),
HDA_DSP_REG_POLL_INTERVAL_US,
chip->rom_init_timeout *
USEC_PER_MSEC);
if (ret < 0)
goto err;
return ret;
err:
flags = SOF_DBG_DUMP_PCI | SOF_DBG_DUMP_MBOX;
snd_sof_dsp_dbg_dump(sdev, "Boot failed\n", flags);
cl_cleanup_skl(sdev, dmab, dmab_bdl);
hda_dsp_core_reset_power_down(sdev, chip->init_core_mask);
return ret;
}
static void cl_skl_cldma_fill_buffer(struct snd_sof_dev *sdev,
struct snd_dma_buffer *dmab,
unsigned int bufsize,
unsigned int copysize,
const void *curr_pos,
bool intr_enable)
{
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
/* copy the image into the buffer with the maximum buffer size. */
unsigned int size = (bufsize == copysize) ? bufsize : copysize;
memcpy(dmab->area, curr_pos, size);
/* Set the wait condition for every load. */
hda->code_loading = 1;
/* Set the interrupt. */
if (intr_enable)
cl_skl_cldma_set_intr(sdev, true);
/* Set the SPB. */
cl_skl_cldma_setup_spb(sdev, size, true);
/* Trigger the code loading stream. */
cl_skl_cldma_stream_run(sdev, true);
}
Annotation
- Immediate include surface: `linux/delay.h`, `linux/device.h`, `linux/dma-mapping.h`, `linux/firmware.h`, `linux/fs.h`, `linux/interrupt.h`, `linux/mm.h`, `linux/module.h`.
- Detected declarations: `function HDA_CL_SD_CTL_FEIE`, `function cl_skl_cldma_stream_run`, `function cl_skl_cldma_stream_clear`, `function cl_skl_cldma_setup_spb`, `function cl_skl_cldma_set_intr`, `function cl_skl_cldma_cleanup_spb`, `function cl_skl_cldma_setup_controller`, `function cl_stream_prepare_skl`, `function cl_cleanup_skl`, `function cl_dsp_init_skl`.
- Atlas domain: Driver Families / sound/soc.
- 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.