Page MenuHomeFreeBSD

Generic SMCCC
ClosedPublic

Authored by br on Aug 27 2019, 2:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 1, 1:22 PM
Unknown Object (File)
Tue, Jan 28, 1:25 PM
Unknown Object (File)
Fri, Jan 24, 4:55 AM
Unknown Object (File)
Sat, Jan 18, 4:21 AM
Unknown Object (File)
Jan 17 2025, 1:23 PM
Unknown Object (File)
Jan 14 2025, 7:31 AM
Unknown Object (File)
Jan 12 2025, 8:54 AM
Unknown Object (File)
Dec 6 2024, 6:56 PM

Details

Summary

Implement generic arm_smccc calls for arm and arm64

This is used by Intel Stratix 10 platform SMC drivers

Test Plan

Tested on Intel S10

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/arm64/include/arm-smccc.h
1 ↗(On Diff #61355)

Why is this file in sys/arm64/include? It doesn't seem to be arm64 specific.

sys/arm64/arm64/smccc-call.S
38 ↗(On Diff #61355)

I think you mean struct arm_smccc_res *res.

42 ↗(On Diff #61355)

You could allow for NULL to be passed as res by checking x4 is non-zero, e.g.

cbz x4, 1f
stp ...
stp ...
1f:
ret

Alternatively if x8 is preserved you could return the struct arm_smccc_res directly. The caller will allocate space for it and pass a pointer to the memory in x8 (assuming I'm remembering the ABI correctly).

50 ↗(On Diff #61355)

And here.

address Andy's comments

br marked 3 inline comments as done.Sep 3 2019, 5:43 PM
br added inline comments.
sys/arm64/include/arm-smccc.h
1 ↗(On Diff #61355)

Hmm I'm not sure where to put it then. Any idea ?

Can you update the psci code to use the arm_smccc_* functions? We should only have one copy the functions to make smccc calls and you can consider psci to be based on it.

sys/arm64/include/arm-smccc.h
1 ↗(On Diff #61355)

I would leave the code where it was and add your changes to sys/dev/psci/smccc.h.

sys/arm64/arm64/smccc-call.S should also be moved to sys/dev/psci/smccc_arm64.S.

Reuse generic SMCCC for PSCI.

Can you update the psci code to use the arm_smccc_* functions? We should only have one copy the functions to make smccc calls and you can consider psci to be based on it.

OK I updated. I did not test on arm since I dont have PSCI-enabled arm hardware

This revision is now accepted and ready to land.Sep 11 2019, 4:36 PM