[coreboot] New patch to review for coreboot: 9f4c566 snow: switch to stack in DRAM once in ramstage

David Hendricks (dhendrix@chromium.org) gerrit at coreboot.org
Mon Feb 11 01:07:14 CET 2013


David Hendricks (dhendrix at chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2350

-gerrit

commit 9f4c56689b01efcedf91a86acf7eb194fb7b6fc9
Author: David Hendricks <dhendrix at chromium.org>
Date:   Sun Feb 10 15:59:22 2013 -0800

    snow: switch to stack in DRAM once in ramstage
    
    This patch gives us some stack space in RAM and sets our stack
    pointer to once we begin ramstage.
    
    Note: We may not need this patch after all since we should have
    plenty of stack space in SRAM. It might be simpler (and perhaps
    faster) to keep the stack in SRAM.
    
    (credit to Gabe for this one, I'm just putting it up on gerrit)
    
    Change-Id: I2e447d6359d52e4615e1cd7811e6f167e3dc314b
    Signed-off-by: David Hendricks <dhendrix at chromium.org>
    Signed-off-by: Gabe Black <gabeblack at chromium.org>
---
 src/arch/armv7/Kconfig               |  4 ++++
 src/mainboard/google/snow/ramstage.c | 13 ++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/arch/armv7/Kconfig b/src/arch/armv7/Kconfig
index 488ca97..fe36d79 100644
--- a/src/arch/armv7/Kconfig
+++ b/src/arch/armv7/Kconfig
@@ -49,4 +49,8 @@ config ARM_DCACHE_POLICY_WRITETHROUGH
 	bool
 	default n
 
+config STACK_SIZE
+	hex
+	default 0x1000
+
 endmenu
diff --git a/src/mainboard/google/snow/ramstage.c b/src/mainboard/google/snow/ramstage.c
index d280dbe..2045c5f 100644
--- a/src/mainboard/google/snow/ramstage.c
+++ b/src/mainboard/google/snow/ramstage.c
@@ -17,6 +17,7 @@
  * MA 02111-1307 USA
  */
 
+#include <lib.h>
 #include <console/console.h>
 
 #if CONFIG_WRITE_HIGH_TABLES
@@ -24,7 +25,7 @@
 #endif
 
 void hardwaremain(int boot_complete);
-void main(void)
+static void real_main(void)
 {
 	console_init();
 	printk(BIOS_INFO, "hello from ramstage\n");
@@ -37,3 +38,13 @@ void main(void)
 
 	hardwaremain(0);
 }
+
+void main(void)
+{
+	__asm__ __volatile__(
+		"mov sp, %0\n\r"
+		"mov pc, %1\n\r"
+		:
+		:"r"(_estack), "r"(&real_main)
+	);
+}



More information about the coreboot mailing list