Fix code coverage issues by checking return value and handling fail case
of blk_pread() and blk_pwrite(). Return default value 0xff if read fails.
Signed-off-by: Green Wan
---
hw/misc/sifive_u_otp.c | 31 +++
1 file changed, 23 insertions(+), 8 deletions(-)
diff
OK, let me do it. I'll send it soon.
On Tue, Nov 3, 2020 at 11:53 PM Alistair Francis wrote:
>
> On Mon, Nov 2, 2020 at 9:49 AM Peter Maydell wrote:
> >
> > On Fri, 23 Oct 2020 at 16:27, Alistair Francis
> > wrote:
> > >
> > > From: Green Wan
ite to same bit of
the OTP memory.
- Second 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'
Testing
five/fu540/firmware/fw_payload.elf \
-d guest_errors -drive if=none,format=raw,file=otp.img
Signed-off-by: Green Wan
Reviewed-by: Bin Meng
Tested-by: Bin Meng
---
hw/misc/sifive_u_otp.c | 65 ++
include/hw/misc/sifive_u_otp.h | 2 ++
2 files changed, 67
- Add write operation to update fuse data bit when PWE bit is on.
- Add array, fuse_wo, to store the 'written' status for all bits
of OTP to block the write operation.
Signed-off-by: Green Wan
Reviewed-by: Alistair Francis
Reviewed-by: Bin Meng
Tested-by: Bin Meng
--
Sorry for replying late. I missed this email. I will revise the patch
today. Thanks,
- Green
On Thu, Oct 15, 2020 at 4:01 PM Bin Meng wrote:
>
> On Thu, Oct 15, 2020 at 12:15 PM Green Wan wrote:
> >
> > Add '-drive' support to OTP device. Allow users to assign
five/fu540/firmware/fw_payload.elf \
-d guest_errors -drive if=none,format=raw,file=otp.img
Signed-off-by: Green Wan
---
hw/misc/sifive_u_otp.c | 67 +-
include/hw/misc/sifive_u_otp.h | 2 +
2 files changed, 68 insertions(+), 1 deletion(-)
diff --git
ve' 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'
Testing
- Tested on sifive_u for both qemu and u-boot.
Green Wan (2):
hw/misc/sifive_u_otp: Add write function and write-once protection
- Add write operation to update fuse data bit when PWE bit is on.
- Add array, fuse_wo, to store the 'written' status for all bits
of OTP to block the write operation.
Signed-off-by: Green Wan
Reviewed-by: Alistair Francis
---
hw/misc/sifive_u_otp.c
:51 AM Alistair Francis wrote:
>
> On Wed, Oct 14, 2020 at 8:02 AM Bin Meng wrote:
> >
> > Hi Alistair,
> >
> > On Wed, Oct 14, 2020 at 10:46 PM Alistair Francis
> > wrote:
> > >
> > > On Wed, Sep 30, 2020 at 12:10 AM Green Wan wro
On Wed, Oct 14, 2020 at 3:17 PM Bin Meng wrote:
>
> Hi Green,
>
> On Wed, Oct 14, 2020 at 3:02 PM Green Wan wrote:
> >
> > On Wed, Oct 14, 2020 at 1:37 PM Bin Meng wrote:
> > >
> > > Hi Green,
> > >
> > > On Mon, Sep 28, 2020 at 6:12
On Wed, Oct 14, 2020 at 1:37 PM Bin Meng wrote:
>
> Hi Green,
>
> On Mon, Sep 28, 2020 at 6:12 PM Green Wan wrote:
> >
> > - Add write operation to update fuse data bit when PWE bit is on.
> > - Add array, fuse_wo, to store the 'written' status for a
On Wed, Sep 30, 2020 at 1:08 AM Alistair Francis wrote:
>
> On Mon, Sep 28, 2020 at 2:18 AM Green Wan wrote:
> >
> > Hi Alistair,
> >
> > Thanks for the review. See the reply inline below.
> >
> >
> > On Sat, Sep 26, 2020 at 5:52 AM Alistair Fran
sted on sifive_u for both qemu and u-boot.
Green Wan (2):
hw/misc/sifive_u_otp: Add write function and write-once protection
hw/misc/sifive_u_otp: Add backend drive support
hw/misc/sifive_u_otp.c | 81 +-
include/hw/misc/sifive_u_otp.h | 5 +++
2 file
- Add write operation to update fuse data bit when PWE bit is on.
- Add array, fuse_wo, to store the 'written' status for all bits
of OTP to block the write operation.
Signed-off-by: Green Wan
Reviewed-by: Alistair Francis
---
hw/misc/sifive_u_otp.c
0/firmware/fw_payload.elf \
-d guest_errors -drive if=none,format=raw,file=otp.img
Signed-off-by: Green Wan
---
hw/misc/sifive_u_otp.c | 51 ++
include/hw/misc/sifive_u_otp.h | 2 ++
2 files changed, 53 insertions(+)
diff --git a/hw/misc/sifive_u_otp.c
Hi Alistair,
Thanks for the review. See the reply inline below.
On Sat, Sep 26, 2020 at 5:52 AM Alistair Francis wrote:
>
> On Tue, Sep 1, 2020 at 8:49 AM Green Wan wrote:
> >
> > Add '-drive' support to OTP device. Allow users to assign a raw file
> > as OTP
- Add write operation to update fuse data bit when PWE bit is on.
- Add array, fuse_wo, to store the 'written' status for all bits
of OTP to block the write operation.
Signed-off-by: Green Wan
---
hw/riscv/sifive_u_otp.c | 30 +-
includ
Add '-drive' support to OTP device. Allow users to assign a raw file
as OTP image.
Signed-off-by: Green Wan
---
hw/riscv/sifive_u_otp.c | 50 +
include/hw/riscv/sifive_u_otp.h | 2 ++
2 files changed, 52 insertions(+)
diff --git
e bigger
than 16K.
For example, '-drive if=none,format=raw,file=otp.img'
Testing
- Tested on sifive_u for both qemu and u-boot.
Green Wan (2):
hw/riscv: sifive_u: Add write operation and write-once protection
hw/riscv: sifive_u: Add backend drive support
hw/ris
Hi Bin,
Thanks for the remindings. I didn't notice the write operation and
will add the write functionality based on bit by bit mechanism.
Regards,
Green
On Fri, Aug 28, 2020 at 8:54 PM Bin Meng wrote:
>
> Hi Green,
>
> On Thu, Aug 27, 2020 at 3:47 PM Green Wan wrote:
&g
ting
- 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
Add '-drive' support to OTP device. Allow users to assign a raw file
as OTP image.
Signed-off-by: Green Wan
---
hw/riscv/sifive_u_otp.c | 50 +
include/hw/riscv/sifive_u_otp.h | 2 ++
2 files changed, 52 insertions(+)
diff --git
Add array to store the 'written' status for all bit of OTP to block
the write operation to the same bit. Ignore the control register
offset from 0x0 to 0x38 of OTP memory mapping.
Signed-off-by: Green Wan
---
hw/riscv/sifive_u_otp.c | 21 +
includ
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
Hi Alistair,
You're right. I can get drive without -device. Now it looks much better.
Sent v3 patch.
Thanks a lot,
- Green
On Fri, Aug 14, 2020 at 5:34 AM Alistair Francis
wrote:
> On Wed, Aug 12, 2020 at 9:12 PM Green Wan wrote:
> >
> > Hi Alistair,
> >
> >
Add array to store the 'written' status for all bit of OTP to block
the write operation to the same bit. Ignore the control register
offset from 0x0 to 0x38 of OTP memory mapping.
Signed-off-by: Green Wan
---
hw/riscv/sifive_u_otp.c | 21 +
includ
Add '-drive' support to OTP device. Allow users to assign a raw file
as OTP image.
Signed-off-by: Green Wan
---
hw/riscv/sifive_u_otp.c | 50 +
include/hw/riscv/sifive_u_otp.h | 2 ++
2 files changed, 52 insertions(+)
diff --git
s for specifying the
device?
Thanks,
- Green
On Tue, Aug 11, 2020 at 6:24 AM Alistair Francis
wrote:
> ,()On Thu, Jul 30, 2020 at 7:49 PM Green Wan wrote:
> >
> > Add a file-backed implementation for OTP of sifive_u machine. The
> > machine property for file-backed is disa
Add a file-backed implementation for OTP of sifive_u machine. The
machine property for file-backed is disabled in default. Do file
open, mmap and close for every OTP read/write in case keep the
update-to-date snapshot of OTP.
Signed-off-by: Green Wan
---
hw/riscv/sifive_u.c | 26
Add array to store the 'written' status for all bit of OTP to block
the write operation to the same bit. Ignore the control register
offset from 0x0 to 0x38 of OTP memory mapping.
Signed-off-by: Green Wan
---
hw/riscv/sifive_u_otp.c | 20
includ
' 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 file-backed OTP.
hw/riscv: sifive_u: Add write-once
def struct SiFiveUOTPState {
uint32_t fuse[SIFIVE_U_OTP_NUM_FUSES];
/* config */
uint32_t serial;
+char *otp_file;
uint32_t fuse_wo[SIFIVE_U_OTP_NUM_FUSES];
} SiFiveUOTPState;
Regards,
Green
On Fri, Jul 24, 2020 at 10:20 PM Bin Meng wrote:
> Hi Green,
>
> On Fri, Jul 2
Add a file-backed implementation for OTP of sifive_u machine. Use
'-boot otp-file=xxx' to enable it. Do file open, mmap and close
for every OTP read/write in case keep the update-to-date snapshot
of OTP.
Signed-off-by: Green Wan
---
hw/riscv/sifive_u_otp.c
Add array to store the 'written' status for all bit of OTP to block
the write operation to the same bit. Ignore the control register
offset from 0x0 to 0x38 of OTP memory mapping.
Signed-off-by: Green Wan
---
hw/riscv/sifive_u_otp.c | 34 ++---
olves 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
36 matches
Mail list logo