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>
16 #include <asm/global_data.h>
18 #include <asm/mrccache.h>
20 #include <asm/processor.h>
21 #include <asm/fsp/fsp_support.h>
23 DECLARE_GLOBAL_DATA_PTR;
30 int print_cpuinfo(void)
32 post_code(POST_CPU_INFO);
33 return default_print_cpuinfo();
36 int fsp_init_phase_pci(void)
40 /* call into FspNotify */
41 debug("Calling into FSP (notify phase INIT_PHASE_PCI): ");
42 status = fsp_notify(NULL, INIT_PHASE_PCI);
44 debug("fail, error code %x\n", status);
48 return status ? -EPERM : 0;
51 void board_final_init(void)
55 /* call into FspNotify */
56 debug("Calling into FSP (notify phase INIT_PHASE_BOOT): ");
57 status = fsp_notify(NULL, INIT_PHASE_BOOT);
59 debug("fail, error code %x\n", status);
64 #if CONFIG_IS_ENABLED(DM_RTC)
65 int fsp_save_s3_stack(void)
70 if (gd->arch.prev_sleep_state == ACPI_S3)
73 ret = uclass_get_device(UCLASS_RTC, 0, &dev);
75 debug("Cannot find RTC: err=%d\n", ret);
79 /* Save the stack address to CMOS */
80 ret = rtc_write32(dev, CMOS_FSP_STACK_ADDR, gd->start_addr_sp);
82 debug("Save stack address to CMOS: err=%d\n", ret);