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 lists.gnu.org (lists.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 4FD1FCCFA18 for ; Thu, 6 Nov 2025 19:15:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vH5Rl-0003Qx-KQ; Thu, 06 Nov 2025 14:15:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3q_MMaQYKCBYKGx49L2AA270.yA8C08G-wD89A929G.AD2@flex--yubinz.bounces.google.com>) id 1vH5Rh-0003QZ-SL for qemu-arm@nongnu.org; Thu, 06 Nov 2025 14:14:58 -0500 Received: from mail-pl1-x64a.google.com ([2607:f8b0:4864:20::64a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3q_MMaQYKCBYKGx49L2AA270.yA8C08G-wD89A929G.AD2@flex--yubinz.bounces.google.com>) id 1vH5Rg-0006IF-78 for qemu-arm@nongnu.org; Thu, 06 Nov 2025 14:14:57 -0500 Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-2930e2e8e7fso16954175ad.2 for ; Thu, 06 Nov 2025 11:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1762456492; x=1763061292; darn=nongnu.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=1uQ4pclRddECNaveNKLWgHY6D0yMd5vtB78zuNiHPMM=; b=xY70Z3HyL0qiwXGGgOLGSdfVrPZD7tQJ16IySHo1AtFXKFELKNOwlJvCJ5GCNeOry4 /55O+nYBzJ5bIEItv66XK9D20jvple/Xjjvc8/dA3pZwMRXOFPWEgvFjSuK/Bt3UqN8+ utjgiNB20D+IK/7VnRyu8y8eNfSw0Lt/mvNR/cRiOHO4P2FmPRt/zApK2m0dgAA2bgBk baTyXa1ZLf16xsc2PpngBZ1v9+2zb3Vu4n0pBpZN2CvE+JzBF8ylhbPBtlJvl87liu2z TmaW2F7/D2i5UNpX9w3+E3g8Z4Jh1jvV4d2UhVKMeMesm7ct2cyPYqxjTnK6IZEByqdq rQqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762456492; x=1763061292; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1uQ4pclRddECNaveNKLWgHY6D0yMd5vtB78zuNiHPMM=; b=ugq/25cVXzYmSnKPuWJ72fX0pp+FnvBALWzfeaFaorpBKUWlFZQ6fkb8ru2P5c7zFN IbuNRgMqBEQIrAvCeBjtQpj55AzNqUMEr3u2GuCZh6f07rhBNwJCUriykTECuJZ8M863 AKUa81tYHsmSUdoqa8XoS40QbfHKfnuUOC7GB+mkHPu8OAbpQJVmImTAtltSbRcpXr+n A3AlvcCQxBsl8xPZCTaspWmtRz469RSRhIjTjEXiw4pZ8Q4d/epAnqHmAtJrExsjqeRv xdRHU6ZJvnH+vFd+GNkzGqcuS5fifFXVVPT7/fsp54w/yg4plD9B4I/6IWS8lh/yVHQ4 TU8w== X-Forwarded-Encrypted: i=1; AJvYcCUE3KgsX2AmRgKu+2RAOF45yg2pE0JPjH6lmpLukgU0MTe043nohUHfJvMiVHFQp0YJTuUZ33yUog==@nongnu.org X-Gm-Message-State: AOJu0Yws0+p8foj1Sbfn5NOEOmS/7BKer/CUtfBkwPdo5h8jyFBR4quO tqJz9/JwrXTJVO0Lz/yoyeTmyNEHrFEcPueoqNXeQKYgRRSdeGlLvgUbDwQWTrewJA/5gV7vgXb ghzj1xA== X-Google-Smtp-Source: AGHT+IExSxDpE0vnYuPjNjsF8fOjkg/LapP5wI99KnFgcahj3rrIKJpP3ZB3xN4D0NQxozoi812Ctawa+Wk= X-Received: from dlbcf38.prod.google.com ([2002:a05:7022:45a6:b0:119:9f33:34ac]) (user=yubinz job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:19cd:b0:296:217:33ff with SMTP id d9443c01a7336-297c04576famr6309345ad.48.1762456491648; Thu, 06 Nov 2025 11:14:51 -0800 (PST) Date: Thu, 06 Nov 2025 19:14:23 +0000 Mime-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAI/zDGkC/x3MQQqAIBBG4avErBNUSqirRAvJv5qNigMRiHdPW n6L9yoJCkNoHSoVPCycYocZBzpuHy8oDt1ktZ2N0bPykoGg5MqclAnTEuAOeOeoJ7ng5PffbXt rH28r/xpeAAAA X-Change-Id: 20251105-aspeed-sgpio-1d49de6cea66 X-Mailer: b4 0.14.2 Message-ID: <20251106-aspeed-sgpio-v1-0-b026093716fa@google.com> Subject: [PATCH 0/2] hw/gpio: Add Aspeed Serial GPIO (SGPIO) controller model From: Yubin Zou To: qemu-devel@nongnu.org Cc: "=?utf-8?q?C=C3=A9dric_Le_Goater?=" , Peter Maydell , Steven Lee , Troy Lee , Jamin Lin , Andrew Jeffery , Joel Stanley , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , qemu-arm@nongnu.org, Yubin Zou Content-Type: text/plain; charset="utf-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::64a; envelope-from=3q_MMaQYKCBYKGx49L2AA270.yA8C08G-wD89A929G.AD2@flex--yubinz.bounces.google.com; helo=mail-pl1-x64a.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org This series introduces a model for the Aspeed Serial GPIO (SGPIO) controller, commonly found on Aspeed SoCs such as the AST2700. The SGPIO peripheral provides a large number of GPIO pins that can be controlled and monitored serially. Improvement to QEMU: These patches enhance QEMU's hardware emulation capabilities for platforms using Aspeed SoCs, particularly for BMC simulations. By modeling the SGPIO controller, QEMU can more accurately represent the hardware, allowing for better development and testing of firmware and software that relies on these GPIOs for various functions like sensor monitoring, presence detect, and system control signals. Impact (Before/After): Before: QEMU lacked a model for the Aspeed SGPIO controller. Any guest software attempting to interact with the SGPIO register space would find no device. Firmware features depending on SGPIO pin states or interrupts could not be tested in QEMU. After: QEMU emulates the Aspeed SGPIO controller on supported machines (e.g., ast2700-evb). - Guest firmware can configure SGPIO pins, set output values, and read input values through the memory-mapped registers. - External entities (like test scripts or other QEMU components) can interact with the pins via QOM properties (e.g., to simulate external signal changes). Path example: /machine/soc/sgpio[0]/sgpio0 - The model generates interrupts based on input pin transitions, according to the configured mode (level/edge), enabling testing of interrupt handlers. Signed-off-by: Yubin Zou --- Yubin Zou (2): hw/gpio: Add the skeleton of Aspeed Serial gpio hw/gpio Add the Interrupt logic to Aspeed Serial gpio hw/arm/aspeed_ast10x0.c | 6 +- hw/arm/aspeed_ast27x0.c | 26 +++ hw/gpio/aspeed_sgpio.c | 349 +++++++++++++++++++++++++++++++++++++++ hw/gpio/meson.build | 1 + include/hw/arm/aspeed_soc.h | 8 +- include/hw/gpio/aspeed_sgpio.h | 68 ++++++++ tests/qtest/ast2700-sgpio-test.c | 152 +++++++++++++++++ tests/qtest/meson.build | 1 + 8 files changed, 606 insertions(+), 5 deletions(-) --- base-commit: 917ac07f9aef579b9538a81d45f45850aba42906 change-id: 20251105-aspeed-sgpio-1d49de6cea66 Best regards, -- Yubin Zou