Josh Huber | 1 Feb 2001 16:38
Favicon

Re: [Ppcboot-users] More newbie question...

On Wed, Jan 31, 2001 at 01:38:32AM +0100, Wolfgang Denk wrote:
> If tools/environment.o is compiled  with  the  "relocatable"  option,
> there  is  something  else  broken.  Please send ma a complete log of
> "make distclean;make WALNUT405_config;make all".

This is happening to me as well.  I was playing with ppcboot (also
0.8.1) trying to build the various built-in targets, and the walnut405
definately fails for me.

I'm not using a cross-compiler, as I'm on a powerpc machine already.
Attached is a log of the failed build.  environment.S is definately
being built using -mrelocatable:

$ tail -n 3 cpu/ppc4xx/config.mk 
PLATFORM_RELFLAGS += -mrelocatable -ffixed-r14

PLATFORM_CPPFLAGS += -DCONFIG_4xx -ffixed-r2 -mstring -mcpu=403 -msoft-float

and then, from config.mk at the top level:
RELFLAGS= $(PLATFORM_RELFLAGS)
...
CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \
...
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
...
%.o:    %.S
        $(CC) $(AFLAGS) -c -o $ <at>  $<

This looks like this rule it's using to build environment.S, and it's
definately being built with -mrelocatable here...
(Continue reading)

Wolfgang Denk | 1 Feb 2001 18:58
Picon
Picon
Favicon

Re: [Ppcboot-users] More newbie question...

In message <20010201103823.C11809 <at> missioncriticallinux.com> you wrote:
> 
> I'm not using a cross-compiler, as I'm on a powerpc machine already.
> Attached is a log of the failed build.  environment.S is definately
> being built using -mrelocatable:
...
> This looks like this rule it's using to build environment.S, and it's
> definately being built with -mrelocatable here...

I see the option here, too, but I don't get  any  problems  from  it.
Maybe  it's  because  I'm  (still)  running  RH-7.0;  with a broken C
compiler like theirs you can expect anything.

> I wonder why it works for you?

I will look into it, but I'm  fighting  a  completely  different  war
right now.

Wolfgang Denk

--

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd <at> denx.de
Visit us at Embedded Systems: Feb 14-16 2001, Nuremberg, Halle 12/K01
(with TQ Components); our presentation "Starke Zwerge: Embedded Linux
auf PowerPC-Systemen" on Thursday, Feb 15 2001, 13:30 Forum Halle 11.
Wolfgang Denk | 1 Feb 2001 18:58
Picon
Picon
Favicon

Re: [Ppcboot-users] More newbie question...

In message <20010201103823.C11809 <at> missioncriticallinux.com> you wrote:
> 
> I'm not using a cross-compiler, as I'm on a powerpc machine already.
> Attached is a log of the failed build.  environment.S is definately
> being built using -mrelocatable:
...
> This looks like this rule it's using to build environment.S, and it's
> definately being built with -mrelocatable here...

I see the option here, too, but I don't get  any  problems  from  it.
Maybe  it's  because  I'm  (still)  running  RH-7.0;  with a broken C
compiler like theirs you can expect anything.

> I wonder why it works for you?

I will look into it, but I'm  fighting  a  completely  different  war
right now.

Wolfgang Denk

--

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd <at> denx.de
Visit us at Embedded Systems: Feb 14-16 2001, Nuremberg, Halle 12/K01
(with TQ Components); our presentation "Starke Zwerge: Embedded Linux
auf PowerPC-Systemen" on Thursday, Feb 15 2001, 13:30 Forum Halle 11.
Josh Huber | 1 Feb 2001 19:41
Favicon

Re: [Ppcboot-users] More newbie question...

On Thu, Feb 01, 2001 at 06:58:51PM +0100, Wolfgang Denk wrote:
> I see the option here, too, but I don't get  any  problems  from  it.
> Maybe  it's  because  I'm  (still)  running  RH-7.0;  with a broken C
> compiler like theirs you can expect anything.

Ok.  For now would a good work-around be to build environment.S
without -mrelocatable?  Does it need to be built that way?

> I will look into it, but I'm  fighting  a  completely  different  war
> right now.

Ok, good luck :)

--

-- 
Josh Huber
1024D/6B21489A 61F0 6138 BE7B FEBF A223  E9D1 BFE1 2065 6B21 489A
Wolfgang Denk | 2 Feb 2001 08:41
Picon
Picon
Favicon

