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 998CFC77B7C for ; Tue, 24 Jun 2025 02:23:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uTtIz-0006c9-Lg; Mon, 23 Jun 2025 22:22:37 -0400 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 ) id 1uTtIw-0006Wr-B4; Mon, 23 Jun 2025 22:22:34 -0400 Received: from mail.aspeedtech.com ([211.20.114.72] helo=TWMBX01.aspeed.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uTtIt-0005OR-NY; Mon, 23 Jun 2025 22:22:34 -0400 Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Tue, 24 Jun 2025 10:22:19 +0800 Received: from mail.aspeedtech.com (192.168.10.10) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Tue, 24 Jun 2025 10:22:19 +0800 To: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Peter Maydell , Steven Lee , Troy Lee , Jamin Lin , Andrew Jeffery , Joel Stanley , "open list:ASPEED BMCs" , "open list:All patches CC here" CC: , Kane-Chen-AS Subject: [RFC v6 0/3] Add QEMU model for ASPEED OTP memory and integrate with SoC Date: Tue, 24 Jun 2025 10:22:15 +0800 Message-ID: <20250624022219.3704712-1-kane_chen@aspeedtech.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Received-SPF: pass client-ip=211.20.114.72; envelope-from=kane_chen@aspeedtech.com; helo=TWMBX01.aspeed.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_FAIL=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Kane Chen From: Kane Chen via Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Kane-Chen-AS This patch series introduces a QEMU model for the ASPEED OTP (One-Time Programmable) memory, along with its integration into the Secure Boot Controller (SBC) and supported SoC (AST2600). The OTP model emulates a simple fuse array used for secure boot or device configuration, implemented with internal buffers; external file/device support not included in this version. It exposes an AddressSpace to support transaction-based access from controllers like the SBC. This series includes: - OTP memory device implementation - SBC integration with command decoding (READ/PROG) - Direct integration in AST2600 SoC without requiring user parameters **[RFC notice]** This is an RFC submission. This version is primarily intended to gather feedback on how the OTP instance is created, connected, and integrated in the SoC structure. A more finalized version with any requested changes, documentation, and test refinements will follow after review. Any feedback or suggestions are appreciated! --- ChangeLog --------- v6: - remove machine parameter 'otpmem' and BlockBackend - remove alias relationship between machine parameter and BlockBackend - simplify to static internal OTP instance with direct connection in SoC - Submitted as [RFC] to gather feedback on QOM integration approach v5: - Switched to notifier-based late binding between SBC and OTP - Exposed 'otpmem' as a machine parameter using QOM alias mechanism - Added fallback support when no backend is provided - Introduced functional test suite covering multiple init configurations - Submitted as [RFC] to gather feedback on QOM integration approach v4: - Replaces blockdev backend with memory-mapped AddressSpace access - Switches from `-drive` CLI option to `otpmem` machine parameter - Restructures the OTP device under the SBC in the QOM tree v3: - Minor fixes and refinements on top of v2 content v2: - Separated the OTP memory into a standalone QEMU device (`aspeed.otpmem`) - Replaced ad-hoc file handling with standard `-drive` backend integration - Linked OTP to SBC via QOM property for cleaner abstraction - Improved memory bounds checking and irreversible programming logic v1: - Embedded OTP logic in the SBC model and created the backing file internally. --- Kane-Chen-AS (3): hw/misc/aspeed_otp: Add ASPEED OTP memory device model hw/misc/aspeed_sbc: Connect ASPEED OTP memory device to SBC hw/arm: Integrate ASPEED OTP memory support into AST2600 SoCs hw/arm/aspeed_ast2600.c | 2 +- hw/misc/aspeed_otpmem.c | 85 +++++++++++++++++++++++++++++ hw/misc/aspeed_sbc.c | 94 +++++++++++++++++++++++++++++++++ hw/misc/meson.build | 1 + hw/misc/trace-events | 7 +++ include/hw/misc/aspeed_otpmem.h | 33 ++++++++++++ include/hw/misc/aspeed_sbc.h | 5 ++ 7 files changed, 226 insertions(+), 1 deletion(-) create mode 100644 hw/misc/aspeed_otpmem.c create mode 100644 include/hw/misc/aspeed_otpmem.h -- 2.43.0