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

nxp: imx93_a55: Switch to timer domain and Zephyr native drivers #8520

Merged
merged 3 commits into from
Mar 25, 2024

Conversation

LaurentiuM1234
Copy link
Contributor

@LaurentiuM1234 LaurentiuM1234 commented Nov 24, 2023

With this PR, the i.MX93 platform will now start using the timer domain in conjunction with the Zephyr native drivers.

Zephyr dependencies:

  1. drivers: dma: Introduce driver for NXP's eDMA IP zephyrproject-rtos/zephyr#65671 (EDMA)
  2. nxp: Add SAI driver with the DAI interface zephyrproject-rtos/zephyr#65187 (DAI)
  3. soc: mimx9: Remove SAI and EDMA static mappings zephyrproject-rtos/zephyr#65679 (removal of SAI3 and EDMA static mappings)
  4. include: drivers: dai: Align DAI direction with SOF direction zephyrproject-rtos/zephyr#65684 (DAI_DIR_{TX/RX} value adjustment)

Important notes:

  1. Currently, the PR is split in multiple commits. This is done to ease the reviewing process, but most of the commits will be squashed into a single one to avoid breaking git bisect.
  2. If git dependency 3 is merged before this PR and the Zephyr revision is bumped up this will lead to SOF no longer working on i.MX93 because the SAI and EDMA address spaces will no longer have any mappings, leading to translation faults.
  3. The transition to timer domain is mandatory because the DMA domain is unusable with the Zephyr native drivers ATM.

@lgirdwood
Copy link
Member

@LaurentiuM1234 I'm guessing someone from NXP will test after Zephyr PRs merge and update topologies to use timer ?

@LaurentiuM1234
Copy link
Contributor Author

@LaurentiuM1234 I'm guessing someone from NXP will test after Zephyr PRs merge and update topologies to use timer ?

The Zephyr PRs will only affect i.MX93 which has one topology that's updated in this PR

src/audio/host-zephyr.c Outdated Show resolved Hide resolved
@LaurentiuM1234 LaurentiuM1234 force-pushed the imx93_native_switch branch 2 times, most recently from 07b432a to a7e1110 Compare November 28, 2023 12:41
src/audio/host-zephyr.c Outdated Show resolved Hide resolved
src/audio/host-zephyr.c Outdated Show resolved Hide resolved
@LaurentiuM1234
Copy link
Contributor Author

V2 updates

  1. dma_block_cfg is now allocated on the heap.
  2. CONFIG_DAI=y has been removed from i.MX93's configuration file. It's already enabled via prf.conf
  3. Removed CONFIG_SAI_HAS_XCR4_CHMOD as a consequence to it being removed from the Zephyr driver.

@keqiaozhang
Copy link
Collaborator

SOFCI TEST

@LaurentiuM1234
Copy link
Contributor Author

V3 updates

  1. Removed selection of CONFIG_DMA_DOMAIN from CONFIG_IMX93_A55. DMA domain is no longer used on i.MX93 so no need to compile zephyr_dma_domain.c.

@lgirdwood lgirdwood added this to the v2.9 milestone Dec 18, 2023
@lgirdwood
Copy link
Member

@LaurentiuM1234 @dbaluta I've penciled in for v2.9.

@LaurentiuM1234
Copy link
Contributor Author

V4 updates

  1. Added support for 93 SAI errata 051421.
  2. Some EDMA naming-related changes in configurations and overlay to match the changes from upstream.

@dbaluta
Copy link
Collaborator

dbaluta commented Jan 17, 2024

There is some issues with compilation on Windows:

https://github.com/thesofproject/sof/actions/runs/7555242327/job/20569791161?pr=8520

@LaurentiuM1234
Copy link
Contributor Author

There is some issues with compilation on Windows:

https://github.com/thesofproject/sof/actions/runs/7555242327/job/20569791161?pr=8520

That's normal ATM. Since we're still missing the EDMA driver, I can't bump up the Zephyr revision.

@dbaluta
Copy link
Collaborator

dbaluta commented Jan 17, 2024

Thanks! Now i see the DNM tag.

