2 * Copyright (c) 2011 The Chromium OS Authors.
6 * SPDX-License-Identifier: GPL-2.0+
15 #include <asm/arch/sysinfo.h>
16 #include <asm/arch/timestamp.h>
18 DECLARE_GLOBAL_DATA_PTR;
20 int arch_cpu_init(void)
22 int ret = get_coreboot_info(&lib_sysinfo);
24 printf("Failed to parse coreboot tables.\n");
30 return x86_cpu_init_f();
33 int board_early_init_f(void)
38 int print_cpuinfo(void)
40 return default_print_cpuinfo();
43 int last_stage_init(void)
45 if (gd->flags & GD_FLG_COLD_BOOT)
46 timestamp_add_to_bootstage();
51 int board_eth_init(bd_t *bis)
53 return pci_eth_init(bis);
56 void board_final_cleanup(void)
59 * Un-cache the ROM so the kernel has one
60 * more MTRR available.
62 * Coreboot should have assigned this to the
63 * top available variable MTRR.
65 u8 top_mtrr = (native_read_msr(MTRR_CAP_MSR) & 0xff) - 1;
66 u8 top_type = native_read_msr(MTRR_PHYS_BASE_MSR(top_mtrr)) & 0xff;
68 /* Make sure this MTRR is the correct Write-Protected type */
69 if (top_type == MTRR_TYPE_WRPROT) {
70 struct mtrr_state state;
73 wrmsrl(MTRR_PHYS_BASE_MSR(top_mtrr), 0);
74 wrmsrl(MTRR_PHYS_MASK_MSR(top_mtrr), 0);
78 if (!fdtdec_get_config_bool(gd->fdt_blob, "u-boot,no-apm-finalize")) {
80 * Issue SMI to coreboot to lock down ME and registers
81 * when allowed via device tree
83 printf("Finalizing coreboot\n");
93 int arch_misc_init(void)