Commit 0ba7505b authored by Manuel Argüelles's avatar Manuel Argüelles Committed by Carles Cufi
Browse files

tests: counter: support System Timer on s32z270dc2_r52



Enable counter_basic_api test for s32z270dc2_r52 boards, using
System Timer counter instances with different prescaler values.

Signed-off-by: default avatarManuel Arguelles <manuel.arguelles@nxp.com>
parent cc70daac
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
/*
 * Copyright 2022 NXP
 *
 * SPDX-License-Identifier: Apache-2.0
 */

&stm0 {
	prescaler = <1>;
	status = "okay";
};

&stm1 {
	prescaler = <8>;
	status = "okay";
};

&stm2 {
	prescaler = <16>;
	status = "okay";
};

&stm3 {
	prescaler = <32>;
	status = "okay";
};
+25 −0
Original line number Diff line number Diff line
/*
 * Copyright 2022 NXP
 *
 * SPDX-License-Identifier: Apache-2.0
 */

&stm0 {
	prescaler = <1>;
	status = "okay";
};

&stm1 {
	prescaler = <8>;
	status = "okay";
};

&stm2 {
	prescaler = <16>;
	status = "okay";
};

&stm3 {
	prescaler = <32>;
	status = "okay";
};
+8 −0
Original line number Diff line number Diff line
@@ -94,6 +94,9 @@ static const struct device *const devices[] = {
#ifdef CONFIG_COUNTER_TMR_ESP32
	DEVS_FOR_DT_COMPAT(espressif_esp32_timer)
#endif
#ifdef CONFIG_COUNTER_NXP_S32_SYS_TIMER
	DEVS_FOR_DT_COMPAT(nxp_s32_sys_timer)
#endif
};

static const struct device *const period_devs[] = {
@@ -976,6 +979,11 @@ static bool reliable_cancel_capable(const struct device *dev)
	if (dev == DEVICE_DT_GET(DT_NODELABEL(counter0))) {
		return true;
	}
#endif
#ifdef CONFIG_COUNTER_NXP_S32_SYS_TIMER
	if (single_channel_alarm_capable(dev)) {
		return true;
	}
#endif
	return false;
}