Skip to contentSkip to conversation

Writing to the OCOTP on mx28 boards

DISCUSSION Maxime Ripard 2 participants 4 messages Sep 28, 2012

lore
Share & tools
lore
#0 lore raw

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

Signature · 9 lines
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw
Quoted 8 lines · Maxime Ripard

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 :)

Signature · 9 lines
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw
Quoted 6 lines · Maxime Ripard
Quoted 5 lines · Maxime Ripard

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.

Quoted 6 lines
Quoted 3 lines

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

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

Hi Sascha,

Quoted 17 lines · Sascha Hauer
Quoted 6 lines · Maxime Ripard
Quoted 5 lines · Maxime Ripard

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.

Quoted 6 lines
Quoted 3 lines

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:

Quoted 8 lines

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

Signature · 9 lines
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox