public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Strange DELAY macro in hal_platrom_setup.h
@ 2006-02-27  7:47 Shmuel Vagner
  2006-02-28 15:51 ` Mark Salter
  0 siblings, 1 reply; 4+ messages in thread
From: Shmuel Vagner @ 2006-02-27  7:47 UTC (permalink / raw)
  To: ecos-discuss

HI,
In the platform initialization code for the IXP425 the SDRAM
initialization uses a DELAY macro.
The strange thing is that the delay macro is empty and does not do any
delay (Note the #if 0 in the code below):

.macro DELAY cycles, reg0
#if 0
    ldr     \reg0, =\cycles
    subs    \reg0, \reg0, #1
    subne   pc,  pc, #0xc
#endif
.endm

I checked with the IXP425 and the SDRAM documentation and they state
that delays are required. Moreover the initialization works fine and I
did not notice any memory problems.

Can someone please explain this?
Thanks
Shmuel


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] Strange DELAY macro in hal_platrom_setup.h
  2006-02-27  7:47 [ECOS] Strange DELAY macro in hal_platrom_setup.h Shmuel Vagner
@ 2006-02-28 15:51 ` Mark Salter
  2006-02-28 18:43   ` David Vrabel
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Salter @ 2006-02-28 15:51 UTC (permalink / raw)
  To: Shmuel Vagner; +Cc: ecos-discuss

On Sun, 2006-02-26 at 16:49 +0200, Shmuel Vagner wrote:
> HI,
> In the platform initialization code for the IXP425 the SDRAM
> initialization uses a DELAY macro.
> The strange thing is that the delay macro is empty and does not do any
> delay (Note the #if 0 in the code below):
> 
> .macro DELAY cycles, reg0
> #if 0
>     ldr     \reg0, =\cycles
>     subs    \reg0, \reg0, #1
>     subne   pc,  pc, #0xc
> #endif
> .endm
> 
> I checked with the IXP425 and the SDRAM documentation and they state
> that delays are required. Moreover the initialization works fine and I
> did not notice any memory problems.
> 
> Can someone please explain this?

Your analysis is correct. This macro should have the delay enabled. I
probably turned off the delay for some debugging purpose and forgot to
turn it back on. The delay is necessary according to the docs but it
seems that it almost always works without the delay. It may take many
reboots before it fails to initialize SDRAM correctly, but I believe
that it will fail eventually.

--Mark



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] Strange DELAY macro in hal_platrom_setup.h
  2006-02-28 15:51 ` Mark Salter
@ 2006-02-28 18:43   ` David Vrabel
  0 siblings, 0 replies; 4+ messages in thread
From: David Vrabel @ 2006-02-28 18:43 UTC (permalink / raw)
  To: Mark Salter; +Cc: Shmuel Vagner, ecos-discuss

Mark Salter wrote:
> 
> Your analysis is correct. This macro should have the delay enabled. I
> probably turned off the delay for some debugging purpose and forgot to
> turn it back on. The delay is necessary according to the docs but it
> seems that it almost always works without the delay. It may take many
> reboots before it fails to initialize SDRAM correctly, but I believe
> that it will fail eventually.

Without the delay SDRAM initialization would reliably (heh) fail on my
board at temperatures above ~ 40 C.  I did intend to report this to this
list but it seems I forgot. Sorry.  I think at the time I was busy
rolling out updated RedBoot images to (rightfully) irate customers...

David Vrabel
-- 
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* RE: [ECOS] Strange DELAY macro in hal_platrom_setup.h
@ 2006-02-28 18:03 Shmuel Vagner
  0 siblings, 0 replies; 4+ messages in thread
From: Shmuel Vagner @ 2006-02-28 18:03 UTC (permalink / raw)
  To: Mark Salter; +Cc: ecos-discuss

Another issue:
In ixdp425.h you have:
#define IXP425_SDRAM_REFRESH_CNT  0x081
Same line in grg.h is:
#define IXP425_SDRAM_REFRESH_CNT  0x081a

According to the SDRAM Datasheets the GRG refresh rate is ok, but the
IXDP is not. 
The IXDP SDRAM controller has to refresh the 8192 rows each 64 ms which
means one refresh each 7.81us. At 133Mhz it means ~ 1039 cycles which is
0x40F. This refresh rate is twice as fast then in the grg because of the
different SDRAM technologies in the two boards.

Therefore the correct definition in ixdp425.h should be:
#define IXP425_SDRAM_REFRESH_CNT  0x40F



-----Original Message-----
From: Mark Salter [mailto:msalter@redhat.com] 
Sent: Tuesday, February 28, 2006 2:28 PM
To: Shmuel Vagner
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Strange DELAY macro in hal_platrom_setup.h

On Sun, 2006-02-26 at 16:49 +0200, Shmuel Vagner wrote:
> HI,
> In the platform initialization code for the IXP425 the SDRAM
> initialization uses a DELAY macro.
> The strange thing is that the delay macro is empty and does not do any
> delay (Note the #if 0 in the code below):
> 
> .macro DELAY cycles, reg0
> #if 0
>     ldr     \reg0, =\cycles
>     subs    \reg0, \reg0, #1
>     subne   pc,  pc, #0xc
> #endif
> .endm
> 
> I checked with the IXP425 and the SDRAM documentation and they state
> that delays are required. Moreover the initialization works fine and I
> did not notice any memory problems.
> 
> Can someone please explain this?

Your analysis is correct. This macro should have the delay enabled. I
probably turned off the delay for some debugging purpose and forgot to
turn it back on. The delay is necessary according to the docs but it
seems that it almost always works without the delay. It may take many
reboots before it fails to initialize SDRAM correctly, but I believe
that it will fail eventually.

--Mark



 
 
************************************************************************
************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals &
computer viruses.
************************************************************************
************


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

end of thread, other threads:[~2006-02-28 17:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-27  7:47 [ECOS] Strange DELAY macro in hal_platrom_setup.h Shmuel Vagner
2006-02-28 15:51 ` Mark Salter
2006-02-28 18:43   ` David Vrabel
2006-02-28 18:03 Shmuel Vagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).