Skip to content

Commit a994852

Browse files
lpawelczMaureenHelm
authored andcommitted
dts/boards: efr32bg_sltb010a: add spi-through-usart nodes
This commit configures USART0 to act as SPI. Signed-off-by: Pawel Czarnecki <[email protected]>
1 parent 06245f3 commit a994852

File tree

3 files changed

+39
-7
lines changed

3 files changed

+39
-7
lines changed

boards/arm/efr32bg_sltb010a/efr32bg_sltb010a.dts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
aliases {
1717
led0 = &led0;
1818
sw0 = &button0;
19+
spi-flash0 = &mx25r80;
20+
spi0 = &usart0;
1921
};
2022

2123
chosen {
@@ -52,6 +54,28 @@
5254
clock-frequency = <76800000>;
5355
};
5456

57+
&usart0 {
58+
status = "okay";
59+
pinctrl-0 = <&usart0_default>;
60+
pinctrl-names = "default";
61+
62+
cs-gpios = <&gpioc 3 GPIO_ACTIVE_LOW>;
63+
64+
mx25r80: mx25r8035f@0 {
65+
compatible = "jedec,spi-nor";
66+
reg = <0>;
67+
spi-max-frequency = <80000000>;
68+
size = <0x800000>;
69+
jedec-id = [c2 28 14];
70+
sfdp-bfp = [
71+
e5 20 f1 ff ff ff 7f 00 44 eb 08 6b 08 3b 04 bb
72+
ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52
73+
10 d8 00 ff 23 72 f5 00 82 ed 04 b7 44 83 38 44
74+
30 b0 30 b0 f7 c4 d5 5c 00 be 29 ff f0 d0 ff ff
75+
];
76+
};
77+
};
78+
5579
&usart1 {
5680
current-speed = <115200>;
5781
status = "okay";
@@ -112,6 +136,10 @@
112136
status = "okay";
113137
};
114138

139+
&gpioc {
140+
status = "okay";
141+
};
142+
115143
&stimer0 {
116144
status = "okay";
117145
};

dts/arm/silabs/efr32bg22-pinctrl.dtsi

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@
77
#include <dt-bindings/pinctrl/gecko-pinctrl.h>
88

99
&pinctrl {
10-
/* configuration for uart0 device, default state */
10+
/* configuration for usart0 device, operating as SPI */
1111
usart0_default: usart0_default {
1212
group1 {
13-
/* configure PE.11 as UART_RX and PE.10 as UART_TX */
14-
psels = <GECKO_PSEL(UART_TX, E, 10)>,
15-
<GECKO_PSEL(UART_RX, E, 11)>,
16-
<GECKO_LOC(UART, 0)>;
13+
psels = <GECKO_PSEL(SPI_SCK, C, 2)>,
14+
<GECKO_PSEL(SPI_MOSI, C, 0)>,
15+
<GECKO_PSEL(SPI_MISO, C, 1)>;
1716
};
1817
};
1918

20-
/* configuration for uart1 device, default state */
19+
/* configuration for usart1 device, default state - operating as UART */
2120
usart1_default: usart1_default {
2221
group1 {
2322
/* configure PA.6 as UART_RX and PA.5 as UART_TX */

dts/arm/silabs/efr32bg22.dtsi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,16 @@
5555
};
5656

5757
usart0: usart@5005c000 {
58-
compatible = "silabs,gecko-usart";
58+
compatible = "silabs,gecko-spi-usart";
5959
reg = <0x5005C000 0x400>;
6060
interrupts = <13 0>, <14 0>;
6161
interrupt-names = "rx", "tx";
6262
status = "disabled";
63+
64+
#address-cells = <1>;
65+
#size-cells = <0>;
66+
67+
status = "disabled";
6368
};
6469

6570
usart1: usart@50060000 {

0 commit comments

Comments
 (0)