Skip to content

remoteproc: adi: replace MDMA memcpy with memcpy_toio for LDR load#3268

Open
vasbimpikasadi wants to merge 1 commit into
analogdevicesinc:adsp-6.12.0-yfrom
vasbimpikasadi:LNXDSP-1348/remoteproc-replace-mdma-with-memcpy
Open

remoteproc: adi: replace MDMA memcpy with memcpy_toio for LDR load#3268
vasbimpikasadi wants to merge 1 commit into
analogdevicesinc:adsp-6.12.0-yfrom
vasbimpikasadi:LNXDSP-1348/remoteproc-replace-mdma-with-memcpy

Conversation

@vasbimpikasadi
Copy link
Copy Markdown

MDMA writes to SHARC L2 memory (0x200xxxxx) are silently rejected at the bus fabric level on ADSP-SC573 and ADSP-SC589. The MDMA engine stalls waiting for a write ACK that never comes (DMA_STAT.RUN=4, IRQERR=0), and the remoteproc driver times out.

Use memcpy_toio/memset_io with the L1 and L2 virtual mappings already established in probe (L1_shared_base, L2_shared_base) instead of the MDMA engine. This follows the same pattern as rproc_elf_load_segments() in remoteproc_elf_loader.c which uses memcpy_toio when the target region is IOMEM.

Remove the now-unused MDMA infrastructure: dmaengine_get/put, dma_alloc_coherent bounce buffer, SPU permission setup for MDMA channels, and the completion callback.

Tested on ADSP-SC589-MINI with a synthetic 128 KB L2 stress LDR image.

PR Description

  • Please replace this comment with a summary of your changes, and add any context
    necessary to understand them. List any dependencies required for this change.
  • To check the checkboxes below, insert a 'x' between square brackets (without
    any space), or simply check them after publishing the PR.
  • If you changes include a breaking change, please specify dependent PRs in the
    description and try to push all related PRs simultaneously.

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have compiled my changes, including the documentation
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly
  • I have provided links for the relevant upstream lore

MDMA writes to SHARC L2 memory (0x200xxxxx) are silently rejected at
the bus fabric level on ADSP-SC573 and ADSP-SC589. The MDMA engine
stalls waiting for a write ACK that never comes (DMA_STAT.RUN=4,
IRQERR=0), and the remoteproc driver times out.

Use memcpy_toio/memset_io with the L1 and L2 virtual mappings already
established in probe (L1_shared_base, L2_shared_base) instead of the
MDMA engine. This follows the same pattern as rproc_elf_load_segments()
in remoteproc_elf_loader.c which uses memcpy_toio when the target
region is IOMEM.

Remove the now-unused MDMA infrastructure: dmaengine_get/put,
dma_alloc_coherent bounce buffer, SPU permission setup for MDMA
channels, and the completion callback.

Tested on ADSP-SC589-MINI with a synthetic 128 KB L2 stress LDR image.

Signed-off-by: Vasileios Bimpikas <vasileios.bimpikas@analog.com>

if (!tx) {
dev_err(rproc_data->dev, "Failed to allocate dma transaction\n");
if (addr >= rproc_data->l1_da_range[0] &&
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where this ranges comes from L2 only for vring's or L3. Firmware is loaded to L3

return -EINVAL;
}

void set_spu_securep_msec(u16 n, bool msec);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In comment section
'''
MDMA writes to SHARC L2 memory (0x200xxxxx) are silently rejected at the bus fabric level on ADSP-SC573 and ADSP-SC589. The MDMA engine stalls waiting for a write ACK that never comes (DMA_STAT.RUN=4, IRQERR=0), and the remoteproc driver times out.
''' does it means that SPU is enabled , when transaction is running and actually that error because SPU is enabled by other cores? And isn't this just suppressing error rather fixing underlying issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants