Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MAX32xxx counter RTC driver #80040

Merged
merged 4 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions boards/adi/max32655evkit/max32655evkit_max32655_m4.dts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@
status = "okay";
};

/*
* ERTCO is required for counter RTC
*/
&clk_ertco {
status = "okay";
};

&gpio0 {
status = "okay";
};
Expand Down Expand Up @@ -122,3 +129,7 @@
pinctrl-0 = <&owm_io_p0_6 &owm_pe_p0_7>;
pinctrl-names = "default";
};

&rtc_counter {
status = "okay";
};
1 change: 1 addition & 0 deletions boards/adi/max32655evkit/max32655evkit_max32655_m4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ supported:
- spi
- adc
- counter
- rtc_counter
- pwm
- w1
- flash
Expand Down
11 changes: 11 additions & 0 deletions boards/adi/max32655fthr/max32655fthr_max32655_m4.dts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@
status = "okay";
};

/*
* ERTCO is required for counter RTC
*/
&clk_ertco {
status = "okay";
};

&gpio0 {
status = "okay";
};
Expand Down Expand Up @@ -151,3 +158,7 @@
pinctrl-0 = <&spi1_mosi_p0_21 &spi1_miso_p0_22 &spi1_sck_p0_23 &spi1_ss0_p0_20>;
pinctrl-names = "default";
};

&rtc_counter {
status = "okay";
};
1 change: 1 addition & 0 deletions boards/adi/max32655fthr/max32655fthr_max32655_m4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ supported:
- spi
- adc
- counter
- rtc_counter
- pwm
- flash
ram: 128
Expand Down
11 changes: 11 additions & 0 deletions boards/adi/max32662evkit/max32662evkit.dts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@
status = "okay";
};

/*
* ERTCO is required for counter RTC
*/
&clk_ertco {
status = "okay";
};

&gpio0 {
status = "okay";
};
Expand All @@ -120,6 +127,10 @@
status = "okay";
};

&rtc_counter {
status = "okay";
};

&spi0 {
status = "okay";
pinctrl-0 = <&spi0a_copi_p0_3 &spi0a_cito_p0_2 &spi0a_sck_p0_4 &spi0a_ts0_p0_5>;
Expand Down
1 change: 1 addition & 0 deletions boards/adi/max32662evkit/max32662evkit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ supported:
- spi
- adc
- counter
- rtc_counter
- pwm
- flash
ram: 80
Expand Down
4 changes: 4 additions & 0 deletions boards/adi/max32666evkit/max32666evkit_max32666_cpu0.dts
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,7 @@
pinctrl-0 = <&owm_io_p0_4 &owm_pe_p0_5>;
pinctrl-names = "default";
};

&rtc_counter {
status = "okay";
};
1 change: 1 addition & 0 deletions boards/adi/max32666evkit/max32666evkit_max32666_cpu0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ supported:
- watchdog
- adc
- counter
- rtc_counter
- pwm
- w1
- flash
Expand Down
4 changes: 4 additions & 0 deletions boards/adi/max32666fthr/max32666fthr_max32666_cpu0.dts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@
status = "okay";
};

&rtc_counter {
status = "okay";
};

&spi1 {
status = "okay";
pinctrl-0 = <&spi1_mosi_p0_17 &spi1_miso_p0_18 &spi1_sck_p0_19 &spi1_ss0_p0_16>;
Expand Down
1 change: 1 addition & 0 deletions boards/adi/max32666fthr/max32666fthr_max32666_cpu0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ supported:
- spi
- adc
- counter
- rtc_counter
- pwm
- w1
- flash
Expand Down
11 changes: 11 additions & 0 deletions boards/adi/max32670evkit/max32670evkit.dts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@
status = "okay";
};

/*
* ERTCO is required for counter RTC
*/
&clk_ertco {
status = "okay";
};

&gpio0 {
status = "okay";
};
Expand Down Expand Up @@ -96,3 +103,7 @@
pinctrl-0 = <&spi0_mosi_p0_3 &spi0_miso_p0_2 &spi0_sck_p0_4 &spi0_ss0_p0_5>;
pinctrl-names = "default";
};

