2 * Copyright (c) 2011 The Chromium OS Authors.
4 * Graeme Russ, graeme.russ@gmail.com.
6 * SPDX-License-Identifier: GPL-2.0+
14 #include <asm/arch/sysinfo.h>
15 #include <asm/arch/timestamp.h>
17 DECLARE_GLOBAL_DATA_PTR;
19 int arch_cpu_init(void)
21 int ret = get_coreboot_info(&lib_sysinfo);
23 printf("Failed to parse coreboot tables.\n");
29 return x86_cpu_init_f();
32 int board_early_init_f(void)
37 int print_cpuinfo(void)
39 return default_print_cpuinfo();
42 int last_stage_init(void)
44 if (gd->flags & GD_FLG_COLD_BOOT)
45 timestamp_add_to_bootstage();
50 void board_final_cleanup(void)
53 * Un-cache the ROM so the kernel has one
54 * more MTRR available.
56 * Coreboot should have assigned this to the
57 * top available variable MTRR.
59 u8 top_mtrr = (native_read_msr(MTRR_CAP_MSR) & 0xff) - 1;
60 u8 top_type = native_read_msr(MTRR_PHYS_BASE_MSR(top_mtrr)) & 0xff;
62 /* Make sure this MTRR is the correct Write-Protected type */
63 if (top_type == MTRR_TYPE_WRPROT) {
64 struct mtrr_state state;
67 wrmsrl(MTRR_PHYS_BASE_MSR(top_mtrr), 0);
68 wrmsrl(MTRR_PHYS_MASK_MSR(top_mtrr), 0);
72 if (!fdtdec_get_config_bool(gd->fdt_blob, "u-boot,no-apm-finalize")) {
74 * Issue SMI to coreboot to lock down ME and registers
75 * when allowed via device tree
77 printf("Finalizing coreboot\n");
87 int arch_misc_init(void)