sound/soc/intel/catpt/dsp.c
Source file repositories/reference/linux-study-clean/sound/soc/intel/catpt/dsp.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/intel/catpt/dsp.c- Extension
.c- Size
- 14844 bytes
- Lines
- 538
- 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.
- 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/cleanup.hlinux/devcoredump.hlinux/dma-mapping.hlinux/firmware.hlinux/pci.hlinux/pxa2xx_ssp.hcore.hmessages.hregisters.h
Detected Declarations
struct catpt_dump_section_hdrfunction catpt_dma_filterfunction catpt_dma_memcpyfunction catpt_dma_memcpy_todspfunction catpt_dma_memcpy_fromdspfunction catpt_dmac_probefunction catpt_dmac_removefunction catpt_dsp_set_srampgefunction catpt_dsp_update_srampgefunction catpt_dsp_stallfunction catpt_dsp_resetfunction lpt_dsp_pll_shutdownfunction wpt_dsp_pll_shutdownfunction catpt_dsp_select_lpclockfunction catpt_dsp_update_lpclockfunction catpt_dsp_set_regs_defaultsfunction catpt_dsp_power_downfunction catpt_dsp_power_upfunction catpt_coredump
Annotated Snippet
struct catpt_dump_section_hdr {
u16 magic;
u8 core_id;
u8 section_id;
u32 size;
};
int catpt_coredump(struct catpt_dev *cdev)
{
struct catpt_dump_section_hdr *hdr;
size_t dump_size, regs_size;
u8 *dump, *pos;
const char *eof;
char *info;
int i;
regs_size = CATPT_SHIM_REGS_SIZE;
regs_size += CATPT_DMA_COUNT * CATPT_DMA_REGS_SIZE;
regs_size += CATPT_SSP_COUNT * CATPT_SSP_REGS_SIZE;
dump_size = resource_size(&cdev->dram);
dump_size += resource_size(&cdev->iram);
dump_size += regs_size;
/* account for header of each section and hash chunk */
dump_size += 4 * sizeof(*hdr) + CATPT_DUMP_HASH_SIZE;
dump = vzalloc(dump_size);
if (!dump)
return -ENOMEM;
pos = dump;
hdr = (struct catpt_dump_section_hdr *)pos;
hdr->magic = CATPT_DUMP_MAGIC;
hdr->core_id = cdev->spec->core_id;
hdr->section_id = CATPT_DUMP_SECTION_ID_FILE;
hdr->size = dump_size - sizeof(*hdr);
pos += sizeof(*hdr);
info = cdev->ipc.config.fw_info;
eof = info + FW_INFO_SIZE_MAX;
/* navigate to fifth info segment (fw hash) */
for (i = 0; i < 4 && info < eof; i++, info++) {
/* info segments are separated by space each */
info = strnchr(info, eof - info, ' ');
if (!info)
break;
}
if (i == 4 && info)
memcpy(pos, info, min_t(u32, eof - info, CATPT_DUMP_HASH_SIZE));
pos += CATPT_DUMP_HASH_SIZE;
hdr = (struct catpt_dump_section_hdr *)pos;
hdr->magic = CATPT_DUMP_MAGIC;
hdr->core_id = cdev->spec->core_id;
hdr->section_id = CATPT_DUMP_SECTION_ID_IRAM;
hdr->size = resource_size(&cdev->iram);
pos += sizeof(*hdr);
memcpy_fromio(pos, catpt_iram_addr(cdev), hdr->size);
pos += hdr->size;
hdr = (struct catpt_dump_section_hdr *)pos;
hdr->magic = CATPT_DUMP_MAGIC;
hdr->core_id = cdev->spec->core_id;
hdr->section_id = CATPT_DUMP_SECTION_ID_DRAM;
hdr->size = resource_size(&cdev->dram);
pos += sizeof(*hdr);
memcpy_fromio(pos, catpt_dram_addr(cdev), hdr->size);
pos += hdr->size;
hdr = (struct catpt_dump_section_hdr *)pos;
hdr->magic = CATPT_DUMP_MAGIC;
hdr->core_id = cdev->spec->core_id;
hdr->section_id = CATPT_DUMP_SECTION_ID_REGS;
hdr->size = regs_size;
pos += sizeof(*hdr);
memcpy_fromio(pos, catpt_shim_addr(cdev), CATPT_SHIM_REGS_SIZE);
pos += CATPT_SHIM_REGS_SIZE;
for (i = 0; i < CATPT_SSP_COUNT; i++) {
memcpy_fromio(pos, catpt_ssp_addr(cdev, i),
CATPT_SSP_REGS_SIZE);
pos += CATPT_SSP_REGS_SIZE;
}
for (i = 0; i < CATPT_DMA_COUNT; i++) {
memcpy_fromio(pos, catpt_dma_addr(cdev, i),
CATPT_DMA_REGS_SIZE);
Annotation
- Immediate include surface: `linux/cleanup.h`, `linux/devcoredump.h`, `linux/dma-mapping.h`, `linux/firmware.h`, `linux/pci.h`, `linux/pxa2xx_ssp.h`, `core.h`, `messages.h`.
- Detected declarations: `struct catpt_dump_section_hdr`, `function catpt_dma_filter`, `function catpt_dma_memcpy`, `function catpt_dma_memcpy_todsp`, `function catpt_dma_memcpy_fromdsp`, `function catpt_dmac_probe`, `function catpt_dmac_remove`, `function catpt_dsp_set_srampge`, `function catpt_dsp_update_srampge`, `function catpt_dsp_stall`.
- Atlas domain: Driver Families / sound/soc.
- 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.