public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Re: Re: really really tiny code
@ 2005-01-26 12:59 Nishant Galange
  2005-01-26 14:30 ` [U-Boot-Users] " Wolfgang Denk
  2005-02-02 18:40 ` [U-Boot-Users] " Ralph Siemsen
  0 siblings, 2 replies; 4+ messages in thread
From: Nishant Galange @ 2005-01-26 12:59 UTC (permalink / raw)
  To: u-boot

Sorry about the off-topic email. I sincerely felt that the people 
on this mailing list are the only ones who can help me.

About the problem itself:
Yes, I am a little comfortable with the u-boot source code now, and 
I planned on using most of the code in cpu/mpc8260/start.S for making this 
'micro monitor' 

I definitely plan to make it available under the GPL, as I feel it 
will be a really good test tool for people bringing up their new hardware 
for the first time. They can use the processor to test crucial parts of 
the system, and use LEDs to report status. From my (limited) experience 
in board bring-up, everything right from the power supply to bad buffers, 
JTAG connections to bus noise are suspect when the board dosen't work. 
Atleast this tiny code will help clear up doubts from the processor's 
point of view. Developers will have one definite ally on the board who keeps 
sending status reports no matter what else is failing.

The only help I need is with gcc, or ppc_82xx-gcc, to be precise. 
I have no idea how to give it a single .S or .asm file and tell it to create a .bin. 
Makefiles? I only know how to use readymade ones, not to how to create one.

You said I will also need a .lds, and I don't know how to tell gcc to use that either.

Can anyone please send the complete process of compiling such a source 
(only 1 or two source files) along with the .lds and creating a .bin?

Waiting,
Nishant

PS. Sorry again if its still off-topic. But I feel it can be a good addition 
to u-boot as a separate tool. This will also be independent of the board, 
and most people will simply have to change the 
addresses of the LEDs to get it working for 
their board.

-----Original Message-----
From: wd@denx.de [mailto:wd at denx.de]
Sent: Wednesday, January 26, 2005 3:05 PM
To: Nishant Galange
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [U-Boot-Users] really really tiny code 


In message <1106684792.3804b95cnishant.subs@myrealbox.com> you wrote:
> 
> I want to write a really tiny program - just init core, MMU and stop.
> Preferably, (if possible) I would like to start out with a blank file, 
> type in the code, and give the compile command at the good old command prom=
> pt. 
> 
> Is it possible? If yes, can anyone please tell me the command? 

Yes, it is poossible. You will need more than one command,  at  least
"vi" and "ppc_82xx-gcc".

> Would any other files (.lds, etc) be necessary? What else will be required?

Yes, you will most probably need a linker script.

One of the most important requirements is an  in-depth  understanding
of your hardware environment and how to write software for it.

> I need a micro development environment like this from where I can do all 
> my work out of the cosy little (really limited, I know) DPRAM, and try 
> out some experiments with the processor's registers and config.
> I might even be adventurous and try initializing the ports and 
> glowing some LEDs :-)
> 
> What do I do? How do I proceed? Please help.

U-Boot includes all the init stuff you will probably  re-0invent,  so
feel  free  to  copy  and  re-use  this  code  (and make your program
available under GPL), but please understand that you are on your  own
with such a project.

Sorry, but this is off topic here.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A year spent in artificial intelligence is enough to make one believe
in God.

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

* [U-Boot-Users] Re: really really tiny code
  2005-01-26 12:59 [U-Boot-Users] Re: Re: really really tiny code Nishant Galange
@ 2005-01-26 14:30 ` Wolfgang Denk
  2005-02-02 18:40 ` [U-Boot-Users] " Ralph Siemsen
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2005-01-26 14:30 UTC (permalink / raw)
  To: u-boot

In message <1106744392.30bb8dbcnishant.subs@myrealbox.com> you wrote:
>
> I definitely plan to make it available under the GPL, as I feel it 
> will be a really good test tool for people bringing up their new hardware
> for the first time. They can use the processor to test crucial parts of 

Using U-Boot is IMHO a much better test tool. It alows to do  exactly
the same, step by step, and in the process you get a real boot loader
ported, too.

> Atleast this tiny code will help clear up doubts from the processor's 
> point of view. Developers will have one definite ally on the board who keeps 
> sending status reports no matter what else is failing.

Haw many boards have you ported U-Boot to,  and  what  was  the  main
problem  with  U-Boot in this process? In other words, which problems
did you encounter when portting  U-Boot  which  yoiu  think  you  can
overcome in your new code?


> I have no idea how to give it a single .S or .asm file and tell it to creat
> e a .bin. 

ppc_82xx-gcc file.S
ppc_82xx-ld -Bstatic -T your_linker_script file.o 

> Makefiles? I only know how to use readymade ones, not to how to create one.

You will have to learn this, then. Sorry, but this is not  the  forum
to teach you software development issues.

> You said I will also need a .lds, and I don't know how to tell gcc to use that either.

GCC doesn;t use it, itls the linker (ld) which does.

> Can anyone please send the complete process of compiling such a source 
> (only 1 or two source files) along with the .lds and creating a .bin?

Type "make all" in the U-Boot directory and what what it's doing.

> PS. Sorry again if its still off-topic. But I feel it can be a good addition 
> to u-boot as a separate tool. This will also be independent of the board,

I disagree. You're just re-inventing the wheel. But please feel free to go on.


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A student of  probability  soon  realizes  that  by  its  nature  the
billion-to-one  chance  crops  up nine times out of ten, and that the
greatest odds boil down to a double-sided statement: it will  happen,
or it will not.         - Terry Pratchett, _The Dark Side of the Sun_

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

