x86: kconfig: Select ARCH_EARLY_INIT_R in the platform Kconfig
authorBin Meng <bmeng.cn@gmail.com>
Sun, 30 Jul 2017 13:23:13 +0000 (06:23 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Tue, 1 Aug 2017 12:17:02 +0000 (20:17 +0800)
This is architecture-dependent early initialization hence should
be put in the platform Kconfig.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
22 files changed:
arch/x86/cpu/broadwell/Kconfig
arch/x86/cpu/broadwell/refcode.c
arch/x86/cpu/qemu/Kconfig
arch/x86/cpu/quark/Kconfig
arch/x86/cpu/queensbay/Kconfig
arch/x86/include/asm/cpu.h
board/advantech/som-db5800-som-6867/som-db5800-som-6867.c
board/congatec/conga-qeval20-qa3-e3845/conga-qeval20-qa3.c
board/coreboot/coreboot/Makefile
board/coreboot/coreboot/coreboot.c [deleted file]
board/efi/efi-x86/efi.c
board/google/chromebook_link/link.c
board/google/chromebook_samus/samus.c
board/google/chromebox_panther/panther.c
board/intel/minnowmax/minnowmax.c
common/Kconfig
configs/bayleybay_defconfig
configs/cougarcanyon2_defconfig
configs/dfi-bt700-q7x-151_defconfig
configs/edison_defconfig
configs/efi-x86_defconfig
configs/theadorable-x86-dfi-bt700_defconfig

index 8501949..f3006c3 100644 (file)
@@ -6,6 +6,7 @@
 config INTEL_BROADWELL
        bool
        select CACHE_MRC_BIN
+       select ARCH_EARLY_INIT_R
        imply HAVE_INTEL_ME
 
 if INTEL_BROADWELL
index 436c6c4..4fa4de3 100644 (file)
@@ -56,7 +56,17 @@ struct rmodule_header {
        uint32_t padding[4];
 } __packed;
 
-int cpu_run_reference_code(void)
+/**
+ * cpu_run_reference_code() - Run the platform reference code
+ *
+ * Some platforms require a binary blob to be executed once SDRAM is
+ * available. This is used to set up various platform features, such as the
+ * platform controller hub (PCH). This function should be implemented by the
+ * CPU-specific code.
+ *
+ * @return 0 on success, -ve on failure
+ */
+static int cpu_run_reference_code(void)
 {
        struct pei_data _pei_data __aligned(8);
        struct pei_data *pei_data = &_pei_data;
@@ -111,3 +121,8 @@ int cpu_run_reference_code(void)
 
        return 0;
 }
+
+int arch_early_init_r(void)
+{
+       return cpu_run_reference_code();
+}
index 6808c9a..6f61744 100644 (file)
@@ -6,6 +6,7 @@
 
 config QEMU
        bool
+       select ARCH_EARLY_INIT_R
 
 if QEMU
 
index 641aa22..9e7d983 100644 (file)
@@ -7,6 +7,7 @@
 config INTEL_QUARK
        bool
        select HAVE_RMU
+       select ARCH_EARLY_INIT_R
        select ARCH_MISC_INIT
 
 if INTEL_QUARK
index 6136d75..e2dfe19 100644 (file)
@@ -8,6 +8,7 @@ config INTEL_QUEENSBAY
        bool
        select HAVE_FSP
        select HAVE_CMC
+       select ARCH_EARLY_INIT_R
 
 if INTEL_QUEENSBAY
 
index c00687a..bc2c4ff 100644 (file)
@@ -288,16 +288,4 @@ u32 cpu_get_family_model(void);
  */
 u32 cpu_get_stepping(void);
 
-/**
- * cpu_run_reference_code() - Run the platform reference code
- *
- * Some platforms require a binary blob to be executed once SDRAM is
- * available. This is used to set up various platform features, such as the
- * platform controller hub (PCH). This function should be implemented by the
- * CPU-specific code.
- *
- * @return 0 on success, -ve on failure
- */
-int cpu_run_reference_code(void);
-
 #endif
index 5bed2c1..6158795 100644 (file)
@@ -17,8 +17,3 @@ int board_early_init_f(void)
 
        return 0;
 }
