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

drivers: rtc: sam0: Add RTC calendar driver and clock fixes #81819

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions boards/atmel/sam0/samc21n_xpro/samc21n_xpro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@
pinctrl-names = "default";
};

&rtc {
status = "okay";
counter-mode = "clock";
prescaler = <1024>;

assigned-clocks = <&osc32kctrl 4>;
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-uart";
Expand Down
1 change: 1 addition & 0 deletions boards/atmel/sam0/samc21n_xpro/samc21n_xpro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ supported:
- gpio
- i2c
- pwm
- rtc
- spi
- uart
vendor: atmel
6 changes: 6 additions & 0 deletions boards/atmel/sam0/samd20_xpro/samd20_xpro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
clock-frequency = <DT_FREQ_M(48)>;
};

&rtc {
status = "okay";
counter-mode = "clock";
prescaler = <1024>;
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-spi";
Expand Down
5 changes: 4 additions & 1 deletion boards/atmel/sam0/samd20_xpro/samd20_xpro.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) 2024 Gerson Fernando Budke <[email protected]>
# SPDX-License-Identifier: Apache-2.0

identifier: samd20_xpro
name: SAM D20 Xplained Pro
type: mcu
Expand All @@ -9,10 +12,10 @@ toolchain:
flash: 256
ram: 32
supported:
- adc
- flash
- gpio
- i2c
- rtc
- spi
- uart
- watchdog
Expand Down
6 changes: 6 additions & 0 deletions boards/atmel/sam0/samd21_xpro/samd21_xpro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@
pinctrl-names = "default";
};

&rtc {
status = "okay";
counter-mode = "clock";
prescaler = <1024>;
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-uart";
Expand Down
2 changes: 1 addition & 1 deletion boards/atmel/sam0/samd21_xpro/samd21_xpro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ toolchain:
flash: 256
ram: 32
supported:
- adc
- counter
- dma
- gpio
- i2c
- pwm
- rtc
- spi
- uart
- usb_device
Expand Down
8 changes: 8 additions & 0 deletions boards/atmel/sam0/same54_xpro/same54_xpro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@
pinctrl-names = "default";
};

&rtc {
status = "okay";
counter-mode = "clock";
prescaler = <1024>;

assigned-clocks = <&osc32kctrl 4>;
};

&sercom2 {
status = "okay";
compatible = "atmel,sam0-uart";
Expand Down
1 change: 1 addition & 0 deletions boards/atmel/sam0/same54_xpro/same54_xpro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ supported:
- i2c
- netif:eth
- pwm
- rtc
- spi
- uart
- usb_device
Expand Down
8 changes: 8 additions & 0 deletions boards/atmel/sam0/saml21_xpro/saml21_xpro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@
pinctrl-names = "default";
};

&rtc {
status = "okay";
counter-mode = "clock";
prescaler = <1024>;

assigned-clocks = <&osc32kctrl 4>;
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-spi";
Expand Down
1 change: 1 addition & 0 deletions boards/atmel/sam0/saml21_xpro/saml21_xpro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ supported:
- gpio
- i2c
- pwm
- rtc
- spi
- uart
- usb_device
Expand Down
8 changes: 7 additions & 1 deletion boards/atmel/sam0/samr21_xpro/samr21_xpro-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
/*
* Copyright (c) 2022, Gerson Fernando Budke <[email protected]>
* Copyright (c) 2022-2024, Gerson Fernando Budke <[email protected]>
* SPDX-License-Identifier: Apache-2.0
*/

#include <dt-bindings/pinctrl/samr21g-pinctrl.h>

&pinctrl {
adc_default: adc_default {
group1 {
pinmux = <PA6B_ADC_AIN6>;
};
};

pwm_default: pwm_default {
group1 {
pinmux = <PA19F_TCC0_WO3>;
Expand Down
12 changes: 12 additions & 0 deletions boards/atmel/sam0/samr21_xpro/samr21_xpro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@
clock-frequency = <48000000>;
};

&adc {
status = "okay";
pinctrl-0 = <&adc_default>;
pinctrl-names = "default";
};

&tcc0 {
status = "okay";
compatible = "atmel,sam0-tcc-pwm";
Expand All @@ -116,6 +122,12 @@
pinctrl-names = "default";
};

&rtc {
status = "okay";
counter-mode = "clock";
prescaler = <1024>;
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-uart";
Expand Down
2 changes: 2 additions & 0 deletions boards/atmel/sam0/samr21_xpro/samr21_xpro.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2019 Benjamin Valentin
# Copyright (c) 2019-2024 Gerson Fernando Budke
# SPDX-License-Identifier: Apache-2.0

identifier: samr21_xpro
name: SAM R21 Xplained Pro
type: mcu
Expand All @@ -18,6 +19,7 @@ supported:
- i2c
- netif
- pwm
- rtc
- spi
- uart
- usb_device
Expand Down
8 changes: 8 additions & 0 deletions boards/atmel/sam0/samr34_xpro/samr34_xpro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@
pinctrl-names = "default";
};

&rtc {
status = "okay";
counter-mode = "clock";
prescaler = <1024>;

assigned-clocks = <&osc32kctrl 4>;
};

&sercom0 {
status = "okay";
compatible = "atmel,sam0-uart";
Expand Down
1 change: 1 addition & 0 deletions boards/atmel/sam0/samr34_xpro/samr34_xpro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ supported:
- gpio
- i2c
- pwm
- rtc
- spi
- uart
- usb_device
Expand Down
Loading
Loading