-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Still more MediaTek updates #82993
Merged
Merged
Still more MediaTek updates #82993
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5be66c8
soc/mediatek: Add SOF extended manifest to link
andyross 8e1628c
boards/mediatek/mt8196: Fix mailbox addressses
andyross 162318f
soc/mediatek/adsp: Union mbox ISRs
andyross 3bc446f
soc/mediatek: Add "mem" dump feature to mtk_adsp_load.py
andyross 291ab1a
soc/mediatek: Fix typo in mt8196 DMA region
andyross fea6d05
soc/mediatek: Add second "DMA" memory region
andyross bf94154
arch/xtensa: Add build-time validation of cache line kconfig
andyross 853c127
soc/mediatek/mtk_adsp: Support __nocache
andyross ffa6ae2
soc/mediatek/adsp: Set CONFIG_DCACHE_LINE_SIZE correctly
andyross 64c5d8b
drivers/console: Add static buffer feature to winstream_console
andyross 42625fe
soc/mediatek/adsp: Enable winstream console
andyross 33ac06c
soc/mediatek: Don't scan SRAM for winstream in mtk_adsp_load.py
andyross 75f3f4d
boards/mediatek: Fix DTS mistakes
andyross 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
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
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 |
---|---|---|
|
@@ -9,4 +9,8 @@ config BUILD_OUTPUT_BIN | |
config IPM_CONSOLE_STACK_SIZE | ||
default 2048 if IPM_CONSOLE_RECEIVER | ||
|
||
# Must match XCHAL_DCACHE_LINESIZE form core-isa.h | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/form/from |
||
config DCACHE_LINE_SIZE | ||
default 32 | ||
|
||
endif # BOARD_QEMU_XTENSA |
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 |
---|---|---|
|
@@ -12,8 +12,10 @@ | |
#include <zephyr/devicetree.h> | ||
#include <zephyr/cache.h> | ||
|
||
#ifdef SOC_FAMILY_INTEL_ADSP | ||
#include <adsp_memory.h> | ||
#include <mem_window.h> | ||
#endif | ||
|
||
struct k_spinlock trace_lock; | ||
|
||
|
@@ -58,19 +60,70 @@ static void winstream_console_hook_install(void) | |
#endif | ||
} | ||
|
||
/* This gets optionally defined by the platform layer as it needs (it | ||
* might want to go in a special location to coordinate with linux | ||
* userspace, etc...) | ||
*/ | ||
extern char _winstream_console_buf[]; | ||
|
||
/* This descriptor with a 96-bit magic number gets linked into the | ||
* binary when enabled so that external tooling can easily find it at | ||
* runtime (e.g. by searching the binary image file, etc...) | ||
*/ | ||
#define WINSTREAM_CONSOLE_MAGIC1 0xd06a5f74U | ||
#define WINSTREAM_CONSOLE_MAGIC2 0x004fe279U | ||
#define WINSTREAM_CONSOLE_MAGIC3 0xf9bdb8cdU | ||
|
||
struct winstream_console_desc { | ||
uint32_t magic1; | ||
uint32_t magic2; | ||
uint32_t magic3; | ||
uint32_t buf_addr; | ||
uint32_t size; | ||
}; | ||
|
||
static const __used struct winstream_console_desc wsdesc = { | ||
.magic1 = WINSTREAM_CONSOLE_MAGIC1, | ||
.magic2 = WINSTREAM_CONSOLE_MAGIC2, | ||
.magic3 = WINSTREAM_CONSOLE_MAGIC3, | ||
.buf_addr = (uint32_t) &_winstream_console_buf, | ||
.size = CONFIG_WINSTREAM_CONSOLE_STATIC_SIZE, | ||
}; | ||
|
||
static int winstream_console_init(void) | ||
{ | ||
void *buf = NULL; | ||
size_t size = 0; | ||
|
||
#ifdef SOC_FAMILY_INTEL_ADSP | ||
/* These have a SOC-specific "mem_window" device. FIXME: The | ||
* type handling is backwards here. We shouldn't be grabbing | ||
* an arbitrary DTS alias and assuming it's a mem_window at | ||
* runtime, that's not safe. The mem_window init code (which | ||
* is typesafe by construction) should be detecting that it's | ||
* supposed to be the console and starting the console hook | ||
* registration process. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a thumbs up for this, needs follow up. |
||
*/ | ||
const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console)); | ||
|
||
if (!device_is_ready(dev)) { | ||
return -ENODEV; | ||
} | ||
const struct mem_win_config *config = dev->config; | ||
void *buf = | ||
sys_cache_uncached_ptr_get((__sparse_force void __sparse_cache *)config->mem_base); | ||
buf = sys_cache_uncached_ptr_get((__sparse_force void __sparse_cache *)config->mem_base); | ||
size = config->size; | ||
#endif | ||
|
||
#ifdef CONFIG_WINSTREAM_CONSOLE_STATIC | ||
/* Dirty trick to prevent linker garbage collection */ | ||
_winstream_console_buf[0] = ((volatile char*) &wsdesc)[0]; | ||
|
||
buf = &_winstream_console_buf; | ||
size = CONFIG_WINSTREAM_CONSOLE_STATIC_SIZE; | ||
#endif | ||
|
||
winstream = sys_winstream_init(buf, config->size); | ||
__ASSERT_NO_MSG(buf != NULL && size != 0); | ||
winstream = sys_winstream_init(buf, size); | ||
winstream_console_hook_install(); | ||
|
||
return 0; | ||
|
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
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.
some spelling mistakes: becuase->because, "process on thsi device, the and the set"