1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
13 #include <acpi/acpi_s3.h>
14 #include <asm/cmos_layout.h>
15 #include <asm/early_cmos.h>
17 #include <asm/mrccache.h>
19 #include <asm/processor.h>
20 #include <asm/fsp/fsp_support.h>
22 DECLARE_GLOBAL_DATA_PTR;
29 int print_cpuinfo(void)
31 post_code(POST_CPU_INFO);
32 return default_print_cpuinfo();
35 int fsp_init_phase_pci(void)
39 /* call into FspNotify */
40 debug("Calling into FSP (notify phase INIT_PHASE_PCI): ");
41 status = fsp_notify(NULL, INIT_PHASE_PCI);
43 debug("fail, error code %x\n", status);
47 return status ? -EPERM : 0;
50 void board_final_cleanup(void)
54 /* call into FspNotify */
55 debug("Calling into FSP (notify phase INIT_PHASE_BOOT): ");
56 status = fsp_notify(NULL, INIT_PHASE_BOOT);
58 debug("fail, error code %x\n", status);
63 #ifdef CONFIG_HAVE_ACPI_RESUME
64 int fsp_save_s3_stack(void)
69 if (gd->arch.prev_sleep_state == ACPI_S3)
72 ret = uclass_get_device(UCLASS_RTC, 0, &dev);
74 debug("Cannot find RTC: err=%d\n", ret);
78 /* Save the stack address to CMOS */
79 ret = rtc_write32(dev, CMOS_FSP_STACK_ADDR, gd->start_addr_sp);
81 debug("Save stack address to CMOS: err=%d\n", ret);