Skip to content

Commit 9084b42

Browse files
committed
soc: Add support for Silabs EFM32TG
* ARM Cortex-M3 processor * Up to 32 kB Flash and 4 kB RAM memory * Energy efficient and autonomous peripherals * Ultra low power Energy Modes * Fast wake-up Signed-off-by: Lukas Woodtli <[email protected]>
1 parent 433893e commit 9084b42

File tree

8 files changed

+256
-0
lines changed

8 files changed

+256
-0
lines changed

dts/arm/silabs/efm32tg.dtsi

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
/*
2+
* Copyright (c) 2025 Lukas Woodtli
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <arm/armv7-m.dtsi>
8+
#include <zephyr/dt-bindings/gpio/gpio.h>
9+
#include <zephyr/dt-bindings/i2c/i2c.h>
10+
11+
/ {
12+
chosen {
13+
zephyr,flash-controller = &msc;
14+
};
15+
16+
cpus {
17+
#address-cells = <1>;
18+
#size-cells = <0>;
19+
20+
cpu0: cpu@0 {
21+
compatible = "arm,cortex-m3";
22+
device_type = "cpu";
23+
clock-frequency = <32000000>;
24+
reg = <0>;
25+
};
26+
};
27+
28+
sram0: memory@20000000 {
29+
compatible = "mmio-sram";
30+
};
31+
32+
soc {
33+
msc: flash-controller@400c0000 {
34+
compatible = "silabs,gecko-flash-controller";
35+
reg = <0x400c0000 0x78>;
36+
interrupts = <21 0>;
37+
38+
#address-cells = <1>;
39+
#size-cells = <1>;
40+
41+
flash0: flash@0 {
42+
compatible = "soc-nv-flash";
43+
write-block-size = <4>;
44+
erase-block-size = <512>;
45+
};
46+
};
47+
48+
usart0: usart@4000c000 { /* USART0 */
49+
compatible = "silabs,gecko-usart";
50+
reg = <0x4000c000 0x400>;
51+
interrupts = <3 0>, <4 0>;
52+
interrupt-names = "rx", "tx";
53+
peripheral-id = <0>;
54+
status = "disabled";
55+
};
56+
57+
usart1: usart@4000c400 { /* USART1 */
58+
compatible = "silabs,gecko-usart";
59+
reg = <0x4000c400 0x400>;
60+
interrupts = <11 0>, <12 0>;
61+
interrupt-names = "rx", "tx";
62+
peripheral-id = <1>;
63+
status = "disabled";
64+
};
65+
66+
67+
leuart0: leuart@40084000 { /* LEUART0 */
68+
compatible = "silabs,gecko-leuart";
69+
reg = <0x40084000 0x400>;
70+
interrupts = <14 0>;
71+
peripheral-id = <0>;
72+
status = "disabled";
73+
};
74+
75+
i2c0: i2c@4000a000 {
76+
compatible = "silabs,gecko-i2c";
77+
clock-frequency = <I2C_BITRATE_STANDARD>;
78+
#address-cells = <1>;
79+
#size-cells = <0>;
80+
reg = <0x4000a000 0x400>;
81+
interrupts = <8 0>;
82+
status = "disabled";
83+
};
84+
85+
gpio@40006100 {
86+
compatible = "silabs,gecko-gpio";
87+
reg = <0x40006100 0xf00>;
88+
interrupts = <1 2>, <9 2>;
89+
interrupt-names = "GPIO_EVEN", "GPIO_ODD";
90+
91+
ranges;
92+
#address-cells = <1>;
93+
#size-cells = <1>;
94+
95+
gpioa: gpio@40006000 {
96+
compatible = "silabs,gecko-gpio-port";
97+
reg = <0x40006000 0x24>;
98+
peripheral-id = <0>;
99+
gpio-controller;
100+
#gpio-cells = <2>;
101+
status = "disabled";
102+
};
103+
104+
gpiob: gpio@40006024 {
105+
compatible = "silabs,gecko-gpio-port";
106+
reg = <0x40006024 0x24>;
107+
peripheral-id = <1>;
108+
gpio-controller;
109+
#gpio-cells = <2>;
110+
status = "disabled";
111+
};
112+
113+
gpioc: gpio@40006048 {
114+
compatible = "silabs,gecko-gpio-port";
115+
reg = <0x40006048 0x24>;
116+
peripheral-id = <2>;
117+
gpio-controller;
118+
#gpio-cells = <2>;
119+
status = "disabled";
120+
};
121+
122+
gpiod: gpio@4000606c {
123+
compatible = "silabs,gecko-gpio-port";
124+
reg = <0x4000606c 0x24>;
125+
peripheral-id = <3>;
126+
gpio-controller;
127+
#gpio-cells = <2>;
128+
status = "disabled";
129+
};
130+
131+
gpioe: gpio@40006090 {
132+
compatible = "silabs,gecko-gpio-port";
133+
reg = <0x40006090 0x24>;
134+
peripheral-id = <4>;
135+
gpio-controller;
136+
#gpio-cells = <2>;
137+
status = "disabled";
138+
};
139+
140+
gpiof: gpio@400060b4 {
141+
compatible = "silabs,gecko-gpio-port";
142+
reg = <0x400060b4 0x24>;
143+
peripheral-id = <5>;
144+
gpio-controller;
145+
#gpio-cells = <2>;
146+
status = "disabled";
147+
};
148+
};
149+
150+
pinctrl: pin-controller {
151+
/* Pin controller is a "virtual" device since SiLabs SoCs do pin
152+
* control in a distributed way (GPIO registers and PSEL
153+
* registers on each peripheral).
154+
*/
155+
compatible = "silabs,gecko-pinctrl";
156+
};
157+
};
158+
};
159+
160+
&nvic {
161+
arm,num-irq-priority-bits = <3>;
162+
};

