Skip to content

Commit f384a86

Browse files
yishai1999kartben
authored andcommitted
boards: silabs: fix boards DTS files coding style issues
Fix board DTS coding style issues to prevent them from spreading when a new board is introduced and uses an existing DTS as a referance. Issues addressed from Zephyr devicetree style guidelines [1]: - Don’t insert empty lines before a deindenting };. - Insert a single empty line to separate nodes at the same hierarchy level. - status is "okay" by default. - compatible property comes first in node. - reg property comes second in node. - status property comes last in node. - the rest of the properties within are nodes naturally sorted. - child nodes are sorted by address or alphabetically if there is no address. No functional change. Link: https://docs.zephyrproject.org/latest/contribute/style/devicetree.html [1] Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
1 parent 1508d7e commit f384a86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+589
-534
lines changed

boards/gardena/sgrm/sgrm.dts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
chosen {
1616
zephyr,console = &usart1;
1717
zephyr,flash = &flash0;
18+
zephyr,ppp-uart = &usart0;
1819
zephyr,shell-uart = &usart1;
1920
zephyr,sram = &sram0;
20-
zephyr,ppp-uart = &usart0;
2121
};
2222
};
2323

@@ -41,9 +41,9 @@
4141

4242
&usart0 {
4343
current-speed = <500000>;
44+
hw-flow-control;
4445
pinctrl-0 = <&usart0_default>;
4546
pinctrl-names = "default";
46-
hw-flow-control;
4747
status = "okay";
4848
};
4949

@@ -80,13 +80,13 @@
8080
#size-cells = <1>;
8181

8282
slot0_partition: partition@0 {
83-
label = "image-0";
8483
reg = <0x00000000 DT_SIZE_K(192)>;
84+
label = "image-0";
8585
};
8686

8787
storage_partition: partition@30000 {
88-
label = "storage";
8988
reg = <0x00030000 DT_SIZE_K(64)>;
89+
label = "storage";
9090
};
9191
};
9292
};

boards/seeed/xiao_mg24/xiao_mg24.dts

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
compatible = "seeed,xiao_mg24", "silabs,efr32mg24";
1515

1616
chosen {
17+
zephyr,bt-hci = &bt_hci_silabs;
18+
zephyr,code-partition = &slot0_partition;
1719
zephyr,console = &usart0;
20+
zephyr,flash = &flash0;
1821
zephyr,shell-uart = &usart0;
19-
zephyr,uart-pipe = &usart0;
2022
zephyr,sram = &sram0;
21-
zephyr,flash = &flash0;
22-
zephyr,code-partition = &slot0_partition;
23-
zephyr,bt-hci = &bt_hci_silabs;
23+
zephyr,uart-pipe = &usart0;
2424
};
2525

2626
/* These aliases are provided for compatibility with samples */
@@ -48,25 +48,25 @@
4848
};
4949

5050
&hfxo {
51-
status = "okay";
5251
ctune = <95>;
5352
precision = <50>;
53+
status = "okay";
5454
};
5555

5656
&lfxo {
57-
status = "okay";
5857
ctune = <44>;
5958
precision = <50>;
59+
status = "okay";
6060
};
6161

6262
&hfrcodpll {
6363
clock-frequency = <DT_FREQ_M(78)>;
6464
clocks = <&hfxo>;
65-
dpll-n = <3839>;
66-
dpll-m = <1919>;
65+
dpll-autorecover;
6766
dpll-edge = "fall";
6867
dpll-lock = "phase";
69-
dpll-autorecover;
68+
dpll-m = <1919>;
69+
dpll-n = <3839>;
7070
};
7171

