Bin Meng | 2922b3e | 2014-12-12 21:05:28 +0800 | [diff] [blame] | 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 | |
Simon Glass | 457191e | 2015-01-27 22:13:37 -0700 | [diff] [blame] | 11 | #include <linux/linkage.h> |
| 12 | |
Bin Meng | 2922b3e | 2014-12-12 21:05:28 +0800 | [diff] [blame] | 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 | |
Bin Meng | db60d86 | 2014-12-17 15:50:49 +0800 | [diff] [blame] | 19 | struct fsp_init_params { |
Bin Meng | 2922b3e | 2014-12-12 21:05:28 +0800 | [diff] [blame] | 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 | |
Bin Meng | db60d86 | 2014-12-17 15:50:49 +0800 | [diff] [blame] | 28 | struct common_buf { |
Bin Meng | 2922b3e | 2014-12-12 21:05:28 +0800 | [diff] [blame] | 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 | |
Bin Meng | db60d86 | 2014-12-17 15:50:49 +0800 | [diff] [blame] | 39 | enum fsp_phase { |
Bin Meng | 2922b3e | 2014-12-12 21:05:28 +0800 | [diff] [blame] | 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 | |
Bin Meng | db60d86 | 2014-12-17 15:50:49 +0800 | [diff] [blame] | 46 | struct fsp_notify_params { |
Bin Meng | 2922b3e | 2014-12-12 21:05:28 +0800 | [diff] [blame] | 47 | /* Notification phase used for NotifyPhase API */ |
Bin Meng | db60d86 | 2014-12-17 15:50:49 +0800 | [diff] [blame] | 48 | enum fsp_phase phase; |
Bin Meng | 2922b3e | 2014-12-12 21:05:28 +0800 | [diff] [blame] | 49 | }; |
| 50 | |
Bin Meng | 2922b3e | 2014-12-12 21:05:28 +0800 | [diff] [blame] | 51 | /* FspInit API function prototype */ |
Simon Glass | 457191e | 2015-01-27 22:13:37 -0700 | [diff] [blame] | 52 | typedef asmlinkage u32 (*fsp_init_f)(struct fsp_init_params *params); |
Bin Meng | 2922b3e | 2014-12-12 21:05:28 +0800 | [diff] [blame] | 53 | |
| 54 | /* FspNotify API function prototype */ |
Simon Glass | 457191e | 2015-01-27 22:13:37 -0700 | [diff] [blame] | 55 | typedef asmlinkage u32 (*fsp_notify_f)(struct fsp_notify_params *params); |
Bin Meng | 2922b3e | 2014-12-12 21:05:28 +0800 | [diff] [blame] | 56 | |
| 57 | #endif |