blob: 2d34d138abdd8c60f832aa04a173b595947649c1 [file] [log] [blame]
Bin Meng2922b3e2014-12-12 21:05:28 +08001/*
2 * Copyright (C) 2013, Intel Corporation
3 * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
4 *
5 * SPDX-License-Identifier: Intel
6 */
7
8#ifndef __FSP_API_H__
9#define __FSP_API_H__
10
Simon Glass457191e2015-01-27 22:13:37 -070011#include <linux/linkage.h>
12
Bin Meng2922b3e2014-12-12 21:05:28 +080013/*
14 * FspInit continuation function prototype.
15 * Control will be returned to this callback function after FspInit API call.
16 */
17typedef void (*fsp_continuation_f)(u32 status, void *hob_list);
18
Bin Mengdb60d862014-12-17 15:50:49 +080019struct fsp_init_params {
Bin Meng2922b3e2014-12-12 21:05:28 +080020 /* Non-volatile storage buffer pointer */
21 void *nvs_buf;
22 /* Runtime buffer pointer */
23 void *rt_buf;
24 /* Continuation function address */
25 fsp_continuation_f continuation;
26};
27
Bin Mengdb60d862014-12-17 15:50:49 +080028struct common_buf {
Bin Meng2922b3e2014-12-12 21:05:28 +080029 /*
30 * Stack top pointer used by the bootloader. The new stack frame will be
31 * set up at this location after FspInit API call.
32 */
33 u32 *stack_top;
34 u32 boot_mode; /* Current system boot mode */
35 void *upd_data; /* User platform configuraiton data region */
36 u32 reserved[7]; /* Reserved */
37};
38
Bin Mengdb60d862014-12-17 15:50:49 +080039enum fsp_phase {
Bin Meng2922b3e2014-12-12 21:05:28 +080040 /* Notification code for post PCI enuermation */
41 INIT_PHASE_PCI = 0x20,
42 /* Notification code before transfering control to the payload */
43 INIT_PHASE_BOOT = 0x40
44};
45
Bin Mengdb60d862014-12-17 15:50:49 +080046struct fsp_notify_params {
Bin Meng2922b3e2014-12-12 21:05:28 +080047 /* Notification phase used for NotifyPhase API */
Bin Mengdb60d862014-12-17 15:50:49 +080048 enum fsp_phase phase;
Bin Meng2922b3e2014-12-12 21:05:28 +080049};
50
Bin Meng2922b3e2014-12-12 21:05:28 +080051/* FspInit API function prototype */
Simon Glass457191e2015-01-27 22:13:37 -070052typedef asmlinkage u32 (*fsp_init_f)(struct fsp_init_params *params);
Bin Meng2922b3e2014-12-12 21:05:28 +080053
54/* FspNotify API function prototype */
Simon Glass457191e2015-01-27 22:13:37 -070055typedef asmlinkage u32 (*fsp_notify_f)(struct fsp_notify_params *params);
Bin Meng2922b3e2014-12-12 21:05:28 +080056
57#endif