* [U-Boot-Users] Re: Re: really really tiny code
  2005-01-26 12:59 [U-Boot-Users] Re: Re: really really tiny code Nishant Galange
  2005-01-26 14:30 ` [U-Boot-Users] " Wolfgang Denk
@ 2005-02-02 18:40 ` Ralph Siemsen
  1 sibling, 0 replies; 4+ messages in thread
From: Ralph Siemsen @ 2005-02-02 18:40 UTC (permalink / raw)
  To: u-boot

Nishant Galange wrote:

> The only help I need is with gcc, or ppc_82xx-gcc, to be precise. 
> I have no idea how to give it a single .S or .asm file and tell it to create a .bin. 
> Makefiles? I only know how to use readymade ones, not to how to create one.

You will have to do some studying then to learn these basic things. 
They are well documented (hint: read the gcc and binutils documentation)

http://gcc.gnu.org/onlinedocs/
http://sources.redhat.com/binutils/docs-2.15/
http://en.tldp.org/HOWTO/Assembly-HOWTO/index.html
http://www.gnu.org/software/make/manual/make.html

Most important, learn to use google and it will answer all your 
questions. :)

But please don't continue asking here, you will only anger the list 
managers...

-R

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

* [U-Boot-Users] Re: Re: really really tiny code
@ 2005-02-03  7:47 Bharath
  0 siblings, 0 replies; 4+ messages in thread
From: Bharath @ 2005-02-03  7:47 UTC (permalink / raw)
  To: u-boot

Hi Nishant,

>Nishant Galange wrote:

> The only help I need is with gcc, or ppc_82xx-gcc, to be precise. 
> I have no idea how to give it a single .S or .asm file and tell it to
create a .bin. 
> Makefiles? I only know how to use readymade ones, not to how to create
one.

This example should help you.I used it when i did not have my debugger up
and running,


I use a montavista ppc_82xx- toolchain .My uboot source is in /home/bharath,
textbase is 0xfff00000 . I used my custom init file's and my c (quick_test)
file to test my target board.

Change them to use for your configuration.

*-----------------------------*

export PATH=$PATH:/opt/montavista/devkit/ppc/82xx/bin

ppc_82xx-gcc -Wa,-gstabs -D__ASSEMBLY__ -g  -Os   -fPIC -ffixed-r14 -meabi
-D__KERNEL__ -DTEXT_BA
SE=0xfff00000 -I/home/bharath/sources/u-boot/include -fno-builtin
-ffreestanding -nostdinc -isyst
em
/opt/montavista/devkit/ppc/82xx/lib/gcc-lib/powerpc-hardhat-linux/3.3.1/incl
ude -pipe  -DCONFI
G_PPC -D__powerpc__ -DCONFIG_8260 -ffixed-r2 -ffixed-r29 -mstring -mcpu=603e
-mmultiple -c -o mpc
8270_init.o mpc8270_init.S

ppc_82xx-gcc -g  -Os   -fPIC -ffixed-r14 -meabi -D__KERNEL__
-DTEXT_BASE=0xfff00000 -I/home/bhara
th/sources/u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem
/opt/montavista/devkit/p
pc/82xx/lib/gcc-lib/powerpc-hardhat-linux/3.3.1/include -pipe  -DCONFIG_PPC
-D__powerpc__ -DCONFI
G_8260 -ffixed-r2 -ffixed-r29 -mstring -mcpu=603e -mmultiple -Wall
-Wstrict-prototypes -c -o mpc8
270_init_h.o mpc8270_init_h.c

ppc_82xx-gcc -g  -Os   -fPIC -ffixed-r14 -meabi -D__KERNEL__
-DTEXT_BASE=0xfff00000 -I/home/bhara
th/sources/u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem
/opt/montavista/devkit/p
pc/82xx/lib/gcc-lib/powerpc-hardhat-linux/3.3.1/include -pipe  -DCONFIG_PPC
-D__powerpc__ -DCONFI
G_8260 -ffixed-r2 -ffixed-r29 -mstring -mcpu=603e -mmultiple -Wall
-Wstrict-prototypes -c -o quic
k_test.o quick_test.c

ppc_82xx-ld -Bstatic -e 0xfff00100 -n $UNDEF_SYM -o quick_test
mpc8270_init.o mpc8270_init_h.o qu
ick_test.o

ppc_82xx-objcopy -x -g -O binary quick_test quick_test.bin

*--------------------------*


Hope this helps,

Cheers,

.Bharath.

Ps: See how u-boot compiles your source.

"One World, One Web, One Program" - Microsoft Promotional Ad
"Ein Volk, Ein Reich, Ein Fuhrer" - Adolf Hitler
DISCLAIMER 
This message and any attachment(s) contained here are information that is confidential, proprietary to HCL Technologies 
and its customers. Contents may be privileged or otherwise protected by law. The information is solely intended for the 
individual or the entity it is addressed to. If you are not the intended recipient of this message, you are not authorized to 
read, forward, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, 
please notify the sender immediately by return e-mail and delete it from your computer

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

end of thread, other threads:[~2005-02-03  7:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-26 12:59 [U-Boot-Users] Re: Re: really really tiny code Nishant Galange
2005-01-26 14:30 ` [U-Boot-Users] " Wolfgang Denk
2005-02-02 18:40 ` [U-Boot-Users] " Ralph Siemsen
  -- strict thread matches above, loose matches on Subject: below --
2005-02-03  7:47 Bharath

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