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

implement restart in OpenSBI #5

Open
pdp7 opened this issue May 27, 2021 · 5 comments
Open

implement restart in OpenSBI #5

pdp7 opened this issue May 27, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@pdp7
Copy link
Collaborator

pdp7 commented May 27, 2021

related to u-boot issue starfive-tech/u-boot#8

BeagleV Starlight requires implement restarting PMIC via I2C in OpenSBI so that SBI reset will work. This will allow restart to work in u-boot

@lbmeng
Copy link
Collaborator

lbmeng commented Jun 3, 2021

@avpatel What's your recommendataion? I have a feeling that in the future OpenSBI codes will add lots of platform specific drivers in order to support SBI reset extension.

@avpatel
Copy link
Contributor

avpatel commented Jun 3, 2021

I agree that we will have lot of variety in reset mechanism across platforms. I suggest the following strategy to handle diversity.

For generic shutdown/reset mechanism, we can have generic syscon-like drivers similar to
linux drivers/power/reset/syscon-reset/poweroff.c
(Note: I am not sure about the DT bindings for these generic OpenSBI shutdown/reset drivers. We can come-up with OpenSBI specific DT bindings and document it under OpenSBI docs)

For SOC specific reset, we can have:
lib/utils/reset/fdt_reset_<xyz>.c
(Note: root DT node compatible string for SOC will be used for probing)

For board specific reset having soc, we can have:
lib/utils/reset/fdt_reset_<xyz>_<abc>.c
(Note: root DT node compatible string for board will be used for probing)

Long term we can insist platform vendors to re-use OpenSBI generic shutdown/reset drivers as much as possible.

@davidlt
Copy link
Collaborator

davidlt commented Jun 3, 2021

Here is what we do on FU740/Unmatched: https://github.com/sifive/meta-sifive/tree/2021.05/recipes-bsp/opensbi/files/unmatched

We haven't sent this for upstream review yet (I will look into it).

We use generic and SBI reset extension (but we don't have reset implemented yet, just shutdown). The files should also be renamed from "fu740" to "unmatched" as all this is board specific, not SoC. For the reset to work might also need to talk to PMIC (DA9063 IIRC) via I2C. For shutdown we have GPIO line, which is easier.

@avpatel
Copy link
Contributor

avpatel commented Jun 3, 2021

@davidlt yes gpio based poweroff/reset could be another generic driver for OpenSBI. I checked the patches OpenSBI gpio patches and I think with some re-organization we can merge it in OpenSBI.

@pdp7 pdp7 changed the title implement restarting PMIC via I2C in OpenSBI implement restart in OpenSBI Jul 7, 2021
@pdp7
Copy link
Collaborator Author

pdp7 commented Jul 7, 2021

We should be able to leverage the the gpio restart work that SiFive is doing once the 3,000 pieces are made which will have GPIO63 connected to PMIC reset.

@MichaelZhuxx MichaelZhuxx added the enhancement New feature or request label Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants