Skip to content

Commit 7ea0013

Browse files
FRASTMMaureenHelm
authored andcommitted
soc: arm: st_stm32: Add STM32G071 SoC series
This patch adds support for the STM32G071xx from STMicroelectronics. Signed-off-by: Philippe Retornaz <[email protected]> Signed-off-by: Francois Ramu <[email protected]>
1 parent 3d32acf commit 7ea0013

File tree

12 files changed

+280
-0
lines changed

12 files changed

+280
-0
lines changed

dts/arm/st/g0/stm32g0.dtsi

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright (c) 2019 Philippe Retornaz <[email protected]>
3+
* Copyright (c) 2019 ST Microelectronics
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
#include <st/g0/stm32g0-pinctrl.dtsi>
9+
#include <arm/armv6-m.dtsi>
10+
#include <dt-bindings/clock/stm32_clock.h>
11+
#include <dt-bindings/gpio/gpio.h>
12+
13+
/ {
14+
cpus {
15+
#address-cells = <1>;
16+
#size-cells = <0>;
17+
18+
cpu@0 {
19+
device_type = "cpu";
20+
compatible = "arm,cortex-m0+";
21+
reg = <0>;
22+
};
23+
};
24+
25+
sram0: memory@20000000 {
26+
device_type = "memory";
27+
compatible = "mmio-sram";
28+
};
29+
30+
soc {
31+
flash-controller@40022000 {
32+
compatible = "st,stm32g0-flash-controller";
33+
label = "FLASH_CTRL";
34+
reg = <0x40022000 0x400>;
35+
interrupts = <3 0>;
36+
37+
#address-cells = <1>;
38+
#size-cells = <1>;
39+
40+
flash0: flash@8000000 {
41+
compatible = "soc-nv-flash";
42+
label = "FLASH_STM32";
43+
44+
write-block-size = <8>;
45+
erase-block-size = <2048>;
46+
};
47+
};
48+
49+
};
50+
};
51+
52+
&nvic {
53+
arm,num-irq-priority-bits = <2>;
54+
};

dts/arm/st/g0/stm32g071.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright (c) 2019 Philippe Retornaz <[email protected]>
3+
* Copyright (c) 2019 ST Microelectronics
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
#include <st/g0/stm32g0.dtsi>

dts/arm/st/g0/stm32g071Xb.dtsi

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) 2019 Philippe Retornaz <[email protected]>
3+
* Copyright (c) 2019 ST Microelectronics
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
#include <mem.h>
9+
#include <st/g0/stm32g071.dtsi>
10+
11+
/ {
12+
sram0: memory@20000000 {
13+
reg = <0x20000000 DT_SIZE_K(36)>;
14+
};
15+
16+
soc {
17+
flash-controller@40022000 {
18+
flash0: flash@8000000 {
19+
reg = <0x08000000 DT_SIZE_K(128)>;
20+
};
21+
};
22+
};
23+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_include_directories(${ZEPHYR_BASE}/drivers)
4+
zephyr_sources(
5+
soc.c
6+
)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Kconfig - STMicroelectronics STM32G0 MCU line
2+
#
3+
# Copyright (c) 2019 Philippe Retornaz <[email protected]>
4+
# Copyright (c) 2019 STMicroelectronics
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
#
8+
9+
if SOC_SERIES_STM32G0X
10+
11+
source "soc/arm/st_stm32/stm32g0/Kconfig.defconfig.stm32g0*"
12+
13+
config SOC_SERIES
14+
default "stm32g0"
15+
16+
if GPIO_STM32
17+
18+
endif # GPIO_STM32
19+
20+
endif # SOC_SERIES_STM32G0X
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Kconfig - STMicroelectronics STM32G071RB MCU
2+
#
3+
# Copyright (c) 2019 Philippe Retornaz <[email protected]>
4+
# Copyright (c) 2019 STMicroelectronics
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
#
8+
9+
if SOC_STM32G071XX
10+
11+
config SOC
12+
string
13+
default "stm32g071xx"
14+
15+
config NUM_IRQS
16+
int
17+
default 32
18+
19+
if GPIO_STM32
20+
21+
endif # GPIO_STM32
22+
endif # SOC_STM32G071XX
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Kconfig - STMicroelectronics STM32G0 MCU series
2+
#
3+
# Copyright (c) 2019 Philippe Retornaz <[email protected]>
4+
# Copyright (c) 2019 STMicroelectronics
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
#
8+
9+
config SOC_SERIES_STM32G0X
10+
bool "STM32G0x Series MCU"
11+
select CPU_CORTEX_M0PLUS
12+
select CPU_CORTEX_M_HAS_VTOR
13+
select SOC_FAMILY_STM32
14+
select HAS_STM32CUBE
15+
select CPU_CORTEX_M_HAS_SYSTICK
16+
select CLOCK_CONTROL_STM32_CUBE if CLOCK_CONTROL
17+
help
18+
Enable support for STM32G0 MCU series
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Kconfig - STMicroelectronics STM32G0 MCU line
2+
#
3+
# Copyright (c) 2019 Philippe Retornaz <[email protected]>
4+
# Copyright (c) 2019 STMicroelectronics
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
#
8+
9+
choice
10+
prompt "STM32G0x MCU Selection"
11+
depends on SOC_SERIES_STM32G0X
12+
13+
config SOC_STM32G071XX
14+
bool "STM32G071XX"
15+
16+
17+
endchoice
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2019 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* SoC level DTS fixup file */
8+
9+
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
10+
11+
/* End of SoC Level DTS fixup file */

soc/arm/st_stm32/stm32g0/linker.ld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* linker.ld - Linker command/script file */
2+
3+
/*
4+
* Copyright (c) 2019 Philippe Retornaz <[email protected]>
5+
* Copyright (c) 2019 STMicroelectronics
6+
*
7+
* SPDX-License-Identifier: Apache-2.0
8+
*/
9+
10+
#include <arch/arm/cortex_m/scripts/linker.ld>

0 commit comments

Comments
 (0)