summaryrefslogtreecommitdiff
path: root/arch/x86/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/cpu')
-rw-r--r--arch/x86/cpu/Makefile22
-rw-r--r--arch/x86/cpu/apollolake/Makefile10
-rw-r--r--arch/x86/cpu/apollolake/cpu_spl.c4
-rw-r--r--arch/x86/cpu/apollolake/fsp_bindings.c4
-rw-r--r--arch/x86/cpu/apollolake/hostbridge.c2
-rw-r--r--arch/x86/cpu/apollolake/lpc.c2
-rw-r--r--arch/x86/cpu/apollolake/pch.c2
-rw-r--r--arch/x86/cpu/apollolake/pmc.c4
-rw-r--r--arch/x86/cpu/apollolake/punit.c2
-rw-r--r--arch/x86/cpu/apollolake/spl.c2
-rw-r--r--arch/x86/cpu/broadwell/Makefile14
-rw-r--r--arch/x86/cpu/broadwell/cpu.c14
-rw-r--r--arch/x86/cpu/broadwell/cpu_full.c2
-rw-r--r--arch/x86/cpu/broadwell/pch.c2
-rw-r--r--arch/x86/cpu/config.mk2
-rw-r--r--arch/x86/cpu/coreboot/Makefile2
-rw-r--r--arch/x86/cpu/coreboot/coreboot.c14
-rw-r--r--arch/x86/cpu/coreboot/timestamp.c11
-rw-r--r--arch/x86/cpu/cpu.c12
-rw-r--r--arch/x86/cpu/cpu_x86.c1
-rw-r--r--arch/x86/cpu/efi/app.c5
-rw-r--r--arch/x86/cpu/efi/payload.c5
-rw-r--r--arch/x86/cpu/i386/cpu.c101
-rw-r--r--arch/x86/cpu/i386/interrupt.c2
-rw-r--r--arch/x86/cpu/intel_common/Makefile20
-rw-r--r--arch/x86/cpu/intel_common/mrc.c2
-rw-r--r--arch/x86/cpu/intel_common/p2sb.c6
-rw-r--r--arch/x86/cpu/ivybridge/Makefile8
-rw-r--r--arch/x86/cpu/ivybridge/cpu.c14
-rw-r--r--arch/x86/cpu/mtrr.c2
-rw-r--r--arch/x86/cpu/qemu/Makefile2
-rw-r--r--arch/x86/cpu/qemu/qemu.c6
-rw-r--r--arch/x86/cpu/quark/quark.c6
-rw-r--r--arch/x86/cpu/slimbootloader/slimbootloader.c5
-rw-r--r--arch/x86/cpu/tangier/tangier.c5
-rw-r--r--arch/x86/cpu/x86_64/cpu.c6
-rw-r--r--arch/x86/cpu/x86_64/misc.c5
37 files changed, 146 insertions, 182 deletions
diff --git a/arch/x86/cpu/Makefile b/arch/x86/cpu/Makefile
index 16e67e3da24..39c8b0835cc 100644
--- a/arch/x86/cpu/Makefile
+++ b/arch/x86/cpu/Makefile
@@ -6,16 +6,16 @@
# (C) Copyright 2002
# Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
-ifeq ($(CONFIG_$(SPL_)X86_64),y)
+ifeq ($(CONFIG_$(XPL_)X86_64),y)
extra-y = start64.o
else
-ifeq ($(CONFIG_$(SPL_TPL_)X86_16BIT_INIT),y)
+ifeq ($(CONFIG_$(PHASE_)X86_16BIT_INIT),y)
extra-y = start.o
else
ifndef CONFIG_SPL
extra-y = start.o
else
-ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_XPL_BUILD
extra-y = start_from_tpl.o
else
extra-y = start_from_spl.o
@@ -24,14 +24,14 @@ endif
endif
endif
-extra-$(CONFIG_$(SPL_TPL_)X86_16BIT_INIT) += resetvec.o start16.o
+extra-$(CONFIG_$(PHASE_)X86_16BIT_INIT) += resetvec.o start16.o
obj-y += cpu.o
ifndef CONFIG_TPL_BUILD
obj-y += cpu_x86.o
endif
-ifndef CONFIG_$(SPL_)X86_64
+ifndef CONFIG_$(XPL_)X86_64
AFLAGS_REMOVE_call32.o := -mregparm=3 \
$(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32)
AFLAGS_call32.o := -fpic -fshort-wchar \
@@ -54,23 +54,23 @@ obj-$(CONFIG_INTEL_QUARK) += quark/
obj-$(CONFIG_INTEL_QUEENSBAY) += queensbay/
obj-$(CONFIG_INTEL_TANGIER) += tangier/
obj-$(CONFIG_APIC) += lapic.o ioapic.o
-obj-$(CONFIG_$(SPL_TPL_)ACPI_GPE) += acpi_gpe.o
+obj-$(CONFIG_$(PHASE_)ACPI_GPE) += acpi_gpe.o
obj-$(CONFIG_QFW) += qfw_cpu.o
ifndef CONFIG_SYS_COREBOOT
-obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += irq.o
+obj-$(CONFIG_$(PHASE_)X86_32BIT_INIT) += irq.o
endif
-ifndef CONFIG_$(SPL_)X86_64
-obj-$(CONFIG_$(SPL_)SMP) += mp_init.o
+ifndef CONFIG_$(XPL_)X86_64
+obj-$(CONFIG_$(XPL_)SMP) += mp_init.o
endif
obj-y += mtrr.o
obj-$(CONFIG_PCI) += pci.o
-ifndef CONFIG_$(SPL_)X86_64
+ifndef CONFIG_$(XPL_)X86_64
obj-$(CONFIG_SMP) += sipi_vector.o
endif
obj-y += turbo.o
obj-$(CONFIG_HAVE_ACPI_RESUME) += wakeup.o
-ifeq ($(CONFIG_$(SPL_)X86_64),y)
+ifeq ($(CONFIG_$(XPL_)X86_64),y)
obj-y += x86_64/
else
obj-y += i386/
diff --git a/arch/x86/cpu/apollolake/Makefile b/arch/x86/cpu/apollolake/Makefile
index 2ddf4af62c5..f481f40d9bb 100644
--- a/arch/x86/cpu/apollolake/Makefile
+++ b/arch/x86/cpu/apollolake/Makefile
@@ -2,20 +2,20 @@
#
# Copyright 2019 Google LLC
-obj-$(CONFIG_SPL_BUILD) += cpu_spl.o
-obj-$(CONFIG_SPL_BUILD) += spl.o
-obj-$(CONFIG_SPL_BUILD) += systemagent.o
+obj-$(CONFIG_XPL_BUILD) += cpu_spl.o
+obj-$(CONFIG_XPL_BUILD) += spl.o
+obj-$(CONFIG_XPL_BUILD) += systemagent.o
obj-y += cpu_common.o
ifndef CONFIG_TPL_BUILD
obj-y += cpu.o
obj-y += punit.o
obj-y += fsp_bindings.o
-ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_XPL_BUILD
obj-y += fsp_m.o
endif
endif
-ifndef CONFIG_SPL_BUILD
+ifndef CONFIG_XPL_BUILD
obj-y += acpi.o
obj-y += fsp_s.o
endif
diff --git a/arch/x86/cpu/apollolake/cpu_spl.c b/arch/x86/cpu/apollolake/cpu_spl.c
index 8798fa79d4c..8198667fa50 100644
--- a/arch/x86/cpu/apollolake/cpu_spl.c
+++ b/arch/x86/cpu/apollolake/cpu_spl.c
@@ -184,9 +184,9 @@ int arch_cpu_init(void)
{
int ret = 0;
- if (spl_phase() == PHASE_TPL)
+ if (xpl_phase() == PHASE_TPL)
ret = arch_cpu_init_tpl();
- else if (spl_phase() == PHASE_SPL)
+ else if (xpl_phase() == PHASE_SPL)
ret = arch_cpu_init_spl();
if (ret)
printf("%s: Error %d\n", __func__, ret);
diff --git a/arch/x86/cpu/apollolake/fsp_bindings.c b/arch/x86/cpu/apollolake/fsp_bindings.c
index f6fbddce922..b4bb677f5cd 100644
--- a/arch/x86/cpu/apollolake/fsp_bindings.c
+++ b/arch/x86/cpu/apollolake/fsp_bindings.c
@@ -247,7 +247,7 @@ static int fsp_update_config_from_dtb(ofnode node, u8 *cfg,
return 0;
}
-#if defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_XPL_BUILD)
const struct fsp_binding fsp_m_bindings[] = {
{
.type = FSP_UINT32,
@@ -653,7 +653,7 @@ int fsp_m_update_config_from_dtb(ofnode node, struct fsp_m_config *cfg)
}
#endif
-#if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD)
+#if !defined(CONFIG_XPL_BUILD) && !defined(CONFIG_TPL_BUILD)
const struct fsp_binding fsp_s_bindings[] = {
{
.type = FSP_UINT8,
diff --git a/arch/x86/cpu/apollolake/hostbridge.c b/arch/x86/cpu/apollolake/hostbridge.c
index 9ee362239ef..039236df02d 100644
--- a/arch/x86/cpu/apollolake/hostbridge.c
+++ b/arch/x86/cpu/apollolake/hostbridge.c
@@ -255,7 +255,7 @@ static int apl_hostbridge_of_to_plat(struct udevice *dev)
static int apl_hostbridge_probe(struct udevice *dev)
{
- if (spl_phase() == PHASE_TPL)
+ if (xpl_phase() == PHASE_TPL)
return apl_hostbridge_early_init(dev);
return 0;
diff --git a/arch/x86/cpu/apollolake/lpc.c b/arch/x86/cpu/apollolake/lpc.c
index 531ff1cd91f..f34c199bf73 100644
--- a/arch/x86/cpu/apollolake/lpc.c
+++ b/arch/x86/cpu/apollolake/lpc.c
@@ -80,7 +80,7 @@ int lpc_open_pmio_window(uint base, uint size)
lgir_reg_num = find_unused_pmio_window();
if (lgir_reg_num < 0) {
- if (spl_phase() > PHASE_TPL) {
+ if (xpl_phase() > PHASE_TPL) {
log_err("LPC: Cannot open IO window: %lx size %lx\n",
bridge_base, size - bridged_size);
log_err("No more IO windows\n");
diff --git a/arch/x86/cpu/apollolake/pch.c b/arch/x86/cpu/apollolake/pch.c
index 32190312ff8..07ef26f6bde 100644
--- a/arch/x86/cpu/apollolake/pch.c
+++ b/arch/x86/cpu/apollolake/pch.c
@@ -12,7 +12,7 @@
static int apl_set_spi_protect(struct udevice *dev, bool protect)
{
- if (spl_phase() == PHASE_SPL)
+ if (xpl_phase() == PHASE_SPL)
return lpc_set_spi_protect(dev, BIOS_CTRL, protect);
return 0;
diff --git a/arch/x86/cpu/apollolake/pmc.c b/arch/x86/cpu/apollolake/pmc.c
index 32fd0344861..bfb8a07d47a 100644
--- a/arch/x86/cpu/apollolake/pmc.c
+++ b/arch/x86/cpu/apollolake/pmc.c
@@ -115,7 +115,7 @@ int apl_pmc_ofdata_to_uc_plat(struct udevice *dev)
ARRAY_SIZE(base));
if (ret)
return log_msg_ret("Missing/short early-regs", ret);
- if (spl_phase() == PHASE_TPL) {
+ if (xpl_phase() == PHASE_TPL) {
upriv->pmc_bar0 = (void *)base[0];
upriv->pmc_bar2 = (void *)base[2];
@@ -186,7 +186,7 @@ static int enable_pmcbar(struct udevice *dev)
static int apl_pmc_probe(struct udevice *dev)
{
- if (spl_phase() == PHASE_TPL) {
+ if (xpl_phase() == PHASE_TPL) {
return enable_pmcbar(dev);
} else {
struct acpi_pmc_upriv *upriv = dev_get_uclass_priv(dev);
diff --git a/arch/x86/cpu/apollolake/punit.c b/arch/x86/cpu/apollolake/punit.c
index b1503c25140..9c708e9df55 100644
--- a/arch/x86/cpu/apollolake/punit.c
+++ b/arch/x86/cpu/apollolake/punit.c
@@ -77,7 +77,7 @@ static int punit_init(struct udevice *dev)
static int apl_punit_probe(struct udevice *dev)
{
- if (spl_phase() == PHASE_SPL)
+ if (xpl_phase() == PHASE_SPL)
return punit_init(dev);
return 0;
diff --git a/arch/x86/cpu/apollolake/spl.c b/arch/x86/cpu/apollolake/spl.c
index b351d73e7d8..510f8c4350f 100644
--- a/arch/x86/cpu/apollolake/spl.c
+++ b/arch/x86/cpu/apollolake/spl.c
@@ -116,7 +116,7 @@ static int spl_fast_spi_load_image(struct spl_image_info *spl_image,
return ret;
spl_image->size = CONFIG_SYS_MONITOR_LEN; /* We don't know SPL size */
- spl_image->entry_point = spl_phase() == PHASE_TPL ?
+ spl_image->entry_point = xpl_phase() == PHASE_TPL ?
CONFIG_SPL_TEXT_BASE : CONFIG_TEXT_BASE;
spl_image->load_addr = spl_image->entry_point;
spl_image->os = IH_OS_U_BOOT;
diff --git a/arch/x86/cpu/broadwell/Makefile b/arch/x86/cpu/broadwell/Makefile
index 3e1f76d6118..dfe013e3833 100644
--- a/arch/x86/cpu/broadwell/Makefile
+++ b/arch/x86/cpu/broadwell/Makefile
@@ -2,23 +2,23 @@
#
# Copyright (c) 2016 Google, Inc
-obj-$(CONFIG_$(SPL_TPL_)X86_16BIT_INIT) += cpu.o
-obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += cpu_full.o
+obj-$(CONFIG_$(PHASE_)X86_16BIT_INIT) += cpu.o
+obj-$(CONFIG_$(PHASE_)X86_32BIT_INIT) += cpu_full.o
ifdef CONFIG_SPL
-ifndef CONFIG_SPL_BUILD
+ifndef CONFIG_XPL_BUILD
obj-y += cpu_from_spl.o
obj-y += cpu_full.o
obj-y += refcode.o
endif
-ifndef CONFIG_SPL_BUILD
+ifndef CONFIG_XPL_BUILD
# obj-y += cpu_from_spl.o
obj-y += adsp.o
obj-y += sata.o
endif
endif
-ifeq ($(CONFIG_$(SPL_TPL_)X86_32BIT_INIT),)
+ifeq ($(CONFIG_$(PHASE_)X86_32BIT_INIT),)
#obj-y += cpu_from_spl.o
endif
@@ -29,5 +29,5 @@ obj-y += northbridge.o
obj-y += pch.o
obj-y += pinctrl_broadwell.o
obj-y += power_state.o
-obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += refcode.o
-obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += sdram.o
+obj-$(CONFIG_$(PHASE_)X86_32BIT_INIT) += refcode.o
+obj-$(CONFIG_$(PHASE_)X86_32BIT_INIT) += sdram.o
diff --git a/arch/x86/cpu/broadwell/cpu.c b/arch/x86/cpu/broadwell/cpu.c
index dc6717eca40..8127d31e57e 100644
--- a/arch/x86/cpu/broadwell/cpu.c
+++ b/arch/x86/cpu/broadwell/cpu.c
@@ -68,7 +68,7 @@ int arch_cpu_init(void)
post_code(POST_CPU_INIT);
/* Do a mini-init if TPL has already done the full init */
- if (IS_ENABLED(CONFIG_TPL) && spl_phase() != PHASE_TPL)
+ if (IS_ENABLED(CONFIG_TPL) && xpl_phase() != PHASE_TPL)
return x86_cpu_reinit_f();
else
return x86_cpu_init_f();
@@ -88,18 +88,6 @@ int checkcpu(void)
return 0;
}
-int print_cpuinfo(void)
-{
- char processor_name[CPU_MAX_NAME_LEN];
- const char *name;
-
- /* Print processor name */
- name = cpu_get_name(processor_name);
- printf("CPU: %s\n", name);
-
- return 0;
-}
-
void board_debug_uart_init(void)
{
/* com1 / com2 decode range */
diff --git a/arch/x86/cpu/broadwell/cpu_full.c b/arch/x86/cpu/broadwell/cpu_full.c
index c43fb7a608b..529dab18d5d 100644
--- a/arch/x86/cpu/broadwell/cpu_full.c
+++ b/arch/x86/cpu/broadwell/cpu_full.c
@@ -84,7 +84,7 @@ static const u8 power_limit_time_msr_to_sec[] = {
[0x11] = 128,
};
-#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD)
+#if defined(CONFIG_XPL_BUILD) && !defined(CONFIG_TPL_BUILD)
int arch_cpu_init(void)
{
return 0;
diff --git a/arch/x86/cpu/broadwell/pch.c b/arch/x86/cpu/broadwell/pch.c
index 2c8b7380d96..5b6147432a7 100644
--- a/arch/x86/cpu/broadwell/pch.c
+++ b/arch/x86/cpu/broadwell/pch.c
@@ -606,7 +606,7 @@ static int broadwell_pch_probe(struct udevice *dev)
return broadwell_pch_early_init(dev);
else
return broadwell_pch_init(dev);
- } else if (IS_ENABLED(CONFIG_SPL) && !IS_ENABLED(CONFIG_SPL_BUILD)) {
+ } else if (IS_ENABLED(CONFIG_SPL) && !IS_ENABLED(CONFIG_XPL_BUILD)) {
return broadwell_pch_init(dev);
} else {
return 0;
diff --git a/arch/x86/cpu/config.mk b/arch/x86/cpu/config.mk
index 87e242a2065..6acdf9b3b23 100644
--- a/arch/x86/cpu/config.mk
+++ b/arch/x86/cpu/config.mk
@@ -9,7 +9,7 @@ LDPPFLAGS += -DRESET_VEC_LOC=$(CONFIG_RESET_VEC_LOC)
LDPPFLAGS += -DSTART_16=$(CONFIG_SYS_X86_START16)
ifdef CONFIG_X86_64
-ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_EFI_APP),)
+ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_EFI_APP),)
LDSCRIPT = $(srctree)/arch/x86/cpu/u-boot-64.lds
endif
endif
diff --git a/arch/x86/cpu/coreboot/Makefile b/arch/x86/cpu/coreboot/Makefile
index a6cdb9a1485..a6c7d0e56d5 100644
--- a/arch/x86/cpu/coreboot/Makefile
+++ b/arch/x86/cpu/coreboot/Makefile
@@ -14,7 +14,7 @@
ifndef CONFIG_SPL
obj-y += car.o
endif
-ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_XPL_BUILD
obj-y += coreboot_spl.o
else
obj-y += sdram.o
diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
index d474c79e25e..fa7430b436f 100644
--- a/arch/x86/cpu/coreboot/coreboot.c
+++ b/arch/x86/cpu/coreboot/coreboot.c
@@ -38,16 +38,6 @@ int arch_cpu_init(void)
return 0;
}
-int checkcpu(void)
-{
- return 0;
-}
-
-int print_cpuinfo(void)
-{
- return default_print_cpuinfo();
-}
-
static void board_final_init(void)
{
/*
@@ -82,7 +72,9 @@ static void board_final_init(void)
static int last_stage_init(void)
{
- if (IS_ENABLED(CONFIG_SPL_BUILD))
+ timestamp_add_to_bootstage();
+
+ if (IS_ENABLED(CONFIG_XPL_BUILD))
return 0;
board_final_init();
diff --git a/arch/x86/cpu/coreboot/timestamp.c b/arch/x86/cpu/coreboot/timestamp.c
index ec4003c4e77..681191d85bb 100644
--- a/arch/x86/cpu/coreboot/timestamp.c
+++ b/arch/x86/cpu/coreboot/timestamp.c
@@ -6,13 +6,12 @@
*/
#include <bootstage.h>
+#include <errno.h>
#include <asm/arch/timestamp.h>
#include <asm/cb_sysinfo.h>
#include <asm/u-boot-x86.h>
#include <linux/compiler.h>
-static struct timestamp_table *ts_table __section(".data");
-
void timestamp_init(void)
{
timestamp_add_now(TS_U_BOOT_INITTED);
@@ -20,6 +19,8 @@ void timestamp_init(void)
void timestamp_add(enum timestamp_id id, uint64_t ts_time)
{
+ const struct sysinfo_t *info = cb_get_sysinfo();
+ struct timestamp_table *ts_table = info->tstamp_table;
struct timestamp_entry *tse;
if (!ts_table || (ts_table->num_entries == ts_table->max_entries))
@@ -37,13 +38,15 @@ void timestamp_add_now(enum timestamp_id id)
int timestamp_add_to_bootstage(void)
{
+ const struct sysinfo_t *info = cb_get_sysinfo();
+ const struct timestamp_table *ts_table = info->tstamp_table;
uint i;
if (!ts_table)
- return -1;
+ return -ENOENT;
for (i = 0; i < ts_table->num_entries; i++) {
- struct timestamp_entry *tse = &ts_table->entries[i];
+ const struct timestamp_entry *tse = &ts_table->entries[i];
const char *name = NULL;
switch (tse->entry_id) {
diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index ad21fdb457a..a8b21406ac0 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -163,8 +163,11 @@ char *cpu_get_name(char *name)
return ptr;
}
-int default_print_cpuinfo(void)
+#if !CONFIG_IS_ENABLED(CPU)
+int print_cpuinfo(void)
{
+ post_code(POST_CPU_INFO);
+
printf("CPU: %s, vendor %s, device %xh\n",
cpu_has_64bit() ? "x86_64" : "x86",
cpu_vendor_name(gd->arch.x86_vendor), gd->arch.x86_device);
@@ -176,6 +179,7 @@ int default_print_cpuinfo(void)
return 0;
}
+#endif
#if CONFIG_IS_ENABLED(SHOW_BOOT_PROGRESS)
void show_boot_progress(int val)
@@ -185,7 +189,7 @@ void show_boot_progress(int val)
#endif
#if !defined(CONFIG_SYS_COREBOOT) && !defined(CONFIG_EFI_STUB) && \
- !defined(CONFIG_SPL_BUILD)
+ !defined(CONFIG_XPL_BUILD)
/*
* Implement a weak default function for boards that need to do some final init
* before the system is ready.
@@ -247,7 +251,7 @@ static int last_stage_init(void)
}
EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
-#endif /* !SYS_COREBOOT && !EFI_STUB && !SPL_BUILD */
+#endif /* !SYS_COREBOOT && !EFI_STUB && !XPL_BUILD */
static int x86_init_cpus(void)
{
@@ -336,7 +340,7 @@ int reserve_arch(void)
}
#endif
-long detect_coreboot_table_at(ulong start, ulong size)
+static long detect_coreboot_table_at(ulong start, ulong size)
{
u32 *ptr, *end;
diff --git a/arch/x86/cpu/cpu_x86.c b/arch/x86/cpu/cpu_x86.c
index 6c53f0ea821..6c32ae499df 100644
--- a/arch/x86/cpu/cpu_x86.c
+++ b/arch/x86/cpu/cpu_x86.c
@@ -7,6 +7,7 @@
#include <dm.h>
#include <errno.h>
#include <asm/cpu.h>
+#include <asm/cpu_x86.h>
#include <asm/global_data.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/arch/x86/cpu/efi/app.c b/arch/x86/cpu/efi/app.c
index 218a68c4642..84fe50e2f2f 100644
--- a/arch/x86/cpu/efi/app.c
+++ b/arch/x86/cpu/efi/app.c
@@ -19,11 +19,6 @@ int checkcpu(void)
return 0;
}
-int print_cpuinfo(void)
-{
- return default_print_cpuinfo();
-}
-
void board_final_init(void)
{
}
diff --git a/arch/x86/cpu/efi/payload.c b/arch/x86/cpu/efi/payload.c
index 642a87a37d8..6845ce72ff9 100644
--- a/arch/x86/cpu/efi/payload.c
+++ b/arch/x86/cpu/efi/payload.c
@@ -144,11 +144,6 @@ int checkcpu(void)
return 0;
}
-int print_cpuinfo(void)
-{
- return default_print_cpuinfo();
-}
-
/* Find any available tables and copy them to a safe place */
int reserve_arch(void)
{
diff --git a/arch/x86/cpu/i386/cpu.c b/arch/x86/cpu/i386/cpu.c
index 934e98ac582..a51a24498a7 100644
--- a/arch/x86/cpu/i386/cpu.c
+++ b/arch/x86/cpu/i386/cpu.c
@@ -263,6 +263,49 @@ static int build_vendor_name(char *vendor_name)
}
#endif
+int x86_cpu_vendor_info(char *name)
+{
+ uint cpu_device;
+
+ cpu_device = 0;
+
+ /* gcc 7.3 does not want to drop x86_vendors, so use #ifdef */
+#ifndef CONFIG_TPL_BUILD
+ *name = '\0'; /* Unset */
+
+ /* Find the id and vendor_name */
+ if (!has_cpuid()) {
+ /* Its a 486 if we can modify the AC flag */
+ if (flag_is_changeable_p(X86_EFLAGS_AC))
+ cpu_device = 0x00000400; /* 486 */
+ else
+ cpu_device = 0x00000300; /* 386 */
+ if (cpu_device == 0x00000400 && test_cyrix_52div()) {
+ /* If we ever care we can enable cpuid here */
+ memcpy(name, "CyrixInstead", 13);
+
+ /* Detect NexGen with old hypercode */
+ } else if (deep_magic_nexgen_probe()) {
+ memcpy(name, "NexGenDriven", 13);
+ }
+ } else {
+ int cpuid_level;
+
+ cpuid_level = build_vendor_name(name);
+ name[12] = '\0';
+
+ /* Intel-defined flags: level 0x00000001 */
+ if (cpuid_level >= 0x00000001)
+ cpu_device = cpuid_eax(0x00000001);
+ else
+ /* Have CPUID level 0 only unheard of */
+ cpu_device = 0x00000400;
+ }
+#endif /* CONFIG_TPL_BUILD */
+
+ return cpu_device;
+}
+
static void identify_cpu(struct cpu_device_id *cpu)
{
cpu->device = 0; /* fix gcc 4.4.4 warning */
@@ -271,7 +314,7 @@ static void identify_cpu(struct cpu_device_id *cpu)
* Do a quick and dirty check to save space - Intel and AMD only and
* just the vendor. This is enough for most TPL code.
*/
- if (spl_phase() == PHASE_TPL) {
+ if (xpl_phase() == PHASE_TPL) {
struct cpuid_result result;
result = cpuid(0x00000000);
@@ -289,46 +332,19 @@ static void identify_cpu(struct cpu_device_id *cpu)
return;
}
-/* gcc 7.3 does not want to drop x86_vendors, so use #ifdef */
#ifndef CONFIG_TPL_BUILD
- char vendor_name[16];
- int i;
-
- vendor_name[0] = '\0'; /* Unset */
-
- /* Find the id and vendor_name */
- if (!has_cpuid()) {
- /* Its a 486 if we can modify the AC flag */
- if (flag_is_changeable_p(X86_EFLAGS_AC))
- cpu->device = 0x00000400; /* 486 */
- else
- cpu->device = 0x00000300; /* 386 */
- if ((cpu->device == 0x00000400) && test_cyrix_52div()) {
- memcpy(vendor_name, "CyrixInstead", 13);
- /* If we ever care we can enable cpuid here */
- }
- /* Detect NexGen with old hypercode */
- else if (deep_magic_nexgen_probe())
- memcpy(vendor_name, "NexGenDriven", 13);
- } else {
- int cpuid_level;
-
- cpuid_level = build_vendor_name(vendor_name);
- vendor_name[12] = '\0';
-
- /* Intel-defined flags: level 0x00000001 */
- if (cpuid_level >= 0x00000001) {
- cpu->device = cpuid_eax(0x00000001);
- } else {
- /* Have CPUID level 0 only unheard of */
- cpu->device = 0x00000400;
- }
- }
- cpu->vendor = X86_VENDOR_UNKNOWN;
- for (i = 0; i < ARRAY_SIZE(x86_vendors); i++) {
- if (memcmp(vendor_name, x86_vendors[i].name, 12) == 0) {
- cpu->vendor = x86_vendors[i].vendor;
- break;
+ {
+ char vendor_name[16];
+ int i;
+
+ cpu->device = x86_cpu_vendor_info(vendor_name);
+
+ cpu->vendor = X86_VENDOR_UNKNOWN;
+ for (i = 0; i < ARRAY_SIZE(x86_vendors); i++) {
+ if (memcmp(vendor_name, x86_vendors[i].name, 12) == 0) {
+ cpu->vendor = x86_vendors[i].vendor;
+ break;
+ }
}
}
#endif
@@ -485,6 +501,11 @@ int x86_cpu_reinit_f(void)
return 0;
}
+void x86_get_identity_for_timer(void)
+{
+ setup_identity();
+}
+
void x86_enable_caches(void)
{
unsigned long cr0;
diff --git a/arch/x86/cpu/i386/interrupt.c b/arch/x86/cpu/i386/interrupt.c
index b3f4214acdb..6f78b072cde 100644
--- a/arch/x86/cpu/i386/interrupt.c
+++ b/arch/x86/cpu/i386/interrupt.c
@@ -237,7 +237,7 @@ void *x86_get_idt(void)
return &idt_ptr;
}
-void __do_irq(int irq)
+static void __do_irq(int irq)
{
printf("Unhandled IRQ : %d\n", irq);
}
diff --git a/arch/x86/cpu/intel_common/Makefile b/arch/x86/cpu/intel_common/Makefile
index 1dc17b45879..a28e6c77c9c 100644
--- a/arch/x86/cpu/intel_common/Makefile
+++ b/arch/x86/cpu/intel_common/Makefile
@@ -5,19 +5,19 @@
obj-$(CONFIG_INTEL_ACPIGEN) += acpi.o
ifdef CONFIG_HAVE_MRC
-obj-$(CONFIG_$(SPL_TPL_)X86_16BIT_INIT) += car.o
-obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += me_status.o
-obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += report_platform.o
-obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += mrc.o
+obj-$(CONFIG_$(PHASE_)X86_16BIT_INIT) += car.o
+obj-$(CONFIG_$(PHASE_)X86_32BIT_INIT) += me_status.o
+obj-$(CONFIG_$(PHASE_)X86_32BIT_INIT) += report_platform.o
+obj-$(CONFIG_$(PHASE_)X86_32BIT_INIT) += mrc.o
endif
-ifndef CONFIG_SPL_BUILD
+ifndef CONFIG_XPL_BUILD
obj-$(CONFIG_INTEL_GMA_ACPI) += intel_opregion.o
endif
ifdef CONFIG_INTEL_CAR_CQOS
obj-$(CONFIG_TPL_BUILD) += car2.o
-ifndef CONFIG_SPL_BUILD
+ifndef CONFIG_XPL_BUILD
obj-y += car2_uninit.o
endif
endif
@@ -26,10 +26,10 @@ obj-y += cpu.o
obj-y += fast_spi.o
obj-y += lpc.o
obj-y += lpss.o
-obj-$(CONFIG_$(SPL_)INTEL_GENERIC_WIFI) += generic_wifi.o
+obj-$(CONFIG_$(XPL_)INTEL_GENERIC_WIFI) += generic_wifi.o
ifndef CONFIG_EFI_APP
-obj-$(CONFIG_$(SPL_TPL_)X86_32BIT_INIT) += microcode.o
-ifndef CONFIG_$(SPL_)X86_64
+obj-$(CONFIG_$(PHASE_)X86_32BIT_INIT) += microcode.o
+ifndef CONFIG_$(XPL_)X86_64
obj-y += microcode.o
endif
endif
@@ -38,7 +38,7 @@ obj-$(CONFIG_HAVE_ITSS) += itss.o
obj-$(CONFIG_HAVE_P2SB) += p2sb.o
ifdef CONFIG_SPL
-ifndef CONFIG_SPL_BUILD
+ifndef CONFIG_XPL_BUILD
ifndef CONFIG_SYS_COREBOOT
obj-y += cpu_from_spl.o
endif
diff --git a/arch/x86/cpu/intel_common/mrc.c b/arch/x86/cpu/intel_common/mrc.c
index c834c05d130..baa1f0e32d6 100644
--- a/arch/x86/cpu/intel_common/mrc.c
+++ b/arch/x86/cpu/intel_common/mrc.c
@@ -259,7 +259,7 @@ int mrc_common_init(struct udevice *dev, void *pei_data, bool use_asm_linkage)
return ret;
delay = dev_read_u32_default(dev, "fspm,training-delay", 0);
- if (spl_phase() == PHASE_SPL) {
+ if (xpl_phase() == PHASE_SPL) {
if (delay)
printf("SDRAM training (%d seconds)...", delay);
else
diff --git a/arch/x86/cpu/intel_common/p2sb.c b/arch/x86/cpu/intel_common/p2sb.c
index 7aad8f8ca56..406c41013fc 100644
--- a/arch/x86/cpu/intel_common/p2sb.c
+++ b/arch/x86/cpu/intel_common/p2sb.c
@@ -96,7 +96,7 @@ int p2sb_of_to_plat(struct udevice *dev)
return log_msg_ret("Missing/short early-regs", ret);
plat->mmio_base = base[0];
/* TPL sets up the initial BAR */
- if (spl_phase() == PHASE_TPL) {
+ if (xpl_phase() == PHASE_TPL) {
plat->bdf = pci_get_devfn(dev);
if (plat->bdf < 0)
return log_msg_ret("Cannot get p2sb PCI address",
@@ -114,9 +114,9 @@ int p2sb_of_to_plat(struct udevice *dev)
static int p2sb_probe(struct udevice *dev)
{
- if (spl_phase() == PHASE_TPL)
+ if (xpl_phase() == PHASE_TPL)
return p2sb_early_init(dev);
- else if (spl_phase() == PHASE_SPL)
+ else if (xpl_phase() == PHASE_SPL)
return p2sb_spl_init(dev);
return 0;
diff --git a/arch/x86/cpu/ivybridge/Makefile b/arch/x86/cpu/ivybridge/Makefile
index 716134e9ff3..471ad8d7ebc 100644
--- a/arch/x86/cpu/ivybridge/Makefile
+++ b/arch/x86/cpu/ivybridge/Makefile
@@ -5,15 +5,15 @@
ifdef CONFIG_HAVE_FSP
obj-y += fsp_configs.o ivybridge.o
else
-obj-$(CONFIG_$(SPL_)X86_32BIT_INIT) += cpu.o
+obj-$(CONFIG_$(XPL_)X86_32BIT_INIT) += cpu.o
obj-y += early_me.o
obj-y += lpc.o
obj-y += northbridge.o
-ifndef CONFIG_SPL_BUILD
+ifndef CONFIG_XPL_BUILD
obj-y += sata.o
endif
-obj-$(CONFIG_$(SPL_)X86_32BIT_INIT) += sdram.o
-ifndef CONFIG_$(SPL_)X86_32BIT_INIT
+obj-$(CONFIG_$(XPL_)X86_32BIT_INIT) += sdram.o
+ifndef CONFIG_$(XPL_)X86_32BIT_INIT
obj-y += sdram_nop.o
endif
endif
diff --git a/arch/x86/cpu/ivybridge/cpu.c b/arch/x86/cpu/ivybridge/cpu.c
index 05691a38d2e..d299068a879 100644
--- a/arch/x86/cpu/ivybridge/cpu.c
+++ b/arch/x86/cpu/ivybridge/cpu.c
@@ -182,20 +182,6 @@ int checkcpu(void)
return 0;
}
-int print_cpuinfo(void)
-{
- char processor_name[CPU_MAX_NAME_LEN];
- const char *name;
-
- /* Print processor name */
- name = cpu_get_name(processor_name);
- printf("CPU: %s\n", name);
-
- post_code(POST_CPU_INFO);
-
- return 0;
-}
-
void board_debug_uart_init(void)
{
/* This enables the debug UART */
diff --git a/arch/x86/cpu/mtrr.c b/arch/x86/cpu/mtrr.c
index 50cba5fb88d..07ea89162de 100644
--- a/arch/x86/cpu/mtrr.c
+++ b/arch/x86/cpu/mtrr.c
@@ -87,7 +87,7 @@ void mtrr_read_all(struct mtrr_info *info)
}
}
-void mtrr_write_all(struct mtrr_info *info)
+static void mtrr_write_all(struct mtrr_info *info)
{
int reg_count = mtrr_get_var_count();
struct mtrr_state state;
diff --git a/arch/x86/cpu/qemu/Makefile b/arch/x86/cpu/qemu/Makefile
index b7dd5bd46c7..1439916ac2d 100644
--- a/arch/x86/cpu/qemu/Makefile
+++ b/arch/x86/cpu/qemu/Makefile
@@ -2,7 +2,7 @@
#
# Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
-ifndef CONFIG_$(SPL_)X86_64
+ifndef CONFIG_$(XPL_)X86_64
obj-y += car.o
endif
obj-y += dram.o
diff --git a/arch/x86/cpu/qemu/qemu.c b/arch/x86/cpu/qemu/qemu.c
index 262584d01f0..563f63e2bc8 100644
--- a/arch/x86/cpu/qemu/qemu.c
+++ b/arch/x86/cpu/qemu/qemu.c
@@ -109,12 +109,6 @@ int checkcpu(void)
{
return 0;
}
-
-int print_cpuinfo(void)
-{
- post_code(POST_CPU_INFO);
- return default_print_cpuinfo();
-}
#endif
int arch_early_init_r(void)
diff --git a/arch/x86/cpu/quark/quark.c b/arch/x86/cpu/quark/quark.c
index fdf92b2c0c3..07504faaffb 100644
--- a/arch/x86/cpu/quark/quark.c
+++ b/arch/x86/cpu/quark/quark.c
@@ -266,12 +266,6 @@ int checkcpu(void)
return 0;
}
-int print_cpuinfo(void)
-{
- post_code(POST_CPU_INFO);
- return default_print_cpuinfo();
-}
-
static void quark_pcie_init(void)
{
u32 val;
diff --git a/arch/x86/cpu/slimbootloader/slimbootloader.c b/arch/x86/cpu/slimbootloader/slimbootloader.c
index 142c9341cf8..8a5c78595aa 100644
--- a/arch/x86/cpu/slimbootloader/slimbootloader.c
+++ b/arch/x86/cpu/slimbootloader/slimbootloader.c
@@ -54,8 +54,3 @@ int checkcpu(void)
{
return 0;
}
-
-int print_cpuinfo(void)
-{
- return default_print_cpuinfo();
-}
diff --git a/arch/x86/cpu/tangier/tangier.c b/arch/x86/cpu/tangier/tangier.c
index 8a8f7d27a9d..b005bc7d9a0 100644
--- a/arch/x86/cpu/tangier/tangier.c
+++ b/arch/x86/cpu/tangier/tangier.c
@@ -19,8 +19,3 @@ int checkcpu(void)
{
return 0;
}
-
-int print_cpuinfo(void)
-{
- return default_print_cpuinfo();
-}
diff --git a/arch/x86/cpu/x86_64/cpu.c b/arch/x86/cpu/x86_64/cpu.c
index 80eab710315..71bc07f872a 100644
--- a/arch/x86/cpu/x86_64/cpu.c
+++ b/arch/x86/cpu/x86_64/cpu.c
@@ -75,3 +75,9 @@ void board_debug_uart_init(void)
/* this was already done in SPL */
}
#endif
+
+void x86_get_identity_for_timer(void)
+{
+ /* set the vendor to Intel so that native_calibrate_tsc() works */
+ gd->arch.x86_vendor = X86_VENDOR_INTEL;
+}
diff --git a/arch/x86/cpu/x86_64/misc.c b/arch/x86/cpu/x86_64/misc.c
index 294511e6eba..fc449ca4ed6 100644
--- a/arch/x86/cpu/x86_64/misc.c
+++ b/arch/x86/cpu/x86_64/misc.c
@@ -32,9 +32,4 @@ int checkcpu(void)
{
return 0;
}
-
-int print_cpuinfo(void)
-{
- return 0;
-}
#endif