Skip to content

Commit effc3e8

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 e83d8d9 commit effc3e8

File tree

9 files changed

+252
-1
lines changed

9 files changed

+252
-1
lines changed

dts/arm/silabs/efm32tg.dtsi

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

modules/hal_silabs/gecko/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ zephyr_library_sources_ifdef(CONFIG_SOC_GECKO_TIMER ${EMLIB_DIR}/src/em_t
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)
111111
zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_EFM32WG ${DEVICE_DIR}/SiliconLabs/EFM32WG/Source/system_efm32wg.c)
112+
zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_EFM32TG ${DEVICE_DIR}/SiliconLabs/EFM32TG/Source/system_efm32tg.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)
114115
zephyr_library_sources_ifdef(CONFIG_SOC_SERIES_EFR32FG13P ${DEVICE_DIR}/SiliconLabs/EFR32FG13P/Source/system_efr32fg13p.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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2025 Lukas Woodtli
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_SERIES_EFM32TG
5+
6+
config NUM_IRQS
7+
# must be >= the highest interrupt number used
8+
default 39
9+
10+
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

west.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ manifest:
240240
groups:
241241
- hal
242242
- name: hal_silabs
243-
revision: 5871310b8c5ebae05c457598a6eef53690ca1bad
243+
revision: pull/108/head
244244
path: modules/hal/silabs
245245
groups:
246246
- hal

0 commit comments

Comments
 (0)