* Re: RE: cfi 0001
@ 2006-03-21 7:20 Tomas E
0 siblings, 0 replies; 4+ messages in thread
From: Tomas E @ 2006-03-21 7:20 UTC (permalink / raw)
To: x0nishan; +Cc: linux-mtd, nico
Hi,
>Tomas,
> First you should tell us a bit more about your board reset.
>Just confirm if the warm-reset is linked to the reset pin of strata NOR.
The at91rm9200 has a built in hardware watchdog which has no external
pin to make use of for a reset of the flash.
The flash is the intel strata 28F640 (rev C)
>CFI command sequences can put the NOR flash into a >state(e.g. in
>buffered write) where the flash contents are not >visible. If the CPU
>resets in the middle of this process and the NOR flash >is not reset back
>to the reset state, and the first instruction is being >executed from
>NOR, then you might face a state where even your >bootloader does not
Yes, I think this is the case but every time I ioremap the flash
0080 show up. I only write a small file but I could never see the
0080 go away.
I expected the flash to become in a readable state
after a while when the write operation was done.
>work - this is not a fault of the driver or the flash,
>rather is a problem with the board's signal routing as such.
Yes this is a problem as well. As long as there is no external reset
of the flash there is no 100% garantee but I would like to
minimize the problem.
>
>Regards,
>Nishanth Menon
Tomas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Re: cfi 0001
@ 2006-03-21 7:35 Tomas E
2006-03-21 16:08 ` Nicolas Pitre
0 siblings, 1 reply; 4+ messages in thread
From: Tomas E @ 2006-03-21 7:35 UTC (permalink / raw)
To: nico; +Cc: linux-mtd
Hi,
>> Nicolas Pitre <nico@cam.org> skrev den Mon, 20 Mar 2006 11:08:19 -0500 (EST):
>> Hi,
>>
>> > On Mon, 20 Mar 2006, Tomas E wrote:
>> >
>> > > Hi,
>> > >
>> > > I have a problem with writing to a Intel Strata flash
>> > > and then doing a warm reset.
>> >
>> > How do you "warm reset" ?
>>
>> I use the at91rm9200 built in watchdog on a custom board, which is very
>> convient but there is no external pin from the watchdog to make the
>> a reset of the flash.
>
>You mean from include/asm-arm/arch-at91rm9200/system.h:
>
>static inline void arch_reset(char mode)
>{
> /*
> * Perform a hardware reset with the use of the Watchdog timer.
> */
> at91_sys_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1);
> at91_sys_write(AT91_ST_CR, AT91_ST_WDRST);
>}
Sorry if my explaination was poor but no. I run my test case
which is to kill the watchdog deamon which will cause the watchdog
to expire. I checked that this code will never be executed in my case.
The built in hardware watchdog on the at91rm9200 performs a cold reset
on all on chip periphials but does nothing on the external.
The flash is external, so its state will remain in what ever state
it was before the reset, which in my case seems to be operation
not complete (0080).
I forgot to say that I using a 28F640 (rev C) flash.
When I ioremap the flash I allways see 0080 patten, I would expect
this to go away after a while or at least show something else sometimes.
I would like to minimize the time when the flash is in this state.
>then it is usually called from machine_restart() in
>arch/arm/kernel/process.c...
>which is called from kernel_restart() in kernel/sys.c...
>But kernel_restart() has called kernel_restart_prepare() which calls
>notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd)...
>And incidentally one of those reboot notifiers is cfi_intelext_reboot()
>in drivers/mtd/chips/cfi_cmdset_0001.c which calls cfi_intelext_reset()
>... which has this comment:
> /* force the completion of any ongoing operation
> and switch to array mode so any bootloader in
> flash is accessible for soft reboot. */
>
>That looks like what you need already.
>
>
>Nicolas
Tomas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Re: cfi 0001
2006-03-21 7:35 Re: cfi 0001 Tomas E
@ 2006-03-21 16:08 ` Nicolas Pitre
2006-03-22 22:46 ` Tomas
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Pitre @ 2006-03-21 16:08 UTC (permalink / raw)
To: Tomas E; +Cc: linux-mtd
On Tue, 21 Mar 2006, Tomas E wrote:
> Hi,
>
> >> Nicolas Pitre <nico@cam.org> skrev den Mon, 20 Mar 2006 11:08:19 -0500 (EST):
> >> Hi,
> >>
> >> > On Mon, 20 Mar 2006, Tomas E wrote:
> >> >
> >> > > Hi,
> >> > >
> >> > > I have a problem with writing to a Intel Strata flash
> >> > > and then doing a warm reset.
> >> >
> >> > How do you "warm reset" ?
> >>
> >> I use the at91rm9200 built in watchdog on a custom board, which is very
> >> convient but there is no external pin from the watchdog to make the
> >> a reset of the flash.
> >
> >You mean from include/asm-arm/arch-at91rm9200/system.h:
> >
> >static inline void arch_reset(char mode)
> >{
> > /*
> > * Perform a hardware reset with the use of the Watchdog timer.
> > */
> > at91_sys_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN | 1);
> > at91_sys_write(AT91_ST_CR, AT91_ST_WDRST);
> >}
>
> Sorry if my explaination was poor but no. I run my test case
> which is to kill the watchdog deamon which will cause the watchdog
> to expire. I checked that this code will never be executed in my case.
The only answer I have for you then is to not rely on the watchdog at
all since it cannot guarantee a reliable system recovery anyway. Use it
only if you have read-only flash.
Or, if you don't have to write to flash for the normal operation of your
system except for some unfrequent occasions, then a simple workaround is
simply to perform a small read of the MTD device right after the write
has completed which will return the flash to data mode.
> The built in hardware watchdog on the at91rm9200 performs a cold reset
> on all on chip periphials but does nothing on the external.
Otherwise, if the watchdog doesn't assert a reset line to which the
flash is connected then it is not fulfilling its purpose and you shoud
simply not use it at all. The only exception is for the system reboot
case where it is expected to fire only after things have been prepared
for a clean reboot.
Nicolas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Re: cfi 0001
2006-03-21 16:08 ` Nicolas Pitre
@ 2006-03-22 22:46 ` Tomas
0 siblings, 0 replies; 4+ messages in thread
From: Tomas @ 2006-03-22 22:46 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: linux-mtd
Hi,
I used a web client due to some mail problem, seem to mess up.
Nicolas Pitre <nico@cam.org> skrev den Tue, 21 Mar 2006 11:08:18 -0500
(EST):
> On Tue, 21 Mar 2006, Tomas E wrote:
>
>> Hi,
>>
>> >> Nicolas Pitre <nico@cam.org> skrev den Mon, 20 Mar 2006 11:08:19
>> -0500 (EST):
>> >> Hi,
>> >>
>> >> > On Mon, 20 Mar 2006, Tomas E wrote:
>> >> >
>> >> > > Hi,
>> >> > >
>> >> > > I have a problem with writing to a Intel Strata flash
>> >> > > and then doing a warm reset.
>> >> >
>> >> > How do you "warm reset" ?
>> >>
>> >> I use the at91rm9200 built in watchdog on a custom board, which is
>> very
>> >> convient but there is no external pin from the watchdog to make the
>> >> a reset of the flash.
>> >
>> >You mean from include/asm-arm/arch-at91rm9200/system.h:
>> >
>> >static inline void arch_reset(char mode)
>> >{
>> > /*
>> > * Perform a hardware reset with the use of the Watchdog timer.
>> > */
>> > at91_sys_write(AT91_ST_WDMR, AT91_ST_RSTEN | AT91_ST_EXTEN |
>> 1);
>> > at91_sys_write(AT91_ST_CR, AT91_ST_WDRST);
>> >}
The above works fine with the latest snapshot.
My problem is as you and others pointed out that I got a cold reset
on the chip but not on the flash. I will put a working watchdog
on the wich list.
>>
>> Sorry if my explaination was poor but no. I run my test case
>> which is to kill the watchdog deamon which will cause the watchdog
>> to expire. I checked that this code will never be executed in my case.
>
> The only answer I have for you then is to not rely on the watchdog at
> all since it cannot guarantee a reliable system recovery anyway. Use it
> only if you have read-only flash.
>
> Or, if you don't have to write to flash for the normal operation of your
> system except for some unfrequent occasions, then a simple workaround is
> simply to perform a small read of the MTD device right after the write
> has completed which will return the flash to data mode.
Yes this is my case and I have now put in this which minimize the time
when the flash is unreadable.
I was thinking that I might put in a watchdog isr that could put the flash
in read mode again and then do same as the arch_reset. But I guess that I
cannot call cfi_intelext_reboot() or similar from a isr because of
deadlock risk.
And and other problem is that it might not work if the program code for
the isr is corrupt.
>
>> The built in hardware watchdog on the at91rm9200 performs a cold reset
>> on all on chip periphials but does nothing on the external.
>
> Otherwise, if the watchdog doesn't assert a reset line to which the
> flash is connected then it is not fulfilling its purpose and you shoud
> simply not use it at all. The only exception is for the system reboot
> case where it is expected to fire only after things have been prepared
> for a clean reboot.
>
>
> Nicolas
>
>
Thank for explaining, Tomas
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-03-22 22:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-21 7:35 Re: cfi 0001 Tomas E
2006-03-21 16:08 ` Nicolas Pitre
2006-03-22 22:46 ` Tomas
-- strict thread matches above, loose matches on Subject: below --
2006-03-21 7:20 Tomas E
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox