[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v4 0/2] Add file-backed and write-once features to OTP
From: |
Green Wan |
Subject: |
[RFC PATCH v4 0/2] Add file-backed and write-once features to OTP |
Date: |
Thu, 27 Aug 2020 15:46:36 +0800 |
Based RFC v3 to fix:
- Fix all nits-related
- Use blk for blk_by_legacy_dinfo(dinfo)
- Move SET_WRITTEN_BIT out from else branch
Summary of Patches
- 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.
Testing
- 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
- [RFC PATCH v4 0/2] Add file-backed and write-once features to OTP,
Green Wan <=