From: Kane-Chen-AS <kane_c...@aspeedtech.com> 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 --------- 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 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 | 211 ++++++++++++++++++++++++++++++++ hw/misc/aspeed_sbc.c | 146 ++++++++++++++++++++++ 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, 453 insertions(+) create mode 100644 hw/misc/aspeed_otpmem.c create mode 100644 include/hw/misc/aspeed_otpmem.h -- 2.43.0