Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial support for HIFI4 DSP on imxrt600 board #71061

Closed

Conversation

dbaluta
Copy link
Collaborator

@dbaluta dbaluta commented Apr 3, 2024

  • this adds SOC definitions
  • DTS
  • board definition

@dbaluta
Copy link
Collaborator Author

dbaluta commented Apr 4, 2024

Changes since v1:

  • fix whitespaces to make compliance check happy

@dbaluta dbaluta force-pushed the mimxrt685_add_dsp branch from 50fcfe3 to ef1b52b Compare April 5, 2024 07:52
@dbaluta
Copy link
Collaborator Author

dbaluta commented Apr 5, 2024

Changes since v2:

  • removed rimage custom command

@@ -115,3 +115,32 @@ choice USB_MCUX_CONTROLLER_TYPE
endchoice

endif # SOC_MIMXRT685S_CM33

if SOC_MIMXRT685S_ADSP
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be worth attempting to de-centralize Kconfig.defconfig here (aka have a per-cluster Kconfig.deconfig placed in each cluster's directory and sourced in the main Kconfig.defconfig). Should make the main Kconfig.defconfig easier to read and, overall, should be cleaner. Maybe same could be applicable to Kconfig and Kconfig.soc? Although I question if it would be worth doing it for Kconfig.soc since it doesn't contain much?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is too much of an overkill right now and we could do that later when this files gets bigger. Also, imxrt595 already has this implementation and prefer to keep it consistent.

dbaluta added 2 commits April 8, 2024 14:44
Add SoC definitions and a linker file for the HIFI4 DSP
found on the NXP i.MXRT685 microcontroller.

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This adds a board for HIFI4 DSP found on i.MXRT865 microcontroller.
It adds the initial configuration files, dts and documentation.

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
@dbaluta dbaluta force-pushed the mimxrt685_add_dsp branch from ef1b52b to ef35404 Compare April 8, 2024 11:45
@dbaluta
Copy link
Collaborator Author

dbaluta commented Apr 8, 2024

Changes since v3:

  • removed io.h file as this was an interface exported by Zephyr to SOF which is not yet supported
  • removed default config for DCACHE, CACHE_MANAGEMENT and LOG as their default values is already correct


$ west build -b mimxrt685_evk/mimxrt685s/adsp samples/hello_world

Debugging can be directly carried out using the J-Link GDB server with ``xt-gdb`` connected. It's
Copy link
Member

Choose a reason for hiding this comment

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

Are we able to use LinkServer to debug the DSP?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@VitekST can you please chime in here?

Copy link
Contributor

Choose a reason for hiding this comment

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

@dleach02 No, not that I am aware.

{
int irq;

if (mask & BIT(0)) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we not have #defines for all these bit masks?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dleach02 this file is auto-generated by Xtensa tools and prefer to keep it like that. Same approach is taken for all intances of this file for intel_adsp, nxp_adsp, espressif.

Copy link
Collaborator

@danieldegrasse danieldegrasse left a comment

Choose a reason for hiding this comment

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

General comment here- should we provide some form of code to boot the DSP at the SOC level? Currently, my understanding is that anyone wanting to use this enablement would need some application level code/build infrastructure to:

  • build the ADSP image
  • copy the ADSP image binary to the right offset in RAM (or potentially multiple offsets, if the data and text sections need to be located in different regions)
  • Setup clocks for the DSP and release it from reset

I'm aware this may be out of scope for this PR, and that what we have here matches the enablement for the RT500 in tree. However, I think it would be useful for customers to have some in tree code to help booting the DSP core, and moreover would be helpful for testing purposes if we expand the ADSP enablement.

If we don't add code to do this, I think at a minimum outlining the steps required in the board documentation would be helpful

if SOC_SERIES_IMXRT6XX

config MCUX_CORE_SUFFIX
default "_cm33" if SOC_MIMXRT685S_CM33
default "_adsp" if SOC_MIMXRT685S_ADSP
endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

We probably want the endif here to be after the if block for SOC_MIMXRT685S_CM33, right? Like so:

if SOC_SERIES_IMXRT6XX

# Common Kconfigs, IE MCUX_CORE_SUFFIX

if SOC_MIMXRT685S_CM33

# RT685 CM33 specific Kconfigs

endif # SOC_MIMXRT685S_CM33

endif # SOC_SERIES_IMXRT6XX

Stack space is reserved at the end of the RT685_ADSP_DATA_MEM
region, starting at RT685_ADSP_DATA_MEM_ADDR - RT685_ADSP_STACK_SIZE

config RT685_ADSP_RESET_MEM_ADDR
Copy link
Collaborator

Choose a reason for hiding this comment

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

Given that these Kconfigs are used at the SOC level, should they be declared there?

@@ -34,3 +34,4 @@ family:
- name: mimxrt685s
cpuclusters:
- name: cm33
- name: adsp
Copy link
Collaborator

Choose a reason for hiding this comment

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

For the RT595, we name the ADSP core f1, since it is a fusion F1. My rational for doing this is that it follows how we name ARM core clusters in tree. Would you prefer to keep the adsp naming here, or refer to this DSP as the hifi4? I don't have a strong preference

@VitekST
Copy link
Contributor

VitekST commented Apr 10, 2024

@danieldegrasse About initialisation of the DSP, I believe it's on the roadmap, as I've written a driver for exactly that purpose in #65229, which has been closed: https://github.com/zephyrproject-rtos/zephyr/pull/65229/files#diff-6916b9e13247d4852595c6b593424b9266520258663d0677a47518849078be7f

@dbaluta just took some burden off me by trying to get my code adapted to HWM2 and merged, or, at least, that's my understanding.

@teburd
Copy link
Collaborator

teburd commented Apr 19, 2024

Nice!

Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Jun 19, 2024
@github-actions github-actions bot closed this Jul 3, 2024
@maxekman
Copy link

@dbaluta Hi! Any chance this PR can be reopened and eventually merged?

@VitekST
Copy link
Contributor

VitekST commented Sep 14, 2024

@maxekman The work is continued here: #77814

@maxekman
Copy link

Thanks for the pointer @VitekST!

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

Successfully merging this pull request may close these issues.

8 participants