qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: Green Wan <green.wan@sifive.com>
Cc: Alistair Francis <alistair23@gmail.com>,
	"open list:RISC-V" <qemu-riscv@nongnu.org>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [RFC PATCH v6 1/2] hw/misc/sifive_u_otp: Add write function and write-once protection
Date: Wed, 14 Oct 2020 15:17:01 +0800	[thread overview]
Message-ID: <CAEUhbmVUSJd1E9r4O+ziVbbH3RgSqaLe7q0CtgCqbhD+mjCurQ@mail.gmail.com> (raw)
In-Reply-To: <CAJivOr7mr_poapw5Okga1uLo7Zq+gs3oiJxuMPpbnAsQMNgzfg@mail.gmail.com>

Hi Green,

On Wed, Oct 14, 2020 at 3:02 PM Green Wan <green.wan@sifive.com> wrote:
>
> On Wed, Oct 14, 2020 at 1:37 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > Hi Green,
> >
> > On Mon, Sep 28, 2020 at 6:12 PM Green Wan <green.wan@sifive.com> wrote:
> > >
> > >  - 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 <green.wan@sifive.com>
> > > Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
> > > ---
> > >  hw/misc/sifive_u_otp.c         | 30 +++++++++++++++++++++++++++++-
> > >  include/hw/misc/sifive_u_otp.h |  3 +++
> > >  2 files changed, 32 insertions(+), 1 deletion(-)
> > >
> >
> > I am not sure how you tested this. I wrote a simple U-Boot command to
> > call U-Boot sifive-otp driver to test the write functionality, but it
> > failed.
> >
> > => misc write otp@10070000 0 80200000 10
>                                                       ^^^^^^^^^
> Quick ask, how about 'md 80200000'?
>
> I didn't use 'misc write' command. I can check afterward.

Note 'misc write' is a new U-Boot command I just added for testing
this QEMU functionality. Please use the U-Boot patch below:
http://patchwork.ozlabs.org/project/uboot/patch/1602657292-82815-1-git-send-email-bmeng.cn@gmail.com/

>
> > => misc read  otp@10070000 0 80400000 10
> > => md 80400000
> > 80400000: ffffffff ffffffff ffffffff ffffffff    ................
> > 80400010: 00000000 00000000 00000000 00000000    ................
> > 80400020: 00000000 00000000 00000000 00000000    ................
> > 80400030: 00000000 00000000 00000000 00000000    ................
> > 80400040: 00000000 00000000 00000000 00000000    ................
> > 80400050: 00000000 00000000 00000000 00000000    ................
> > 80400060: 00000000 00000000 00000000 00000000    ................
> > 80400070: 00000000 00000000 00000000 00000000    ................
> > 80400080: 00000000 00000000 00000000 00000000    ................
> > 80400090: 00000000 00000000 00000000 00000000    ................
> > 804000a0: 00000000 00000000 00000000 00000000    ................
> > 804000b0: 00000000 00000000 00000000 00000000    ................
> > 804000c0: 00000000 00000000 00000000 00000000    ................
> > 804000d0: 00000000 00000000 00000000 00000000    ................
> > 804000e0: 00000000 00000000 00000000 00000000    ................
> > 804000f0: 00000000 00000000 00000000 00000000    ................
> > => misc write otp@10070000 0 80200010 10
> > => misc read  otp@10070000 0 80400010 10
> > => md 80400000
> > 80400000: ffffffff ffffffff ffffffff ffffffff    ................
> > 80400010: ffffffff ffffffff ffffffff ffffffff    ................
> > 80400020: 00000000 00000000 00000000 00000000    ................
> > 80400030: 00000000 00000000 00000000 00000000    ................
> > 80400040: 00000000 00000000 00000000 00000000    ................
> > 80400050: 00000000 00000000 00000000 00000000    ................
> > 80400060: 00000000 00000000 00000000 00000000    ................
> > 80400070: 00000000 00000000 00000000 00000000    ................
> > 80400080: 00000000 00000000 00000000 00000000    ................
> > 80400090: 00000000 00000000 00000000 00000000    ................
> > 804000a0: 00000000 00000000 00000000 00000000    ................
> > 804000b0: 00000000 00000000 00000000 00000000    ................
> > 804000c0: 00000000 00000000 00000000 00000000    ................
> > 804000d0: 00000000 00000000 00000000 00000000    ................
> > 804000e0: 00000000 00000000 00000000 00000000    ................
> > 804000f0: 00000000 00000000 00000000 00000000    ................
> >
> > But it can read the serial number at offset 0x3f0
> >
> > => misc read  otp@10070000 3f0 80400010 10
> > => md 80400000
> > 80400000: ffffffff ffffffff ffffffff ffffffff    ................
> > 80400010: 00000001 fffffffe ffffffff ffffffff    ................
> > 80400020: 00000000 00000000 00000000 00000000    ................
> > 80400030: 00000000 00000000 00000000 00000000    ................
> > 80400040: 00000000 00000000 00000000 00000000    ................
> > 80400050: 00000000 00000000 00000000 00000000    ................
> > 80400060: 00000000 00000000 00000000 00000000    ................
> > 80400070: 00000000 00000000 00000000 00000000    ................
> > 80400080: 00000000 00000000 00000000 00000000    ................
> > 80400090: 00000000 00000000 00000000 00000000    ................
> > 804000a0: 00000000 00000000 00000000 00000000    ................
> > 804000b0: 00000000 00000000 00000000 00000000    ................
> > 804000c0: 00000000 00000000 00000000 00000000    ................
> > 804000d0: 00000000 00000000 00000000 00000000    ................
> > 804000e0: 00000000 00000000 00000000 00000000    ................
> > 804000f0: 00000000 00000000 00000000 00000000    ................

Regards,
Bin


  reply	other threads:[~2020-10-14  7:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28 10:11 [RFC PATCH v6 0/2] Add file-backed and write-once features to OTP Green Wan
2020-09-28 10:11 ` [RFC PATCH v6 1/2] hw/misc/sifive_u_otp: Add write function and write-once protection Green Wan
2020-10-14  5:37   ` Bin Meng
2020-10-14  7:02     ` Green Wan
2020-10-14  7:17       ` Bin Meng [this message]
2020-10-15  2:09         ` Green Wan
2020-09-28 10:11 ` [RFC PATCH v6 2/2] hw/misc/sifive_u_otp: Add backend drive support Green Wan
2020-10-14  5:41   ` Bin Meng
2020-09-28 11:43 ` [RFC PATCH v6 0/2] Add file-backed and write-once features to OTP no-reply
2020-10-13 10:51 ` Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEUhbmVUSJd1E9r4O+ziVbbH3RgSqaLe7q0CtgCqbhD+mjCurQ@mail.gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=alistair23@gmail.com \
    --cc=green.wan@sifive.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).