diff options
author | Simon Glass | 2017-03-28 10:27:30 -0600 |
---|---|---|
committer | Tom Rini | 2017-04-05 13:55:09 -0400 |
commit | 76d1d02fd280ef7ad63a97c3a80bd765bf5596fa (patch) | |
tree | ea7633ce30c7a60653b4da7cb8d40308c9f5ba6b /arch | |
parent | 8749fa6af3e94630eeb02bc3a45fe9bdcb8d3087 (diff) |
board_f: x86: Use checkcpu() for CPU init
At present we misuse print_cpuinfo() do so CPU init on x86. This is done
because it is the next available call after the console is enabled. But
several arches use checkcpu() instead. Despite the horrible name (which
we can fix), it seems a better choice.
Adjust the various x86 CPU implementations to move their init code into
checkcpu() and use print_cpuinfo() only for printing CPU info.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/cpu/broadwell/cpu.c | 12 | ||||
-rw-r--r-- | arch/x86/cpu/coreboot/coreboot.c | 5 | ||||
-rw-r--r-- | arch/x86/cpu/efi/efi.c | 5 | ||||
-rw-r--r-- | arch/x86/cpu/ivybridge/cpu.c | 14 | ||||
-rw-r--r-- | arch/x86/cpu/qemu/qemu.c | 6 | ||||
-rw-r--r-- | arch/x86/cpu/quark/quark.c | 5 | ||||
-rw-r--r-- | arch/x86/cpu/x86_64/cpu.c | 5 | ||||
-rw-r--r-- | arch/x86/lib/efi/efi.c | 5 | ||||
-rw-r--r-- | arch/x86/lib/fsp/fsp_common.c | 5 |
9 files changed, 55 insertions, 7 deletions
diff --git a/arch/x86/cpu/broadwell/cpu.c b/arch/x86/cpu/broadwell/cpu.c index 1b71d566c95..294dfa66431 100644 --- a/arch/x86/cpu/broadwell/cpu.c +++ b/arch/x86/cpu/broadwell/cpu.c @@ -131,10 +131,8 @@ int arch_cpu_init(void) return x86_cpu_init_f(); } -int print_cpuinfo(void) +int checkcpu(void) { - char processor_name[CPU_MAX_NAME_LEN]; - const char *name; int ret; set_max_freq(); @@ -144,6 +142,14 @@ int print_cpuinfo(void) return ret; gd->arch.pei_boot_mode = PEI_BOOT_NONE; + 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); diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index 1b042037bb2..658b900f0b8 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -34,6 +34,11 @@ int board_early_init_f(void) return 0; } +int checkcpu(void) +{ + return 0; +} + int print_cpuinfo(void) { return default_print_cpuinfo(); diff --git a/arch/x86/cpu/efi/efi.c b/arch/x86/cpu/efi/efi.c index 993ab8dcde2..741613f6155 100644 --- a/arch/x86/cpu/efi/efi.c +++ b/arch/x86/cpu/efi/efi.c @@ -18,6 +18,11 @@ int board_early_init_f(void) return 0; } +int checkcpu(void) +{ + return 0; +} + int print_cpuinfo(void) { return default_print_cpuinfo(); diff --git a/arch/x86/cpu/ivybridge/cpu.c b/arch/x86/cpu/ivybridge/cpu.c index c4aca08f0df..099cb94e5d2 100644 --- a/arch/x86/cpu/ivybridge/cpu.c +++ b/arch/x86/cpu/ivybridge/cpu.c @@ -74,7 +74,7 @@ int arch_cpu_init_dm(void) /* * We should do as little as possible before the serial console is * up. Perhaps this should move to later. Our next lot of init - * happens in print_cpuinfo() when we have a console + * happens in checkcpu() when we have a console */ ret = set_flex_ratio_to_tdp_nominal(); if (ret) @@ -125,12 +125,10 @@ static void enable_usb_bar(struct udevice *bus) pci_bus_write_config(bus, usb3, PCI_COMMAND, cmd, PCI_SIZE_32); } -int print_cpuinfo(void) +int checkcpu(void) { enum pei_boot_mode_t boot_mode = PEI_BOOT_NONE; - char processor_name[CPU_MAX_NAME_LEN]; struct udevice *dev, *lpc; - const char *name; uint32_t pm1_cnt; uint16_t pm1_sts; int ret; @@ -182,6 +180,14 @@ int print_cpuinfo(void) gd->arch.pei_boot_mode = boot_mode; + 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); diff --git a/arch/x86/cpu/qemu/qemu.c b/arch/x86/cpu/qemu/qemu.c index 7153eb21f57..35a146c66ae 100644 --- a/arch/x86/cpu/qemu/qemu.c +++ b/arch/x86/cpu/qemu/qemu.c @@ -148,6 +148,12 @@ int arch_cpu_init(void) #if !CONFIG_IS_ENABLED(EFI_STUB) && \ !CONFIG_IS_ENABLED(SPL_X86_32BIT_INIT) + +int checkcpu(void) +{ + return 0; +} + int print_cpuinfo(void) { post_code(POST_CPU_INFO); diff --git a/arch/x86/cpu/quark/quark.c b/arch/x86/cpu/quark/quark.c index bdd360a99f7..0c2cea4ee9d 100644 --- a/arch/x86/cpu/quark/quark.c +++ b/arch/x86/cpu/quark/quark.c @@ -264,6 +264,11 @@ int arch_cpu_init_dm(void) return 0; } +int checkcpu(void) +{ + return 0; +} + int print_cpuinfo(void) { post_code(POST_CPU_INFO); diff --git a/arch/x86/cpu/x86_64/cpu.c b/arch/x86/cpu/x86_64/cpu.c index db171f750df..cafae15af0c 100644 --- a/arch/x86/cpu/x86_64/cpu.c +++ b/arch/x86/cpu/x86_64/cpu.c @@ -67,6 +67,11 @@ int misc_init_r(void) return 0; } +int checkcpu(void) +{ + return 0; +} + int print_cpuinfo(void) { return 0; diff --git a/arch/x86/lib/efi/efi.c b/arch/x86/lib/efi/efi.c index ede5d5676bd..533318bc360 100644 --- a/arch/x86/lib/efi/efi.c +++ b/arch/x86/lib/efi/efi.c @@ -125,6 +125,11 @@ void dram_init_banksize(void) } } +int checkcpu(void) +{ + return 0; +} + int print_cpuinfo(void) { return default_print_cpuinfo(); diff --git a/arch/x86/lib/fsp/fsp_common.c b/arch/x86/lib/fsp/fsp_common.c index cebf85ee5b6..66a388d601f 100644 --- a/arch/x86/lib/fsp/fsp_common.c +++ b/arch/x86/lib/fsp/fsp_common.c @@ -14,6 +14,11 @@ DECLARE_GLOBAL_DATA_PTR; +int checkcpu(void) +{ + return 0; +} + int print_cpuinfo(void) { post_code(POST_CPU_INFO); |