qemu-cr16/include/hw/nvram/aspeed_otp.h
Kane-Chen-AS 688a3dae78 hw/nvram/aspeed_otp: Add ASPEED OTP memory device model
Introduce a QEMU device model for ASPEED's One-Time Programmable (OTP)
memory.

This model simulates a word-addressable OTP region used for secure
fuse storage. The OTP memory can operate with an internal memory
buffer.

The OTP model provides a memory-like interface through a dedicated
AddressSpace, allowing other device models (e.g., SBC) to issue
transactions as if accessing a memory-mapped region.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250812094011.2617526-2-kane_chen@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2025-09-29 18:00:20 +02:00

33 lines
581 B
C

/*
* ASPEED OTP (One-Time Programmable) memory
*
* Copyright (C) 2025 Aspeed
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef ASPEED_OTP_H
#define ASPEED_OTP_H
#include "system/memory.h"
#include "hw/block/block.h"
#include "system/address-spaces.h"
#define TYPE_ASPEED_OTP "aspeed-otp"
OBJECT_DECLARE_SIMPLE_TYPE(AspeedOTPState, ASPEED_OTP)
typedef struct AspeedOTPState {
DeviceState parent_obj;
BlockBackend *blk;
uint64_t size;
AddressSpace as;
MemoryRegion mmio;
uint8_t *storage;
} AspeedOTPState;
#endif /* ASPEED_OTP_H */