Skip to content

plat-qcom: lemans: enable QFPROM fuse provisioning support#6

Open
zelvam95 wants to merge 4 commits intoqualcomm-linux:qcom-nextfrom
zelvam95:feature/plat-qcom-lemans-fuseprov-enablement
Open

plat-qcom: lemans: enable QFPROM fuse provisioning support#6
zelvam95 wants to merge 4 commits intoqualcomm-linux:qcom-nextfrom
zelvam95:feature/plat-qcom-lemans-fuseprov-enablement

Conversation

@zelvam95
Copy link
Copy Markdown
Contributor

@zelvam95 zelvam95 commented Apr 4, 2026

This series enables QFPROM-based fuse provisioning support for the
Qualcomm Lemans platform in OP-TEE.

The implementation builds on the existing Qualcomm fuse provisioning
framework and adds only the required Lemans-specific platform glue to
support secure fuse programming flows. No changes are made to the core
fuse provisioning logic.

The series includes:

  1. Lemans-specific QFPROM driver configuration
  2. Platform enablement with verified base addresses

The implementation maintains the same conditional compilation approach
as Kodiak, with CFG_QCOM_QFPROM_FUSEPROV defaulting to 'y' for secure
builds and 'n' for insecure builds. Actual fuse programming requires
explicit enablement of CFG_QFPROM_PROGRAMMING as a safety measure.

No functional impact on existing platforms.

Tested on: Lemans platform (secure build)
Dependencies: Requires CMD_DB, RPMH_CLIENT, and QFPROM base drivers

@kishorebatta-ossqcom
Copy link
Copy Markdown

Looks good to me.

@b49020 b49020 requested review from b49020 and ldts April 6, 2026 07:16
@zelvam95 zelvam95 force-pushed the feature/plat-qcom-lemans-fuseprov-enablement branch 2 times, most recently from b55ab01 to 4cb7539 Compare April 7, 2026 18:37
Comment thread core/drivers/clk/qcom/clock-qcom.c Outdated
#define QFPROM_CLOCK_DIVIDE 0x7
#endif

#if defined(PLATFORM_FLAVOR_kodiak)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see this #ifdef as a scalable approach overall in the clock driver. I think you should rather absract the generic clock driver to deal with whatever target specific clocks are supported via a generic header file. Then you can return not supported error if a clock is not defined for a particular target.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah, this is part of the new PAS https://github.com/OP-TEE/optee_os/pull/7721/commits . I think we should drop the PAS version we have in the staging tree and use this one instead - rebase is going to be messy

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Okay let me try to rebase now with your latest patch-set. It will then be easier for @zelvam95

@zelvam95 zelvam95 force-pushed the feature/plat-qcom-lemans-fuseprov-enablement branch from 4cb7539 to 745c512 Compare April 10, 2026 01:52
@zelvam95
Copy link
Copy Markdown
Contributor Author

Hi @b49020, @ldts,

Have done one level of refactoring now. I think further clean-up it'd make sense to do once the clock driver is merged upstream? Please share your thoughts on this version I have posted now & If this'd be fine.

@b49020
Copy link
Copy Markdown
Member

b49020 commented Apr 10, 2026

Have done one level of refactoring now. I think further clean-up it'd make sense to do once the clock driver is merged upstream? Please share your thoughts on this version I have posted now & If this'd be fine.

@zelvam95 let me do the qcom-next rebase now to tip so that's easier for your refactoring work

@b49020
Copy link
Copy Markdown
Member

b49020 commented Apr 10, 2026

@zelvam95 please rebase both of your PRs to tip of qcom-next. It's already rebased to include latest PAS PR from Jorge.

@ldts
Copy link
Copy Markdown
Contributor

ldts commented Apr 10, 2026

I'll follow up with the review as soon as you rebase @zelvam95 - seems we are close now

@ldts
Copy link
Copy Markdown
Contributor

ldts commented Apr 10, 2026

ah this is to be abandoned I guess

@zelvam95
Copy link
Copy Markdown
Contributor Author

ah this is to be abandoned I guess