modules/hal_silabs/gecko/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ zephyr_library_sources_ifdef(CONFIG_SOC_GECKO_RTCC ${EMLIB_DIR}/src/em_r
108108
zephyr_library_sources_ifdef(CONFIG_SOC_GECKO_TIMER ${EMLIB_DIR}/src/em_timer.c)
109109
zephyr_library_sources_ifdef(CONFIG_SOC_GECKO_USART ${EMLIB_DIR}/src/em_usart.c)
110110
zephyr_library_sources_ifdef(CONFIG_SOC_GECKO_WDOG ${EMLIB_DIR}/src/em_wdog.c)
111+
zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_EFM32TG ${DEVICE_DIR}/SiliconLabs/EFM32TG/Source/system_efm32tg.c)
111112
zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_EFM32WG ${DEVICE_DIR}/SiliconLabs/EFM32WG/Source/system_efm32wg.c)
112113
zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_EFR32BG13P ${DEVICE_DIR}/SiliconLabs/EFR32BG13P/Source/system_efr32bg13p.c)
113114
zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_EFR32FG1P ${DEVICE_DIR}/SiliconLabs/EFR32FG1P/Source/system_efr32fg1p.c)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2025 Lukas Woodtli
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_EFM32TG
5+
select ARM
6+
select CPU_CORTEX_M3
7+
select CPU_CORTEX_M_HAS_DWT
8+
select HAS_SILABS_GECKO
9+
select SOC_GECKO_CMU
10+
select SOC_GECKO_GPIO
11+
select HAS_PM
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2025 Lukas Woodtli
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_SERIES_EFM32TG
5+
6+
config SYS_CLOCK_HW_CYCLES_PER_SEC
7+
default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency)
8+
9+
config NUM_IRQS
10+
# must be >= the highest interrupt number used
11+
default 39
12+
13+
endif
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) 2025 Lukas Woodtli
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_EFM32TG
5+
bool
6+
select SOC_FAMILY_SILABS_S0
7+
help
8+
Silicon Labs EFM32TG (Tiny Gecko) Series MCU
9+
10+
config SOC_EFM32TG840F32
11+
bool
12+
select SOC_SERIES_EFM32TG
13+
14+
config SOC_SERIES
15+
default "efm32tg" if SOC_SERIES_EFM32TG
16+
17+
config SOC
18+
default "efm32tg840f32" if SOC_EFM32TG840F32

soc/silabs/silabs_s0/efm32tg/soc.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2025 Lukas Woodtli
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/**
8+
* @file
9+
* @brief Board configuration macros for the efm32tg soc
10+
*
11+
*/
12+
13+
#ifndef _SOC__H_
14+
#define _SOC__H_
15+
16+
#include <zephyr/sys/util.h>
17+
18+
#ifndef _ASMLANGUAGE
19+
20+
#include <em_bus.h>
21+
#include <em_common.h>
22+
23+
24+
#include "soc_pinmap.h"
25+
#include "../common/soc_gpio.h"
26+
27+
#endif /* !_ASMLANGUAGE */
28+
29+
#endif /* _SOC__H_ */
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2025 Lukas Woodtli
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/** @file
7+
* @brief Silabs EFM32TG MCU pin definitions.
8+
*
9+
* This file contains pin configuration data required by different MCU
10+
* modules to correctly configure GPIO controller.
11+
*/
12+
13+
#ifndef _SILABS_EFM32TG_SOC_PINMAP_H_
14+
#define _SILABS_EFM32TG_SOC_PINMAP_H_
15+
16+
#include <soc.h>
17+
#include <em_gpio.h>
18+
19+
#endif /* _SILABS_EFM32TG_SOC_PINMAP_H_ */

soc/silabs/soc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ family:
77
- name: efm32hg
88
socs:
99
- name: efm32hg322f64
10+
- name: efm32tg
11+
socs:
12+
- name: efm32tg840f32
1013
- name: silabs_s1
1114
series:
1215
- name: efm32pg1b

0 commit comments

Comments
 (0)