-
Notifications
You must be signed in to change notification settings - Fork 321
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 support for running SOF on imx95 #9512
Merged
dbaluta
merged 9 commits into
thesofproject:main
from
LaurentiuM1234:feature/imx95_support
Oct 4, 2024
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9dada51
platform: add imx95 platform
LaurentiuM1234 7c590de
platform: Kconfig: add configuration for imx95
LaurentiuM1234 3e256c2
include: drivers: mu.h: select MU version 2 for imx95
LaurentiuM1234 f4db66a
zephyr: CMakeLists.txt: include required sources for imx95
LaurentiuM1234 5314001
lib: dma: add entries for imx95's EDMA2 and HOST_DMA
LaurentiuM1234 9c8e8f0
west.yml: pull in CMSIS module
LaurentiuM1234 07d0069
tools: topolgy1: add topology for imx95
LaurentiuM1234 abd767a
app: boards: add DTS and config overlay for imx95
LaurentiuM1234 030a8f7
build: add support for building SOF on imx95
LaurentiuM1234 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 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,11 @@ | ||
CONFIG_DYNAMIC_INTERRUPTS=y | ||
CONFIG_TRACE=n | ||
CONFIG_ZEPHYR_NATIVE_DRIVERS=y | ||
CONFIG_IMX95=y | ||
|
||
CONFIG_SAI_HAS_MCLK_CONFIG_OPTION=y | ||
|
||
CONFIG_DMA=y | ||
CONFIG_DMA_NXP_EDMA_ENABLE_HALFMAJOR_IRQ=y | ||
|
||
CONFIG_SHARED_INTERRUPTS=y |
This file contains 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,25 @@ | ||
/* | ||
* Copyright 2024 NXP | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/ { | ||
host_dma: dma { | ||
compatible = "nxp,sof-host-dma"; | ||
dma-channels = <32>; | ||
#dma-cells = <0>; | ||
}; | ||
}; | ||
|
||
&sai3 { | ||
tx-fifo-watermark = <8>; | ||
rx-fifo-watermark = <96>; | ||
fifo-depth = <96>; | ||
rx-sync-mode = <1>; | ||
status = "okay"; | ||
}; | ||
|
||
&edma2 { | ||
status = "okay"; | ||
}; |
This file contains 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 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 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 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,26 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright 2024 NXP | ||
*/ | ||
|
||
#ifdef __SOF_LIB_CLK_H__ | ||
|
||
#ifndef __PLATFORM_LIB_CLK_H__ | ||
#define __PLATFORM_LIB_CLK_H__ | ||
|
||
#define CLK_MAX_CPU_HZ 800000000 | ||
#define CPU_DEFAULT_IDX 0 | ||
#define NUM_CPU_FREQ 1 | ||
#define NUM_CLOCKS 1 | ||
|
||
struct sof; | ||
|
||
void platform_clock_init(struct sof *sof); | ||
|
||
#endif /* __PLATFORM_LIB_CLK_H__ */ | ||
|
||
#else | ||
|
||
#error "This file shouldn't be included from outside of sof/lib/clk.h" | ||
|
||
#endif /* __SOF_LIB_CLK_H__ */ |
This file contains 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,19 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright 2024 NXP | ||
*/ | ||
|
||
#ifdef __SOF_LIB_CPU_H__ | ||
|
||
#ifndef __PLATFORM_LIB_CPU_H__ | ||
#define __PLATFORM_LIB_CPU_H__ | ||
|
||
#define PLATFORM_PRIMARY_CORE_ID 0 | ||
|
||
#endif /* __PLATFORM_LIB_CPU_H__ */ | ||
|
||
#else | ||
|
||
#error "This file shouldn't be included from outside of sof/lib/cpu.h" | ||
|
||
#endif /* __SOF_LIB_CPU_H__ */ |
This file contains 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,19 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright 2024 NXP | ||
*/ | ||
|
||
#ifdef __SOF_LIB_DAI_H__ | ||
|
||
#ifndef __PLATFORM_LIB_DAI_H__ | ||
#define __PLATFORM_LIB_DAI_H__ | ||
|
||
/* TODO: remove me whenever possible */ | ||
|
||
#endif /* __PLATFORM_LIB_DAI_H__ */ | ||
|
||
#else | ||
|
||
#error "This file shouldn't be included from outside of sof/lib/dai.h" | ||
|
||
#endif /* __SOF_LIB_DAI_H__ */ |
This file contains 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,19 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright 2024 NXP | ||
*/ | ||
|
||
#ifdef __SOF_LIB_DMA_H__ | ||
|
||
#ifndef __PLATFORM_LIB_DMA_H__ | ||
#define __PLATFORM_LIB_DMA_H__ | ||
|
||
/* TODO: remove me whenever possible */ | ||
|
||
#endif /* __PLATFORM_LIB_DMA_H__ */ | ||
|
||
#else | ||
|
||
#error "This file shouldn't be included from outside of sof/lib/dma.h" | ||
|
||
#endif /* __SOF_LIB_DMA_H__ */ |
This file contains 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,49 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright 2024 NXP | ||
*/ | ||
|
||
#ifdef __SOF_LIB_MAILBOX_H__ | ||
|
||
#ifndef __PLATFORM_LIB_MAILBOX_H__ | ||
#define __PLATFORM_LIB_MAILBOX_H__ | ||
|
||
/* i.MX95's mailbox is organized as follows: | ||
* | ||
* +---------------+-------------------------+ | ||
* | Region name | Base address | Size | | ||
* +---------------+---------------+---------+ | ||
* | Inbox region | 0x8fffd000 | 0x1000 | | ||
* +---------------+---------------+---------+ | ||
* | Outbox region | 0x8fffe000 | 0x1000 | | ||
* +---------------+---------------+---------+ | ||
* | Stream region | 0x8ffff000 | 0x1000 | | ||
* +---------------+---------------+---------+ | ||
* | ||
* IMPORTANT: all regions should be 32-byte aligned. | ||
* This is required because cache maintenance might | ||
* be performed on them. | ||
*/ | ||
|
||
/* inbox */ | ||
#define MAILBOX_HOSTBOX_SIZE 0x1000 | ||
#define MAILBOX_HOSTBOX_BASE 0x86000000 | ||
#define MAILBOX_HOSTBOX_OFFSET 0 | ||
|
||
/* outbox */ | ||
#define MAILBOX_DSPBOX_SIZE 0x1000 | ||
#define MAILBOX_DSPBOX_BASE 0x86001000 | ||
#define MAILBOX_DSPBOX_OFFSET (MAILBOX_HOSTBOX_OFFSET + MAILBOX_HOSTBOX_SIZE) | ||
|
||
/* stream */ | ||
#define MAILBOX_STREAM_SIZE 0x1000 | ||
#define MAILBOX_STREAM_BASE 0x86002000 | ||
#define MAILBOX_STREAM_OFFSET (MAILBOX_DSPBOX_OFFSET + MAILBOX_DSPBOX_SIZE) | ||
|
||
#endif /* __PLATFORM_LIB_MAILBOX_H__ */ | ||
|
||
#else | ||
|
||
#error "This file shouldn't be included from outside of sof/lib/mailbox.h" | ||
|
||
#endif /* __SOF_LIB_MAILBOX_H__ */ |
This file contains 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,42 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright 2024 NXP | ||
*/ | ||
|
||
#ifdef __SOF_LIB_MEMORY_H__ | ||
|
||
#ifndef __PLATFORM_LIB_MEMORY_H__ | ||
#define __PLATFORM_LIB_MEMORY_H__ | ||
|
||
#include <rtos/cache.h> | ||
|
||
#define PLATFORM_DCACHE_ALIGN DCACHE_LINE_SIZE | ||
|
||
#define SHARED_DATA | ||
|
||
#define uncache_to_cache(address) address | ||
#define cache_to_uncache(address) address | ||
#define cache_to_uncache_init(address) address | ||
#define is_uncached(address) 0 | ||
|
||
/* no address translation required */ | ||
#define host_to_local(addr) (addr) | ||
#define local_to_host(addr) (addr) | ||
|
||
#define HEAPMEM_SIZE 0x00010000 | ||
|
||
/* WAKEUP domain MU7 side B */ | ||
#define MU_BASE 0x42440000UL | ||
|
||
static inline void *platform_shared_get(void *ptr, int bytes) | ||
{ | ||
return ptr; | ||
} | ||
|
||
#endif /* __PLATFORM_LIB_MEMORY_H__ */ | ||
|
||
#else | ||
|
||
#error "This file shouldn't be included from outside of sof/lib/memory.h" | ||
|
||
#endif /* __SOF_LIB_MEMORY_H__*/ |
This file contains 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,35 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright 2024 NXP | ||
*/ | ||
|
||
#ifdef __SOF_PLATFORM_H__ | ||
|
||
#ifndef __PLATFORM_PLATFORM_H__ | ||
#define __PLATFORM_PLATFORM_H__ | ||
|
||
/* refers to M7 core clock - one core, one clock */ | ||
#define PLATFORM_DEFAULT_CLOCK 0 | ||
|
||
#define HOST_PAGE_SIZE 4096 | ||
|
||
#define PLATFORM_PAGE_TABLE_SIZE 256 | ||
|
||
/* TODO: generous (SOF is usually used with 2 channels at most on i.MX | ||
* platforms) and (potentially) not true. Can be adjusted later on if | ||
* need be. | ||
*/ | ||
#define PLATFORM_MAX_CHANNELS 4 | ||
/* TODO: same as PLATFORM_MAX_CHANNELS */ | ||
#define PLATFORM_MAX_STREAMS 5 | ||
|
||
/* WAKEUP domain MU7 side B */ | ||
#define PLATFORM_IPC_INTERRUPT 207 | ||
|
||
#endif /* __PLATFORM_PLATFORM_H__ */ | ||
|
||
#else | ||
|
||
#error "This file shouldn't be included from outside of sof/platform.h" | ||
|
||
#endif /* __SOF_PLATFORM_H__ */ |
This file contains 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,19 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* | ||
* Copyright 2024 NXP | ||
*/ | ||
|
||
#ifdef __SOF_TRACE_TRACE_H__ | ||
|
||
#ifndef __PLATFORM_TRACE_TRACE_H__ | ||
#define __PLATFORM_TRACE_TRACE_H__ | ||
|
||
/* TODO: remove me whenever possible */ | ||
|
||
#endif /* __PLATFORM_TRACE_TRACE_H__ */ | ||
|
||
#else | ||
|
||
#error "This file shouldn't be included from outside of sof/trace/trace.h" | ||
|
||
#endif /* __SOF_TRACE_TRACE_H__ */ |
This file contains 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,35 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
/* | ||
* Copyright 2024 NXP | ||
*/ | ||
|
||
#include <rtos/clk.h> | ||
#include <sof/lib/notifier.h> | ||
|
||
static const struct freq_table platform_cpu_freq[] = { | ||
{ | ||
.freq = CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC, | ||
.ticks_per_msec = CONFIG_SYS_CLOCK_TICKS_PER_SEC * 1000, | ||
}, | ||
}; | ||
|
||
static struct clock_info platform_clocks_info[NUM_CLOCKS]; | ||
|
||
void platform_clock_init(struct sof *sof) | ||
{ | ||
int i; | ||
|
||
sof->clocks = platform_clocks_info; | ||
|
||
for (i = 0; i < CONFIG_CORE_COUNT; i++) { | ||
sof->clocks[i] = (struct clock_info) { | ||
.freqs_num = NUM_CPU_FREQ, | ||
.freqs = platform_cpu_freq, | ||
.default_freq_idx = CPU_DEFAULT_IDX, | ||
.current_freq_idx = CPU_DEFAULT_IDX, | ||
.notification_id = NOTIFIER_ID_CPU_FREQ, | ||
.notification_mask = NOTIFIER_TARGET_CORE_MASK(i), | ||
.set_freq = NULL, | ||
}; | ||
} | ||
} |
This file contains 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,5 @@ | ||
SECTION_PROLOGUE(.fw_metadata,,) | ||
{ | ||
KEEP (*(*.fw_metadata)) | ||
. = ALIGN(16); | ||
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) |
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.
@LaurentiuM1234 I think @kv2019i got rid of a lot of these last week since they should come from Zephyr - can you check.
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.
hm...double-checked and couldn't find anything else to drop w/o breaking the build... @kv2019i anything obvious that I'm missing?
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.
ok, I'm probably wrong, probably in process of being removed.
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.
Ack @LaurentiuM1234 @lgirdwood platform clk.h is still needed. We have a Zephyr version of clk.h that still depends on it. OTOH, I did a quick look and it seems this could be cleaned up further as well as the usage of clk.h is not much in app code -> #9541