mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* IIM on iMX27 "how-to" needed
@ 2012-01-31 10:36 Igor
  2012-01-31 11:40 ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Igor @ 2012-01-31 10:36 UTC (permalink / raw)
  To: barebox

Hi,

I'm trying to read and write the e-fuse banks on my iMX27 with Barebox
but still unsuccessfully.

I configured and compiled Barebox with IIM support, so I can see these devices:
barebox:/ ls -l /dev
crw-------         32 imx_iim_bank0
crw-------         32 imx_iim_bank1
crw-------         32 imx_iim_bank2
crw-------         32 imx_iim_bank3
crw-------         32 imx_iim_bank4
crw-------         32 imx_iim_bank5
crw-------         32 imx_iim_bank6
crw-------         32 imx_iim_bank7

and I get:
barebox:/ devinfo
[..]
`---- imx_iim0
     `---- 0x00000000-0x0000001f: /dev/imx_iim_bank0
     `---- 0x00000000-0x0000001f: /dev/imx_iim_bank1
     `---- 0x00000000-0x0000001f: /dev/imx_iim_bank2
     `---- 0x00000000-0x0000001f: /dev/imx_iim_bank3
     `---- 0x00000000-0x0000001f: /dev/imx_iim_bank4
     `---- 0x00000000-0x0000001f: /dev/imx_iim_bank5
     `---- 0x00000000-0x0000001f: /dev/imx_iim_bank6
     `---- 0x00000000-0x0000001f: /dev/imx_iim_bank7

barebox:/ devinfo imx_iim0
resources:
num   : 0
start : 0x10028000
size  : 0x00001000
driver: imx_iim

no info available for imx_iim0
Parameters:
permanent_write_enable = 0
explicit_sense_enable = 1

By the way I don't know how to read and write the fuse banks.

If I try to read them, I get:
barebox:/ md -b /dev/imx_iim_bank0
could not parse: /dev/imx_iim_bank0

Can you give me any suggestions on how to proceed with fuses?

Thanks a lot in advance,
Igor.

-- 
"Don't find fault, find a remedy."
(Henry Ford)

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: IIM on iMX27 "how-to" needed
  2012-01-31 10:36 IIM on iMX27 "how-to" needed Igor
@ 2012-01-31 11:40 ` Sascha Hauer
  2012-01-31 12:51   ` Igor Trevisan
  0 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2012-01-31 11:40 UTC (permalink / raw)
  To: Igor; +Cc: barebox

On Tue, Jan 31, 2012 at 11:36:51AM +0100, Igor wrote:
> Hi,
> 
> I'm trying to read and write the e-fuse banks on my iMX27 with Barebox
> but still unsuccessfully.
> 
> I configured and compiled Barebox with IIM support, so I can see these devices:
> barebox:/ ls -l /dev
> crw-------         32 imx_iim_bank0
> crw-------         32 imx_iim_bank1
> crw-------         32 imx_iim_bank2
> crw-------         32 imx_iim_bank3
> crw-------         32 imx_iim_bank4
> crw-------         32 imx_iim_bank5
> crw-------         32 imx_iim_bank6
> crw-------         32 imx_iim_bank7
> 
> and I get:
> barebox:/ devinfo
> [..]
> `---- imx_iim0
>      `---- 0x00000000-0x0000001f: /dev/imx_iim_bank0
>      `---- 0x00000000-0x0000001f: /dev/imx_iim_bank1
>      `---- 0x00000000-0x0000001f: /dev/imx_iim_bank2
>      `---- 0x00000000-0x0000001f: /dev/imx_iim_bank3
>      `---- 0x00000000-0x0000001f: /dev/imx_iim_bank4
>      `---- 0x00000000-0x0000001f: /dev/imx_iim_bank5
>      `---- 0x00000000-0x0000001f: /dev/imx_iim_bank6
>      `---- 0x00000000-0x0000001f: /dev/imx_iim_bank7
> 
> barebox:/ devinfo imx_iim0
> resources:
> num   : 0
> start : 0x10028000
> size  : 0x00001000
> driver: imx_iim
> 
> no info available for imx_iim0
> Parameters:
> permanent_write_enable = 0
> explicit_sense_enable = 1
> 
> By the way I don't know how to read and write the fuse banks.
> 
> If I try to read them, I get:
> barebox:/ md -b /dev/imx_iim_bank0
> could not parse: /dev/imx_iim_bank0

