blob: bc55c50a43748893fbe8d05b4626a2a2c6f41591 [file] [log] [blame]
Andrey Petrovb37fd672016-03-01 16:25:38 -08001/*
2 * This file is part of the coreboot project.
3 *
Lee Leahy47bd2d92016-07-24 18:12:16 -07004 * Copyright (C) 2015-2016 Intel Corp.
Andrey Petrovb37fd672016-03-01 16:25:38 -08005 * (Written by Alexandru Gagniuc <alexandrux.gagniuc@intel.com> for Intel Corp.)
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef _FSP2_0_API_H_
14#define _FSP2_0_API_H_
15
16#include <stddef.h>
Andrey Petrovb37fd672016-03-01 16:25:38 -080017#include <fsp/info_header.h>
Andrey Petrov465fc132016-02-25 14:16:33 -080018#include <soc/fsp/FspmUpd.h>
19#include <soc/fsp/FspsUpd.h>
Andrey Petrovb37fd672016-03-01 16:25:38 -080020
21enum fsp_status {
22 FSP_SUCCESS = 0x00000000,
Andrey Petrov82a61222016-06-14 12:03:15 -070023 FSP_STATUS_RESET_REQUIRED_COLD = 0x40000001,
24 FSP_STATUS_RESET_REQUIRED_WARM = 0x40000002,
Andrey Petrov3a94a3b2016-07-18 00:15:41 -070025 FSP_STATUS_RESET_REQUIRED_3 = 0x40000003,
26 FSP_STATUS_RESET_REQUIRED_4 = 0x40000004,
27 FSP_STATUS_RESET_REQUIRED_5 = 0x40000005,
28 FSP_STATUS_RESET_REQUIRED_6 = 0x40000006,
29 FSP_STATUS_RESET_REQUIRED_7 = 0x40000007,
30 FSP_STATUS_RESET_REQUIRED_8 = 0x40000008,
Andrey Petrovb37fd672016-03-01 16:25:38 -080031 FSP_INVALID_PARAMETER = 0x80000002,
32 FSP_UNSUPPORTED = 0x80000003,
33 FSP_NOT_READY = 0x80000006,
34 FSP_DEVICE_ERROR = 0x80000007,
35 FSP_OUT_OF_RESOURCES = 0x80000009,
36 FSP_VOLUME_CORRUPTED = 0x8000000a,
37 FSP_NOT_FOUND = 0x8000000a,
38 FSP_TIMEOUT = 0x80000012,
39 FSP_ABORTED = 0x80000015,
40 FSP_INCOMPATIBLE_VERSION = 0x80000010,
41 FSP_SECURITY_VIOLATION = 0x8000001a,
42 FSP_CRC_ERROR = 0x8000001b,
43};
44
Andrey Petrova6dd5352016-03-17 16:42:41 -070045enum fsp_boot_mode {
46 FSP_BOOT_WITH_FULL_CONFIGURATION = 0x00,
47 FSP_BOOT_WITH_MINIMAL_CONFIGURATION = 0x01,
48 FSP_BOOT_ASSUMING_NO_CONFIGURATION_CHANGES = 0x02,
49 FSP_BOOT_ON_S4_RESUME = 0x05,
50 FSP_BOOT_ON_S3_RESUME = 0x11,
51 FSP_BOOT_ON_FLASH_UPDATE = 0x12,
52 FSP_BOOT_IN_RECOVERY_MODE = 0x20
53};
54
Andrey Petrovb37fd672016-03-01 16:25:38 -080055enum fsp_notify_phase {
56 AFTER_PCI_ENUM = 0x20,
Hannah Williams16f3d3d2016-04-29 14:40:40 -070057 READY_TO_BOOT = 0x40,
58 END_OF_FIRMWARE = 0xF0
Andrey Petrovb37fd672016-03-01 16:25:38 -080059};
60
61
Andrey Petrovb37fd672016-03-01 16:25:38 -080062/* Main FSP stages */
Aaron Durbind04639b2016-07-17 23:23:59 -050063enum fsp_status fsp_memory_init(bool s3wake);
Aaron Durbin32ac0182016-07-18 00:35:42 -050064enum fsp_status fsp_silicon_init(void);
Andrey Petrovb37fd672016-03-01 16:25:38 -080065enum fsp_status fsp_notify(enum fsp_notify_phase phase);
66
67/* Callbacks for updating stage-specific parameters */
Andrey Petrov465fc132016-02-25 14:16:33 -080068void platform_fsp_memory_init_params_cb(struct FSPM_UPD *mupd);
69void platform_fsp_silicon_init_params_cb(struct FSPS_UPD *supd);
Andrey Petrovb37fd672016-03-01 16:25:38 -080070
71/*
72 * # DOCUMENTATION:
73 *
74 * This file defines the interface between coreboot and the FSP 2.0 wrapper
75 * fsp_memory_init(), fsp_silicon_init(), and fsp_notify() are the main entry
76 * points and map 1:1 to the FSP entry points of the same name.
77 *
78 * ### fsp_memory_init():
Aaron Durbinb4302502016-07-17 17:04:37 -050079 * - s3wake: boolean indicating if the system is waking from resume
Andrey Petrovb37fd672016-03-01 16:25:38 -080080 *
81 * This function is responsible for loading and executing the memory
82 * initialization code from the FSP-M binary. It expects this binary to reside
83 * in cbfs as FSP_M_FILE.
84 *
Aaron Durbind04639b2016-07-17 23:23:59 -050085 * The function takes one parameter, which is described above, but does not
Andrey Petrovb37fd672016-03-01 16:25:38 -080086 * take in memory parameters as an argument. The memory parameters can be filled
87 * in with platform_fsp_memory_init_params_cb(). This is a callback symbol
88 * that fsp_memory_init() will call. The platform must provide this symbol.
89 *
Andrey Petrovb37fd672016-03-01 16:25:38 -080090 *
91 * ### fsp_silicon_init():
Andrey Petrovb37fd672016-03-01 16:25:38 -080092 *
93 * This function is responsible for loading and executing the silicon
94 * initialization code from the FSP-S binary. It expects this binary to reside
95 * in cbfs as FSP_S_FILE.
96 *
97 * Like fsp_memory_init(), it provides a callback to fill in FSP-specific
98 * parameters, via platform_fsp_silicon_init_params_cb(). The platform must
99 * also provide this symbol.
100 *
101 *
102 * ### fsp_notify():
103 * - phase: Which FSP notification phase
104 *
105 * This function is responsible for loading and executing the notify code from
106 * the FSP-S binary. It expects that fsp_silicon_init() has already been called
107 * succesfully, and that the FSP-S binary is still loaded into memory.
108 */
109
110#endif /* _FSP2_0_API_H_ */