Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB803C5B56A for ; Wed, 12 Aug 2026 13:54:42 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wu9PR-0004hW-Lr; Wed, 12 Aug 2026 09:54:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <163wangjack@gmail.com>) id 1wu9PQ-0004hJ-Kg for qemu-rust@nongnu.org; Wed, 12 Aug 2026 09:54:20 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <163wangjack@gmail.com>) id 1wu9PO-0000P4-FO for qemu-rust@nongnu.org; Wed, 12 Aug 2026 09:54:20 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-2cc97653887so14925635ad.1 for ; Wed, 12 Aug 2026 06:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786542857; x=1787147657; darn=nongnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:content-type :message-id:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=N90NN4n9+LzV7tiYeeKSL3/VSpyLD/AD9T0cJNXZa5o=; b=PijYLHbsz2Lg4ljFePeDxGAI9tdmux+H120ih7tQSmw6kNwSdBF0/JU8QVJ1UqSI8a ZysMraQFI0Eg+SheL3y/c9X8Scgl2xXS6nli20rZ8rUi96VVObJ/aS8spdPeBczXlRjt NpPGKBomtmVqmQuQspMv5K6ZnNu0KdhoEBVc8vbotq1CotmR2CTQ0ZOivcOki/DlW7eC jeDZxOzwMXOZEHaloAje+ECNPK2dGmygL4SD8d2F55EtVm7VS68rJ7P2mKYzLQFLepRI NJU2f/zfuuwZ/VubPwRTLosJ+fIZoJ80MZZ0D1eo3ZK4N4MTBaXrG0Z3SHXBwGrwoXuL UTRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786542857; x=1787147657; h=references:to:cc:in-reply-to:date:subject:mime-version:content-type :message-id:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=N90NN4n9+LzV7tiYeeKSL3/VSpyLD/AD9T0cJNXZa5o=; b=hKJ00h7ZHevO4mOXytPG9ODJfmuFERK0R6+bp40dB+2h2AraI9fi0Tt1o6iuaXgOAA 9Hin7XtYM8VAVefxaX2hzV7ChMaimLsrQTeg4cOOc150lfIf/rl2jOql7izKfpT1Xr3e z2N/ZS5k33emU+LnUG6Fm+JupFc48xO6pwr/kqWTxgwlDKKZKZ0uJgO2WjLtONrQatXu bS5tvtkqL6fkO5WLkcfDKxOidb/MH4R+44Ncnk7kkIZgU2saYo51vt9Jgdb7YFHHHs7M yMIlDzqwlEXNauIWaVKktI3uJWvCYMCw//w/2CpLYdzC4yVCv+qfR1B7srXeWaJK4k67 jhWg== X-Forwarded-Encrypted: i=1; AHgh+RoIYGEWDMDRG6qDcRfM2HfvGfla5w1S89Ypd9X4UcgcSwENq7+Kzb3n+hD0VMnXFX2rHbhFEbBW3dw=@nongnu.org X-Gm-Message-State: AOJu0YzfkErOb0K6/t8p0EqwQLTq7cpqwLe0G6n3veXeT3Ukfh5g6ERD 0Q9G8vUBH10Z1t62qyTeXKvHtFGLN/YTCpjvXDryOpEPoCWfCVxnDls5 X-Gm-Gg: AR+sD12sG8CbTrfLsDtQOHZeYxDVoT9BXlnHdI0cBa+puPQdYozq0rO6BS8sW/QP8Ax HVEGmOA+Swu6EcksydLWfm70owZqHGKS9apijGLLuQCJ7i/EBvFjE5UEEDTCRWrz6P7MSnMxPo1 c4cvpR5npq8zhTuPSYCGbhyYoOwYuGHnWy12F4dpedUfSJq6SGSuIE0UBL/zhX91VRjJBs/sgLw 9qlNmTCW2a5hSK6OMRSP3Pyncrc3j44HsKZ5TUiiBfZXF4DFQKSUK0c8dN5P0nOU9tF/e8WQfRO n9DNU1GUb+ZdYySo2L8wJAJPC/lE9LFriFw1ubmL1Im9Q5e0YAapuf7kOHu2xYexr6PRTxVbHr/ 59R6EuaIi19BSdP3HpGbMgf2eNKPgCYEsHw087xuztLurt1ER6xSRg0dZl4pElQmV5JQd3ccBAi 04WD7QR/uJh4PPspgqU8mAVSFBs8UPQEQFYUPl1ZBXg3UMjPhopj1YLO9nA9MC/lUb9xzvtw== X-Received: by 2002:a17:903:22c4:b0:2ce:7563:70a5 with SMTP id d9443c01a7336-2d3453a1791mr57888355ad.6.1786542856795; Wed, 12 Aug 2026 06:54:16 -0700 (PDT) Received: from smtpclient.apple ([212.135.212.213]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d351152467sm7283655ad.33.2026.08.12.06.54.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Aug 2026 06:54:16 -0700 (PDT) From: Jack wang <163wangjack@gmail.com> Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_E51B9375-9BFF-449C-8072-1866BF2C15C3" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: [RFC PATCH v1 0/5] hw/gpio: STM32F1xx GPIO controller in Rust Date: Wed, 12 Aug 2026 21:53:55 +0800 In-Reply-To: <20260726145119.19881-1-163wangjack@gmail.com> Cc: Paolo Bonzini , Peter Maydell , Alistair Francis , Fabiano Rosas , Laurent Vivier , qemu-arm@nongnu.org, qemu-rust@nongnu.org, caojunze424@gmail.com To: qemu-devel@nongnu.org References: <20260726145119.19881-1-163wangjack@gmail.com> X-Mailer: Apple Mail (2.3864.600.51.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=163wangjack@gmail.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FROM_STARTS_WITH_NUMS=0.738, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-rust@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: QEMU Rust-related patches and discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-rust-bounces+qemu-rust=archiver.kernel.org@nongnu.org Sender: qemu-rust-bounces+qemu-rust=archiver.kernel.org@nongnu.org --Apple-Mail=_E51B9375-9BFF-449C-8072-1866BF2C15C3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi all, sorry for pre wrong link with patch 5,now I add right link(rfc) = below, really sorry for my mistake A polite ping for this RFC series.Thanks advice for Philippe advice and = I am ready for v2. Could anyone have other suggestions for my patch. I am appreciative for = your advice and ready to fix it in v2 > 2026=E5=B9=B47=E6=9C=8826=E6=97=A5 22:51=EF=BC=8CJack Wang = <163wangjack@gmail.com> =E5=86=99=E9=81=93=EF=BC=9A >=20 > Hi all, >=20 > This RFC adds an STM32F1xx GPIO controller modelled in Rust, following = the > existing rust/hw/char/pl011 device as a template. The register logic = (CRL/CRH > mode+config decode and the IDR update algorithm) is a direct port of = the C > model in hw/gpio/stm32l4x5_gpio.c; the STM32F1xx GPIO block (RM0008) = is the > same IP used by the upstream stm32f100_soc. >=20 > This series is currently stacked on an out-of-tree STM32F103 SoC and = board > that are not yet upstream which is = https://github.com/shandianchengzi/qemu > But the commit(the initialize logic and gpio architecture) is both = capable=20 > for stm32f100.This is the reason that struct name is stm32f1xx. Patch = 3=20 > ("hw/arm/stm32f103: instantiate and mapGPIO ports") therefore touches = files=20 > that do not exist in mainline and willnot apply cleanly on its own.=20 > I am sending this as an RFC to get feedback onthe Rust device model = and=20 > its integration now, before the SoC lands, rather than as an = apply-ready series > . Once the SoC is upstream (or if you I > can retarget the device at the existing stm32f100_soc), I will resend = a > non-RFC series. >=20 > checkpatch reports SPDX warnings on Kconfig/trace-events/Cargo.toml/ > meson.build and "MAINTAINERS need updating" on the new files. These = are > false positives: matching rust/hw/char/pl011, these file types carry = no SPDX > header in-tree, and MAINTAINERS already gains an entry covering = rust/hw/gpio/ > and the qtest in this series. >=20 > Anyway this is my first time to generate rust model build so sorry for = some > mistakes. And any help or tip are welcomed >=20 > Jack Wang (5): > hw/gpio: add stm32f1xx GPIO device model (Rust) > rust: add hw/gpio crate to the workspace > hw/arm/stm32f103: instantiate and map GPIO ports > tests/qtest: add stm32f103 GPIO test > rust/hw/gpio: add native unit tests >=20 > MAINTAINERS | 7 + > hw/arm/Kconfig | 1 + > hw/arm/stm32f103_board.c | 2 +- > hw/arm/stm32f103_soc.c | 54 ++- > hw/gpio/Kconfig | 5 + > hw/gpio/trace-events | 7 + > include/hw/arm/stm32f103_soc.h | 9 + > rust/Cargo.lock | 17 +- > rust/Cargo.toml | 18 + > rust/hw/Kconfig | 1 + > rust/hw/gpio/Cargo.toml | 28 ++ > rust/hw/gpio/Kconfig | 2 + > rust/hw/gpio/meson.build | 54 +++ > rust/hw/gpio/src/bindings.rs | 19 ++ > rust/hw/gpio/src/gpio.rs | 539 ++++++++++++++++++++++++++++++ > rust/hw/gpio/src/lib.rs | 3 + > rust/hw/gpio/tests/tests.rs | 191 +++++++++++ > rust/hw/meson.build | 1 + > tests/qtest/meson.build | 4 + > tests/qtest/stm32f103_gpio-test.c | 328 ++++++++++++++++++ > 20 files changed, 1281 insertions(+), 9 deletions(-) > create mode 100644 rust/hw/gpio/Cargo.toml > create mode 100644 rust/hw/gpio/Kconfig > create mode 100644 rust/hw/gpio/meson.build > create mode 100644 rust/hw/gpio/src/bindings.rs > create mode 100644 rust/hw/gpio/src/gpio.rs > create mode 100644 rust/hw/gpio/src/lib.rs > create mode 100644 rust/hw/gpio/tests/tests.rs > create mode 100644 tests/qtest/stm32f103_gpio-test.c >=20 > --=20 > 2.53.0 >=20 --Apple-Mail=_E51B9375-9BFF-449C-8072-1866BF2C15C3 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