&rtc_counter {
status = "okay";
};
1 change: 1 addition & 0 deletions boards/adi/max32670evkit/max32670evkit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ supported:
- watchdog
- spi
- counter
- rtc_counter
- pwm
- flash
ram: 160
Expand Down
11 changes: 11 additions & 0 deletions boards/adi/max32672evkit/max32672evkit.dts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@
status = "okay";
};

/*
* ERTCO is required for counter RTC
*/
&clk_ertco {
status = "okay";
};

&gpio0 {
status = "okay";
};
Expand Down Expand Up @@ -149,3 +156,7 @@
pinctrl-names = "default";
cs-gpios = <&gpio0 5 (GPIO_ACTIVE_LOW | MAX32_VSEL_VDDIOH)>;
};

&rtc_counter {
status = "okay";
};
1 change: 1 addition & 0 deletions boards/adi/max32672evkit/max32672evkit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ supported:
- spi
- adc
- counter
- rtc_counter
- pwm
- flash
ram: 200
Expand Down
11 changes: 11 additions & 0 deletions boards/adi/max32672fthr/max32672fthr.dts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@
status = "okay";
};

/*
* ERTCO is required for counter RTC
*/
&clk_ertco {
status = "okay";
};

&gpio0 {
status = "okay";
};
Expand Down Expand Up @@ -148,3 +155,7 @@
pinctrl-0 = <&spi1a_mosi_p0_15 &spi1a_miso_p0_14 &spi1a_sck_p0_16 &spi1a_ss0_p0_17>;
pinctrl-names = "default";
};

&rtc_counter {
status = "okay";
};
1 change: 1 addition & 0 deletions boards/adi/max32672fthr/max32672fthr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ supported:
- spi
- adc
- counter
- rtc_counter
- pwm
- flash
ram: 200
Expand Down
4 changes: 4 additions & 0 deletions boards/adi/max32690evkit/max32690evkit_max32690_m4.dts
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,7 @@
pinctrl-0 = <&owm_io_p0_8 &owm_pe_p0_7>;
pinctrl-names = "default";
};

&rtc_counter {
status = "okay";
};
1 change: 1 addition & 0 deletions boards/adi/max32690evkit/max32690evkit_max32690_m4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ supported:
- watchdog
- adc
- counter
- rtc_counter
- pwm
- w1
- flash
Expand Down
1 change: 1 addition & 0 deletions drivers/counter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ zephyr_library_sources_ifdef(CONFIG_COUNTER_SNPS_DW counter_dw_timer
zephyr_library_sources_ifdef(CONFIG_COUNTER_SHELL counter_timer_shell.c)
zephyr_library_sources_ifdef(CONFIG_COUNTER_TIMER_RPI_PICO counter_rpi_pico_timer.c)
zephyr_library_sources_ifdef(CONFIG_COUNTER_TIMER_MAX32 counter_max32_timer.c)
zephyr_library_sources_ifdef(CONFIG_COUNTER_RTC_MAX32 counter_max32_rtc.c)
zephyr_library_sources_ifdef(CONFIG_COUNTER_NXP_MRT counter_nxp_mrt.c)
zephyr_library_sources_ifdef(CONFIG_COUNTER_RA_AGT counter_renesas_ra_agt.c)
2 changes: 2 additions & 0 deletions drivers/counter/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ source "drivers/counter/Kconfig.rpi_pico"

source "drivers/counter/Kconfig.max32_timer"

source "drivers/counter/Kconfig.max32_rtc"

source "drivers/counter/Kconfig.nxp_mrt"

source "drivers/counter/Kconfig.renesas_ra"
Expand Down
9 changes: 9 additions & 0 deletions drivers/counter/Kconfig.max32_rtc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024 Analog Devices, Inc.
# SPDX-License-Identifier: Apache-2.0

config COUNTER_RTC_MAX32
bool "MAX32xxx counter rtc driver"
default y
depends on DT_HAS_ADI_MAX32_RTC_COUNTER_ENABLED
help
Enable the counter rtc driver for MAX32 MCUs.
Loading
Loading