-
Notifications
You must be signed in to change notification settings - Fork 34
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
H3 support #183
Comments
Other than using a different CPU core, the H3 is practically the same SoC as the H5, which is already supported. So on the crust side, all that is needed is 1) adding a new platform, 2) hooking up existing drivers (everything but the CSS driver), and 3) adjusting the CSS driver for a Cortex-A7 (i.e. don't set AA64nAA32 in the resume path). I have pushed a WIP branch doing steps 1 and 2. That branch boots on my OPi One and I can make it successfully do power state transitions by poking Even with only CPU core on/off control (no cluster reset or DRAM suspend), this is equivalent to what the U-Boot PSCI implementation provides today. If the existing A64/H5 cluster/DRAM suspend code does work out of the box, that's a nice bonus. If not, full suspend power savings will require a few days of figuring out what bits to twiddle from the BSP reference. As you suggest, the hard part is actually the changes needed in U-Boot. It needs:
Steps 1 and 2 can be emulated by a U-Boot script doing Note that it's not really possible to work on the crust CSS/DRAM driver until we've replaced the U-Boot PSCI implementation (steps 3 and 4). |
Practically, there are a couple of other pieces needed for H3 board support, beyond H3 SoC support:
Both of these are equally as useful for H5 boards, which use a similar design. |
WIP U-Boot support is here: https://github.com/smaeul/u-boot/commits/h3 |
Ok, now I feel confused a bit. Initially I thought H3 doesn't have TrustZone/ATF and it will be just Linux talking to AR100 using HW msgbox. But you mentioned PSCI which normaly results in secure world switch I guess. Also not sure why all this is PSCI/SCPI needed in U-Boot as its not running after execution is handed over to Linux. I probably need to read more on this stuff. |
U-Boot actually is still running. It provides a secure monitor containing a PSCI implementation, similar to what ATF does (although much more primitive). See this patch series which originally added it: https://lists.denx.de/pipermail/u-boot/2014-July/183610.html Linux is not allowed (per the SCPI spec) to call the SCPI commands to turn CPUs on/off and suspend the system. Only the secure monitor can do that, so it has the opportunity to notify a trusted OS of the change (and possibly migrate it to a different CPU core). This applies even though we don't actually have a trusted OS running. Because the SCPI shared memory area is in SRAM A2, that prohibition is actually enforced at the hardware level. SRAM A2 is secure-only, so Linux, running in NS SVC mode, cannot access it at all. |
Thanks for the effort and clarification. I'm currently quite busy with my regular work, but I definetely want to look into this and try it on one of my H3 boards once I have some spare time. |
I just pushed initial H3 support to master. It is not complete, and it is not quite stable either, and it still requires the hacked-up U-Boot branch linked above. But it boots, SMP works, and suspend usually works. |
As of commit f690a19, I believe the Crust side of H3 support is feature-complete and ready for wider testing. The U-Boot support is functional but still WIP for performance/reliability. I pushed a new branch, which is much closer to being upstreamable: https://github.com/smaeul/u-boot/commits/patch/h3-scp I'll leave this issue open until U-Boot support is merged, so people can find the branch. (ping @jernejsk, who has been using the H3 support already) |
Hi @smaeul , thank you for your work. I have here available a few H3 devices, so I will test crust on them and get back to you about the results. 😊 |
Sure, I'll test this. I see that U-Boot commits are not applied on top of stable. Do I need to cherry pick any other patch beside yours to make it work on top of 2021.10? |
Initial test on OrangePi Plus2E was successful, as it also was quick regression test on Tanix TX6 (H6). I'll test this on other H3 boards that I have and then roll out LibreELEC 11 PR, for wider testing. Although, to be honest, I didn't get any complaint about suspend/resume for a long time, even for your initial (previous, partial) H3 support. |
H3 support nicely works on all my board that I currently have (OrangePi Plus2E, Beelink X2, BananaPi M2+). However, U-Boot commit |
(I didn't had properly enabled SCP in u-boot configuration) So far, Crust works amazing on BPI M2+ |
hello everyone ` $ make CPP build/scp/arch/or1k/scp.ld.o please help me |
@emrali361 you're using wrong compiler, you need or1k compiler. |
@gamelaster Thank you. I generated that cross compiler by crosstool-ng , therefore, I made u-boot and kernel with the cross compiler. right now, I need to bl31.bin for orangepi pc. I can't understand about the or1k compiler and don't know where can get or how to generate this cross compiler. |
@emrali361 you can download it from your package manager, or compile it by yourself |
Type of issue
Question
H3 support
What steps are needed to have crust running on H3 based board?
As far as I uderstand it, currently only platforms with ATF are supported. Should u-boot be bringing up the SCP core from reset on platforms without ATF?
The text was updated successfully, but these errors were encountered: