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

arch/xtensa: Add automatic vector linkage generation #72771

Merged
merged 2 commits into from
May 22, 2024

Conversation

andyross
Copy link
Contributor

Existing solutions for linking the Xtensa vector table are a cut-and-paste mess of inherited code, with more than a dozen special sections that need to be linked into many special MEMORY{} regions.

Accept the existing convention used by C/asm code, but automatically detect the needed offsets for the platform from core-isa.h (it can share the preprocessing with gen_zsr.py) and emit a file that can be included in lieu of all the existing boilerplate.

@zephyrbot zephyrbot added the area: Xtensa Xtensa Architecture label May 14, 2024
@andyross
Copy link
Contributor Author

andyross commented May 14, 2024

Some more automitization[1] of a particularly ugly area of Xtensa platform integration. There's a really shocking amount of manually customized linker script nonsense on these platforms, and it's all needless as the offsets involved are specified in core-isa.h.

As elsewhere, only dc233c is enabled for a start. Platform owners can manage the transition at leisure.

[1] Edit: automITization? Weird typo. Almost seems like it should be a real word.

@andyross
Copy link
Contributor Author

(Fix pylint squawks)

@andyross
Copy link
Contributor Author

Review ping. This is split out from the mt8195 PR but can merge separately.

dcpleung
dcpleung previously approved these changes May 20, 2024
@andyross
Copy link
Contributor Author

Looks like this still needs one more approval, Xtensa linkage is admittedly obscure and Daniel and I are the only regulars who touch it at the arch level: @dbaluta @iuliana-prodan @sylvioalves @marekmatej are Xtensa experts too though. :)

@andyross
Copy link
Contributor Author

Oh, heh, and a rebase. One sec.

Existing solutions for linking the Xtensa vector table are a
cut-and-paste mess of inherited code, with more than a dozen special
sections that need to be linked into many special MEMORY{} regions.

Accept the existing convention used by C/asm code, but automatically
detect the needed offsets for the platform from core-isa.h (it can
share the preprocessing with gen_zsr.py) and emit a file that can be
included in lieu of all the existing boilerplate.

Signed-off-by: Andy Ross <[email protected]>
Remove all the hard-configured absolute addresses and zillions of tiny
ELF segments in favor of the auto-generated vector region, which is
guaranteed correct as long as core-isa.h is matched to the target.

Signed-off-by: Andy Ross <[email protected]>
@dleach02 dleach02 merged commit 7dd4c4d into zephyrproject-rtos:main May 22, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Xtensa Xtensa Architecture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants