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 DSP fixups #844

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions overlays/xtensa_mtk_mt818x_adsp/gdb/gdb/xtensa-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,9 @@ xtensa_register_t rmap[] =
XTREG_END
};

extern xtensa_register_t xtensa_rmap[] __attribute__((alias("rmap")));

xtensa_gdbarch_tdep xtensa_tdep (rmap);

#ifdef XTENSA_CONFIG_INSTANTIATE
XTENSA_CONFIG_INSTANTIATE(rmap,16)
Expand Down
4 changes: 3 additions & 1 deletion overlays/xtensa_mtk_mt8195_adsp/gdb/gdb/xtensa-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const xtensa_mask_t xtensa_mask39 = { 1, xtensa_submask39 };


/* Register map. */
static xtensa_register_t rmap[] =
xtensa_register_t rmap[] =
Copy link
Collaborator

Choose a reason for hiding this comment

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

oof. global with such a generic name doesn't seem ideal. I assume this is required for ABI though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, these overlays get dropped on top of the binutils source code (that starts out populated with an old Xtensa "sample_controller" file). It's... not super clean. FWIW the Espressif-contributed work on LLVM is capable of generating a single toolchain where all these deltas are captured by a config struct instead. It appears to build Zephyr last I checked, though I haven't had time to see what would be needed to turn it into a "Lite Xtensa SDK".

(Worth nothing that there is no lldb work there that I've seen, so we'd still need to build binutils and gdb I guess. Though there might be some savings)

Copy link
Member

Choose a reason for hiding this comment

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

FWIW the Espressif-contributed work on LLVM is capable of generating a single toolchain where all these deltas are captured by a config struct instead. It appears to build Zephyr last I checked, though I haven't had time to see what would be needed to turn it into a "Lite Xtensa SDK".

Interesting. Since LLVM will be part of Zephyr SDK from 0.18.0, we can potentially explore this option. At least, we can drop the GCC builds for the Xtensa toolchain variants whose users do not explicitly require GCC (well, if LLVM works, why should they?)

{
/* idx ofs bi sz al targno flags cp typ group name */
XTREG( 0, 0,32, 4, 4,0x0020,0x0006,-2, 9,0x2100,pc, 0,0,0,0,0,0)
Expand Down Expand Up @@ -496,4 +496,6 @@ static xtensa_register_t rmap[] =
XTREG_END
};

extern xtensa_register_t xtensa_rmap[] __attribute__((alias("rmap")));
Copy link
Member

Choose a reason for hiding this comment

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

^


xtensa_gdbarch_tdep xtensa_tdep (rmap);
2 changes: 2 additions & 0 deletions overlays/xtensa_mtk_mt8196_adsp/gdb/gdb/xtensa-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,9 @@ xtensa_register_t rmap[] =
XTREG_END
};

extern xtensa_register_t xtensa_rmap[] __attribute__((alias("rmap")));

xtensa_gdbarch_tdep xtensa_tdep (rmap);

#ifdef XTENSA_CONFIG_INSTANTIATE
XTENSA_CONFIG_INSTANTIATE(rmap,16)
Expand Down
Loading