* Writing to the OCOTP on mx28 boards
@ 2012-09-28 12:08 Maxime Ripard
2012-09-28 12:23 ` Maxime Ripard
0 siblings, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2012-09-28 12:08 UTC (permalink / raw)
To: barebox; +Cc: Brian Lilly
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?
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Writing to the OCOTP on mx28 boards
2012-09-28 12:08 Writing to the OCOTP on mx28 boards Maxime Ripard
@ 2012-09-28 12:23 ` Maxime Ripard
2012-09-28 12:42 ` Sascha Hauer
0 siblings, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2012-09-28 12:23 UTC (permalink / raw)
To: barebox; +Cc: Brian Lilly
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
Thanks to Franck Jullien :)
--
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Writing to the OCOTP on mx28 boards
2012-09-28 12:23 ` Maxime Ripard
@ 2012-09-28 12:42 ` Sascha Hauer
2012-09-28 14:39 ` Maxime Ripard
0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2012-09-28 12:42 UTC (permalink / raw)
To: Maxime Ripard; +Cc: barebox, Brian Lilly
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Writing to the OCOTP on mx28 boards
2012-09-28 12:42 ` Sascha Hauer
@ 2012-09-28 14:39 ` Maxime Ripard
0 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2012-09-28 14:39 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox, Brian Lilly
Hi Sascha,
Le 28/09/2012 14:42, Sascha Hauer a écrit :
> 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'
Ok, I see.
Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-28 14:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-28 12:08 Writing to the OCOTP on mx28 boards Maxime Ripard
2012-09-28 12:23 ` Maxime Ripard
2012-09-28 12:42 ` Sascha Hauer
2012-09-28 14:39 ` Maxime Ripard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox