Merge branch 'master' of git://git.denx.de/u-boot
[oweals/u-boot.git] / arch / x86 / include / asm / fsp / fsp_api.h
1 /*
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
11 #include <linux/linkage.h>
12
13 /*
14  * FspInit continuation function prototype.
15  * Control will be returned to this callback function after FspInit API call.
16  */
17 typedef void (*fsp_continuation_f)(u32 status, void *hob_list);
18
19 struct fsp_init_params {
20         /* 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
28 struct common_buf {
29         /*
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
39 enum fsp_phase {
40         /* 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
46 struct fsp_notify_params {
47         /* Notification phase used for NotifyPhase API */
48         enum fsp_phase  phase;
49 };
50
51 /* FspInit API function prototype */
52 typedef asmlinkage u32 (*fsp_init_f)(struct fsp_init_params *params);
53
54 /* FspNotify API function prototype */
55 typedef asmlinkage u32 (*fsp_notify_f)(struct fsp_notify_params *params);
56
57 #endif