[coreboot] [RFC] v2: register reductions in i440bx/debug.c

Stefan Reinauer stepan at coresystems.de
Fri Aug 29 00:33:12 CEST 2008

Mats Erik Andersson wrote:
> I did try to introduce other reductions further into
> the code base, but I was not successful in getting
> compilable code until I removed the assignment 
>       device = ctrl->channel0[0];
> in favour of explicit calculations in this very file
> i440bx/debug.c.
> Instead of the present patch, I also tried some variations
> in using a macro to perform the replacement of the original
> variable 'device' (meant to improve readablility), but some
> of those caused romcc to get stuck in a seemingly infinite
> loop, so there is something wrong with the parsing performed
> by romcc.

There are a couple of debug defines you can activate in romcc. But keep
in mind that romcc indeed takes forever because it can not spill
registers to any memory. I've seen romcc run 10 or more minutes before
it failed/succeeded compilation.

> Now, I would like to know, if the kind of code that the present
> patch introduces is at all acceptable by the project. In particular,
> it is that repeated 'ctrl->channel0[i]' that comes to my mind.
There's nothing principally wrong with it, but I suggest that for a
chipset as simple as the 440BX, you drop the ctrl structure completely.
The original author tried to mimic a scenario that is required on the
AMD K8 where you have several memory controllers and the SPD roms are
not assigned to fixed addresses. Instead of getting the actual values
via indirections and arrays, just assume they're at 0xa0 + 2 * i and
you'll be fine.

Also, did you evaluate the possibility of using cache as ram on the
system? That would get rid of the register pressure completely because
you can use the processor cache as your stack.

coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info at coresystems.dehttp://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20080829/c0902c7f/attachment.sig>

More information about the coreboot mailing list