-
Notifications
You must be signed in to change notification settings - Fork 350
Add support for mtk mt8195 platform #4679
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cc92bb1
platform: mtk: add xtensa headers for mt8195
kuanhsuncheng e7e6df0
configs: mtk: add default config for mt8195
kuanhsuncheng a9d5477
drivers: mtk: add drivers for mt8195
kuanhsuncheng a2e7d0c
platform: mtk: add memory layout for mt8195
kuanhsuncheng 45df427
platform: mtk: add support for mt8195 platform
kuanhsuncheng abcc6d6
mt8195: add compile support for mt8195
kuanhsuncheng 96123ad
drivers: mtk: add afe driver for mtk mt8195
kuanhsuncheng 11ec0cd
platform: mt8195: add afe-platform support
kuanhsuncheng 438df3a
platform: mtk: compile afe support for mt8195
kuanhsuncheng d678bea
topology1: add mt8195.m4
kuanhsuncheng 57e76d6
topology1: add sof-mt8195-mt6359-rt1019-rt5682.m4
kuanhsuncheng adce6ca
topology1: add afe.m4
kuanhsuncheng 7a0c00b
topology1: add afe tokens
kuanhsuncheng ffe91b6
topology1: add afe config
kuanhsuncheng 2c620b3
topology1: add sof-mt8195-mt6359-rt1019-rt5682 topology
kuanhsuncheng 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| CONFIG_MT8195=y | ||
| CONFIG_CORE_COUNT=1 | ||
| CONFIG_XT_VIRTUAL_OPS=1 | ||
| CONFIG_COMP_VOLUME=y | ||
| CONFIG_COMP_SRC=n | ||
| CONFIG_COMP_FIR=n | ||
| CONFIG_COMP_IIR=n | ||
| CONFIG_COMP_DCBLOCK=n | ||
| CONFIG_COMP_TDFB=n | ||
| CONFIG_COMP_TONE=n | ||
| CONFIG_COMP_MIXER=n | ||
| CONFIG_COMP_MUX=n | ||
| CONFIG_COMP_SWITCH=n | ||
| CONFIG_COMP_KPB=n | ||
| CONFIG_COMP_SEL=n | ||
| CONFIG_COMP_ASRC=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
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,5 @@ | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
kuanhsuncheng marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| if(CONFIG_MT8195) | ||
| add_subdirectory(mt8195) | ||
| endif() | ||
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,6 @@ | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
kuanhsuncheng marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| add_local_sources(sof ipc.c timer.c | ||
| interrupt.c uart.c afe-memif.c afe-dai.c afe-drv.c | ||
| ) | ||
|
|
||
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,116 @@ | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
| // | ||
| // Copyright(c) 2021 Mediatek | ||
dbaluta marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // | ||
| // Author: Bo Pan <bo.pan@mediatek.com> | ||
| // YC Hung <yc.hung@mediatek.com> | ||
|
|
||
| #include <sof/audio/component.h> | ||
| #include <sof/drivers/afe-drv.h> | ||
| #include <sof/drivers/timer.h> | ||
| #include <sof/lib/alloc.h> | ||
| #include <sof/lib/dai.h> | ||
| #include <sof/lib/dma.h> | ||
| #include <sof/lib/io.h> | ||
| #include <sof/lib/notifier.h> | ||
| #include <sof/lib/uuid.h> | ||
| #include <sof/math/numbers.h> | ||
| #include <sof/platform.h> | ||
| #include <ipc/dai.h> | ||
| #include <errno.h> | ||
| #include <stddef.h> | ||
| #include <stdint.h> | ||
|
|
||
| /* 30290c76-6a05-4784-8464-c21f09cee87e */ | ||
| DECLARE_SOF_UUID("afe-dai", afe_dai_uuid, 0x30290c76, 0x6a05, 0x4784, | ||
| 0x84, 0x64, 0xc2, 0x1f, 0x09, 0xce, 0xe8, 0x7e); | ||
|
|
||
| DECLARE_TR_CTX(afe_dai_tr, SOF_UUID(afe_dai_uuid), LOG_LEVEL_INFO); | ||
|
|
||
| static int afe_dai_drv_trigger(struct dai *dai, int cmd, int direction) | ||
| { | ||
| return 0; | ||
| } | ||
|
|
||
| static int afe_dai_drv_set_config(struct dai *dai, struct ipc_config_dai *common_config, | ||
| void *spec_config) | ||
| { | ||
| struct sof_ipc_dai_config *config = spec_config; | ||
| struct mtk_base_afe *afe = dai_get_drvdata(dai); | ||
|
|
||
| afe_dai_set_config(afe, | ||
| dai->index, | ||
| config->afe.dai_channels, | ||
| config->afe.dai_rate, | ||
| config->afe.dai_format); | ||
| return 0; | ||
| } | ||
|
|
||
| /* get HDA hw params */ | ||
| static int afe_dai_drv_get_hw_params(struct dai *dai, struct sof_ipc_stream_params *params, int dir) | ||
| { | ||
| struct mtk_base_afe *afe = dai_get_drvdata(dai); | ||
| unsigned int channel, rate, format; | ||
|
|
||
| afe_dai_get_config(afe, dai->index, &channel, &rate, &format); | ||
| params->rate = rate; | ||
| params->channels = channel; | ||
| params->buffer_fmt = format; | ||
| params->frame_fmt = format; | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| static int afe_dai_drv_probe(struct dai *dai) | ||
| { | ||
| struct mtk_base_afe *afe = afe_get(); | ||
|
|
||
| dai_info(dai, "afe_dai_probe()"); | ||
|
|
||
| if (dai_get_drvdata(dai)) | ||
| return -EEXIST; | ||
|
|
||
| dai_set_drvdata(dai, afe); | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| static int afe_dai_drv_remove(struct dai *dai) | ||
| { | ||
| dai_info(dai, "afe_dai_remove()"); | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| static int afe_dai_drv_dummy(struct dai *dai) | ||
| { | ||
| return 0; | ||
| } | ||
|
|
||
| static int afe_dai_drv_get_handshake(struct dai *dai, int direction, int stream_id) | ||
| { | ||
| return (int)dai->plat_data.fifo[0].handshake; | ||
| } | ||
|
|
||
| static int afe_dai_drv_get_fifo(struct dai *dai, int direction, int stream_id) | ||
| { | ||
| return 0; | ||
| } | ||
|
|
||
| const struct dai_driver afe_dai_driver = { | ||
| .type = SOF_DAI_MEDIATEK_AFE, | ||
| .uid = SOF_UUID(afe_dai_uuid), | ||
| .tctx = &afe_dai_tr, | ||
| .dma_dev = DMA_DEV_AFE_MEMIF, | ||
| .ops = { | ||
| .trigger = afe_dai_drv_trigger, | ||
| .set_config = afe_dai_drv_set_config, | ||
| .pm_context_store = afe_dai_drv_dummy, | ||
| .pm_context_restore = afe_dai_drv_dummy, | ||
| .get_hw_params = afe_dai_drv_get_hw_params, | ||
| .get_handshake = afe_dai_drv_get_handshake, | ||
| .get_fifo = afe_dai_drv_get_fifo, | ||
| .probe = afe_dai_drv_probe, | ||
| .remove = afe_dai_drv_remove, | ||
| }, | ||
| }; | ||
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.
Uh oh!
There was an error while loading. Please reload this page.