arch/x86: Use the stage argument to implement cbmem_top
commit7c9a0e8a9cfa90f8f413f3b485f8103bca80fac6
authorArthur Heymans <arthur@aheymans.xyz>
Wed, 23 Oct 2019 15:02:50 +0000 (23 17:02 +0200)
committerArthur Heymans <arthur@aheymans.xyz>
Sun, 3 Nov 2019 11:18:31 +0000 (3 11:18 +0000)
treed5b9e20eec7f0a969978eca5bf25da5d1c1d812c
parent463ad5169dfe958637c7514149bd91630ee07f7e
arch/x86: Use the stage argument to implement cbmem_top

Currently all stages that need cbmem need an implementation of a
cbmem_top function.  On FSP and AGESA platforms this proves to be
painful and a pointer to the top of lower memory if often passed via
lower memory (e.g. EBDA) or via a PCI scratchpad register.

The problem with writing to lower memory is that also need to be
written on S3 as one cannot assume it to be still there. Writing
things on S3 is always a fragile thing to do.

A very generic solution is to pass cbmem_top via the program argument.
It should be possible to implement this solution on every
architecture.

Instead trying to figure out which files can be removed from stages
and which cbmem_top implementations need with preprocessor, rename all
cbmem_top implementation to cbmem_top_romstage.

TESTED on qemu-x86.

Change-Id: I6d5a366d6f1bc76f26d459628237e6b2c8ae03ea
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36144
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
src/arch/x86/Kconfig
src/arch/x86/Makefile.inc
src/arch/x86/c_start.S
src/arch/x86/cbmem.c
src/arch/x86/exit_car.S
src/northbridge/intel/e7505/Makefile.inc
src/northbridge/intel/fsp_rangeley/Makefile.inc
src/northbridge/intel/i440bx/Makefile.inc
src/soc/intel/quark/Makefile.inc