Skip to content
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

Mediatek: mt8196: add platform/core_config/build_config #9758

Merged
merged 7 commits into from
Jan 15, 2025

Conversation

hailongfan-mtk
Copy link
Contributor

Add mediatek mt8196 platform/core_config/build_config drivers for auido development.

Add mt8196.toml to support sof-mt8196.ri binary build.

Signed-off-by: hailong.fan <[email protected]>
@sofci
Copy link
Collaborator

sofci commented Dec 26, 2024

Can one of the admins verify this patch?

reply test this please to run this test once

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how this aligns with #9755 , but no showstoppers as far as I can tell. There's a bit of commented out code left here and there, but I'll leave this to @thesofproject/mediatek maintainers to check as this is all in MTK platform code.

}

//todo
//io_reg_update_bits(MTK_ADSPPLL_CON3, MTK_PLL_PWR_ON, MTK_PLL_PWR_ON);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe clean this up, I guess these are now copied from platform to another as copies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe clean this up, I guess these are now copied from platform to another as copies.

Yes, updated, thanks.

@kv2019i
Copy link
Collaborator

kv2019i commented Dec 27, 2024

SOFCI TEST

@andyross
Copy link
Contributor

Not sure how this aligns with #9755

Parallel efforts. The intent is that this hardware ships with Zephyr at launch, but for now there are two trees for different bits of enablement.

@lgirdwood
Copy link
Member

Not sure how this aligns with #9755

Parallel efforts. The intent is that this hardware ships with Zephyr at launch, but for now there are two trees for different bits of enablement.

Okay, how do you want to proceed - obviously xtos related code is being deprecated and removed.

Add xtensa headers for mediatek mt8196 platform.

Signed-off-by: hailong.fan <[email protected]>
Add memory layout and register address for mediatek mt8196
[Cache]
I-Cache: 64KB, 4-way Associativity
D-Cache: 128KB, 4-way Associativity

[Memory]
Dram: ADSP can access DRAM shared with CPU
L2TCM: 768KB ADSP SRAM POOL

Signed-off-by: hailong.fan <[email protected]>
mt8196 plaform integrates a single-core HIFI5 DSP.
The DSP does not have DVFS scenario.
When the system is in an active state, the DSP clock is 800MHz(0.75v).
When the system enters a low power scenario, the DSP is in WFI state,
and the clock is 26MHz.

The DSP core and DMA in DSP subsys both can access DRAM directly.

Signed-off-by: hailong.fan <[email protected]>
#ifdef CFG_CORE_OFF_SUPPORT
#endif
#ifdef CFG_TICKLESS_SUPPORT
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seem unneeded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, removed, thanks.

Add interrupt, timer and ipc driver for mt8196.

Signed-off-by: hailong.fan <[email protected]>
Add default config for mt8196 platform.

Signed-off-by: hailong.fan <[email protected]>
@andyross
Copy link
Contributor

andyross commented Jan 7, 2025

Okay, how do you want to proceed - obviously xtos related code is being deprecated and removed.

I'm entirely neutral on whether this gets merged separately. I think it's probably useful to have as a reference in the public tree, even if it gets deleted. But the Zephyr work is far enough along now that I really don't think there's much need to maintain two working versions. Ideally we all end up on the same page, and e.g. @hailongfan-mtk would be reviewing the Zephyr platform too.

Will come by with some notes here in a bit once I figure out the divergence with the internal tree (which is based on a somewhat older SOF)

@lgirdwood
Copy link
Member

Okay, how do you want to proceed - obviously xtos related code is being deprecated and removed.

I'm entirely neutral on whether this gets merged separately. I think it's probably useful to have as a reference in the public tree, even if it gets deleted. But the Zephyr work is far enough along now that I really don't think there's much need to maintain two working versions. Ideally we all end up on the same page, and e.g. @hailongfan-mtk would be reviewing the Zephyr platform too.

Will come by with some notes here in a bit once I figure out the divergence with the internal tree (which is based on a somewhat older SOF)

ok, @hailongfan-mtk @andyross we can merge this now as a backup for the Zephyr work, and then deprecate/delete as the Zephyr support stabilzes ? Good for you guys ?

