[RFC PATCH v3 0/2] Add file-backed and write-once features to OTP

Green Wan posted 2 patches 3 years, 9 months ago
Test docker-quick@centos7 passed
Test docker-mingw@fedora passed
Test checkpatch passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200818170839.20258-1-green.wan@sifive.com
Maintainers: Sagar Karandikar <sagark@eecs.berkeley.edu>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <Alistair.Francis@wdc.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
There is a newer version of this series
hw/riscv/sifive_u_otp.c         | 71 +++++++++++++++++++++++++++++++++
include/hw/riscv/sifive_u_otp.h |  3 ++
2 files changed, 74 insertions(+)
[RFC PATCH v3 0/2] Add file-backed and write-once features to OTP
Posted by Green Wan 3 years, 9 months ago
First patch is to add file-backed implementation to allow users to use
'-drive' to assign an OTP raw image file. OTP image file must be bigger
than 16K.

For example, '-drive if=none,format=raw,file=otp.img'

Second patch is to add 'write-once' feature to block second write to the
OTP memory. Only keep the 'written' state for non-control register range
from 0x38 to 16KB.

Tested on sifive_u for both qemu and u-boot.

Green Wan (2):
  hw/riscv: sifive_u: Add backend drive support
  hw/riscv: sifive_u: Add write-once protection.

 hw/riscv/sifive_u_otp.c         | 71 +++++++++++++++++++++++++++++++++
 include/hw/riscv/sifive_u_otp.h |  3 ++
 2 files changed, 74 insertions(+)

-- 
2.17.1