Hi all, sorry for pre wrong link with patch 5,now I = add right link(rfc) below, really sorry  for my mistake

A polite ping for this RFC series.Thanks advice for = Philippe advice and I am ready for v2.

Could anyone = have other suggestions for my patch. I am appreciative for your advice = and ready to fix it in v2



2026=E5=B9=B47=E6=9C=8826=E6=97=A5 22:51=EF=BC=8CJack = Wang <163wangjack@gmail.com> =E5=86=99=E9=81=93=EF=BC=9A

Hi all,

This RFC = adds an STM32F1xx GPIO controller modelled in Rust, following = the
existing rust/hw/char/pl011 device as a template. The register = logic (CRL/CRH
mode+config decode and the IDR update algorithm) is a = direct port of the C
model in hw/gpio/stm32l4x5_gpio.c; the STM32F1xx = GPIO block (RM0008) is the
same IP used by the upstream = stm32f100_soc.

This series is currently stacked on an out-of-tree = STM32F103 SoC and board
that are not yet upstream which is = https://github.com/shandianchengzi/qemu
But the commit(the initialize = logic and gpio architecture) is both capable
for stm32f100.This is = the reason that struct name is  stm32f1xx. Patch 3 =
("hw/arm/stm32f103: instantiate and mapGPIO ports") therefore = touches files
that do not exist in mainline and willnot apply = cleanly on its own.
I am sending this as an RFC to get feedback = onthe Rust device model and
its integration now, before the SoC = lands, rather than as an apply-ready series
. Once the SoC is = upstream (or if you I
can retarget the device at the existing = stm32f100_soc), I will resend a
non-RFC series.

