From 33594595c916650ffb682b52a27f9bbf7ed223ca Mon Sep 17 00:00:00 2001 From: Teresa Zepeda Ventura Date: Wed, 21 Aug 2024 08:27:30 -0600 Subject: [PATCH] boards: sparkfun: Add SPI support over EUSART in devicetree Modified devicetree to integrate support for EUSART in pincontrol settings. Signed-off-by: Teresa Zepeda Ventura --- .../sparkfun/thing_plus_matter_mgm240p/board.c | 3 +++ ...rkfun_thing_plus_matter_mgm240p-pinctrl.dtsi | 9 +++++++++ .../sparkfun_thing_plus_matter_mgm240p.dts | 13 +++++++++++++ .../sparkfun_thing_plus_matter_mgm240p.yaml | 1 + dts/arm/silabs/efr32mg24.dtsi | 17 +++++++++++++++++ 5 files changed, 43 insertions(+) diff --git a/boards/sparkfun/thing_plus_matter_mgm240p/board.c b/boards/sparkfun/thing_plus_matter_mgm240p/board.c index 6578e872700c8d..36735f35276cb9 100644 --- a/boards/sparkfun/thing_plus_matter_mgm240p/board.c +++ b/boards/sparkfun/thing_plus_matter_mgm240p/board.c @@ -51,6 +51,9 @@ static int sparkfun_thing_plus_mgm240p_init_clocks(void) #endif #if defined(_CMU_EM01GRPBCLKCTRL_MASK) CMU_ClockSelectSet(cmuClock_EM01GRPBCLK, cmuSelect_HFRCODPLL); +#endif +#if defined(_CMU_EM01GRPCCLKCTRL_MASK) + CMU_ClockSelectSet(cmuClock_EM01GRPCCLK, cmuSelect_HFRCODPLL); #endif CMU_ClockSelectSet(cmuClock_EM23GRPACLK, cmuSelect_LFRCO); CMU_ClockSelectSet(cmuClock_EM4GRPACLK, cmuSelect_LFRCO); diff --git a/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p-pinctrl.dtsi b/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p-pinctrl.dtsi index 4e6cb746f80804..bbec29ee586d2c 100644 --- a/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p-pinctrl.dtsi +++ b/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p-pinctrl.dtsi @@ -18,6 +18,15 @@ }; }; + eusart1_default: eusart1_default { + group1 { + psels = , + , + , + ; + }; + }; + i2c0_default: i2c0_default { group1 { psels = , diff --git a/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.dts b/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.dts index e0352730d309bb..4f12a4868157d4 100644 --- a/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.dts +++ b/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.dts @@ -25,6 +25,7 @@ aliases { led0 = &blue_led; + spi0 = &eusart1; watchdog0 = &wdog0; }; @@ -53,6 +54,18 @@ pinctrl-names = "default"; status = "okay"; }; + +&eusart1 { + compatible = "silabs,gecko-spi-eusart"; + + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&eusart1_default>; + pinctrl-names = "default"; + + status = "okay"; +}; + &i2c0 { pinctrl-0 = <&i2c0_default>; pinctrl-names = "default"; diff --git a/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.yaml b/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.yaml index 87bea1b93152be..392fbb38fb97b6 100644 --- a/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.yaml +++ b/boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.yaml @@ -14,6 +14,7 @@ supported: - uart - spi - watchdog + - clock_control testing: ignore_tags: - net diff --git a/dts/arm/silabs/efr32mg24.dtsi b/dts/arm/silabs/efr32mg24.dtsi index 540b9b83eac98d..29fa2cb647bd6c 100644 --- a/dts/arm/silabs/efr32mg24.dtsi +++ b/dts/arm/silabs/efr32mg24.dtsi @@ -119,6 +119,23 @@ status = "disabled"; }; + eusart0: eusart@5b010000 { + compatible = "silabs,gecko-spi-eusart"; + reg = <0x5B010000 0x4000>; + interrupts = <11 0>, <12 0>; + interrupt-names = "rx", "tx"; + clocks = <&cmu CLOCK_EUSART0 CLOCK_BRANCH_EUSART0CLK>; + status = "disabled"; + }; + eusart1: eusart@500a0000 { + compatible = "silabs,gecko-spi-eusart"; + reg = <0x500A0000 0x4000>; + interrupts = <13 0>, <14 0>; + interrupt-names = "rx", "tx"; + clocks = <&cmu CLOCK_EUSART1 CLOCK_BRANCH_EM01GRPCCLK>; + status = "disabled"; + }; + burtc0: burtc@50064000 { compatible = "silabs,gecko-burtc"; reg = <0x50064000 0x3034>;