mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: barebox@lists.infradead.org, Brian Lilly <brian@crystalfontz.com>
Subject: Re: Writing to the OCOTP on mx28 boards
Date: Fri, 28 Sep 2012 14:42:12 +0200	[thread overview]
Message-ID: <20120928124212.GC1322@pengutronix.de> (raw)
In-Reply-To: <506596C4.6080903@free-electrons.com>

On Fri, Sep 28, 2012 at 02:23:32PM +0200, Maxime Ripard wrote:
> Le 28/09/2012 14:08, Maxime Ripard a écrit :
> > Hi everyone,
> > 
> > I'm trying to write down some data to the /dev/ocotp file, which is
> > basically a one time programming chip containing four bytes.
> > 
> > Using the command mw -b -d /dev/ocotp 0-3 0x01020304 writes down only
> > "4" to the first byte of the OCOTP, which is not quite what I was
> > expecting. What's the correct syntax for the mw command?
> 
> Ok, just found out, it should be
> mw -l -d /dev/ocotp 0-3 0x01020304

Not quite. 0-3 is wrong, though appearantly happens to work. It should
be:

mw -d /dev/ocotp 0 0x01020304

(-l can be skipped, as 32bit accesses are default). If you want to write
multiple words you can do a:

mw -d /dev/ocotp 0 0xdeadbeef 0x12345678 0x11223344

The 0-3 notation is only for 'md'

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-09-28 12:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-28 12:08 Maxime Ripard
2012-09-28 12:23 ` Maxime Ripard
2012-09-28 12:42   ` Sascha Hauer [this message]
2012-09-28 14:39     ` Maxime Ripard

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=20120928124212.GC1322@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=brian@crystalfontz.com \
    --cc=maxime.ripard@free-electrons.com \
    /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