Skip to contentSkip to conversation

Add support for STM32G0 SoC family

PATCH Superseded Felipe Balbi 2 participants 4 messages Mar 20, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Add support for STM32G0 SoC family

From: Felipe Balbi <[email protected]>

Hi all,

These two patches add support for STM32G0 family and nucleo-g071rb board. Patches have been tested with minimal embedded rust examples.

Felipe Balbi (2):
hw/arm: Add support for stm32g000 SoC family
hw/arm: Add nucleo-g071rb board

 hw/arm/Kconfig                 |  12 ++
 hw/arm/meson.build             |   2 +
 hw/arm/nucleo-g071rb.c         |  70 ++++++++++
 hw/arm/stm32g000_soc.c         | 246 +++++++++++++++++++++++++++++++++
 include/hw/arm/stm32g000_soc.h |  62 +++++++++
 5 files changed, 392 insertions(+)
 create mode 100644 hw/arm/nucleo-g071rb.c
 create mode 100644 hw/arm/stm32g000_soc.c
 create mode 100644 include/hw/arm/stm32g000_soc.h
Signature · 1 line
2.44.0
#1 lore raw

PATCH 1/2 hw/arm: Add support for stm32g000 SoC family

From: Felipe Balbi <[email protected]>

Minimal support with USARTs and SPIs working. This SoC will be used to create and nucleo-g071rb board.

---
 hw/arm/Kconfig                 |   6 +
 hw/arm/meson.build             |   1 +
 hw/arm/stm32g000_soc.c         | 246 +++++++++++++++++++++++++++++++++
 include/hw/arm/stm32g000_soc.h |  62 +++++++++
 4 files changed, 315 insertions(+)
 create mode 100644 hw/arm/stm32g000_soc.c
 create mode 100644 include/hw/arm/stm32g000_soc.h
hw/arm/Kconfig +6 -0
index 893a7bff66b9..28a46d2b1ad3 100644
@@ -463,6 +463,12 @@ config STM32F405_SOC
     select STM32F4XX_SYSCFG
     select STM32F4XX_EXTI
 
+config STM32G000_SOC
+    bool
+    select ARM_V7M
+    select STM32F2XX_USART
+    select STM32F2XX_SPI
+
 config B_L475E_IOT01A
     bool
     default y
hw/arm/meson.build +1 -0
index 6808135c1f79..9c4137a988e1 100644
@@ -34,6 +34,7 @@ arm_ss.add(when: ['CONFIG_RASPI', 'TARGET_AARCH64'], if_true: files('bcm2838.c',
 arm_ss.add(when: 'CONFIG_STM32F100_SOC', if_true: files('stm32f100_soc.c'))
 arm_ss.add(when: 'CONFIG_STM32F205_SOC', if_true: files('stm32f205_soc.c'))
 arm_ss.add(when: 'CONFIG_STM32F405_SOC', if_true: files('stm32f405_soc.c'))
+arm_ss.add(when: 'CONFIG_STM32G000_SOC', if_true: files('stm32g000_soc.c'))
 arm_ss.add(when: 'CONFIG_B_L475E_IOT01A', if_true: files('b-l475e-iot01a.c'))
 arm_ss.add(when: 'CONFIG_STM32L4X5_SOC', if_true: files('stm32l4x5_soc.c'))
 arm_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: files('xlnx-zynqmp.c', 'xlnx-zcu102.c'))
hw/arm/stm32g000_soc.c new file +246 -0

246 lines not on this page · raw message

include/hw/arm/stm32g000_soc.h new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
2.44.0
#2 lore raw

Re: [PATCH 1/2] hw/arm: Add support for stm32g000 SoC family

Quoted 1 line · Felipe Balbi

+ qdev_prop_set_uint8(armv7m, "num-prio-bits", 4);

Hi Felipe.

This should be 2, not 4. From RM0454 section 11.1 on page 250: "4 programmable priority levels (2 bits of interrupt priority are used)".

Sam

Signature · 1 line
Samuel Tardieu
#3 lore raw

PATCH 2/2 hw/arm: Add nucleo-g071rb board

In reply to Felipe Balbi

From: Felipe Balbi <[email protected]>

This board is based around STM32G071RB SoC, a Cortex-M0 based device. More information can be found at:

https://www.st.com/en/product/nucleo-g071rb.html

---
 hw/arm/Kconfig         |  6 ++++
 hw/arm/meson.build     |  1 +
 hw/arm/nucleo-g071rb.c | 70 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 77 insertions(+)
 create mode 100644 hw/arm/nucleo-g071rb.c
hw/arm/Kconfig +6 -0
index 28a46d2b1ad3..5938bb8208a1 100644
@@ -310,6 +310,12 @@ config STM32VLDISCOVERY
     depends on TCG && ARM
     select STM32F100_SOC
 
+config NUCLEO_G071RB
+    bool
+    default y
+    depends on TCG && ARM
+    select STM32G000_SOC
+
 config STRONGARM
     bool
     select PXA2XX
hw/arm/meson.build +1 -0
index 9c4137a988e1..580c2d55fc3f 100644
@@ -18,6 +18,7 @@ arm_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview.c'))
 arm_ss.add(when: 'CONFIG_SBSA_REF', if_true: files('sbsa-ref.c'))
 arm_ss.add(when: 'CONFIG_STELLARIS', if_true: files('stellaris.c'))
 arm_ss.add(when: 'CONFIG_STM32VLDISCOVERY', if_true: files('stm32vldiscovery.c'))
+arm_ss.add(when: 'CONFIG_NUCLEO_G071RB', if_true: files('nucleo-g071rb.c'))
 arm_ss.add(when: 'CONFIG_ZYNQ', if_true: files('xilinx_zynq.c'))
 arm_ss.add(when: 'CONFIG_SABRELITE', if_true: files('sabrelite.c'))
 
hw/arm/nucleo-g071rb.c new file +70 -0

70 lines not on this page · raw message

Signature · 1 line
2.44.0