sound/soc/intel/atom/sst/sst_loader.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/atom/sst/sst_loader.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/atom/sst/sst_loader.c- Extension
.c- Size
- 12051 bytes
- Lines
- 454
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/pci.hlinux/delay.hlinux/fs.hlinux/sched.hlinux/firmware.hlinux/dmaengine.hlinux/pm_qos.hsound/core.hsound/pcm.hsound/soc.hsound/compress_driver.hasm/platform_sst_audio.h../sst-mfld-platform.hsst.h
Detected Declarations
function Copyrightfunction memcpy32_fromiofunction intel_sst_reset_dsp_mrfldfunction sst_start_mrfldfunction sst_validate_fw_imagefunction sst_fill_memcpy_listfunction sst_parse_module_memcpyfunction sst_parse_fw_memcpyfunction sst_do_memcpyfunction list_for_each_entryfunction sst_memcpy_free_resourcesfunction sst_cache_and_parse_fwfunction sst_firmware_load_cbfunction sst_request_fwfunction sst_dccm_config_writefunction sst_post_download_mrfldfunction sst_load_fw
Annotated Snippet
if (block->size <= 0) {
dev_err(sst_drv_ctx->dev, "block size invalid\n");
return -EINVAL;
}
switch (block->type) {
case SST_IRAM:
ram_iomem = sst_drv_ctx->iram;
break;
case SST_DRAM:
ram_iomem = sst_drv_ctx->dram;
break;
case SST_DDR:
ram_iomem = sst_drv_ctx->ddr;
break;
case SST_CUSTOM_INFO:
block = (void *)block + sizeof(*block) + block->size;
continue;
default:
dev_err(sst_drv_ctx->dev, "wrong ram type0x%x in block0x%x\n",
block->type, count);
return -EINVAL;
}
ret_val = sst_fill_memcpy_list(memcpy_list,
ram_iomem + block->ram_offset,
(void *)block + sizeof(*block), block->size, 1);
if (ret_val)
return ret_val;
block = (void *)block + sizeof(*block) + block->size;
}
return 0;
}
/**
* sst_parse_fw_memcpy - parse the firmware image & populate the list for memcpy
*
* @ctx : pointer to drv context
* @size : size of the firmware
* @fw_list : pointer to list_head to be populated
* This function parses the FW image and saves the parsed image in the list
* for memcpy
*/
static int sst_parse_fw_memcpy(struct intel_sst_drv *ctx, unsigned long size,
struct list_head *fw_list)
{
struct fw_module_header *module;
u32 count, num_modules;
int ret_val;
ret_val = sst_validate_fw_image(ctx, size, &module, &num_modules);
if (ret_val)
return ret_val;
for (count = 0; count < num_modules; count++) {
ret_val = sst_parse_module_memcpy(ctx, module, fw_list);
if (ret_val)
return ret_val;
module = (void *)module + sizeof(*module) + module->mod_size;
}
return 0;
}
/**
* sst_do_memcpy - function initiates the memcpy
*
* @memcpy_list: Pter to memcpy list on which the memcpy needs to be initiated
*
* Triggers the memcpy
*/
static void sst_do_memcpy(struct list_head *memcpy_list)
{
struct sst_memcpy_list *listnode;
list_for_each_entry(listnode, memcpy_list, memcpylist) {
if (listnode->is_io)
memcpy32_toio((void __iomem *)listnode->dstn,
listnode->src, listnode->size);
else
memcpy(listnode->dstn, listnode->src, listnode->size);
}
}
void sst_memcpy_free_resources(struct intel_sst_drv *sst_drv_ctx)
{
struct sst_memcpy_list *listnode, *tmplistnode;
/* Free the list */
list_for_each_entry_safe(listnode, tmplistnode,
Annotation
- Immediate include surface: `linux/pci.h`, `linux/delay.h`, `linux/fs.h`, `linux/sched.h`, `linux/firmware.h`, `linux/dmaengine.h`, `linux/pm_qos.h`, `sound/core.h`.
- Detected declarations: `function Copyright`, `function memcpy32_fromio`, `function intel_sst_reset_dsp_mrfld`, `function sst_start_mrfld`, `function sst_validate_fw_image`, `function sst_fill_memcpy_list`, `function sst_parse_module_memcpy`, `function sst_parse_fw_memcpy`, `function sst_do_memcpy`, `function list_for_each_entry`.
- Atlas domain: Driver Families / sound/soc.
- 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.