Skip to content

WIP: mcu: consolidated MCU platform ports (ESP32-P4/S3/C6, Teensy 4.1, Nordic nRF54, RP2350) - #11522

Draft
lgirdwood wants to merge 16 commits into
thesofproject:mainfrom
lgirdwood:feature/mcu-ports
Draft

lgirdwood wants to merge 16 commits into
thesofproject:mainfrom
lgirdwood:feature/mcu-ports

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

Consolidates all 6 MCU SOF/Zephyr platform ports onto a single main-rebased branch (lgirdwood:feature/mcu-ports) paired with lgirdwood:feature/mcu-dai-ports in west.yml:

Consolidated Platforms

  • PJRC Teensy 4.1 (teensy41 / NXP i.MX RT1062) — S/PDIF and SAI1 I2S loopback, Audio PLL4 scheduling (ZEPHYR_DOMAIN_AUDIO_TIMER)
  • Espressif ESP32-P4 (esp32p4_function_ev_board) — I2S and PDM loopback, PIE/RISC-V DSP acceleration
  • Espressif ESP32-S3 (nano_esp32s3) — USB Audio Class 2.0 + I2S loopback and CLI test bridge
  • Espressif ESP32-C6 (esp32c6_devkitc, xiao_esp32c6) — I2S loopback
  • Nordic nRF54 (nrf54l15dk, nrf54lm20dk) — USB Audio Class 2.0 + TDM rate-matched loopback
  • Raspberry Pi RP2350 (rpi_pico2) — USB Audio Class 2.0 float audio pipeline (EQ, DRC, Volume)

Unified Architecture Highlights

  • Shared static topology loader lifecycle (COMP_STATE_PAUSED -> pipeline_prepare() -> COMP_TRIGGER_PRE_START / START, task cancellation before STOP, cached kcontrol restoration)
  • Unified static_pipeline_uac2 USB Audio Class 2.0 bridge and feature-unit bypass/mute handling
  • Cooperative CONFIG_LL_THREAD_PRIORITY=-16 across USB-audio MCU targets to avoid usbd_thread preemption during pipeline_copy()

Superseded Individual PRs

Supersedes #11194, #11197, #11200, #11224, #11228, and #11438.

… unsigned int

Align drc_arm.c helper signatures and local loop/index variables with
commit 1fe1b8c ("audio: drc: use size_t for byte, sample and frame
counts"):
- Use size_t for byte, division frame, and loop indices (nbyte,
  div_start, count, i, j, inc).
- Use unsigned int for channel counts and indices (nch, ch).
- Use bool for boolean flags (is_release, is_releasing, is_bad_db,
  is_2byte).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
… builds

Allow CONFIG_SOF_FULL_ZEPHYR_APPLICATION targets without CONFIG_USERSPACE
(such as single-core ARM Cortex-M microcontrollers) to build cleanly:
- Guard generated <zephyr/syscalls/*.h> includes with CONFIG_USERSPACE and
  map syscall wrappers directly to z_impl_* functions when userspace is
  disabled.
- Set Cortex-M cache line fallback alignment to 32 bytes in rtos/cache.h
  while preserving 64 bytes for host/POSIX library builds.
- Ensure generated sof_versions.h and uuid-registry.h are created and
  added to include paths before building SOF subdirectories and app.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Wire up NXP i.MX SAI, S/PDIF, ESAI, and MICFIL DAI types in IPC4/IPC3 DAI
lookup and DMA device mapping so Zephyr-based NXP i.MX / i.MX RT platforms
can instantiate SAI and S/PDIF Copiers in IPC4 pipelines.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…ine capture

- Add CONFIG_ZEPHYR_DOMAIN_AUDIO_TIMER to drive the Zephyr LL scheduling
  domain directly from hardware DAI DMA period completion callbacks while
  suppressing SysTick k_timer ticks when audio is active.
- Scope eDMA source/destination address increment setup in dai-zephyr.c
  to NXP i.MX DAI types.
- Allow DAI component state transitions in dai_comp_trigger_internal() when
  CONFIG_STATIC_PIPELINE is enabled alongside IPC4.
- Pass (dma_fmt, local_fmt) instead of (local_fmt, dma_fmt) to
  pcm_get_conversion_function() for capture streams in
  set_new_local_buffer().
- Reset static pipelines cleanly on XRUN recovery when host IPC stream
  structures are absent.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…ipeline bridge

- Add the COMP_USB_AUDIO host endpoint component with lock-free SPSC
  playback/capture ring buffers and asynchronous USB SOF-to-DAI rate
  estimation for explicit UAC2 feedback.
- Extend upstream static_pipeline_uac2.c to bridge Zephyr UAC2 callbacks
  with COMP_USB_AUDIO ring buffers, support zero-copy UAC2 capture double-
  buffer replenishment via static_pipeline_uac2_buf_release(), and query
  the playback rate adjustment for USB feedback.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add Sound Open Firmware platform and board support for PJRC Teensy 4.1
(NXP i.MX RT1062 Cortex-M7 @ 600 MHz):
- src/platform/teensy41/: pure SOF platform initialization, clocks, memory
  layout, and upstream static_pipeline descriptor graph (USB Audio <->
  Volume <-> S/PDIF or SAI1 I2S Copier).
- zephyr/lib/{alloc.c,dma.c}: static SOF heap and eDMA0 registration.
- app/boards/teensy41.{conf,overlay} & app/src/: Zephyr UAC2 composite
  device initialization, HalfKay bootloader soft-reboot request (0xFB),
  and upstream static_pipeline startup.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…priority

- static_pipeline_loader: pause pipelines cleanly instead of hard component resets on stop, cancel pipe_task before COMP_TRIGGER_STOP, and restore cached kcontrols on restart
- static_pipeline_uac2: unify SOF-driven LL pipeline copy without synchronous UAC2 copy hacks, preserve effect bypass switches on mute, and maintain continuous ISO IN streaming on Teensy/RP2350/nRF54LM20
- boards: set CONFIG_LL_THREAD_PRIORITY=-16 (cooperative) across RP2350, Teensy 4.1, and nRF54LM20 to prevent usbd_thread (-8) preemption mid-pipeline_copy()
- usb_audio / i2s_audio / dai-zephyr / pipeline-stream / platform defs: add adaptive TDM rate-matching and clean non-module-adapter endpoint handling
- eq_iir / drc_arm / volume: support float and fixed-point MCU pipeline configurations cleanly

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…upport

- Add esp32s3_cam_ov5640_esp32s3_procpu config and overlay (UAC2, CDC-ACM, I2C0, I2S0 GPIO10-14 with 256*fs MCLK)
- Add Waveshare codec driver for CH32V003 PA control (0x24), ES8311 DAC (0x18), and ES7210 dual-mic ADC (0x40)
- Default ESP32-S3 topology to I2S master clock mode on Waveshare OV5640, initialize codecs after topology setup, sync codec rate on UAC2 rate changes, and identify board as 'SOF ESP32S3 Waveshare CAM'

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
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