Received: by 2002:a17:504:749a:b0:1be9:327d:8ee3 with SMTP id a26csp510576njk; Wed, 16 Apr 2025 20:10:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW0JnYC7mlq3BVV3Hu+vcDN3qjMCoVlGMb7biChTO09cxLYsyOJGYVnf5cp1kRWZoGuDIsFf7JhiBfG1g==@linaro.org X-Google-Smtp-Source: AGHT+IHy9iQ4kREbZ1TiB0H8mpk6dNB20XA5YsNhY8rJMbBNasCulzKToYBZa8XPOisQkzHzWSq2 X-Received: by 2002:a05:620a:a005:b0:7c7:a536:66d1 with SMTP id af79cd13be357-7c91e39e758mr160560785a.6.1744859428203; Wed, 16 Apr 2025 20:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1744859428; cv=none; d=google.com; s=arc-20240605; b=VSiMqZSGDW7Ttunsfr917O8wEx/pWqRYO8cX26lfHWjJ5J6Tv50m6zDtERJmHCLHfl VKfRqqRrfm2hdY5AQhAvdu0omBKpWykFkE3p6lAyKpXdOMKY8w3ILLNDmvXHjsfjNVZv jBlWMpVlA6fM7VQkzG3PT6iwlLh4JJKOmQ/yjTFrujAWC91qx23b7GivWdP1/9nbT7nM Q23Yjs2l0kKDbtqXuUWOCMaFUq6A86PIN5Mp+B8DAdXztSjCTLPYZSz9+xwCjCAlt0Cv 5kn/wYyKw1dNIaZPfyqWLxAyYp+lCQTHo+H+UkIayetidHMVwnNbXdulCP084Suta2nT 3pbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:from:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to; bh=ZbNL6BpULXzurChSy98sS9b9p6nX5357nyUeV079soQ=; fh=3E+GgkJ59sv88GyUpaKWpV4DoJlJz+B5Ev7H4uQXan0=; b=VQN0N5FtRp6LiZV29W6S7xlIJpZn37oMTXkWkjNS4EzaFIegKlsmRd0qul30rzR8Aw YiD8LruYZcSVKMKvdxPcfQI4JVv6Z21gR/l5dFhcLPGXpiu1u0nMrB506RfbKyoOhas7 C1mkP5c/v4z3xnUZ78I9BVlEyLFc/9L0/GDcifpyWncmE1zIq/clZkdr67NlbsOKLrwd rnzpQp15Nnjrt6QFWX/lWE58ZriPq/fWIWQ4506lM9mwlDVxo4gqrOwpQZl970VDgKjA iEAnEElQLjxEtq4YHkSYb3IIxQDFkomf84cyR4Rw26UyEgEw0Hz8g2liwvmuMrlf7Fdm VW1Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c7a89f67c9si1445570085a.227.2025.04.16.20.10.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Apr 2025 20:10:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nongnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u5Fdn-0005xt-6p; Wed, 16 Apr 2025 23:10:15 -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 1u5Fdh-0005tZ-PW; Wed, 16 Apr 2025 23:10:11 -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 1u5Fdf-0000B0-FK; Wed, 16 Apr 2025 23:10:09 -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.1258.12; Thu, 17 Apr 2025 11:09:57 +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.1258.12 via Frontend Transport; Thu, 17 Apr 2025 11:09:57 +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: [PATCH v2 0/3] hw/misc/aspeed_otp: Introduce OTP memory and integrate with SBC Date: Thu, 17 Apr 2025 11:09:52 +0800 Message-ID: <20250417030957.2586802-1-kane_chen@aspeedtech.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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-arm@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-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: UHaPvV8AZo8o From: Kane-Chen-AS Dear reviewers, This patch series introduces a new model for the ASPEED OTP (One-Time Programmable) memory and integrates it with the ASPEED Secure Boot Controller (SBC) and SoC models such as AST1030 and AST2600. The OTP memory is implemented as a QEMU device (`aspeed.otpmem`) and is designed to simulate fuse-like behavior using a block backend. Programming is restricted by irreversible bit-flip rules (e.g., 0->1 or 1->0 depending on address parity). The memory content is persistent and can be passed via `-drive id=otpmem`. The SBC device (`aspeed.sbc`) accesses the OTP device through a QOM link property. This decouples OTP handling from the SBC logic and allows future extensibility such as secure configuration or key provisioning. The SoC integration connects the OTP memory to the SBC and provides device-tree-style infrastructure for future firmware use. Any feedback or suggestions are appreciated! Thanks, Kane --- ChangeLog --------- 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 controller hw/arm: Integrate Aspeed OTP memory into AST10x0 and AST2600 SoCs hw/arm/aspeed_ast10x0.c | 19 +++ hw/arm/aspeed_ast2600.c | 19 +++ hw/misc/aspeed_otpmem.c | 217 ++++++++++++++++++++++++++++++++ hw/misc/aspeed_sbc.c | 155 +++++++++++++++++++++++ hw/misc/meson.build | 1 + include/hw/arm/aspeed_soc.h | 2 + include/hw/misc/aspeed_otpmem.h | 40 ++++++ include/hw/misc/aspeed_sbc.h | 15 +++ 8 files changed, 468 insertions(+) create mode 100644 hw/misc/aspeed_otpmem.c create mode 100644 include/hw/misc/aspeed_otpmem.h -- 2.43.0