starfive-tech / opensbi

Other
17 stars 16 forks source link

how to migrate to generic platform? #6

Closed pdp7 closed 3 years ago

pdp7 commented 3 years ago

@avpatel @atishp04 @lbmeng @tekkamanninja when moving to generic platform on upstream opensbi, how would we specify the reset implementation?

I was discussing this with @MichaelZhuxx and we were confused how that would work if no longer using platform/starfive/vic7100/platform.c

avpatel commented 3 years ago

Initially, you can add board specific generic platform override file in platform/generic directory. This can board specific override can register the reset operations.

As an example, look at platform/generic/sifive_fu540.c

Eventually, you can have a proper reset driver under lib/utils/reset directory for BeagleV

Regards, Anup

pdp7 commented 3 years ago

@avpatel this series was pointed out by @davidlt to me... could that be useful for beaglev starlight board as well? https://github.com/sifive/meta-sifive/tree/2021.05/recipes-bsp/opensbi/files/unmatched

avpatel commented 3 years ago

The patches pointed by David can be useful for BeagleV only if BeagleV has same mechanism for reset.

I think the reset mechanism on BeagleV is based on I2c which means it is different from SiFive Unmatched

Regards, Anup

pdp7 commented 3 years ago

The PCB will be corrected in the next revision so that PMIC can be reset via toggling a GPIO pin so that should avoid the need to do it with I2C.

avpatel commented 3 years ago

In that case, we certainly have same reset mechanism for both SiFive Unmatched and BeagleV.

I would suggest that someone take patches pointed by David and try to upstream it. We do have some comments to improve those patches.

Regards, Anup

lbmeng commented 3 years ago

I would suggest that someone take patches pointed by David and try to upstream it.

As I understand, @davidlt was planning to upstream the OpenSBI patches for Unmatched.

davidlt commented 3 years ago

Note that reset on Unmatched is not yet implemented, but it most liikely would require talking to PMIC via I2C. Right now shutdown uses the same DT bindings as Linux (not something SBI specific).

pdp7 commented 3 years ago

generic platform now works :)