I will rebase this on Tip. Will make this work. Will raise the patch tonight/weekend :)

@zelvam95 zelvam95 closed this Apr 10, 2026
@zelvam95 zelvam95 force-pushed the feature/plat-qcom-lemans-fuseprov-enablement branch from 745c512 to 8038358 Compare April 10, 2026 16:19
@zelvam95 zelvam95 reopened this Apr 10, 2026
@zelvam95 zelvam95 force-pushed the feature/plat-qcom-lemans-fuseprov-enablement branch 2 times, most recently from 564f51c to 414eb04 Compare April 10, 2026 17:34
@zelvam95
Copy link
Copy Markdown
Contributor Author

Hi @b49020, @ldts,

Can you please review the latest patch?
Note that since PIL PAS PTA is not enabled for Lemans & If I want to enable QFPROM alone, we will have to wrap those functions under the "config check".

I have refactored it based on the tip now and have pushed it. Can you please review and let me know if any comments on this?

@zelvam95 zelvam95 requested a review from b49020 April 10, 2026 17:36
@ldts
Copy link
Copy Markdown
Contributor

ldts commented Apr 14, 2026

um, I am going to extract the PAS clocks from that file into its own file. it is too messy otherwise.
Please could you pull it from the upstream PAS pull request? OP-TEE/optee_os@4aa933b

Comment thread core/arch/arm/plat-qcom/conf.mk
Comment thread core/drivers/clk/qcom/clock-qcom.c Outdated
Comment thread core/drivers/clk/qcom/clock-qcom.c Outdated
Comment thread core/drivers/qcom/qfprom/kodiak/qfprom_target.h Outdated
Comment thread core/drivers/qcom/qfprom/qfprom_target.c Outdated
Comment thread core/drivers/qcom/qfprom/qfprom_target.c Outdated
Comment thread core/drivers/qcom/qfprom/qfprom_target.c Outdated
PAS clock configuration is conditionally compiled and platform-specific;
keeping it in the same file as the core clock setup adds unnecessary
coupling and complicates maintenance.

No functional change.

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
@zelvam95 zelvam95 force-pushed the feature/plat-qcom-lemans-fuseprov-enablement branch 2 times, most recently from aac148d to b4bf594 Compare April 18, 2026 03:56
Refactor QFPROM-specific clock configuration into a generic clock rate
setting API.

This allows QFPROM driver to directly manage its clocks using the
generic clock rate API instead of going through the clock group
abstraction, which is more appropriate for its use case.

Signed-off-by: Selvam Sathappan Periakaruppan <speriaka@qti.qualcomm.com>
@zelvam95 zelvam95 force-pushed the feature/plat-qcom-lemans-fuseprov-enablement branch from b4bf594 to bcdfd27 Compare April 18, 2026 06:02
Add QFPROM driver support for Lemans platform with 37 fuse regions
including security keys, anti-rollback counters, OEM configuration,
and calibration data.

Add Lemans-specific clock driver header with QFPROM clock register
definitions (GCC_SEC_CTRL_CFG_RCGR, GCC_SEC_CTRL_CMD_RCGR).

Move platform-specific fuse region enums from common header to
target-specific headers to allow per-platform customization.

Implement conditional MX voltage rail workaround using
CFG_QFPROM_MX_RAIL_WA configuration flag. This workaround is
required for Kodiak platform but not needed for Lemans.

Signed-off-by: Selvam Sathappan Periakaruppan <speriaka@qti.qualcomm.com>
Enable QFPROM Fuse Provisioning support for Lemans platform with
required driver dependencies (CMD_DB, RPMH, QFPROM, CLK).

Move common platform definitions to shared section and organize
platform-specific definitions (GCC_BASE) into respective platform
sections.

Signed-off-by: Selvam Sathappan Periakaruppan <speriaka@qti.qualcomm.com>
@zelvam95 zelvam95 force-pushed the feature/plat-qcom-lemans-fuseprov-enablement branch from bcdfd27 to c36e3e9 Compare April 18, 2026 06:40
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.

4 participants