The command is correct, the usage is wrong.
See http://wiki.barebox.org/doku.php?id=commands:md and let me know
if that helps (and what could be made better)

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] 7+ messages in thread

* Re: IIM on iMX27 "how-to" needed
  2012-01-31 11:40 ` Sascha Hauer
@ 2012-01-31 12:51   ` Igor Trevisan
  2012-01-31 13:12     ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Igor Trevisan @ 2012-01-31 12:51 UTC (permalink / raw)
  To: barebox

Hi,

>
> The command is correct, the usage is wrong.
> See http://wiki.barebox.org/doku.php?id=commands:md and let me know
> if that helps

Yes, it helps.
It helped me, first of all to RTFM ;-) and use correctly Barebox commands...
And second it helped to find a new problem:

barebox:/ md -b -s /dev/imx_iim_bank0
do_fuse_sense: sense error (0x04)
read: I/O error

What do I do wrong?
Igor.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: IIM on iMX27 "how-to" needed
  2012-01-31 12:51   ` Igor Trevisan
@ 2012-01-31 13:12     ` Sascha Hauer
       [not found]       ` <CALQ+5afyqAu7NP5yks7pJcJzbpm3u2G7USn1MSTnbby1-3r4mw@mail.gmail.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2012-01-31 13:12 UTC (permalink / raw)
  To: Igor Trevisan; +Cc: barebox

On Tue, Jan 31, 2012 at 01:51:31PM +0100, Igor Trevisan wrote:
> Hi,
> 
> >
> > The command is correct, the usage is wrong.
> > See http://wiki.barebox.org/doku.php?id=commands:md and let me know
> > if that helps
> 
> Yes, it helps.
> It helped me, first of all to RTFM ;-) and use correctly Barebox commands...
> And second it helped to find a new problem:
> 
> barebox:/ md -b -s /dev/imx_iim_bank0
> do_fuse_sense: sense error (0x04)
> read: I/O error
> 
> What do I do wrong?

You could try imx_iim0.explicit_sense_enable=0, maybe this helps.

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] 7+ messages in thread

* Re: IIM on iMX27 "how-to" needed
       [not found]       ` <CALQ+5afyqAu7NP5yks7pJcJzbpm3u2G7USn1MSTnbby1-3r4mw@mail.gmail.com>
@ 2012-02-10 14:13         ` Igor Trevisan
  2012-02-10 22:59           ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Igor Trevisan @ 2012-02-10 14:13 UTC (permalink / raw)
  To: barebox

Sorry,

I replied to Sasha privately and not to the list!


On Fri, Feb 10, 2012 at 2:05 PM, Igor Trevisan <igt1972@gmail.com> wrote:
>>
>> You could try imx_iim0.explicit_sense_enable=0, maybe this helps.
>>
>
> Again... This helps!
> Sorry, I misunderstood the logic of the sense flag!
> (I think I owe you at least a beer...;)
>
> By the way, now I can read the first two banks:
>
> barebox:/  md -b -s /dev/imx_iim_bank1
> 00000000: 41 ce 3c ad 4d 89 93 00 00 00 00 00 00 00 00 00    A.<.M...........
> 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
> barebox:/
> barebox:/
> barebox:/  md -b -s /dev/imx_iim_bank0
> 00000000: 59 20 81 40 20 00 00 00 00 00 00 00 00 00 00 00    Y .@ ...........
> 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
>
> Now I would like to go further and try to program some fuse bits
> (I need to store some codes...).
> I think I need first of all to set:
> imx_iim0.permanent_write_enable=1
>
> I did this, then I tried to write with
>
> mw -b 0x10028814 0xbb
>
> but reading back I still find:
> barebox:/  md -b -s /dev/imx_iim_bank0
> 00000000: 59 20 81 40 20 00 00 00 00 00 00 00 00 00 00 00    Y .@ ...........
> 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
>
> Which is the right way to write the fuse bits?
> Thanks in advance,
> I.
>
>
>
>
> --
> "Don't find fault, find a remedy."
> (Henry Ford)



-- 
"Don't find fault, find a remedy."
(Henry Ford)

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: IIM on iMX27 "how-to" needed
  2012-02-10 14:13         ` Igor Trevisan
