Skip to content

se_services: zephyr: Add API for LPCMP configuration - #140

Merged
RupeshKumar-AlifSemi merged 1 commit into
alifsemi:mainfrom
Prabhakar-Alifsemi:lpcmp-configure-se-service
Aug 14, 2026
Merged

se_services: zephyr: Add API for LPCMP configuration#140
RupeshKumar-AlifSemi merged 1 commit into
alifsemi:mainfrom
Prabhakar-Alifsemi:lpcmp-configure-se-service

Conversation

@Prabhakar-Alifsemi

Copy link
Copy Markdown
Contributor

API is used to configure LPCMP VBAT related registers which should not be accessed by the application directly.

@sudhir-alifsemi sudhir-alifsemi left a comment

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.

Can you redo the formatting and make sure only the relevant changes are applied.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a Zephyr-side SE service API to configure the low-power comparator (LPCMP) (and related power settings) through the Secure Enclave, keeping VBAT/LPCMP-related register access out of application code.

Changes:

  • Add se_service_configure_lpcmp() and se_service_power_settings_set() APIs and wire them into the SE service call path.
  • Extend the services protocol definitions with an LPCMP configuration service packet and a new service ID.
  • Add an lpcmp_configure_t configuration struct for callers.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
se_services/zephyr/src/se_service.c Adds two new SE-backed service wrappers for LPCMP configuration and power-setting configuration.
se_services/zephyr/include/se_service.h Exposes the new public Zephyr APIs and their documentation.
se_services/include/services_lib_protocol.h Defines the LPCMP configuration service packet structure.
se_services/include/services_lib_ids.h Adds a new application service ID for LPCMP configuration.
se_services/include/aipm.h Adds lpcmp_configure_t used by the new API.
Suppressed comments (1)

se_services/zephyr/src/se_service.c:1830

  • The error log message is a copy/paste from the OTP service and will be misleading when the power-setting request fails. Log the current function/service instead.
	if (err) {
		LOG_ERR("service_read_otp failed with %d\n", err);
		return err;

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread se_services/zephyr/src/se_service.c
Comment thread se_services/zephyr/src/se_service.c
Comment thread se_services/zephyr/include/se_service.h
Comment thread se_services/include/services_lib_protocol.h
Comment thread se_services/zephyr/src/se_service.c Outdated
API is used to configure LPCMP VBAT related registers
which should not be accessed by the application directly.

Signed-off-by: Honkala Petri <petri.honkala@alifsemi.com>

@RupeshKumar-AlifSemi RupeshKumar-AlifSemi left a comment

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.

Looks OK

@RupeshKumar-AlifSemi
RupeshKumar-AlifSemi merged commit 20c18bf into alifsemi:main Aug 14, 2026
1 check passed
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.

6 participants