From 75c83edc4881e7dd837ab8086870ac73e915a614 Mon Sep 17 00:00:00 2001 From: Florian Grandel Date: Thu, 6 Jul 2023 16:06:19 +0200 Subject: [PATCH] dts: ti: cc13xx_cc26xx: devicetree sysclk alignment This change introduces the "_rtc_timer" suffix for the system tick timer driver "compatible" property and aligns naming conventions with the actual CC13/26xx SoC series product policy. This frees up the "_rtc" namespace to introduce additional APIs based on the same peripheral in the future (not part of this PR): rtc: rtc@... { compatible = "ti,cc13xx-cc26xx-rtc"; ... timer { compatible = "ti,cc13xx-cc26xx-rtc-timer"; ... }; counter { compatible = "ti,cc13xx-cc26xx-rtc-counter"; ... }; pps { compatible = "ti,cc13xx-cc26xx-rtc-pps"; ... }; }; Or alternatively an MFD pattern with similar requirements. Fixing the namespacing now makes sense standalone as it reduces the chance of custom drivers being broken in the future. Redundant extension of the mandatory system clock devicetree node is replaced with a single `status = "okay"` which seems to be the more sensible default to avoid user error when defining custom boards. Knowledgeable users can still override this if really needed. Signed-off-by: Florian Grandel --- boards/arm/beagle_bcf/beagleconnect_freedom.dts | 4 ---- boards/arm/cc1352p1_launchxl/cc1352p1_launchxl.dts | 4 ---- boards/arm/cc1352r1_launchxl/cc1352r1_launchxl.dts | 4 ---- boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts | 4 ---- boards/arm/cc26x2r1_launchxl/cc26x2r1_launchxl.dts | 4 ---- drivers/timer/Kconfig.cc13xx_cc26xx_rtc | 2 +- drivers/timer/cc13xx_cc26xx_rtc_timer.c | 2 +- dts/arm/ti/cc13xx_cc26xx.dtsi | 5 +++-- dts/bindings/rtc/ti,cc13xx-cc26xx-rtc.yaml | 2 +- 9 files changed, 6 insertions(+), 25 deletions(-) diff --git a/boards/arm/beagle_bcf/beagleconnect_freedom.dts b/boards/arm/beagle_bcf/beagleconnect_freedom.dts index 154928bc8c..c41d642ebf 100644 --- a/boards/arm/beagle_bcf/beagleconnect_freedom.dts +++ b/boards/arm/beagle_bcf/beagleconnect_freedom.dts @@ -201,10 +201,6 @@ }; }; -&rtc { - status = "okay"; -}; - &ieee802154 { status = "okay"; }; diff --git a/boards/arm/cc1352p1_launchxl/cc1352p1_launchxl.dts b/boards/arm/cc1352p1_launchxl/cc1352p1_launchxl.dts index 06053065c8..50ab7b4fdc 100644 --- a/boards/arm/cc1352p1_launchxl/cc1352p1_launchxl.dts +++ b/boards/arm/cc1352p1_launchxl/cc1352p1_launchxl.dts @@ -131,10 +131,6 @@ cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; }; -&rtc { - status = "okay"; -}; - &radio { status = "okay"; }; diff --git a/boards/arm/cc1352r1_launchxl/cc1352r1_launchxl.dts b/boards/arm/cc1352r1_launchxl/cc1352r1_launchxl.dts index 71c2214ed9..4f6cc4864b 100644 --- a/boards/arm/cc1352r1_launchxl/cc1352r1_launchxl.dts +++ b/boards/arm/cc1352r1_launchxl/cc1352r1_launchxl.dts @@ -111,10 +111,6 @@ cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; }; -&rtc { - status = "okay"; -}; - &radio { status = "okay"; }; diff --git a/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts b/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts index 0df448d6f3..0d50b59e77 100644 --- a/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts +++ b/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts @@ -141,10 +141,6 @@ /* TODO: "jedec,spi-nor" for the mx25r8035 */ }; -&rtc { - status = "okay"; -}; - &radio { status = "okay"; }; diff --git a/boards/arm/cc26x2r1_launchxl/cc26x2r1_launchxl.dts b/boards/arm/cc26x2r1_launchxl/cc26x2r1_launchxl.dts index 6021603165..271e63b920 100644 --- a/boards/arm/cc26x2r1_launchxl/cc26x2r1_launchxl.dts +++ b/boards/arm/cc26x2r1_launchxl/cc26x2r1_launchxl.dts @@ -111,10 +111,6 @@ cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; }; -&rtc { - status = "okay"; -}; - &wdt0 { status = "okay"; }; diff --git a/drivers/timer/Kconfig.cc13xx_cc26xx_rtc b/drivers/timer/Kconfig.cc13xx_cc26xx_rtc index 5b4b82aa3f..e6fbef0bfa 100644 --- a/drivers/timer/Kconfig.cc13xx_cc26xx_rtc +++ b/drivers/timer/Kconfig.cc13xx_cc26xx_rtc @@ -6,7 +6,7 @@ config CC13XX_CC26XX_RTC_TIMER bool "TI SimpleLink CC13xx/CC26xx RTC system clock timer" default y - depends on DT_HAS_TI_CC13XX_CC26XX_RTC_ENABLED + depends on DT_HAS_TI_CC13XX_CC26XX_RTC_TIMER_ENABLED select TICKLESS_CAPABLE select TIMER_HAS_64BIT_CYCLE_COUNTER help diff --git a/drivers/timer/cc13xx_cc26xx_rtc_timer.c b/drivers/timer/cc13xx_cc26xx_rtc_timer.c index bf0895f32a..9a64c77924 100644 --- a/drivers/timer/cc13xx_cc26xx_rtc_timer.c +++ b/drivers/timer/cc13xx_cc26xx_rtc_timer.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#define DT_DRV_COMPAT ti_cc13xx_cc26xx_rtc +#define DT_DRV_COMPAT ti_cc13xx_cc26xx_rtc_timer /* * TI SimpleLink CC13X2/CC26X2 RTC-based system timer diff --git a/dts/arm/ti/cc13xx_cc26xx.dtsi b/dts/arm/ti/cc13xx_cc26xx.dtsi index dd32e43755..57c07c2b12 100644 --- a/dts/arm/ti/cc13xx_cc26xx.dtsi +++ b/dts/arm/ti/cc13xx_cc26xx.dtsi @@ -123,11 +123,12 @@ status = "disabled"; }; + /* The RTC peripheral backs the kernel system clock and tick timer. */ rtc: rtc@40092000 { - compatible = "ti,cc13xx-cc26xx-rtc"; + compatible = "ti,cc13xx-cc26xx-rtc-timer"; reg = <0x40092000 0x1000>; interrupts = <4 0>; /* interrupt #20 = 4 + 16 */ - status = "disabled"; + status = "okay"; /* the system clock timer is mandatory */ }; radio: radio@40040000 { diff --git a/dts/bindings/rtc/ti,cc13xx-cc26xx-rtc.yaml b/dts/bindings/rtc/ti,cc13xx-cc26xx-rtc.yaml index 93f7912d3c..861efc3a8f 100644 --- a/dts/bindings/rtc/ti,cc13xx-cc26xx-rtc.yaml +++ b/dts/bindings/rtc/ti,cc13xx-cc26xx-rtc.yaml @@ -6,7 +6,7 @@ description: TI SimpleLink CC13xx/CC26xx RTC -compatible: "ti,cc13xx-cc26xx-rtc" +compatible: "ti,cc13xx-cc26xx-rtc-timer" include: rtc.yaml