checkpatch = reports SPDX warnings on Kconfig/trace-events/Cargo.toml/
meson.build = and "MAINTAINERS need updating" on the new files. These are
false = positives: matching rust/hw/char/pl011, these file types carry no = SPDX
header in-tree, and MAINTAINERS already gains an entry covering = rust/hw/gpio/
and the qtest in this series.

Anyway this is my = first time to generate rust model build so sorry for some
mistakes. = And any help or tip are welcomed

Jack Wang (5):
=  hw/gpio: add stm32f1xx GPIO device model (Rust)
 rust: = add hw/gpio crate to the workspace
 hw/arm/stm32f103: = instantiate and map GPIO ports
 tests/qtest: add stm32f103 GPIO = test
 rust/hw/gpio: add native unit tests

MAINTAINERS =             &n= bsp;         | =   7 +
hw/arm/Kconfig =             &n= bsp;      |   1 +
= hw/arm/stm32f103_board.c =          |   2 = +-
hw/arm/stm32f103_soc.c =            | =  54 ++-
hw/gpio/Kconfig =             &n= bsp;     |   5 +
= hw/gpio/trace-events =             &n= bsp;|   7 +
include/hw/arm/stm32f103_soc.h =    |   9 +
rust/Cargo.lock =             &n= bsp;     |  17 +-
rust/Cargo.toml =             &n= bsp;     |  18 +
rust/hw/Kconfig =             &n= bsp;     |   1 +
= rust/hw/gpio/Cargo.toml =           |  28 = ++
rust/hw/gpio/Kconfig =             &n= bsp;|   2 +
rust/hw/gpio/meson.build =          |  54 +++
= rust/hw/gpio/src/bindings.rs      |  19 = ++
rust/hw/gpio/src/gpio.rs =          | 539 = ++++++++++++++++++++++++++++++
rust/hw/gpio/src/lib.rs =           | =   3 +
rust/hw/gpio/tests/tests.rs =       | 191 +++++++++++
= rust/hw/meson.build =             &n= bsp; |   1 +
tests/qtest/meson.build =           | =   4 +
tests/qtest/stm32f103_gpio-test.c | 328 = ++++++++++++++++++
20 files changed, 1281 insertions(+), 9 = deletions(-)
create mode 100644 rust/hw/gpio/Cargo.toml
create = mode 100644 rust/hw/gpio/Kconfig
create mode 100644 = rust/hw/gpio/meson.build
create mode 100644 = rust/hw/gpio/src/bindings.rs
create mode 100644 = rust/hw/gpio/src/gpio.rs
create mode 100644 = rust/hw/gpio/src/lib.rs
create mode 100644 = rust/hw/gpio/tests/tests.rs
create mode 100644 = tests/qtest/stm32f103_gpio-test.c

-- =
2.53.0


= --Apple-Mail=_E51B9375-9BFF-449C-8072-1866BF2C15C3--