From 8b37c7694f1eace82626d00fbfb85311ebf0d220 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 6 Nov 2014 13:20:06 -0700 Subject: x86: Use the standard arch_cpu_init() function Instead of an x86-specific cpu_init_f() function, use the normal U-Boot one for this purpose. Also remove a useless/misleading comment. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/cpu/coreboot/coreboot.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'arch/x86/cpu/coreboot/coreboot.c') diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index e24f13a..4e1349f 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -20,18 +20,17 @@ DECLARE_GLOBAL_DATA_PTR; -/* - * Miscellaneous platform dependent initializations - */ -int cpu_init_f(void) +int arch_cpu_init(void) { int ret = get_coreboot_info(&lib_sysinfo); - if (ret != 0) + if (ret != 0) { printf("Failed to parse coreboot tables.\n"); + return ret; + } timestamp_init(); - return ret; + return x86_cpu_init_f(); } int board_early_init_f(void) -- cgit v1.1 From e1ffd81797d59652124bd9cda813a58644f5dea9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 6 Nov 2014 13:20:08 -0700 Subject: x86: Fix up some missing prototypes Some functions are missing prototypes. Fix those that are specific to x86. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/cpu/coreboot/coreboot.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'arch/x86/cpu/coreboot/coreboot.c') diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index 4e1349f..5527183 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -97,7 +97,7 @@ int board_eth_init(bd_t *bis) #define MTRRphysBase_MSR(reg) (0x200 + 2 * (reg)) #define MTRRphysMask_MSR(reg) (0x200 + 2 * (reg) + 1) -int board_final_cleanup(void) +void board_final_cleanup(void) { /* Un-cache the ROM so the kernel has one * more MTRR available. @@ -119,8 +119,6 @@ int board_final_cleanup(void) /* Issue SMI to Coreboot to lock down ME and registers */ printf("Finalizing Coreboot\n"); outb(0xcb, 0xb2); - - return 0; } void panic_puts(const char *str) -- cgit v1.1 From 727c1a987147bb55ff41ab62f7e01293a38910b8 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 10 Nov 2014 18:00:26 -0700 Subject: x86: Replace fill_processor_name() with cpu_get_name() This implementation has a 'cpu' prefix and returns a pointer to the string, avoiding the need for copying. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/cpu/coreboot/coreboot.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch/x86/cpu/coreboot/coreboot.c') diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index 5527183..c9f83b0 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -72,6 +72,11 @@ void show_boot_progress(int val) outb(val, 0x80); } +int print_cpuinfo(void) +{ + return default_print_cpuinfo(); +} + int last_stage_init(void) { if (gd->flags & GD_FLG_COLD_BOOT) -- cgit v1.1 From 8ef07571a0300e6ae84931c63d5eb3b2310c8aba Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 12 Nov 2014 22:42:07 -0700 Subject: x86: Add chromebook_link board This board is a 'bare' version of the existing 'link 'board. It does not require coreboot to run, but is intended to start directly from the reset vector. This initial commit has place holders for a wide range of features. These will be added in follow-on patches and series. So far it cannot be booted as there is no ROM image produced, but it does build without errors. Signed-off-by: Simon Glass --- arch/x86/cpu/coreboot/coreboot.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/x86/cpu/coreboot/coreboot.c') diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index c9f83b0..8501716 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include -- cgit v1.1 From d1cd045982b1e1e4db2c1cc2b2b932f739b78a11 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 12 Nov 2014 22:42:09 -0700 Subject: x86: Emit post codes in startup code for Chromebooks On x86 it is common to use 'post codes' which are 8-bit hex values emitted from the code and visible to the user. Traditionally two 7-segment displays were made available on the motherboard to show the last post code that was emitted. This allows diagnosis of a boot problem since it is possible to see where the code got to before it died. On modern hardware these codes are not normally visible. On Chromebooks they are displayed by the Embedded Controller (EC), so it is useful to emit them. We must enable this feature for the EC to see the codes, so add an option for this. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/x86/cpu/coreboot/coreboot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/x86/cpu/coreboot/coreboot.c') diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index 8501716..0760a61 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -70,7 +71,7 @@ void show_boot_progress(int val) gd->arch.tsc_prev = now; } #endif - outb(val, 0x80); + outb(val, POST_PORT); } int print_cpuinfo(void) -- cgit v1.1 From 378a8634ad12981779c24e6ec29619deff88d19b Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 12 Nov 2014 22:42:16 -0700 Subject: x86: Tidy up coreboot header usage There is no need to explicitly write 'arch-coreboot' when including headers, as when the arch directory points to coreboot the correct files will be used. Signed-off-by: Simon Glass --- arch/x86/cpu/coreboot/coreboot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/x86/cpu/coreboot/coreboot.c') diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index 0760a61..3356121 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -16,8 +16,8 @@ #include #include #include -#include -#include +#include +#include #include DECLARE_GLOBAL_DATA_PTR; -- cgit v1.1 From a49e3c7f09abf4961f2945275338c3a0c18b9b61 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 12 Nov 2014 22:42:26 -0700 Subject: x86: Make show_boot_progress() common This function can probably be used on all x86 boards, so move it into the common file. Signed-off-by: Simon Glass --- arch/x86/cpu/coreboot/coreboot.c | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'arch/x86/cpu/coreboot/coreboot.c') diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index 3356121..2df7288 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -51,29 +50,6 @@ int board_early_init_r(void) return 0; } -void show_boot_progress(int val) -{ -#if MIN_PORT80_KCLOCKS_DELAY - /* - * Scale the time counter reading to avoid using 64 bit arithmetics. - * Can't use get_timer() here becuase it could be not yet - * initialized or even implemented. - */ - if (!gd->arch.tsc_prev) { - gd->arch.tsc_base_kclocks = rdtsc() / 1000; - gd->arch.tsc_prev = 0; - } else { - uint32_t now; - - do { - now = rdtsc() / 1000 - gd->arch.tsc_base_kclocks; - } while (now < (gd->arch.tsc_prev + MIN_PORT80_KCLOCKS_DELAY)); - gd->arch.tsc_prev = now; - } -#endif - outb(val, POST_PORT); -} - int print_cpuinfo(void) { return default_print_cpuinfo(); -- cgit v1.1