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

plat-k3: Add support for modifying extended OTP bits #5758

Closed
wants to merge 4 commits into from

Conversation

manorit2001
Copy link
Contributor

K3 family of devices have a set of one-time programmable(OTP) efuses to carry root of trust keys and other information used during device boot. The purpose of these efuses is fixed. K3 family of devices have another set of OTP efuses for general purpose use by the customer.

The PR adds support for reading/writing into these bits through a K3 specific PTA, any ideas around making it a generic like HUK would be a plus. Open to suggestions

https://software-dl.ti.com/tisci/esd/latest/6_topic_user_guides/extended_otp.html

core/arch/arm/plat-k3/drivers/ti_sci.c Show resolved Hide resolved
core/arch/arm/plat-k3/drivers/ti_sci.c Outdated Show resolved Hide resolved
core/arch/arm/plat-k3/drivers/ti_sci.c Outdated Show resolved Hide resolved
core/arch/arm/plat-k3/drivers/ti_sci.c Show resolved Hide resolved
core/arch/arm/plat-k3/drivers/ti_sci.h Show resolved Hide resolved
core/pta/k3/otp.c Outdated Show resolved Hide resolved
core/pta/k3/otp.c Outdated Show resolved Hide resolved
core/pta/k3/otp.c Outdated Show resolved Hide resolved
lib/libutee/include/k3/otp_keywriting_ta.h Outdated Show resolved Hide resolved
lib/libutee/include/k3/otp_keywriting_ta.h Outdated Show resolved Hide resolved
@ldts
Copy link
Contributor

ldts commented Jan 12, 2023

Do you plan to add a command to U-boot to access the PTA?

something like the below might be a good thing to have:
https://github.com/u-boot/u-boot/blob/master/common/scp03.c
https://u-boot.readthedocs.io/en/latest/usage/cmd/scp03.html

@manorit2001
Copy link
Contributor Author

Do you plan to add a command to U-boot to access the PTA?

something like the below might be a good thing to have: https://github.com/u-boot/u-boot/blob/master/common/scp03.c https://u-boot.readthedocs.io/en/latest/usage/cmd/scp03.html

Hi, currently there are no plans as such, a userspace implementation is already made but not upstreamed, we'll be looking at that instead of the uboot implementation. Feel free to implement it yourself if you think it might be a good addition

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash commit "plat-k3: remove duplicate comments" into commit "plat-k3: drivers: add TISCI calls for extended OTP".

core/arch/arm/plat-k3/drivers/ti_sci.c Outdated Show resolved Hide resolved
core/pta/k3/otp.c Outdated Show resolved Hide resolved
core/pta/k3/otp.c Outdated Show resolved Hide resolved
core/pta/k3/otp.c Outdated Show resolved Hide resolved
lib/libutee/include/k3/otp_keywriting_ta.h Show resolved Hide resolved
core/pta/k3/otp.c Outdated Show resolved Hide resolved
core/pta/k3/otp.c Outdated Show resolved Hide resolved
@manorit2001
Copy link
Contributor Author

Please squash commit "plat-k3: remove duplicate comments" into commit "plat-k3: drivers: add TISCI calls for extended OTP".

Hi, am removing comments from some other functions also that are not added in this PR. Would it be fine if I squash it?

@manorit2001 manorit2001 force-pushed the extended-otp branch 2 times, most recently from 27b6da0 to 96f591c Compare January 18, 2023 06:19
@etienne-lms
Copy link
Contributor

Please squash commit "plat-k3: remove duplicate comments" into commit "plat-k3: drivers: add TISCI calls for extended OTP".
Hi, am removing comments from some other functions also that are not added in this PR. Would it be fine if I squash it?

Fine as-is.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> for the series.

Extended OTP are a set of bits in our efuses that can be programmed for
user specific cases which deal with authentication/encryption.

This patch adds support for calling extended OTP APIs using TISCI.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Writing into the extended OTP has been a vendor specific thing and no
generic drivers exists for it in the OP-TEE framework.

Add a PTA to write into the custom extended OTP bits in K3 architecture.

This header should be exported out of optee-os to be used by the host
binary for interacting with the PTA.

Includes OTP keywriting PTA header file in libutee

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Add the config to build it for K3 platforms. It is still an optional
support and can be disabled if necessary.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Removing duplicated comments in the existing as well as newly added
functions.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
@manorit2001
Copy link
Contributor Author

Resolved the merge conflicts

@jforissier
Copy link
Contributor

Thanks @manorit2001, I have added Etienne's Acked-by: tags and merged the series.

@jforissier jforissier closed this Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants