Ram initialization and small c.
Steve Gehlbach
steve at nexpath.com
Tue Feb 25 12:56:01 CET 2003
Ronald G. Minnich wrote:
> I would like to see that code, thanks
>
> ron
>
The original message is below since I think it did not post to the list
due to my return email address (fixed that I think). The code is
attached (6 files).
------
I think you have to cramp your C coding style anyway, to stay within
registers. The extra scratch area does not help much, with chips such
as the SiS630, only has three gp regs, little help. You can't go around
declaring variables willy nilly, you run out of space (registers) no
matter what compiler.
I also have been experimenting with inline gcc, and I think it works
pretty well and once you get the hang of it, and it _is_ easier than
assy. I have re-coded the console routines, and ram setup, and spd
timing setup on the sis630 for C. It is still a wip but I have tested
the spd setup by wrapping a real main on a live machine.
So far it is about 400 lines of C, should I attach it? It compiles
without using the stack (except for a %ebp push/pop which can be deleted).
I can't see how a special compiler gets you enough more than gcc to be
worth the downside of effort and debugging. Scratch regs vary from chip
to chip, and use 1.5 regs to access (pci). You could use the %ebp and
%esp which is a gain of two (and maybe %es %fs etc), but I think using
gcc will get us there anyway.
Just another opinion to put in the hat.
-Steve
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: chipinit.c
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20030225/117221c8/attachment.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: common.h
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20030225/117221c8/attachment.h>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: console.h
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20030225/117221c8/attachment-0001.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: raminit.c
Type: image/x-xbitmap
Size: 802 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20030225/117221c8/attachment.xbm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: setup.c
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20030225/117221c8/attachment-0001.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 630_regs.h
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20030225/117221c8/attachment-0002.h>
More information about the coreboot
mailing list