summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2019-10-23 18:58:06 +0200
committerPatrick Georgi <pgeorgi@google.com>2019-11-04 11:39:25 +0000
commita09d33ec88bc5a43e78a23d5ccc8fb7a87fda362 (patch)
treedf25fc329520e09ff002549c5d289f4fab670d29
parentbc78e014c548ae6e6689050735875120036d0da8 (diff)
downloadcoreboot-a09d33ec88bc5a43e78a23d5ccc8fb7a87fda362.tar.gz
coreboot-a09d33ec88bc5a43e78a23d5ccc8fb7a87fda362.tar.bz2
coreboot-a09d33ec88bc5a43e78a23d5ccc8fb7a87fda362.zip
arch/ppc64: Pass cbmem_top to ramstage via calling argument
This avoids the need for a platform specific implementation of cbmem_top. HOW TO TEST? There is no serial console for the qemu target... Change-Id: I68aa09a46786eba37c009c5f08642445805b08eb Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/36276 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marty E. Plummer <hanetzer@startmail.com> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r--src/arch/ppc64/Kconfig1
-rw-r--r--src/arch/ppc64/include/arch/stages.h2
-rw-r--r--src/arch/ppc64/stages.c5
-rw-r--r--src/mainboard/emulation/qemu-power8/Makefile.inc1
4 files changed, 6 insertions, 3 deletions
diff --git a/src/arch/ppc64/Kconfig b/src/arch/ppc64/Kconfig
index 0699e910ce7c..da9c155917f9 100644
--- a/src/arch/ppc64/Kconfig
+++ b/src/arch/ppc64/Kconfig
@@ -1,5 +1,6 @@
config ARCH_PPC64
bool
+ select RAMSTAGE_CBMEM_TOP_ARG
config ARCH_BOOTBLOCK_PPC64
bool
diff --git a/src/arch/ppc64/include/arch/stages.h b/src/arch/ppc64/include/arch/stages.h
index a4939b1758ba..37e9f85c8c45 100644
--- a/src/arch/ppc64/include/arch/stages.h
+++ b/src/arch/ppc64/include/arch/stages.h
@@ -16,6 +16,6 @@
#include <main_decl.h>
-void stage_entry(void) __attribute__((section(".text.stage_entry")));
+void stage_entry(uintptr_t stage_arg) __attribute__((section(".text.stage_entry")));
#endif
diff --git a/src/arch/ppc64/stages.c b/src/arch/ppc64/stages.c
index 3cc9371ffee1..aacf45f88fd1 100644
--- a/src/arch/ppc64/stages.c
+++ b/src/arch/ppc64/stages.c
@@ -22,9 +22,12 @@
* linker script.
*/
+#include <cbmem.h>
#include <arch/stages.h>
-void stage_entry(void)
+void stage_entry(uintptr_t stage_arg)
{
+ if (!ENV_ROMSTAGE_OR_BEFORE)
+ _cbmem_top_ptr = stage_arg;
main();
}
diff --git a/src/mainboard/emulation/qemu-power8/Makefile.inc b/src/mainboard/emulation/qemu-power8/Makefile.inc
index 5c6c56e5de46..307cb191bdb2 100644
--- a/src/mainboard/emulation/qemu-power8/Makefile.inc
+++ b/src/mainboard/emulation/qemu-power8/Makefile.inc
@@ -15,7 +15,6 @@
bootblock-y += bootblock.c
bootblock-y += uart.c
romstage-y += cbmem.c
-ramstage-y += cbmem.c
romstage-y += romstage.c
ramstage-y += timer.c
romstage-y += uart.c