@ 2012-02-10 22:59           ` Sascha Hauer
  2012-02-13  9:12             ` Igor Trevisan
  0 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2012-02-10 22:59 UTC (permalink / raw)
  To: Igor Trevisan; +Cc: barebox

On Fri, Feb 10, 2012 at 03:13:00PM +0100, Igor Trevisan wrote:
> Sorry,
> 
> I replied to Sasha privately and not to the list!
> 
> 
> On Fri, Feb 10, 2012 at 2:05 PM, Igor Trevisan <igt1972@gmail.com> wrote:
> >>
> >> You could try imx_iim0.explicit_sense_enable=0, maybe this helps.
> >>
> >
> > Again... This helps!
> > Sorry, I misunderstood the logic of the sense flag!
> > (I think I owe you at least a beer...;)
> >
> > By the way, now I can read the first two banks:
> >
> > barebox:/  md -b -s /dev/imx_iim_bank1
> > 00000000: 41 ce 3c ad 4d 89 93 00 00 00 00 00 00 00 00 00    A.<.M...........
> > 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
> > barebox:/
> > barebox:/
> > barebox:/  md -b -s /dev/imx_iim_bank0
> > 00000000: 59 20 81 40 20 00 00 00 00 00 00 00 00 00 00 00    Y .@ ...........
> > 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
> >
> > Now I would like to go further and try to program some fuse bits
> > (I need to store some codes...).
> > I think I need first of all to set:
> > imx_iim0.permanent_write_enable=1
> >
> > I did this, then I tried to write with
> >
> > mw -b 0x10028814 0xbb
> >
> > but reading back I still find:
> > barebox:/  md -b -s /dev/imx_iim_bank0
> > 00000000: 59 20 81 40 20 00 00 00 00 00 00 00 00 00 00 00    Y .@ ...........
> > 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
> >
> > Which is the right way to write the fuse bits?

Try

mw -d /dev/imx_iim_bank0 -b 0x2 0x80

to change the the '0x80' at offset 2 to 0x80.

I suggest that you explore the usage of 'mw' with something less
sensitive than the fuses, they have the potential to brick your board...

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] 7+ messages in thread

* Re: IIM on iMX27 "how-to" needed
  2012-02-10 22:59           ` Sascha Hauer
@ 2012-02-13  9:12             ` Igor Trevisan
  0 siblings, 0 replies; 7+ messages in thread
From: Igor Trevisan @ 2012-02-13  9:12 UTC (permalink / raw)
  To: barebox

Hi,

>> > Which is the right way to write the fuse bits?
>
> Try
>
> mw -d /dev/imx_iim_bank0 -b 0x2 0x80
>
> to change the the '0x80' at offset 2 to 0x80.

it (obviously...) works!

> I suggest that you explore the usage of 'mw' with something less
> sensitive than the fuses, they have the potential to brick your board...

Oh yes, I did experiments on ram0 before killing my uC! ;-)
By the way... Thanks a lot for your support Sascha.
I.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-02-13  9:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-31 10:36 IIM on iMX27 "how-to" needed Igor
2012-01-31 11:40 ` Sascha Hauer
2012-01-31 12:51   ` Igor Trevisan
2012-01-31 13:12     ` Sascha Hauer
     [not found]       ` <CALQ+5afyqAu7NP5yks7pJcJzbpm3u2G7USn1MSTnbby1-3r4mw@mail.gmail.com>
2012-02-10 14:13         ` Igor Trevisan
2012-02-10 22:59           ` Sascha Hauer
2012-02-13  9:12             ` Igor Trevisan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox