Skip to content

Commit

Permalink
dts: ti: cc13xx_cc26xx: devicetree sysclk alignment
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
fgrandel authored and cfriedt committed Jul 7, 2023
1 parent 38e2eb8 commit 75c83ed
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 25 deletions.
4 changes: 0 additions & 4 deletions boards/arm/beagle_bcf/beagleconnect_freedom.dts
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,6 @@
};
};

&rtc {
status = "okay";
};

&ieee802154 {
status = "okay";
};
Expand Down
4 changes: 0 additions & 4 deletions boards/arm/cc1352p1_launchxl/cc1352p1_launchxl.dts
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@
cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};

&rtc {
status = "okay";
};

&radio {
status = "okay";
};
Expand Down
4 changes: 0 additions & 4 deletions boards/arm/cc1352r1_launchxl/cc1352r1_launchxl.dts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@
cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};

&rtc {
status = "okay";
};

&radio {
status = "okay";
};
Expand Down
4 changes: 0 additions & 4 deletions boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@
/* TODO: "jedec,spi-nor" for the mx25r8035 */
};

&rtc {
status = "okay";
};

&radio {
status = "okay";
};
Expand Down
4 changes: 0 additions & 4 deletions boards/arm/cc26x2r1_launchxl/cc26x2r1_launchxl.dts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@
cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};

&rtc {
status = "okay";
};

&wdt0 {
status = "okay";
};
2 changes: 1 addition & 1 deletion drivers/timer/Kconfig.cc13xx_cc26xx_rtc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/timer/cc13xx_cc26xx_rtc_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions dts/arm/ti/cc13xx_cc26xx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion dts/bindings/rtc/ti,cc13xx-cc26xx-rtc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

description: TI SimpleLink CC13xx/CC26xx RTC

compatible: "ti,cc13xx-cc26xx-rtc"
compatible: "ti,cc13xx-cc26xx-rtc-timer"

include: rtc.yaml

Expand Down

0 comments on commit 75c83ed

Please sign in to comment.