7272
&em23grpaclk {
@@ -98,19 +98,19 @@
9898

9999
&eusart0 {
100100
compatible = "silabs,eusart-uart";
101+
current-speed = <115200>;
101102
pinctrl-0 = <&eusart0_default>;
102103
pinctrl-names = "default";
103-
current-speed = <115200>;
104104
};
105105

106106
&eusart1 {
107107
compatible = "silabs,eusart-spi";
108-
pinctrl-0 = <&eusart1_default>;
109-
pinctrl-names = "default";
110-
cs-gpios = <&gpioc 7 GPIO_ACTIVE_LOW>;
111-
clock-frequency = <4000000>;
112108
#address-cells = <1>;
113109
#size-cells = <0>;
110+
clock-frequency = <4000000>;
111+
cs-gpios = <&gpioc 7 GPIO_ACTIVE_LOW>;
112+
pinctrl-0 = <&eusart1_default>;
113+
pinctrl-names = "default";
114114
};
115115

116116
&i2c0 {
@@ -145,7 +145,6 @@
145145

146146
&gpioc {
147147
status = "okay";
148-
149148
};
150149

151150
&gpiod {
@@ -172,27 +171,27 @@
172171

173172
/* Reserve 48 kB for the bootloader */
174173
boot_partition: partition@0 {
175-
label = "mcuboot";
176174
reg = <0x0 DT_SIZE_K(48)>;
175+
label = "mcuboot";
177176
read-only;
178177
};
179178

180179
/* Reserve 720 kB for the application in slot 0 */
181180
slot0_partition: partition@c000 {
182-
label = "image-0";
183181
reg = <0x0000c000 0x000B8000>;
182+
label = "image-0";
184183
};
185184

186185
/* Reserve 720 kB for the application in slot 1 */
187186
slot1_partition: partition@C4000 {
188-
label = "image-1";
189187
reg = <0x000C0000 0x000B8000>;
188+
label = "image-1";
190189
};
191190

192191
/* Set 16 kB of storage at the end of the 1536 kB of flash */
193192
storage_partition: partition@17c000 {
194-
label = "storage";
195193
reg = <0x0017c000 DT_SIZE_K(16)>;
194+
label = "storage";
196195
};
197196
};
198197
};

boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk-pinctrl.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<SI32_MUX(USART0_RTS, 1, 14)>;
1414
output-enable;
1515
};
16+
1617
group2 {
1718
pinmux = <SI32_MUX(USART0_RX, 1, 13)>,
1819
<SI32_MUX(USART0_CTS, 1, 15)>;

boards/silabs/dev_kits/sim3u1xx_dk/sim3u1xx_dk.dts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,36 @@
2424
zephyr,console = &usart0;
2525
zephyr,flash = &flash0;
2626
zephyr,shell-uart = &usart0;
27-
zephyr,uart-pipe = &usart0;
2827
zephyr,sram = &sram0;
28+
zephyr,uart-pipe = &usart0;
2929
};
3030

3131
leds {
3232
compatible = "gpio-leds";
3333

3434
led_red: led_2_10 {
35-
label = "Red LED (DS3)";
3635
gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>;
36+
label = "Red LED (DS3)";
3737
};
38+
3839
led_yellow: led_2_11 {
39-
label = "Yellow LED (DS4)";
4040
gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>;
41+
label = "Yellow LED (DS4)";
4142
};
4243
};
4344

4445
gpio_keys {
4546
compatible = "gpio-keys";
4647

4748
user_button_sw2: button_0 {
48-
label = "Push button switch (SW2)";
4949
gpios = <&gpio2 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
50+
label = "Push button switch (SW2)";
5051
zephyr,code = <INPUT_KEY_0>;
5152
};
53+
5254
user_button_sw3: button_1 {
53-
label = "Push button switch (SW3)";
5455
gpios = <&gpio2 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
56+
label = "Push button switch (SW3)";
5557
zephyr,code = <INPUT_KEY_1>;
5658
};
5759
};
@@ -77,9 +79,9 @@
7779

7880
&usart0 {
7981
current-speed = <115200>;
82+
hw-flow-control;
8083
pinctrl-0 = <&usart0_default>;
8184
pinctrl-names = "default";
82-
hw-flow-control;
8385
status = "okay";
8486
};
8587

@@ -100,20 +102,20 @@
100102
#size-cells = <1>;
101103

102104
slot0_partition: partition@0 {
103-
label = "image-0";
104105
reg = <0x00000000 DT_SIZE_K(192)>;
106+
label = "image-0";
105107
};
106108

107109
storage_partition: partition@30000 {
108-
label = "storage";
109110
reg = <0x00030000 DT_SIZE_K(64)>;
111+
label = "storage";
110112
};
111113
};
112114
};
113115

114116
&dma {
115-
status = "okay";
116117
dma-channels = <8>; /* Crypto DMA channels have ID 5, 6, and 7 */
118+
status = "okay";
117119
};
118120

