Repository navigation
platform: teensy41: add PJRC Teensy 4.1 platform support, Audio PLL scheduling, and UAC2 loopback #11197
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
Draft
lgirdwood
wants to merge
7
commits into
thesofproject:main
Choose a base branch
from
lgirdwood:feature/teensy41-sof-port
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
platform: teensy41: add PJRC Teensy 4.1 platform support, Audio PLL scheduling, and UAC2 loopback #11197
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2f02645
audio: drc: arm: align byte, frame, and channel types with size_t and…
lrgirdwo d31fd70
zephyr: build: guard userspace syscalls and support Cortex-M full app…
lrgirdwo 5453993
ipc4: dai: add support for NXP i.MX SAI, SPDIF, ESAI, and MICFIL DAIs
lrgirdwo 88d8e08
audio: dai-zephyr: support audio timer LL scheduling and static pipel…
lrgirdwo 6da005e
audio: usb_audio: add USB Audio Class 2.0 host component and static p…
lrgirdwo 1d3e8e0
west: manifest: temporarily reference Zephyr fork for Teensy 4.1 DAI …
lrgirdwo 078b9a8
platform: teensy41: add PJRC Teensy 4.1 platform and board support
lrgirdwo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| # Target Platform & SOF Core | ||
| CONFIG_PLATFORM_TEENSY41=y | ||
| CONFIG_SOF_FULL_ZEPHYR_APPLICATION=y | ||
| CONFIG_IPC_MAJOR_4=y | ||
| CONFIG_COMP_BASEFW_IPC4=n | ||
| CONFIG_CROSS_CORE_STREAM=n | ||
| CONFIG_STATIC_PIPELINE=y | ||
| CONFIG_ZEPHYR_NATIVE_DRIVERS=y | ||
| CONFIG_SYS_HEAP_BIG_ONLY=y | ||
| CONFIG_BUILD_OUTPUT_HEX=y | ||
| CONFIG_BUILD_OUTPUT_BIN=y | ||
|
|
||
| # Zephyr DAI & DMA Drivers for NXP i.MX RT1062 | ||
| CONFIG_DAI=y | ||
| CONFIG_DAI_NXP_SAI=y | ||
| CONFIG_DAI_NXP_SPDIF=y | ||
| CONFIG_PINCTRL=y | ||
| CONFIG_DMA=y | ||
| CONFIG_DMA_MCUX_EDMA=y | ||
| CONFIG_DMA_TCD_QUEUE_SIZE=8 | ||
| CONFIG_DMA_MCUX_USE_DTCM_FOR_DMA_DESCRIPTORS=n | ||
|
|
||
| # Audio Processing Modules & ARM SIMD Optimizations | ||
| CONFIG_COMP_VOLUME=y | ||
| CONFIG_VOLUME_ARM_SIMD=y | ||
| CONFIG_COMP_IIR=y | ||
| CONFIG_EQ_IIR_ARM_SIMD=y | ||
| CONFIG_FILTER_ARM_SIMD=y | ||
| CONFIG_COMP_FIR=y | ||
| CONFIG_COMP_DRC=y | ||
| CONFIG_DRC_ARM_SIMD=y | ||
| CONFIG_COMP_CROSSOVER=y | ||
| CONFIG_COMP_DCBLOCK=y | ||
| CONFIG_DCBLOCK_ARM_SIMD=y | ||
| CONFIG_COMP_MULTIBAND_DRC=y | ||
| CONFIG_COMP_TDFB=y | ||
| CONFIG_COMP_USB_AUDIO=y | ||
| CONFIG_COMP_LEVEL_MULTIPLIER=y | ||
| CONFIG_COMP_SEL=y | ||
| CONFIG_COMP_MUX=y | ||
| CONFIG_COMP_MIXIN_MIXOUT=y | ||
| CONFIG_MIXIN_MIXOUT_ARM_SIMD=y | ||
| CONFIG_FORMAT_CONVERT_ARM_SIMD=y | ||
|
|
||
| # USB Device Stack Next & UAC2 Class | ||
| CONFIG_USB_DEVICE_STACK_NEXT=y | ||
| CONFIG_CDC_ACM_SERIAL_INITIALIZE_AT_BOOT=n | ||
| CONFIG_USBD_AUDIO2_CLASS=y | ||
| CONFIG_UDC_ENABLE_SOF=y | ||
| CONFIG_UDC_NXP_EHCI=y | ||
| CONFIG_UDC_BUF_COUNT=64 | ||
| CONFIG_UDC_BUF_POOL_SIZE=16384 | ||
| CONFIG_UDC_WORKQUEUE_PRIORITY=-10 | ||
| CONFIG_UDC_NXP_EVENT_COUNT=16 | ||
| CONFIG_UDC_WORKQUEUE_STACK_SIZE=2048 | ||
| CONFIG_LL_THREAD_PRIORITY=0 | ||
|
|
||
| # USB Device Identification | ||
| CONFIG_SAMPLE_USBD_VID=0x16C0 | ||
| CONFIG_SAMPLE_USBD_PID=0x04D2 | ||
| CONFIG_SAMPLE_USBD_MANUFACTURER="PJRC" | ||
| CONFIG_SAMPLE_USBD_PRODUCT="SOF Teensy 4.1 Audio A" | ||
|
|
||
| # System Resources & Memory | ||
| CONFIG_MAIN_STACK_SIZE=8192 | ||
| CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096 | ||
| CONFIG_USBD_THREAD_STACK_SIZE=4096 | ||
| CONFIG_ISR_STACK_SIZE=4096 | ||
| CONFIG_HW_STACK_PROTECTION=n | ||
| CONFIG_HEAP_MEM_POOL_SIZE=8192 | ||
| CONFIG_TICKLESS_KERNEL=n | ||
| CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 | ||
|
|
||
| # Logging | ||
| CONFIG_LOG=y | ||
| CONFIG_LOG_DEFAULT_LEVEL=3 | ||
| CONFIG_LOG_MAX_LEVEL=4 | ||
| CONFIG_SOF_LOG_LEVEL_INF=y | ||
| CONFIG_DAI_LOG_LEVEL_INF=y | ||
| CONFIG_USBD_UAC2_LOG_LEVEL_INF=y | ||
| CONFIG_UDC_DRIVER_LOG_LEVEL_INF=y | ||
| CONFIG_LOG_MODE_DEFERRED=y | ||
| CONFIG_LOG_BUFFER_SIZE=4096 | ||
| CONFIG_LOG_MODE_OVERFLOW=y | ||
| CONFIG_LOG_BACKEND_UART=n | ||
| CONFIG_LOG_PROCESS_THREAD=n | ||
| CONFIG_EARLY_CONSOLE=n | ||
| CONFIG_SCHEDULE_LL_STATS_LOG=n | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| /* | ||
| * Copyright (c) 2026 Sound Open Firmware (SOF) Project | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #include <zephyr/dt-bindings/usb/audio.h> | ||
|
|
||
| / { | ||
| uac2_card: usb_audio2 { | ||
| compatible = "zephyr,uac2"; | ||
| status = "okay"; | ||
| full-speed; | ||
| high-speed; | ||
| audio-function = <AUDIO_FUNCTION_IO_BOX>; | ||
|
|
||
| uac_aclk: aclk { | ||
| compatible = "zephyr,uac2-clock-source"; | ||
| clock-type = "internal-programmable"; | ||
| frequency-control = "host-programmable"; | ||
| sampling-frequencies = <48000>; | ||
| sof-synchronized; | ||
| }; | ||
|
|
||
| /* Playback from Host (ISO OUT) */ | ||
| i2s_out_terminal: i2s_out_terminal { | ||
| compatible = "zephyr,uac2-input-terminal"; | ||
| clock-source = <&uac_aclk>; | ||
| terminal-type = <USB_TERMINAL_STREAMING>; | ||
| front-left; | ||
| front-right; | ||
| }; | ||
|
|
||
| i2s_fu: i2s_fu { | ||
| compatible = "zephyr,uac2-feature-unit"; | ||
| data-source = <&i2s_out_terminal>; | ||
| mute-control = "host-programmable"; | ||
| volume-control = "host-programmable"; | ||
| }; | ||
|
|
||
| i2s_speaker: i2s_speaker { | ||
| compatible = "zephyr,uac2-output-terminal"; | ||
| data-source = <&i2s_fu>; | ||
| clock-source = <&uac_aclk>; | ||
| terminal-type = <OUTPUT_TERMINAL_SPEAKER>; | ||
| assoc-terminal = <&i2s_mic>; | ||
| }; | ||
|
|
||
| /* Capture to Host (ISO IN) */ | ||
| i2s_mic: i2s_mic { | ||
| compatible = "zephyr,uac2-input-terminal"; | ||
| clock-source = <&uac_aclk>; | ||
| terminal-type = <INPUT_TERMINAL_MICROPHONE>; | ||
| front-left; | ||
| front-right; | ||
| }; | ||
|
|
||
| i2s_in_fu: i2s_in_fu { | ||
| compatible = "zephyr,uac2-feature-unit"; | ||
| data-source = <&i2s_mic>; | ||
| mute-control = "host-programmable"; | ||
| volume-control = "host-programmable"; | ||
| }; | ||
|
|
||
| i2s_in_terminal: i2s_in_terminal { | ||
| compatible = "zephyr,uac2-output-terminal"; | ||
| data-source = <&i2s_in_fu>; | ||
| clock-source = <&uac_aclk>; | ||
| terminal-type = <USB_TERMINAL_STREAMING>; | ||
| }; | ||
|
|
||
| /* Audio Streaming Interfaces */ | ||
| as_i2s_out: as_i2s_out { | ||
| compatible = "zephyr,uac2-audio-streaming"; | ||
| linked-terminal = <&i2s_out_terminal>; | ||
| subslot-size = <2>; | ||
| bit-resolution = <16>; | ||
| }; | ||
|
|
||
| as_i2s_in: as_i2s_in { | ||
| compatible = "zephyr,uac2-audio-streaming"; | ||
| linked-terminal = <&i2s_in_terminal>; | ||
| subslot-size = <2>; | ||
| bit-resolution = <16>; | ||
| }; | ||
| }; | ||
| }; | ||
|
|
||
| &flexcan1 { | ||
| status = "disabled"; | ||
| }; | ||
|
|
||
| &sai1_dai { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &spdif { | ||
| status = "okay"; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| /* | ||
| * Copyright (c) 2023 Nordic Semiconductor ASA. | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #ifndef ZEPHYR_SAMPLES_SUBSYS_USB_COMMON_SAMPLE_USBD_H | ||
| #define ZEPHYR_SAMPLES_SUBSYS_USB_COMMON_SAMPLE_USBD_H | ||
|
|
||
| #include <stdint.h> | ||
| #include <zephyr/usb/usbd.h> | ||
|
|
||
| struct usbd_context *sample_usbd_init_device(usbd_msg_cb_t msg_cb); | ||
| struct usbd_context *sample_usbd_setup_device(usbd_msg_cb_t msg_cb); | ||
|
|
||
| #endif /* ZEPHYR_SAMPLES_SUBSYS_USB_COMMON_SAMPLE_USBD_H */ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit is too large, all the zephyr changes should go to zephyr, this can go to my fork atm and be referenced viw a local west url in this pr.