Re: [Ppcboot-users] More newbie question...

In message <20010201134158.F11809 <at> missioncriticallinux.com> you wrote:
> 
> Ok.  For now would a good work-around be to build environment.S
> without -mrelocatable?  Does it need to be built that way?

environment.S is compiled twice: once inthe tools directory using the
native compiler; here "-mrelocatable" is wrong;  then  again  in  the
common  directory  using the cross compiler - and now "-mrelocatable"
is necessary.

Wolfgang Denk

--

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd <at> denx.de
Visit us at Embedded Systems: Feb 14-16 2001, Nuremberg, Halle 12/K01
(with TQ Components); our presentation "Starke Zwerge: Embedded Linux
auf PowerPC-Systemen" on Thursday, Feb 15 2001, 13:30 Forum Halle 11.
Wolfgang Denk | 2 Feb 2001 08:41
Picon
Picon
Favicon

Re: [Ppcboot-users] More newbie question...

In message <20010201134158.F11809 <at> missioncriticallinux.com> you wrote:
> 
> Ok.  For now would a good work-around be to build environment.S
> without -mrelocatable?  Does it need to be built that way?

environment.S is compiled twice: once inthe tools directory using the
native compiler; here "-mrelocatable" is wrong;  then  again  in  the
common  directory  using the cross compiler - and now "-mrelocatable"
is necessary.

Wolfgang Denk

--

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd <at> denx.de
Visit us at Embedded Systems: Feb 14-16 2001, Nuremberg, Halle 12/K01
(with TQ Components); our presentation "Starke Zwerge: Embedded Linux
auf PowerPC-Systemen" on Thursday, Feb 15 2001, 13:30 Forum Halle 11.
Picon

[Ppcboot-users] Jumping to RAM code & SDRAM cfg table


Hi Wolfgang:

        In the message you wrote on 30th of January you said that I might have initialized badly the SDRAM in my MBX860_C board. But I think that

there are one thing that doesn´t match with that idea:

        Why have I got the code properly relocated in SDRAM before jumping there? I think that if relocating was well it means that the accesses to this memory were good, and in consequence the SDRAM should have been initialized well.

        I have also noticed that the SDRAM configuration table that comes with the board monitor program is the same as the one that comes with the PPCBoot. Do I have to put an initialization sequence in addition to the

"upmconfig()" instruction in the PPCBoot?

        Where can I find information about configuration tables and initialization sequences for any SDRAM?

                                                                                Thank you

                                                                                                Billa


Wolfgang Denk | 2 Feb 2001 12:00
Picon
Picon
Favicon

Re: [Ppcboot-users] Jumping to RAM code & SDRAM cfg table

Dear Jose,

in message <A1C99F4731CAD111BA5400A024FC3B0C892D16 <at> ESBILMA01EDCGE> you wrote:
>
> 	In the message you wrote on 30th of January you said that I might
> have initialized badly the SDRAM in my MBX860_C board. But I think that
> there are one thing that doesn´t match with that idea:
> 
> 	Why have I got the code properly relocated in SDRAM before jumping
> there? I think that if relocating was well it means that the accesses to
> this memory were good, and in consequence the SDRAM should have been
> initialized well.

Not necessarily. Ordinary read and write accesses usually don't cause
problems, and this is all that's used to relocate the code (in  fact,
it's only write accesses)>

But as soon as the code starts  running  from  RAM,  you  will  fetch
instructions  from  RAM,  and this is the first time where burst mode
accesses come into play. And nearly all the memory problems I've seen
so far happened during burst mode.

So you may very well be able to read and  write  to  RAM,  and  still
crash badly when trying to run code from it.

> 	I have also noticed that the SDRAM configuration table that comes
> with the board monitor program is the same as the one that comes with the
> PPCBoot. Do I have to put an initialization sequence in addition to the
> "upmconfig()" instruction in the PPCBoot?

Well, yes. "upmconfig()" is just the easy part. Have a look  at  what
"initdram()" is doing for allt he existent boards - you have to setup
the prescaler for refresh, and perform a proper SDRAM initializsation
sequence; and you have to enable refresh.

That would be another potential  source  of  trouble:  if  you  don't
enable  refresh,  or it doesn't work properly, you can write the code
to RAM, but you might load just garbage when you try to run the code.

