Skip to content

Commit 3359459

Browse files
Terezventhenrikbrixandersen
authored andcommitted
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 <[email protected]>
1 parent b05eb43 commit 3359459

File tree

5 files changed

+43
-0
lines changed

5 files changed

+43
-0
lines changed

boards/sparkfun/thing_plus_matter_mgm240p/board.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ static int sparkfun_thing_plus_mgm240p_init_clocks(void)
5151
#endif
5252
#if defined(_CMU_EM01GRPBCLKCTRL_MASK)
5353
CMU_ClockSelectSet(cmuClock_EM01GRPBCLK, cmuSelect_HFRCODPLL);
54+
#endif
55+
#if defined(_CMU_EM01GRPCCLKCTRL_MASK)
56+
CMU_ClockSelectSet(cmuClock_EM01GRPCCLK, cmuSelect_HFRCODPLL);
5457
#endif
5558
CMU_ClockSelectSet(cmuClock_EM23GRPACLK, cmuSelect_LFRCO);
5659
CMU_ClockSelectSet(cmuClock_EM4GRPACLK, cmuSelect_LFRCO);

boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p-pinctrl.dtsi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@
1818
};
1919
};
2020

21+
eusart1_default: eusart1_default {
22+
group1 {
23+
psels = <GECKO_PSEL(SPI_SCK, C, 2)>,
24+
<GECKO_PSEL(SPI_MISO, C, 3)>,
25+
<GECKO_PSEL(SPI_MOSI, C, 6)>,
26+
<GECKO_PSEL(SPI_CSN, A, 7)>;
27+
};
28+
};
29+
2130
i2c0_default: i2c0_default {
2231
group1 {
2332
psels = <GECKO_PSEL(I2C_SDA, B, 3)>,

boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.dts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
aliases {
2727
led0 = &blue_led;
28+
spi0 = &eusart1;
2829
watchdog0 = &wdog0;
2930
};
3031

@@ -53,6 +54,18 @@
5354
pinctrl-names = "default";
5455
status = "okay";
5556
};
57+
58+
&eusart1 {
59+
compatible = "silabs,gecko-spi-eusart";
60+
61+
#address-cells = <1>;
62+
#size-cells = <0>;
63+
pinctrl-0 = <&eusart1_default>;
64+
pinctrl-names = "default";
65+
66+
status = "okay";
67+
};
68+
5669
&i2c0 {
5770
pinctrl-0 = <&i2c0_default>;
5871
pinctrl-names = "default";

boards/sparkfun/thing_plus_matter_mgm240p/sparkfun_thing_plus_matter_mgm240p.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ supported:
1414
- uart
1515
- spi
1616
- watchdog
17+
- clock_control
1718
testing:
1819
ignore_tags:
1920
- net

dts/arm/silabs/efr32mg24.dtsi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,23 @@
119119
status = "disabled";
120120
};
121121

122+
eusart0: eusart@5b010000 {
123+
compatible = "silabs,gecko-spi-eusart";
124+
reg = <0x5B010000 0x4000>;
125+
interrupts = <11 0>, <12 0>;
126+
interrupt-names = "rx", "tx";
127+
clocks = <&cmu CLOCK_EUSART0 CLOCK_BRANCH_EUSART0CLK>;
128+
status = "disabled";
129+
};
130+
eusart1: eusart@500a0000 {
131+
compatible = "silabs,gecko-spi-eusart";
132+
reg = <0x500A0000 0x4000>;
133+
interrupts = <13 0>, <14 0>;
134+
interrupt-names = "rx", "tx";
135+
clocks = <&cmu CLOCK_EUSART1 CLOCK_BRANCH_EM01GRPCCLK>;
136+
status = "disabled";
137+
};
138+
122139
burtc0: burtc@50064000 {
123140
compatible = "silabs,gecko-burtc";
124141
reg = <0x50064000 0x3034>;

0 commit comments

Comments
 (0)