From 98cf5a209fa70d38c46586a8ae44d35cdbd317c3 Mon Sep 17 00:00:00 2001 From: Amneesh Singh Date: Thu, 8 Oct 2026 12:16:59 +0530 Subject: [PATCH 1/7] UPSTREAM: boards: ti: am243x_evm: mark PWM as supported commit 8d38dd2caad62b0545a9422bd6c74e5087c32b20 upstream. Mark PWM as supported in the board YAML so that twister can pick it up. Signed-off-by: Amneesh Singh --- boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0.yaml b/boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0.yaml index 7dea2b83a2a0..967818055d5e 100644 --- a/boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0.yaml +++ b/boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0.yaml @@ -13,4 +13,5 @@ toolchain: supported: - spi - sdhc + - pwm vendor: ti From e20bd28f66809ff92e66e1ba0f6048855091a74c Mon Sep 17 00:00:00 2001 From: Amneesh Singh Date: Thu, 8 Oct 2026 12:16:59 +0530 Subject: [PATCH 2/7] UPSTREAM: boards: ti: am62l_evm: mark PWM as supported commit bc79ac99fcefdce056e96195aa55be3561b89bbb upstream. Mark PWM as supported in the board YAML, so that twister can pick it up. Signed-off-by: Amneesh Singh --- boards/ti/am62l_evm/am62l_evm_am62l3_a53.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/boards/ti/am62l_evm/am62l_evm_am62l3_a53.yaml b/boards/ti/am62l_evm/am62l_evm_am62l3_a53.yaml index 991c3d8c96e5..9a688e7001b0 100644 --- a/boards/ti/am62l_evm/am62l_evm_am62l3_a53.yaml +++ b/boards/ti/am62l_evm/am62l_evm_am62l3_a53.yaml @@ -10,6 +10,7 @@ supported: - adc - uart - shdc + - pwm testing: ignore_tags: - net From 403c1f898ca4b3b60f90f72e2cb2b4bc20e6f66a Mon Sep 17 00:00:00 2001 From: Amneesh Singh Date: Thu, 8 Oct 2026 12:16:59 +0530 Subject: [PATCH 3/7] UPSTREAM: boards: ti: am243x_evm: enable CLOCK_CONTROL commit 09b72d3fc66bef926aa4a36d19f5db8947b6c63a upstream. Set CLOCK_CONTROL=y in the board defconfig by default so that other peripherals can do clock related operations. We already have a clock controller and TISCI node enabled in the DT. Signed-off-by: Amneesh Singh --- boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0_defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0_defconfig b/boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0_defconfig index 1b60b680f7a0..073ab9a507ba 100644 --- a/boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0_defconfig +++ b/boards/ti/am243x_evm/am243x_evm_am2434_r5f0_0_defconfig @@ -15,3 +15,6 @@ CONFIG_UART_CONSOLE=y # Enable MPU CONFIG_ARM_MPU=y + +# Enable Clock Control +CONFIG_CLOCK_CONTROL=y From 3b54857fc512e79971bb0ae88e3b831bcea467df Mon Sep 17 00:00:00 2001 From: Amneesh Singh Date: Thu, 8 Oct 2026 12:16:59 +0530 Subject: [PATCH 4/7] UPSTREAM: tests: pwm_loopback: factor out common parts in tests.yaml commit a06c69f22e9473f7f5d0cdbadde9e383048fcdd3 upstream. There are some common scenario fields in this YAML file, move it under common: so that they do not repeat. This is also useful if we add more scenarios later. Signed-off-by: Amneesh Singh --- tests/drivers/pwm/pwm_loopback/testcase.yaml | 31 ++++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/tests/drivers/pwm/pwm_loopback/testcase.yaml b/tests/drivers/pwm/pwm_loopback/testcase.yaml index 377f0d16c704..2ac57f483780 100644 --- a/tests/drivers/pwm/pwm_loopback/testcase.yaml +++ b/tests/drivers/pwm/pwm_loopback/testcase.yaml @@ -1,25 +1,18 @@ +common: + tags: + - pwm + - drivers + - userspace + depends_on: pwm + filter: dt_compat_enabled("test-pwm-loopback") + harness: ztest + harness_config: + fixture: pwm_loopback + tests: - drivers.pwm.loopback: - tags: - - pwm - - drivers - - userspace - depends_on: pwm - filter: dt_compat_enabled("test-pwm-loopback") - harness: ztest - harness_config: - fixture: pwm_loopback + drivers.pwm.loopback: {} drivers.pwm.s32k5xxcvb_s32k566_ftm.loopback: - tags: - - pwm - - drivers - - userspace extra_args: DTC_OVERLAY_FILE="boards/s32k5xxcvb_s32k566_ftm.overlay" platform_allow: - s32k5xxcvb/s32k566/m7 - s32k5xxcvb/s32k566/r52 - depends_on: pwm - filter: dt_compat_enabled("test-pwm-loopback") - harness: ztest - harness_config: - fixture: pwm_loopback From 7cfb45de22cd719c25c46b9fb353cb9e4e46e3f8 Mon Sep 17 00:00:00 2001 From: Amneesh Singh Date: Thu, 8 Oct 2026 12:17:00 +0530 Subject: [PATCH 5/7] UPSTREAM: tests: pwm_loopback: enable I/O expander snippet for TI AM62L EVM commit 70646690320e53923c54d41ecdb2d8d61bebeba0 upstream. Enable aforementioned using the platform directive under extra_args to allow physical connections. Signed-off-by: Amneesh Singh --- tests/drivers/pwm/pwm_loopback/testcase.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/drivers/pwm/pwm_loopback/testcase.yaml b/tests/drivers/pwm/pwm_loopback/testcase.yaml index 2ac57f483780..8eb469fe6ffa 100644 --- a/tests/drivers/pwm/pwm_loopback/testcase.yaml +++ b/tests/drivers/pwm/pwm_loopback/testcase.yaml @@ -10,7 +10,9 @@ common: fixture: pwm_loopback tests: - drivers.pwm.loopback: {} + drivers.pwm.loopback: + extra_args: + - platform:am62l_evm/am62l3/a53:SNIPPET=ti-io-exp drivers.pwm.s32k5xxcvb_s32k566_ftm.loopback: extra_args: DTC_OVERLAY_FILE="boards/s32k5xxcvb_s32k566_ftm.overlay" platform_allow: From bf24c9b099b5e2f3d7192dc2612b7fdde4db1f89 Mon Sep 17 00:00:00 2001 From: Amneesh Singh Date: Thu, 8 Oct 2026 12:17:00 +0530 Subject: [PATCH 6/7] UPSTREAM: tests: pwm_loopback: add overlay for TI AM243x EVM commit da9163ac1efa4921d48bb24cc41d3387c4bbe5b1 upstream. Add an overlay for PWM loopback from EPWM0 to ECAP0, this assumes pins are configured in the board DT. Signed-off-by: Amneesh Singh --- .../boards/am243x_evm_am2434_r5f0_0.overlay | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/drivers/pwm/pwm_loopback/boards/am243x_evm_am2434_r5f0_0.overlay diff --git a/tests/drivers/pwm/pwm_loopback/boards/am243x_evm_am2434_r5f0_0.overlay b/tests/drivers/pwm/pwm_loopback/boards/am243x_evm_am2434_r5f0_0.overlay new file mode 100644 index 000000000000..cac662cb6378 --- /dev/null +++ b/tests/drivers/pwm/pwm_loopback/boards/am243x_evm_am2434_r5f0_0.overlay @@ -0,0 +1,22 @@ +/* + * SPDX-FileCopyrightText: 2026 Texas Instruments Incorporated + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + pwm_loopback_0 { + compatible = "test-pwm-loopback"; + pwms = <&main_epwm0 0 0 PWM_POLARITY_NORMAL>, + <&main_ecap0 0 0 PWM_POLARITY_NORMAL>; + }; +}; + +&main_epwm0 { + status = "okay"; +}; + +&main_ecap0 { + status = "okay"; +}; From 9be4668fdf033be27cb909a806578266c6f25833 Mon Sep 17 00:00:00 2001 From: Amneesh Singh Date: Thu, 8 Oct 2026 12:17:00 +0530 Subject: [PATCH 7/7] UPSTREAM: tests: pwm_loopback: add overlay for TI AM62Lx EVM commit 7118bab677c6cebcfe1c8b64e07b2d778693c77a upstream. Add an overlay for PWM loopback from EPWM0 to ECAP0. This assumes pins are already configured in the board DT. The test scenario already enables the I/O expander snippet required for these pins. Signed-off-by: Amneesh Singh --- .../boards/am62l_evm_am62l3_a53.overlay | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/drivers/pwm/pwm_loopback/boards/am62l_evm_am62l3_a53.overlay diff --git a/tests/drivers/pwm/pwm_loopback/boards/am62l_evm_am62l3_a53.overlay b/tests/drivers/pwm/pwm_loopback/boards/am62l_evm_am62l3_a53.overlay new file mode 100644 index 000000000000..cac662cb6378 --- /dev/null +++ b/tests/drivers/pwm/pwm_loopback/boards/am62l_evm_am62l3_a53.overlay @@ -0,0 +1,22 @@ +/* + * SPDX-FileCopyrightText: 2026 Texas Instruments Incorporated + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + pwm_loopback_0 { + compatible = "test-pwm-loopback"; + pwms = <&main_epwm0 0 0 PWM_POLARITY_NORMAL>, + <&main_ecap0 0 0 PWM_POLARITY_NORMAL>; + }; +}; + +&main_epwm0 { + status = "okay"; +}; + +&main_ecap0 { + status = "okay"; +};