Skip to content

sc846: add remoteproc support - #3499

Draft
artursartamonovsadi wants to merge 3 commits into
adsp-6.18.31-yfrom
arturs/adsp/sc846-remoteproc
Draft

artursartamonovsadi wants to merge 3 commits into
adsp-6.18.31-yfrom
arturs/adsp/sc846-remoteproc

Conversation

@artursartamonovsadi

Copy link
Copy Markdown

PR Description

Add support for remoteproc support on sc846 platform

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

  Update the SC846 SoM SHARC-FX node for the new remoteproc interface,
  including reset, system-vector, mailbox and vring configuration. Correct
  the L1 and L2 address ranges and relocate the resource table and vring
  into L2 memory.

Signed-off-by: Arturs Artamonovs <Arturs.Artamonovs@analog.com>
  Allow ADI_REMOTEPROC to be selected on ARCH_SC84X platforms so their
  SHARC DSP cores can use the ADI remoteproc driver.

Signed-off-by: Arturs Artamonovs <Arturs.Artamonovs@analog.com>
  Enable the ADI remoteproc driver to load ELF firmware alongside existing
  LDR images. Translate SHARC device addresses to physical memory and use
  MDMA to load segments and clear zero-filled regions, avoiding unsupported
  narrow ARM accesses to SHARC-FX instruction RAM.

  Set the system vector from the ELF entry point and use an embedded
  resource table when available. Fall back to the driver's built-in table
  for firmware without a resource table so RPMsg remains supported.

  Also correct L1 device-to-virtual address translation.

Signed-off-by: Arturs Artamonovs <Arturs.Artamonovs@analog.com>
@artursartamonovsadi
artursartamonovsadi requested review from a team and ukleinek August 18, 2026 16:02
@pamolloy pamolloy added this to ADSP Aug 19, 2026
@pamolloy pamolloy added the sc846 Support for the ADSP-SC846 label Aug 19, 2026

@ukleinek ukleinek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I didn't test this yet on sc5xx (but intent to). Just some general, mostly nitpick comments.

u32 verify;
struct adi_sharc_resource_table *adi_rsc_table;
struct sharc_resource_table *loaded_rsc_table;
/* True when the resource table came from the firmware image itself

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/* True when the resource table came from the firmware image itself
/*
* True when the resource table came from the firmware image itself

Comment on lines +550 to +559
* adi_elf_load_segments: load ELF PT_LOAD segments over MDMA
*
* Mirrors rproc_elf_load_segments() but routes every write through MDMA
* rather than memcpy(), because IRAM cannot take narrow accesses from the
* ARM. See adi_rproc_dma_write().
*
* The SPU is held open for the duration of the load, as the LDR path does:
* the SHARC-FX bus completer ports reject non-secure accesses with an error
* response rather than completing them.
*/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't see how, but this would be considerably easier to mainline if it could reuse rproc_elf_load_segments() somehow (or a generic extension of it).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I will try to look into it. As far as I understood problem is that Linux is non-secure level, and L2 access to SHARC-FX is only allowed to use with MDMA from non-secure state, when its also set in SPU to accept non secure access. MDMA SPU configured from U-boot

* ELF has no equivalent pass, and without this ldr_load_addr would
* still hold SHARC_IDLE_ADDR from probe, leaving the core spinning in
* the bootrom idle loop instead of running the loaded firmware. Use
* the entry point remoteproc resolved through .get_boot_addr.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* the entry point remoteproc resolved through .get_boot_addr.
* the entry point remoteproc resolved through .get_boot_addr().

Comment on lines -555 to +893
if (ret < 0)
if (ret < 0) {
return ret;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This hunk should be dropped.

Comment on lines -781 to +1124
if (da >= rproc_data->l1_da_range[0] && da < rproc_data->l1_da_range[1])
ret = L1_shared_base + da;
else if (da >= rproc_data->l2_da_range[0] && da < rproc_data->l2_da_range[1])
if (da >= rproc_data->l1_da_range[0] && da < rproc_data->l1_da_range[1]) {
ret = L1_shared_base + (da - rproc_data->l1_da_range[0]);
}
else if (da >= rproc_data->l2_da_range[0] && da < rproc_data->l2_da_range[1]) {
ret = L2_shared_base + (da - rproc_data->l2_da_range[0]);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This only adds curly braces that are not welcome in the kernel coding style. Please drop this hunk.

&svect_args);
if (ret)
return dev_err_probe(dev, ret, "Missing adi,svect property\n");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would keep this empty line.

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

Labels

sc846 Support for the ADSP-SC846

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants