[coreboot] [PATCH] make AMD CAR disable a C function

Stefan Reinauer stepan at coresystems.de
Sun May 16 20:35:05 CEST 2010


On 5/16/10 7:50 PM, Kevin O'Connor wrote:
> The AMD disable_cache_as_ram can be C code, but the other
> architectures can not.  It would be nice if there was a single calling
> convention for this capability across architectures.
>
> Maybe something like:
>
> void __regparm(3) __noreturn disable_car(void (*func)(u32), u32 param, u32 esp);
>
> which would call func(param) on the stack specified by 'esp'.  The
> caller would then do something like:
>
> void romstage(u32 bist) {
>     ...
>     disable_car(load_ramstage, bist, CONFIG_RAMTOP)
> }
>
> void load_ramstage(u32 bist) {
>     ...
> }

I agree. Right now AMD (K8/K10) is the only exception to the coreboot
calling convention. All other CPU types return to cache_as_ram.inc from
romstage.c:main(). Then cache_as_ram.inc disables cache as ram, sets up
the stack and loads the ramstage with the C function copy_and_run().

Stefan




More information about the coreboot mailing list