119121
&crypto {

boards/silabs/dev_kits/sltb004a/sltb004a-pinctrl.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
psels = <GECKO_PSEL(UART_RX, A, 1)>,
1515
<GECKO_LOC(UART_RX, 0)>;
1616
};
17+
1718
group2 {
1819
/* configure PA.0 as UART_TX */
1920
psels = <GECKO_PSEL(UART_TX, A, 0)>,

boards/silabs/dev_kits/sltb004a/sltb004a.dts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,20 @@
2626

2727
chosen {
2828
zephyr,console = &usart0;
29+
zephyr,flash = &flash0;
2930
zephyr,shell-uart = &usart0;
30-
zephyr,uart-pipe = &usart0;
3131
zephyr,sram = &sram0;
32-
zephyr,flash = &flash0;
32+
zephyr,uart-pipe = &usart0;
3333
};
3434

3535
leds {
3636
compatible = "gpio-leds";
37+
3738
led0: led_0 {
3839
gpios = <&gpiod 8 0>;
3940
label = "LED 0";
4041
};
42+
4143
led1: led_1 {
4244
gpios = <&gpiod 9 0>;
4345
label = "LED 1";
@@ -46,12 +48,14 @@
4648

4749
buttons {
4850
compatible = "gpio-keys";
51+
4952
button0: button_0 {
5053
/* gpio flags need validation */
5154
gpios = <&gpiod 14 GPIO_ACTIVE_LOW>;
5255
label = "User Push Button 0";
5356
zephyr,code = <INPUT_KEY_0>;
5457
};
58+
5559
button1: button_1 {
5660
/* gpio flags need validation */
5761
gpios = <&gpiod 15 GPIO_ACTIVE_LOW>;
@@ -62,7 +66,7 @@
6266

6367
pwmleds {
6468
compatible = "pwm-leds";
65-
status = "okay";
69+
6670
pwm_led0: pwm_led0 {
6771
pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
6872
};
@@ -86,9 +90,9 @@
8690
#address-cells = <1>;
8791
#size-cells = <0>;
8892

93+
location-clk = <GECKO_LOCATION(18) GECKO_PORT_F GECKO_PIN(7)>;
8994
location-rx = <GECKO_LOCATION(30) GECKO_PORT_K GECKO_PIN(2)>;
9095
location-tx = <GECKO_LOCATION(29) GECKO_PORT_K GECKO_PIN(0)>;
91-
location-clk = <GECKO_LOCATION(18) GECKO_PORT_F GECKO_PIN(7)>;
9296

9397
cs-gpios = <&gpiok 1 GPIO_ACTIVE_LOW>;
9498

@@ -97,15 +101,15 @@
97101
mx25r80: mx25r8035f@0 {
98102
compatible = "jedec,spi-nor";
99103
reg = <0>;
100-
spi-max-frequency = <80000000>;
101-
size = <0x800000>;
102104
jedec-id = [c2 28 14];
103105
sfdp-bfp = [
104106
e5 20 f1 ff ff ff 7f 00 44 eb 08 6b 08 3b 04 bb
105107
ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52
106108
10 d8 00 ff 23 72 f5 00 82 ed 04 b7 44 83 38 44
107109
30 b0 30 b0 f7 c4 d5 5c 00 be 29 ff f0 d0 ff ff
108110
];
111+
size = <0x800000>;
112+
spi-max-frequency = <80000000>;
109113
};
110114
};
111115

@@ -158,14 +162,14 @@
158162

159163
/* This set selects for ENV_I2C supporting Si7021, Si11330, BMP280 */
160164
/*
161-
location-sda = <GECKO_LOCATION(17) GECKO_PORT_C GECKO_PIN(4)>;
162165
location-scl = <GECKO_LOCATION(17) GECKO_PORT_C GECKO_PIN(5)>;
166+
location-sda = <GECKO_LOCATION(17) GECKO_PORT_C GECKO_PIN(4)>;
163167
*/
164168

165169
/* This set selects for HALL_I2C supporting Si7210 */
166170
/*
167-
location-sda = <GECKO_LOCATION(8) GECKO_PORT_B GECKO_PIN(8)>;
168171
location-scl = <GECKO_LOCATION(8) GECKO_PORT_B GECKO_PIN(9)>;
172+
location-sda = <GECKO_LOCATION(8) GECKO_PORT_B GECKO_PIN(8)>;
169173
*/
170174
};
171175

@@ -178,9 +182,9 @@
178182
status = "okay";
179183

180184
pwm0: pwm {
181-
status = "okay";
182185
pin-location = <GECKO_LOCATION(17) GECKO_PORT_D GECKO_PIN(9)>;
183186
prescaler = <1024>;
187+
status = "okay";
184188
};
185189
};
186190

@@ -214,21 +218,20 @@
214218
};
215219

216220
&flash0 {
217-
218221
partitions {
219222
compatible = "fixed-partitions";
220223
#address-cells = <1>;
221224
#size-cells = <1>;
222225

223226
/* Set 6Kb of storage at the end of the 1024Kb of flash */
224227
storage_partition: partition@fe800 {
225-
label = "storage";
226228
reg = <0x000fe800 0x00001800>;
229+
label = "storage";
227230
};
228231

229232
};
230233
};
231234

232235
&trng0 {
233-
status = "okay";
236+
status = "okay";
234237
};

0 commit comments

Comments
 (0)