Open pdp7 opened 3 years ago
@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.
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 lib/utils/reset/fdt_reset_<xyz>.c
(Note: root DT node compatible string for
For lib/utils/reset/fdt_reset_<xyz>_<abc>.c
(Note: root DT node compatible string for
Long term we can insist platform vendors to re-use OpenSBI generic shutdown/reset drivers as much as possible.
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.
@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.
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.
related to u-boot issue https://github.com/starfive-tech/u-boot/issues/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