1/*
2 * Copyright (c) 2017 Christian Taedcke
3 * Copyright (c) 2019 Lemonbeat GmbH
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#include "slstk3402a-pinctrl.dtsi"
9#include <zephyr/dt-bindings/input/input-event-codes.h>
10
11/ {
12	model = "Silicon Labs EFM32PG12 STK3402A board";
13
14	chosen {
15		zephyr,console = &usart0;
16		zephyr,shell-uart = &usart0;
17		zephyr,sram = &sram0;
18		zephyr,flash = &flash0;
19	};
20
21	/* These aliases are provided for compatibility with samples */
22	aliases {
23		led0 = &led0;
24		led1 = &led1;
25		pwm-led0 = &pwm_led0;
26		sw0 = &button0;
27		sw1 = &button1;
28		watchdog0 = &wdog0;
29		watchdog1 = &wdog1;
30	};
31
32	leds {
33		compatible = "gpio-leds";
34		led0: led_0 {
35			gpios = <&gpiof 4 0>;
36			label = "LED 0";
37		};
38		led1: led_1 {
39			gpios = <&gpiof 5 0>;
40			label = "LED 1";
41		};
42	};
43
44	buttons {
45		compatible = "gpio-keys";
46		button0: button_0 {
47			/* gpio flags need validation */
48			gpios = <&gpiof 6 GPIO_ACTIVE_LOW>;
49			label = "User Push Button 0";
50			zephyr,code = <INPUT_KEY_0>;
51		};
52		button1: button_1 {
53			/* gpio flags need validation */
54			gpios = <&gpiof 7 GPIO_ACTIVE_LOW>;
55			label = "User Push Button 1";
56			zephyr,code = <INPUT_KEY_1>;
57		};
58	};
59
60	pwmleds {
61		compatible = "pwm-leds";
62		status = "okay";
63		pwm_led0: pwm_led0 {
64			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
65		};
66	};
67};
68
69&cpu0 {
70	clock-frequency = <40000000>;
71};
72
73&usart0 {
74	current-speed = <115200>;
75	pinctrl-0 = <&usart0_default>;
76	pinctrl-names = "default";
77	status = "okay";
78};
79
80&leuart0 {
81	current-speed = <9600>;
82	location-rx = <GECKO_LOCATION(18) GECKO_PORT_D GECKO_PIN(11)>;
83	location-tx = <GECKO_LOCATION(18) GECKO_PORT_D GECKO_PIN(10)>;
84	status = "okay";
85};
86
87&i2c0 {
88	pinctrl-0 = <&i2c0_default>;
89	pinctrl-names = "default";
90	status = "okay";
91};
92
93&rtcc0 {
94	prescaler = <1>;
95	status = "okay";
96};
97
98&timer0 {
99	status = "okay";
100
101	pwm0: pwm {
102		status = "okay";
103		pin-location = <GECKO_LOCATION(28) GECKO_PORT_F GECKO_PIN(4)>;
104		prescaler = <1024>;
105	};
106};
107
108&gpio {
109	location-swo = <0>;
110	status = "okay";
111};
112
113&gpioa {
114	status = "okay";
115
116	board-controller-enable {
117		gpio-hog;
118		gpios = <5 GPIO_ACTIVE_HIGH>;
119		output-high;
120	};
121};
122
123&gpiob {
124	status = "okay";
125};
126
127&gpiod {
128	status = "okay";
129};
130
131&gpiof {
132	status = "okay";
133};
134
135&wdog0 {
136	status = "okay";
137};
138
139&wdog1 {
140	status = "okay";
141};
142
143
144&flash0 {
145
146	partitions {
147		compatible = "fixed-partitions";
148		#address-cells = <1>;
149		#size-cells = <1>;
150
151		/* Set 6Kb of storage at the end of the 1024Kb of flash */
152		storage_partition: partition@fe800 {
153			label = "storage";
154			reg = <0x000fe800 0x00001800>;
155		};
156
157	};
158};
159
160&trng0 {
161	status = "okay";
162};
163
164&adc0 {
165	status = "okay";
166};
167