• Home
  • Raw
  • Download

Lines Matching +full:sram +full:- +full:section

1 // SPDX-License-Identifier: GPL-2.0-only
9 #include <linux/dma-mapping.h>
19 return param == chan->device->dev; in catpt_dma_filter()
39 chan = dma_request_channel(mask, catpt_dma_filter, cdev->dev); in catpt_dma_request_config_chan()
41 dev_err(cdev->dev, "request channel failed\n"); in catpt_dma_request_config_chan()
42 return ERR_PTR(-ENODEV); in catpt_dma_request_config_chan()
54 dev_err(cdev->dev, "slave config failed: %d\n", ret); in catpt_dma_request_config_chan()
73 dev_err(cdev->dev, "prep dma memcpy failed\n"); in catpt_dma_memcpy()
74 return -EIO; in catpt_dma_memcpy()
79 CATPT_HMDC_HDDA(CATPT_DMA_DEVID, chan->chan_id), in catpt_dma_memcpy()
80 CATPT_HMDC_HDDA(CATPT_DMA_DEVID, chan->chan_id)); in catpt_dma_memcpy()
84 dev_err(cdev->dev, "submit tx failed: %d\n", ret); in catpt_dma_memcpy()
89 ret = (status == DMA_COMPLETE) ? 0 : -EPROTO; in catpt_dma_memcpy()
94 CATPT_HMDC_HDDA(CATPT_DMA_DEVID, chan->chan_id), 0); in catpt_dma_memcpy()
120 dmac = devm_kzalloc(cdev->dev, sizeof(*dmac), GFP_KERNEL); in catpt_dmac_probe()
122 return -ENOMEM; in catpt_dmac_probe()
124 dmac->regs = cdev->lpe_ba + cdev->spec->host_dma_offset[CATPT_DMA_DEVID]; in catpt_dmac_probe()
125 dmac->dev = cdev->dev; in catpt_dmac_probe()
126 dmac->irq = cdev->irq; in catpt_dmac_probe()
128 ret = dma_coerce_mask_and_coherent(cdev->dev, DMA_BIT_MASK(31)); in catpt_dmac_probe()
139 cdev->dmac = dmac; in catpt_dmac_probe()
151 dw_dma_remove(cdev->dmac); in catpt_dmac_remove()
154 static void catpt_dsp_set_srampge(struct catpt_dev *cdev, struct resource *sram, in catpt_dsp_set_srampge() argument
158 u32 off = sram->start; in catpt_dsp_set_srampge()
162 dev_dbg(cdev->dev, "SRAMPGE [0x%08lx] 0x%08lx -> 0x%08lx", in catpt_dsp_set_srampge()
169 /* wait for SRAM power gating to propagate */ in catpt_dsp_set_srampge()
181 dev_dbg(cdev->dev, "sanitize block %ld: off 0x%08x\n", in catpt_dsp_set_srampge()
182 b - __ffs(mask), off); in catpt_dsp_set_srampge()
183 memcpy_fromio(buf, cdev->lpe_ba + off, sizeof(buf)); in catpt_dsp_set_srampge()
189 void catpt_dsp_update_srampge(struct catpt_dev *cdev, struct resource *sram, in catpt_dsp_update_srampge() argument
196 for (res = sram->child; res; res = res->sibling) { in catpt_dsp_update_srampge()
199 h = (res->end - sram->start) / CATPT_MEMBLOCK_SIZE; in catpt_dsp_update_srampge()
200 l = (res->start - sram->start) / CATPT_MEMBLOCK_SIZE; in catpt_dsp_update_srampge()
210 catpt_dsp_set_srampge(cdev, sram, mask, new); in catpt_dsp_update_srampge()
262 mutex_lock(&cdev->clk_mutex); in catpt_dsp_select_lpclock()
266 dev_dbg(cdev->dev, "LPCS [0x%08lx] 0x%08x -> 0x%08x", in catpt_dsp_select_lpclock()
270 mutex_unlock(&cdev->clk_mutex); in catpt_dsp_select_lpclock()
280 dev_warn(cdev->dev, "await WAITI timeout\n"); in catpt_dsp_select_lpclock()
281 /* no signal - only high clock selection allowed */ in catpt_dsp_select_lpclock()
283 mutex_unlock(&cdev->clk_mutex); in catpt_dsp_select_lpclock()
293 dev_warn(cdev->dev, "clock change still in progress\n"); in catpt_dsp_select_lpclock()
304 dev_warn(cdev->dev, "clock change still in progress\n"); in catpt_dsp_select_lpclock()
307 cdev->spec->pll_shutdown(cdev, lp); in catpt_dsp_select_lpclock()
309 mutex_unlock(&cdev->clk_mutex); in catpt_dsp_select_lpclock()
317 list_for_each_entry(stream, &cdev->stream_list, node) in catpt_dsp_update_lpclock()
318 if (stream->prepared) in catpt_dsp_update_lpclock()
367 catpt_dsp_set_srampge(cdev, &cdev->dram, cdev->spec->dram_mask, in lpt_dsp_power_down()
368 cdev->spec->dram_mask); in lpt_dsp_power_down()
369 catpt_dsp_set_srampge(cdev, &cdev->iram, cdev->spec->iram_mask, in lpt_dsp_power_down()
370 cdev->spec->iram_mask); in lpt_dsp_power_down()
381 /* SRAM power gating none */ in lpt_dsp_power_up()
382 catpt_dsp_set_srampge(cdev, &cdev->dram, cdev->spec->dram_mask, 0); in lpt_dsp_power_up()
383 catpt_dsp_set_srampge(cdev, &cdev->iram, cdev->spec->iram_mask, 0); in lpt_dsp_power_up()
428 /* SRAM power gating all */ in wpt_dsp_power_down()
429 catpt_dsp_set_srampge(cdev, &cdev->dram, cdev->spec->dram_mask, in wpt_dsp_power_down()
430 cdev->spec->dram_mask); in wpt_dsp_power_down()
431 catpt_dsp_set_srampge(cdev, &cdev->iram, cdev->spec->iram_mask, in wpt_dsp_power_down()
432 cdev->spec->iram_mask); in wpt_dsp_power_down()
462 /* SRAM power gating none */ in wpt_dsp_power_up()
465 catpt_dsp_set_srampge(cdev, &cdev->dram, cdev->spec->dram_mask, 0); in wpt_dsp_power_up()
466 catpt_dsp_set_srampge(cdev, &cdev->iram, cdev->spec->iram_mask, 0); in wpt_dsp_power_up()
514 dump_size = resource_size(&cdev->dram); in catpt_coredump()
515 dump_size += resource_size(&cdev->iram); in catpt_coredump()
517 /* account for header of each section and hash chunk */ in catpt_coredump()
522 return -ENOMEM; in catpt_coredump()
527 hdr->magic = CATPT_DUMP_MAGIC; in catpt_coredump()
528 hdr->core_id = cdev->spec->core_id; in catpt_coredump()
529 hdr->section_id = CATPT_DUMP_SECTION_ID_FILE; in catpt_coredump()
530 hdr->size = dump_size - sizeof(*hdr); in catpt_coredump()
533 info = cdev->ipc.config.fw_info; in catpt_coredump()
538 info = strnchr(info, eof - info, ' '); in catpt_coredump()
544 memcpy(pos, info, min_t(u32, eof - info, CATPT_DUMP_HASH_SIZE)); in catpt_coredump()
548 hdr->magic = CATPT_DUMP_MAGIC; in catpt_coredump()
549 hdr->core_id = cdev->spec->core_id; in catpt_coredump()
550 hdr->section_id = CATPT_DUMP_SECTION_ID_IRAM; in catpt_coredump()
551 hdr->size = resource_size(&cdev->iram); in catpt_coredump()
554 memcpy_fromio(pos, cdev->lpe_ba + cdev->iram.start, hdr->size); in catpt_coredump()
555 pos += hdr->size; in catpt_coredump()
558 hdr->magic = CATPT_DUMP_MAGIC; in catpt_coredump()
559 hdr->core_id = cdev->spec->core_id; in catpt_coredump()
560 hdr->section_id = CATPT_DUMP_SECTION_ID_DRAM; in catpt_coredump()
561 hdr->size = resource_size(&cdev->dram); in catpt_coredump()
564 memcpy_fromio(pos, cdev->lpe_ba + cdev->dram.start, hdr->size); in catpt_coredump()
565 pos += hdr->size; in catpt_coredump()
568 hdr->magic = CATPT_DUMP_MAGIC; in catpt_coredump()
569 hdr->core_id = cdev->spec->core_id; in catpt_coredump()
570 hdr->section_id = CATPT_DUMP_SECTION_ID_REGS; in catpt_coredump()
571 hdr->size = regs_size; in catpt_coredump()
588 dev_coredumpv(cdev->dev, dump, dump_size, GFP_KERNEL); in catpt_coredump()