Copy link
Contributor

@andyross andyross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks incomplete? I don't see the integration for the AFE driver. Presumably this would boot, but would have no audio capability? (c.f. src/platform/mt81*/afe-platform.c and related files in the current tree) Is that coming in a separate PR?

XTHAL_MPU_ENTRY(0x4e180000, 1, XTHAL_AR_NONE, XTHAL_MEM_DEVICE), // unused
XTHAL_MPU_ENTRY(0x90000000, 1, XTHAL_AR_RWXrwx, XTHAL_MEM_WRITEBACK_NOALLOC), // dram
XTHAL_MPU_ENTRY(0x90500000, 1, XTHAL_AR_RWXrwx, XTHAL_MEM_NON_CACHEABLE), // dram
XTHAL_MPU_ENTRY(0x91100000, 1, XTHAL_AR_NONE, XTHAL_MEM_DEVICE), // unused
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I think this MPU setup is skewed vs. what is being used internally (there have been two recent changes I'm aware of, anyway). Can you be sure to synchronize the trees and validate this vs. the SOF main branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I think this MPU setup is skewed vs. what is being used internally (there have been two recent changes I'm aware of, anyway). Can you be sure to synchronize the trees and validate this vs. the SOF main branch?

The current MPU settings are correct and have been verified. Other changes (cache issues) will be submitted later.

Copy link
Contributor

@andyross andyross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But +1 as-is, no reason not to merge as long as the remaining bits are coming.

@hailongfan-mtk
Copy link
Contributor Author

This looks incomplete? I don't see the integration for the AFE driver. Presumably this would boot, but would have no audio capability? (c.f. src/platform/mt81*/afe-platform.c and related files in the current tree) Is that coming in a separate PR?

Yes, this is only the DSP system part, the AFE part will be proposed in another PR.

@hailongfan-mtk
Copy link
Contributor Author

hailongfan-mtk commented Jan 9, 2025

Okay, how do you want to proceed - obviously xtos related code is being deprecated and removed.

I'm entirely neutral on whether this gets merged separately. I think it's probably useful to have as a reference in the public tree, even if it gets deleted. But the Zephyr work is far enough along now that I really don't think there's much need to maintain two working versions. Ideally we all end up on the same page, and e.g. @hailongfan-mtk would be reviewing the Zephyr platform too.
Will come by with some notes here in a bit once I figure out the divergence with the internal tree (which is based on a somewhat older SOF)

ok, @hailongfan-mtk @andyross we can merge this now as a backup for the Zephyr work, and then deprecate/delete as the Zephyr support stabilzes ? Good for you guys ?

ok, thanks a lot

@lgirdwood
Copy link
Member

CI been hanging a long time - restart it.

@lgirdwood
Copy link
Member

SOFCI TEST

@johnylin76 johnylin76 self-requested a review January 10, 2025 13:06
@kv2019i
Copy link
Collaborator

kv2019i commented Jan 10, 2025

@hailongfan-mtk The build is failing: https://github.com/thesofproject/sof/actions/runs/12648815920/job/35243903764?pr=9758

 CMake Error at CMakeLists.txt:39 (project):
  The CMAKE_C_COMPILER:

    xtensa-mt8196-elf-gcc

I think we've accepted platforms that cannot be compile tested with github flows, but these shouldn't be in the default platform list. If we merge this in current form, gcc-build-default-platforms will start failing for every pull request.

@@ -10,7 +10,7 @@ set -e
DEFAULT_PLATFORMS=(
imx8m
rn rmb vangogh
mt8186 mt8195 mt8188
mt8186 mt8195 mt8188 mt8196
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hailongfan-mtk please remove mt8196 from DEFAULT_PLATFORMS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks.

Add CMakefile for mediatek mt8196 platform to build.

Signed-off-by: hailong.fan <[email protected]>
@johnylin76
Copy link
Contributor

CI now only has codestyle failures left. Should be good to go

@lgirdwood
Copy link
Member

CI stalled - restart.

@lgirdwood
Copy link
Member

SOFCI TEST

@kv2019i kv2019i merged commit 42e5c21 into thesofproject:main Jan 15, 2025
45 of 51 checks passed
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.

7 participants