-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add HS4xD support #56683
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
Add HS4xD support #56683
Conversation
8455a43
to
e37e29b
Compare
@evgeniy-paltsev Could you please take a look? PR has same issues with checks, but it wold be nice to have your feedback on key points |
9d3ad81
to
1218bbb
Compare
dts/arc/synopsys/arc_hs4xd.dtsi
Outdated
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.
I'm wondering if this is still related to some issue?
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.
zephyr_compile_options(-arcv2hs -core4 -Xdual_issue -Xcode_density -Hrgf_banked_regs=32 -HL | |
-Xatomic -Xll64 -Xunaligned -Xdiv_rem=radix4 -Xswap -Xbitscan -Xmpy_option=qmpyh -Xshift_assist | |
-Xbarrel_shifter -Xtimer0 -Xtimer1 -Xrtc -Hld_cycles=2 -Xlpb_size=128) | |
zephyr_compile_options(-arcv2hs -core4 -Xdual_issue -Xcode_density -Hrgf_banked_regs=32 -HL | |
-Xatomic -Xll64 -Xunaligned -Xdiv_rem=radix4 -Xswap -Xbitscan -Xmpy_option=qmpyh -Xshift_assist | |
-Xbarrel_shifter -Xtimer0 -Xtimer1 -Xrtc -Hld_cycles=2) |
Alignment fix and drop Xlpb_size as we disable LPB anyway.
soc/arc/snps_arc_hsdk4xd/linker.ld
Outdated
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.
#if DT_NODE_HAS_PROP(DT_CHOSEN(zephyr_sram), reg) && \ | |
(DT_REG_SIZE(DT_CHOSEN(zephyr_sram)) > 0) | |
#if DT_NODE_HAS_PROP(DT_CHOSEN(zephyr_sram), reg) && (DT_REG_SIZE(DT_CHOSEN(zephyr_sram)) > 0) |
This fits to 100 character per line limit.
arch/arc/Kconfig
Outdated
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.
I'd rephrase it to:
Call SoC per-core setup code on early stage initialization (before C runtime initialization).
Setup code is called in form of soc_early_asm_init_percpu assembler macro.
cmake/gcc-m-cpu.cmake
Outdated
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.
Can you add this to https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/mgmt/mcumgr/grp/os_mgmt/include/os_mgmt_processor.h as a separate commit?
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.
Done: #57348
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.
A couple of minor notes below. And what about documentation update or maybe even a separate docs page for that board?
arch/arc/Kconfig
Outdated
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.
satge -> stage
boards/arc/hsdk4xd/Kconfig.board
Outdated
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.
This is also shouldn't be just a TODO.
Minimal HSDK4xD support Signed-off-by: Nikolay Agishev <[email protected]>
soc_early_asm_init_percpu | ||
#endif | ||
|
||
_dsp_extension_probe |
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.
Can you explain this dsp_extension__probe (and the CONFIG_DSP_TURNED_OFF) more?
The 'probe' name implies it is testing if the DSP extension is present or not, but the implementation and comments say it is turning off DSP.
Is the mechanism for turning off DSP generic for ARC? does it work on EM as well? If not, maybe move this to the SOC specific early_soc_init instead of this generic reset.S module.
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.
Initially the macro looked like:
.macro _dsp_extension_probe
lr r0, [_ARC_V2_DSP_BUILD]
bmsk r0, r0, 7
breq r0, 0, skip_dsp_setup
#ifdef CONFIG_ARC_DSP_TURNED_OFF
mov r0, 0 /* DSP_CTRL_DISABLED_ALL */
sr r0, [_ARC_V2_DSP_CTRL]
#endif
skip_dsp_setup :
.endm
After all stages of review it turned into what you may see. Indeed, in current state it's more appropriate to move it into early_soc_init.
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.
I see it was already merged. Please do so in a follow-up PR (this was minimal enablement only, anyway, and documentation is missing).
Does writing 0 to DSP_CTRL really 'turn DSP off"? Or just initializes some control flags?
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.
DSP_CTRL does not really turn off DSP. Writing 0 disables some DSP features
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.
Thanks for confirming, that's what I remembered. So, not only the 'probe' but also the "DSP_TURNED_OFF" should be renamed. Actually, I don't think we need a kconfig option for that, it is just standard initialization.
Minimal HSDK4xD support