All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Add write-once and file-backed features to OTP
@ 2020-07-24  9:51 ` Green Wan
  0 siblings, 0 replies; 12+ messages in thread
From: Green Wan @ 2020-07-24  9:51 UTC (permalink / raw)
  Cc: qemu-riscv, Sagar Karandikar, Bastian Koppelmann, qemu-devel,
	Green Wan, Alistair Francis, Paolo Bonzini, Palmer Dabbelt,
	bmeng.cn

Add file-backed implementation to allow users to assign an OTP image
file to machine. If '-boot otp-file=filename' is specified, OTP 
device uses otp image file instead of fuse array. In order to keep data
up-to-date due to unexpected crash or CTRL+a-x, every read/write to OTP
memory involves file open, mmap and close operation to the image file.

Add write-once feature to block second write operation 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 file-backed OTP. softmmu/vl: add otp-file to
    boot option
  hw/riscv: sifive_u: Add write-once protection.

 hw/riscv/sifive_u_otp.c         | 122 ++++++++++++++++++++++++++++++--
 include/hw/riscv/sifive_u_otp.h |   3 +
 qemu-options.hx                 |   3 +-
 softmmu/vl.c                    |   6 +-
 4 files changed, 128 insertions(+), 6 deletions(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-07-28  8:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24  9:51 [RFC PATCH 0/2] Add write-once and file-backed features to OTP Green Wan
2020-07-24  9:51 ` Green Wan
2020-07-24  9:51 ` [RFC PATCH 1/2] hw/riscv: sifive_u: Add file-backed OTP. softmmu/vl: add otp-file to boot option Green Wan
2020-07-24  9:51   ` Green Wan
2020-07-24 14:20   ` Bin Meng
2020-07-24 14:20     ` Bin Meng
2020-07-28  2:02     ` Green Wan
2020-07-28  2:02       ` Green Wan
2020-07-28  8:28       ` Paolo Bonzini
2020-07-28  8:28         ` Paolo Bonzini
2020-07-24  9:51 ` [RFC PATCH 2/2] hw/riscv: sifive_u: Add write-once protection Green Wan
2020-07-24  9:51   ` Green Wan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.