> 	Where can I find information about configuration tables and
> initialization sequences for any SDRAM?

In the processor User's manuals, and in the dtatsheets for the  SDRAM
chips  you're  using.  If  you find that unsufficient, have a look at
Micron's web pages; usually  they  provide  excellent  documentation,
which  is  not  limited to their own chips, but also explains general
principles.

Wolfgang Denk

--

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd <at> denx.de
Visit us at Embedded Systems: Feb 14-16 2001, Nuremberg, Halle 12/K01
(with TQ Components); our presentation "Starke Zwerge: Embedded Linux
auf PowerPC-Systemen" on Thursday, Feb 15 2001, 13:30 Forum Halle 11.
Wolfgang Denk | 2 Feb 2001 12:00
Picon
Picon
Favicon

Re: [Ppcboot-users] Jumping to RAM code & SDRAM cfg table

Dear Jose,

in message <A1C99F4731CAD111BA5400A024FC3B0C892D16 <at> ESBILMA01EDCGE> you wrote:
>
> 	In the message you wrote on 30th of January you said that I might
> have initialized badly the SDRAM in my MBX860_C board. But I think that
> there are one thing that doesn´t match with that idea:
> 
> 	Why have I got the code properly relocated in SDRAM before jumping
> there? I think that if relocating was well it means that the accesses to
> this memory were good, and in consequence the SDRAM should have been
> initialized well.

Not necessarily. Ordinary read and write accesses usually don't cause
problems, and this is all that's used to relocate the code (in  fact,
it's only write accesses)>

But as soon as the code starts  running  from  RAM,  you  will  fetch
instructions  from  RAM,  and this is the first time where burst mode
accesses come into play. And nearly all the memory problems I've seen
so far happened during burst mode.

So you may very well be able to read and  write  to  RAM,  and  still
crash badly when trying to run code from it.

> 	I have also noticed that the SDRAM configuration table that comes
> with the board monitor program is the same as the one that comes with the
> PPCBoot. Do I have to put an initialization sequence in addition to the
> "upmconfig()" instruction in the PPCBoot?

Well, yes. "upmconfig()" is just the easy part. Have a look  at  what
"initdram()" is doing for allt he existent boards - you have to setup
the prescaler for refresh, and perform a proper SDRAM initializsation
sequence; and you have to enable refresh.

That would be another potential  source  of  trouble:  if  you  don't
enable  refresh,  or it doesn't work properly, you can write the code
to RAM, but you might load just garbage when you try to run the code.

> 	Where can I find information about configuration tables and
> initialization sequences for any SDRAM?

In the processor User's manuals, and in the dtatsheets for the  SDRAM
chips  you're  using.  If  you find that unsufficient, have a look at
Micron's web pages; usually  they  provide  excellent  documentation,
which  is  not  limited to their own chips, but also explains general
principles.

Wolfgang Denk

--

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd <at> denx.de
Visit us at Embedded Systems: Feb 14-16 2001, Nuremberg, Halle 12/K01
(with TQ Components); our presentation "Starke Zwerge: Embedded Linux
auf PowerPC-Systemen" on Thursday, Feb 15 2001, 13:30 Forum Halle 11.
Murray Jensen | 2 Feb 2001 15:18
Picon
Picon

Re: [Ppcboot-users] Jumping to RAM code & SDRAM cfg table

On Fri, 02 Feb 2001 12:00:24 +0100, Wolfgang Denk <wd <at> denx.de> writes:
>But as soon as the code starts  running  from  RAM,  you  will  fetch
>instructions  from  RAM,  and this is the first time where burst mode
>accesses come into play. And nearly all the memory problems I've seen
>so far happened during burst mode.
>
>So you may very well be able to read and  write  to  RAM,  and  still
>crash badly when trying to run code from it.

You could test this theory by disabling burst mode in the bank option
register (set BIH in ORx). Cheers!
								Murray...
--
Murray Jensen, CSIRO Manufacturing Sci & Tech,         Phone: +61 3 9662 7763
Locked Bag No. 9, Preston, Vic, 3072, Australia.         Fax: +61 3 9662 7853
Internet: Murray.Jensen <at> cmst.csiro.au  (old address was mjj <at> mlb.dmt.csiro.au)

Gmane