-
-int arch_early_init_r(void)
-{
-       return 0;
-}
index 7a5b765..1283eeb 100644 (file)
@@ -28,11 +28,6 @@ int board_early_init_f(void)
        return 0;
 }
 
-int arch_early_init_r(void)
-{
-       return 0;
-}
-
 int board_late_init(void)
 {
        struct udevice *dev;
index 27ebe78..4f2ac89 100644 (file)
@@ -12,4 +12,4 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-y  += coreboot_start.o coreboot.o
+obj-y  += coreboot_start.o
diff --git a/board/coreboot/coreboot/coreboot.c b/board/coreboot/coreboot/coreboot.c
deleted file mode 100644 (file)
index bb7f778..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright (C) 2013 Google, Inc
- *
- * SPDX-License-Identifier:    GPL-2.0+
- */
-
-#include <common.h>
-#include <cros_ec.h>
-#include <asm/gpio.h>
-
-int arch_early_init_r(void)
-{
-       return 0;
-}
index 1fbe36a..2adc202 100644 (file)
@@ -5,9 +5,3 @@
  */
 
 #include <common.h>
-#include <asm/gpio.h>
-
-int arch_early_init_r(void)
-{
-       return 0;
-}
index 64e7c1a..dc22592 100644 (file)
@@ -5,14 +5,3 @@
  */
 
 #include <common.h>
-#include <cros_ec.h>
-#include <dm.h>
-#include <asm/gpio.h>
-#include <asm/io.h>
-#include <asm/pci.h>
-#include <asm/arch/pch.h>
-
-int arch_early_init_r(void)
-{
-       return 0;
-}
index 356b92a..5b5eb19 100644 (file)
@@ -5,9 +5,3 @@
  */
 
 #include <common.h>
-#include <asm/cpu.h>
-
-int arch_early_init_r(void)
-{
-       return cpu_run_reference_code();
-}
index ed60e44..2adc202 100644 (file)
@@ -5,9 +5,3 @@
  */
 
 #include <common.h>
-#include <asm/arch/pch.h>
-
-int arch_early_init_r(void)
-{
-       return 0;
-}
index 99aed53..5bdb2fd 100644 (file)
 
 #define GPIO_BANKE_NAME                "gpioe"
 
-int arch_early_init_r(void)
-{
-       return 0;
-}
-
 int misc_init_r(void)
 {
        struct udevice *dev;
index 1645ae9..0983891 100644 (file)
@@ -871,7 +871,6 @@ menu "Start-up hooks"
 
 config ARCH_EARLY_INIT_R
        bool "Call arch-specific init soon after relocation"
-       default y if X86
        help
          With this option U-Boot will call arch_early_init_r() soon after
          relocation. Driver model is running by this point, and the cache
index 9436784..bf00390 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_FIT=y
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
-# CONFIG_ARCH_EARLY_INIT_R is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
 # CONFIG_CMD_IMLS is not set
index 2e729fa..84856aa 100644 (file)
@@ -5,7 +5,6 @@ CONFIG_TARGET_COUGARCANYON2=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
-# CONFIG_ARCH_EARLY_INIT_R is not set
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
index bed4f28..76cdf55 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_FIT_SIGNATURE=y
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
-# CONFIG_ARCH_EARLY_INIT_R is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
 # CONFIG_CMD_IMLS is not set
index ba43b47..02c09aa 100644 (file)
@@ -3,7 +3,6 @@ CONFIG_VENDOR_INTEL=y
 CONFIG_DEFAULT_DEVICE_TREE="edison"
 CONFIG_TARGET_EDISON=y
 CONFIG_SMP=y
-# CONFIG_ARCH_EARLY_INIT_R is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
 # CONFIG_CMD_IMLS is not set
index 20681b0..7495da4 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_FIT=y
 CONFIG_ENV_IS_NOWHERE=y
 CONFIG_CONSOLE_MUX=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
-# CONFIG_ARCH_EARLY_INIT_R is not set
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_BOOTM is not set
 # CONFIG_CMD_IMLS is not set
index 64af353..dee551b 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_FIT_SIGNATURE=y
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
-# CONFIG_ARCH_EARLY_INIT_R is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
 # CONFIG_CMD_IMLS is not set