app/boards/mimx93_evk_a55.overlay Outdated Show resolved Hide resolved
app/boards/mimx93_evk_a55.overlay Outdated Show resolved Hide resolved
src/audio/host-zephyr.c Outdated Show resolved Hide resolved
@LaurentiuM1234 LaurentiuM1234 force-pushed the imx93_native_switch branch 2 times, most recently from ec6fbc8 to 314825c Compare January 25, 2024 09:46
@LaurentiuM1234
Copy link
Contributor Author

V5 updates:

  1. Most Zephyr dependencies have been merged, added west.yml bump. Waiting on dai: nxp: sai: Disable data line on pause trigger zephyrproject-rtos/zephyr#67907

@LaurentiuM1234 LaurentiuM1234 force-pushed the imx93_native_switch branch 3 times, most recently from 3ae68ab to f45fa54 Compare February 1, 2024 22:35
@LaurentiuM1234
Copy link
Contributor Author

V6 updates

  1. Dependencies merged, updated Zephyr manifest and 64-bit CI build is now clean.
  2. Switched to RX SYNC - TX ASYNC mode. See comments from overlay for explanation.

A few notes:

  1. Current PR layout will break git bisect. Since 93 is not officially supported in the kernel and is mostly used to test out new stuff I would be inclined to keep the layout as-is as long as this won't affect anyone else.
  2. Bunch of CI failures, some of them caused by the recent SMP changes from Zephyr.
  3. Need to re-test everything to make sure the native switch works ok. Will lift the DNM tag once this is done and the SMP-related issues are fixed. Also need to make sure that this PR isn't a cause for the other non-SMP-related CI failures.

@LaurentiuM1234
Copy link
Contributor Author

LaurentiuM1234 commented Feb 7, 2024

@lgirdwood @kv2019i do we, by any chance, have an ETA on the fix for the SMP-related issues? It would be very helpful. Thanks!

EDIT: just found #8818 tracking this. Sorry for the unnecessary ping!

@kv2019i
Copy link
Collaborator

kv2019i commented Mar 4, 2024

We are very close to unblocking Zephyr updates now, but as there are still issues, we'll do SOF2.9 with old Zephyr baseline. I'll bump this to 2.10.

@kv2019i kv2019i modified the milestones: v2.9, v2.10 Mar 4, 2024
@LaurentiuM1234
Copy link
Contributor Author

V7 updates

  1. EDMA4 and SAI3 nodes have been moved to Zephyr (see dts: nxp: imx93: add nodes for SAI3 and EDMA4 zephyrproject-rtos/zephyr#70045). All we do here is enable and configure them for SOF usage.
  2. Removed commits that were already merged via Preparatory patches for NXP platforms transition to Zephyr native drivers #8859
  3. Removed cleanup commits. This will be handled separately.

Bump up Zephyr revision to fetch a Zephyr version that
contains the following patch:
	1) 64ba1b221091c343f7cca79a7970981eb1ff3a35
	("dts: nxp: imx93: add nodes for SAI3 and EDMA4")
This is required for the transition to Zephyr native drivers
on i.MX93.

Signed-off-by: Laurentiu Mihalcea <[email protected]>
This commit introduces the necessary changes to the overlay
and configuration files required for enabling the Zephyr native
SAI, EDMA and HOST DMA drivers on i.MX93.

Signed-off-by: Laurentiu Mihalcea <[email protected]>
Starting with this commit, i.MX93 now uses the timer domain
in conjunction with the Zephyr native drivers.

Signed-off-by: Laurentiu Mihalcea <[email protected]>
@LaurentiuM1234
Copy link
Contributor Author

V8 updates

  1. All dependencies have been merged. Removing the [DNM] tag.
  2. Added manifest update

@LaurentiuM1234 LaurentiuM1234 changed the title [DNM]: nxp: imx93_a55: Switch to timer domain and Zephyr native drivers nxp: imx93_a55: Switch to timer domain and Zephyr native drivers Mar 22, 2024
@dbaluta dbaluta merged commit aaf2f11 into thesofproject:main Mar 25, 2024
43 of 45 checks passed
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.

7 participants