[coreboot-gerrit] New patch to review for coreboot: ARMv8: Bootblock: Fix compile and runtime errors

Naman Govil (namangov@gmail.com) gerrit at coreboot.org
Wed Jul 8 19:46:46 CEST 2015


Naman Govil (namangov at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10854

-gerrit

commit 3e2bee6fed708132cf4240a9afdd03a8f1901990
Author: Akshay Saraswat <akshay.s at samsung.com>
Date:   Fri Sep 5 10:49:34 2014 +0530

    ARMv8: Bootblock: Fix compile and runtime errors
    
    This patch intends to fix following logical errors:
    1. bootblock.S is getting compiled everytime even if
       CONFIG_ARM_BOOTBLOCK_CUSTOM is not defined. bootblock.S
       contains same declarations as of id.S, hence, compiler
       complains for duplicate definitions.
    2. mmu_enable, exception_hwinit and arch_secondary_cpu_init function
       calls are happening for all stages without any check but the
       definitions for these functions are getting compiled only for
       ramstage. Obviously compiler doesn't find that definitions in case
       bootblock and complains.
    3. bootblock_cpu_init, bootblock_mainboard_init are required to be
       called from bootblock's main function when CPU_HAS_BOOTBLOCK_INIT and
       alike CONFIGS are enabled. But these function calls are commented.
    4. CONFIG_BOOTBLOCK_CONSOLE is always defined. When it is enbaled it
       contains value 1 in the final config else 0. Checking this config
       with #ifdef doesn't make sense, hence, replaced it with if.
    
    BRANCH=None
    BUG=None
    TEST=Compiled  and booted over Jazz board using linaro-4.8 gnu gcc
    	and didn't find errors related to this part of code
    
    Change-Id: I72fe02509c25e76c029ee6af0442f059adb54736
    Signed-off-by: Akshay Saraswat <akshay.s at samsung.com>
    Signed-off-by: Naman Govil <namangov at gmail.com>
---
 src/arch/arm64/armv8/Makefile.inc         |  3 ++-
 src/arch/arm64/armv8/bootblock_simple.c   | 12 ++++++------
 src/arch/arm64/c_entry.c                  | 17 +++++++++++++++++
 src/arch/arm64/include/bootblock_common.h |  6 +++++-
 4 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/src/arch/arm64/armv8/Makefile.inc b/src/arch/arm64/armv8/Makefile.inc
index 0c4778d..13181a8 100644
--- a/src/arch/arm64/armv8/Makefile.inc
+++ b/src/arch/arm64/armv8/Makefile.inc
@@ -32,8 +32,9 @@ armv8_asm_flags = $(armv8_flags)
 ################################################################################
 ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV8_64),y)
 
-ifneq ($(CONFIG_ARM64_BOOTBLOCK_CUSTOM),y)
+ifeq ($(CONFIG_ARM64_BOOTBLOCK_CUSTOM),y)
 bootblock-y += bootblock.S
+else
 bootblock-y += bootblock_simple.c
 endif
 bootblock-y += cache.c
diff --git a/src/arch/arm64/armv8/bootblock_simple.c b/src/arch/arm64/armv8/bootblock_simple.c
index 5e00890..c93a100 100644
--- a/src/arch/arm64/armv8/bootblock_simple.c
+++ b/src/arch/arm64/armv8/bootblock_simple.c
@@ -51,14 +51,14 @@ void main(void)
 	 */
 
 	if (boot_cpu()) {
-		//bootblock_cpu_init();
-		//bootblock_mainboard_init();
+		bootblock_cpu_init();
+		bootblock_mainboard_init();
 	}
 
-#ifdef CONFIG_BOOTBLOCK_CONSOLE
-	console_init();
-	exception_init();
-#endif
+	if (IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) {
+		console_init();
+		exception_init();
+	}
 
 	run_romstage();
 }
diff --git a/src/arch/arm64/c_entry.c b/src/arch/arm64/c_entry.c
index a4d4773..5970405 100644
--- a/src/arch/arm64/c_entry.c
+++ b/src/arch/arm64/c_entry.c
@@ -29,6 +29,12 @@ void __attribute__((weak)) arm64_soc_init(void)
 	/* Default weak implementation does nothing. */
 }
 
+unsigned int  __attribute__((weak)) smp_processor_id(void)
+{
+	/* Default weak implementation does nothing. */
+	return 0;
+}
+
 static void seed_stack(void)
 {
 	char *stack_begin;
@@ -57,6 +63,17 @@ static void arm64_init(void)
 	main();
 }
 
+static void secondary_cpu_start(void)
+{
+#ifndef __PRE_RAM__
+	mmu_enable();
+	exception_hwinit();
+
+	/* This will never return. */
+	arch_secondary_cpu_init();
+#endif
+}
+
 /*
  * This variable holds entry point for CPUs starting up. The first
  * element is the BSP path, and the second is the non-BSP path.
diff --git a/src/arch/arm64/include/bootblock_common.h b/src/arch/arm64/include/bootblock_common.h
index 2fa705f..ed6569e 100644
--- a/src/arch/arm64/include/bootblock_common.h
+++ b/src/arch/arm64/include/bootblock_common.h
@@ -5,7 +5,11 @@
 #ifdef CONFIG_BOOTBLOCK_MAINBOARD_INIT
 #include CONFIG_BOOTBLOCK_MAINBOARD_INIT
 #else
-static void bootblock_mainboard_init(void)
+static inline void bootblock_mainboard_init(void)
 {
+	/*
+	 * Do nothing.
+	 * Start adding activities as and when required
+	 */
 }
 #endif



More information about the coreboot-gerrit mailing list