Commit 3b43cb31 authored by Mahesh Mahadevan's avatar Mahesh Mahadevan Committed by Benjamin Cabé
Browse files

tests: pm: Test the SoC State Change Power Domain driver



The SoC State Change Power Domain driver issues TURN_ON/
TURN_OFF actions to all devices registered with it for
certain power states that can be specified via device tree.
This test exercises the functionality of this driver.

Signed-off-by: default avatarMahesh Mahadevan <mahesh.mahadevan@nxp.com>
parent b579a904
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
# Copyright 2025 NXP
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(power_domain_soc_state_change)

target_sources(app PRIVATE src/main.c)
+11 −0
Original line number Diff line number Diff line
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

menu "Zephyr"
source "Kconfig.zephyr"
endmenu

config TEST_PROVIDE_PM_HOOKS
	bool "Provide PM hooks for test purposes"
	default y
	select HAS_PM
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright 2025 NXP
 * SPDX-License-Identifier: Apache-2.0
 */

/ {
	power-states {
		state0: state0 {
			compatible = "zephyr,power-state";
			power-state-name = "runtime-idle";
			min-residency-us = <10000>;
			exit-latency-us = <100>;
		};

		state1: state1 {
			compatible = "zephyr,power-state";
			power-state-name = "suspend-to-idle";
			min-residency-us = <50000>;
			exit-latency-us = <500>;
		};

		state2: state2 {
			compatible = "zephyr,power-state";
			power-state-name = "standby";
			min-residency-us = <100000>;
			exit-latency-us = <1000>;
		};
	};

	test_soc_state_domain: test_soc_state_domain {
		compatible = "power-domain-soc-state-change";
		status = "okay";
		onoff-power-states = <&state1 &state2>;
		#power-domain-cells = <0>;
	};

	test_dev_soc_state_change: test_dev_soc_state_change {
		compatible = "test-device-pm";
		status = "okay";
		power-domains = <&test_soc_state_domain>;
	};
};

&cpu0 {
	cpu-power-states = <&state0 &state1 &state2>;
};
+10 −0
Original line number Diff line number Diff line
# Copyright 2025 NXP
# SPDX-License-Identifier: Apache-2.0

include: [base.yaml, pm.yaml]

description: |
    This binding provides resources required to build and run the
    tests/subsys/pm/power_domain_soc_state_change test in Zephyr.

compatible: "test-device-pm"
+7 −0
Original line number Diff line number Diff line
# Copyright 2025 NXP
# SPDX-License-Identifier: Apache-2.0

CONFIG_ZTEST=y
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_POWER_DOMAIN=y
Loading