Am 22.12.2009 23:17, schrieb Myles Watson:
On Tue, Dec 22, 2009 at 2:27 PM, Patrick Georgi <patrick@georgi-clan.de mailto:patrick@georgi-clan.de> wrote:
- Provide a framework to build image selection logic In newconfig, most boards have their own code to select the image. The goal in this layout is to have generic decision routines to take care of that, and encourage their use.
Is it possible to have it be generic? Won't we have to unify CMOS layouts for that to happen?
In a way, it's just the do_normal_boot() code in src/pc80/mc146818rtc_early.c. We already have everything in the tree to make it all generic, but we didn't properly use it. Maybe because the generic code came after the copied versions and no-one dared to refactor things.
It's not simply a port because of the intrusive change of moving CAR out of the bootblock, and this time, the generic code will be around from the start, so it has a chance to be used.
I think it would be a mistake to bring romcc to targets that don't need it now.
The alternative at that point is to do that code in assembly, or to move CAR to the bootblock again. romcc works quite fine for small code, and the code in the bootblock is supposed to be small.
- Look up fallback/romstage in CBFS (this can be extended with selection logic if desired) ("selection logic" is C, compiled with romcc, lookup is assembly)
It's more important to me to avoid assembly than to have the absolute minimum size bootblock. Especially for K8 & Fam10, there's plenty of space to not have to do this.
Among the reasons: The way it is done now, it's always exactly one copy of the tree walker. If it's written in C and compiled with romcc, it could end up several times in the bootblock, if there are various calls (fallback, normal, ...), probably giving the register allocator a harder time.
Picky detail: Since CONFIG_TINY_BOOTBLOCK is referenced in a Makefile that isn't board specific, the Kconfig entry for it should go there too (with a default n). There should just be a "select" in qemu-x86/Kconfig
Fixed, thanks for the reminder. I wanted to keep things minimal and forgot about it. It's not a big issue, as in Makefiles, missing variables simply expand to the empty string, but it's cleaner the way you proposed.
Acked-by: Myles Watson <mylesgw@gmail.com mailto:mylesgw@gmail.com>
Thanks, r4989