public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] standalone code
@ 2003-08-14 14:01 Philippe Simal
  2003-08-14 17:22 ` Marc Singer
  2003-08-14 18:48 ` Wolfgang Denk
  0 siblings, 2 replies; 3+ messages in thread
From: Philippe Simal @ 2003-08-14 14:01 UTC (permalink / raw)
  To: u-boot

Hello,

I'm running u-boot-0.3.0 on an IBM PPC440GP EBONY board . The next stage is to port u-boot to our custom designed board.
In the meanwhile I'm writing some hardware debug code that does not use any kernel. 
(1)First I tried to run it as a standalone program just like the 'hello world' example. The problem is that I do not have access to the drivers used by u-boot. I only can use some system calls like mon_printf()...
So I tried to link my debug code directly to the u-boot code with an entry point just before the call main_loop() in board.c.
This works fine except that I cannot use function pointers used in my debug menu .
(2)I know this has something to do with the code relocation from flash to sdram so I tried to relocate all my pointers. Ok that didn't work.

So my questions are, (1) is it possible to make a standalone pease of software that runs in sdram with the full use of the u-boot drivers?
(2) What must I do to use my pointers whitout crashing the ppc.

Best regards,

Philippe Simal

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20030814/7ff01d84/attachment.htm 

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

* [U-Boot-Users] standalone code
  2003-08-14 14:01 [U-Boot-Users] standalone code Philippe Simal
@ 2003-08-14 17:22 ` Marc Singer
  2003-08-14 18:48 ` Wolfgang Denk
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Singer @ 2003-08-14 17:22 UTC (permalink / raw)
  To: u-boot

On Thu, Aug 14, 2003 at 04:01:54PM +0200, Philippe Simal wrote:
> So my questions are, (1) is it possible to make a standalone pease of software that runs in sdram with the full use of the u-boot drivers?

If you are only doing small work, you can add commands to u-boot.  The
hassle may be that you need to reflash u-boot to gain access to the
new commands.  On my dev board, I am able to download u-boot to SRAM
and run without writing to flash.  If you have this option it makes
for rapid development.

Cheers.

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

* [U-Boot-Users] standalone code
  2003-08-14 14:01 [U-Boot-Users] standalone code Philippe Simal
  2003-08-14 17:22 ` Marc Singer
@ 2003-08-14 18:48 ` Wolfgang Denk
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2003-08-14 18:48 UTC (permalink / raw)
  To: u-boot

Dear Philippe,

in message <007601c3626c$9e7d2ee0$10c8c8c8@philippesimal> you wrote:
> 
> In the meanwhile I'm writing some hardware debug code that does not use
> any kernel. 

It wouldbe great if you contributed such code as part  of  the  post/
stuff.

> (1)First I tried to run it as a standalone program just like the 'hello
> world' example. The problem is that I do not have access to the drivers
> used by u-boot. I only can use some system calls like mon_printf()...

Please  update  your  U-Boot  sources.  We  reworked  the  standalone
applications code, so it now not only works on all architectures, but
also   allows  for  easy  extension.  See  doc/README.standalone  for
details.

> So I tried to link my debug code directly to the u-boot code with an
> entry point just before the call main_loop() in board.c.
> This works fine except that I cannot use function pointers used in my
> debug menu .

You can, but you have to manually  relocated  them,  or  use  dynamic
initialization.

> (2)I know this has something to do with the code relocation from flash
> to sdram so I tried to relocate all my pointers. Ok that didn't work.

It is trivial to fix. See how  all  the  other  static  pointers  get
relocated (basicly, just add gd->reloc_off).

> So my questions are, (1) is it possible to make a standalone pease of
> software that runs in sdram with the full use of the u-boot drivers?

Yes, easily.

> (2) What must I do to use my pointers whitout crashing the ppc.

See above.

Hope this helps.

Best regards,

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
"Obviously, a major malfunction has occurred."
              -- Steve Nesbitt, voice of Mission Control, January 28,
                 1986, as the shuttle Challenger exploded within view
                 of the grandstands.

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

end of thread, other threads:[~2003-08-14 18:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-14 14:01 [U-Boot-Users] standalone code Philippe Simal
2003-08-14 17:22 ` Marc Singer
2003-08-14 18:48 ` Wolfgang Denk

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