Commit graph

24 commits

Author SHA1 Message Date
Flavio Ceolin 73b755d817 pm: Add a symbol for device power state constraints
Add a symbol to enable device power state constraints this
saves resources when this feature is not needed.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-07 19:06:23 -04:00
Flavio Ceolin 39544299fc tests: pm/power_states_api: Test device constraints
Test that device pm state constraints work as expected.
It declares a device in DT that specify that two pm states cause
power loss and use this information when the device is in the middle
of an action.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-07 19:06:23 -04:00
Flavio Ceolin 2f99ff51cc pm: Disable device pm per power state
Make it possible to disble device power management individually per
power state.  This allows targets tuning which states should
(and which should not) trigger device power management.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-04 19:13:53 -04:00
Alberto Escolar Piedras b39d7c2c3d tests/subsys/pm/*: Switch to native_sim
Enable all these tests which run in native_posix in native_sim,
Switch from native_posix to native_sim as default test platform
And switch native_posix overlays to native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:53:54 +01:00
Flavio Ceolin 0b01671fe9 tests: pm: Test pm_state_cpu_get_all
Add test for pm_state_cpu_get_all API

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-23 20:57:57 -05:00
Anas Nashif 345735d0a8 tests: remove CONFIG_ZTEST_NEW_API in all tests
Remove all usage of CONFIG_ZTEST_NEW_API from tests and sample as this
is now enabled by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Gerard Marull-Paretas a05371d353 pm: state: allow disabling certain power states
In some platforms it may be desirable to disable certain CPU power
states, for example, because they have extra requirements not available
on all boards/applications. Because `cpu-power-states` are defined at
SoC dts file levels, the only way to achieve that now was by re-defining
`cpu-power-states` property in e.g. a board file. With this patch, one
can now selectively set `status = "disabled";` to any power state and it
will be skipped by the PM subsystem.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-07-26 16:49:00 +02:00
Gerard Marull-Paretas e4c43e4cc9 pm: power-states node needs to be a child of cpus
This again aligns with Linux.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-25 09:16:14 +02:00
Gerard Marull-Paretas c008bf1720 tests: pm: power_states: use cpu0 to define cpu-power-states
There's no need to define a new CPU, we can re-use cpu0 in native_posix.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-07-25 09:16:14 +02:00
Fabio Baltieri 691322a495 dts: bindings: drop remaining "required: false" from bindings
Drop the remaining "required: false" from the bindings, make CI happy.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 14:23:53 +01:00
Fabio Baltieri f5b4acac57 yamllint: indentation: fix files in tests/
Fix the YAML files indentation for files in tests/.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 14:23:53 +01:00
Gerard Marull-Paretas 79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Yinfang Wang 473649a5bb tests: subsys: pm: move power_states_api to new ztest API
move power_states_api to new ztest API.

Signed-off-by: Yinfang Wang <yinfang.wang@intel.com>
2022-08-15 18:40:17 +00:00
Fabio Baltieri def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Gerard Marull-Paretas ade7ccb918 tests: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:02:14 +02:00
Anas Nashif 97af0c8c33 tests: remove subsys prefix from test identifier
No need for subsys, the subsystem is expected to be the first component
of the identifier.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-03-18 10:50:57 -04:00
Flavio Ceolin f3718ed701 tests: pm: s/power/pm tag
Use tag "pm" in power management tests.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-12-10 07:43:01 -05:00
Gerard Marull-Paretas 7bfd0976aa pm: state: PM_STATE_DT_ITEMS_LEN->DT_NUM_CPU_POWER_STATES
Rename PM_STATE_DT_ITEMS_LEN to DT_NUM_CPU_POWER_STATES to make its
purpose more clear. This macro could be made part of a Devicetree API
for PM in the future.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 12:33:57 -05:00
Gerard Marull-Paretas 5ab7d35e7c pm: state: PM_STATE_DT_ITEMS_LIST->PM_STATE_LIST_FROM_DT_CPU
Rename the PM_STATE_DT_ITEMS_LIST macro to PM_STATE_LIST_FROM_DT_CPU to
make its purpose more clear. Similar naming scheme is found e.g. in the
GPIO API.

Associated internal macros and docstrings have been adjusted, too.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 12:33:57 -05:00
Gerard Marull-Paretas fa96955305 pm: state: PM_STATE_INFO_DT_ITEMS_LIST->PM_STATE_INFO_LIST_FROM_DT_CPU
Rename the PM_STATE_INFO_DT_ITEMS_LIST macro to
PM_STATE_INFO_LIST_FROM_DT_CPU to make its purpose more clear. Similar
naming scheme is found e.g. in the GPIO API.

Associated internal macros and docstrings have been adjusted, too.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 12:33:57 -05:00
Torsten Rasmussen 1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Martí Bolívar 682aea8b3b dts: don't use 'test' vendor prefix
This is now failing an edtlib check for unknown vendor prefixes.

I can't find a reason to use a vendor prefix in application-local
bindings like this, so just remove it wherever it appears by
normalizing to test-foo-compat instead of test,foo_compat or
test,foo-compat.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-19 08:05:04 -05:00
Gerard Marull-Paretas 5a4cdd24a0 tests: replace power/power.h with pm/pm.h
Replace old header with the new one.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-05 18:35:49 -04:00
Gerard Marull-Paretas ef91546a51 tests: power: move to pm folder
Adjust naming to make things more consistent.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-05 18:35:49 -04:00