Simon Glass | 466c785 | 2019-12-06 21:42:18 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: Intel */ |
| 2 | /* |
| 3 | * Copyright (C) 2015-2016 Intel Corp. |
| 4 | * (Written by Andrey Petrov <andrey.petrov@intel.com> for Intel Corp.) |
| 5 | * (Written by Alexandru Gagniuc <alexandrux.gagniuc@intel.com> for Intel Corp.) |
| 6 | * Mostly taken from coreboot fsp2_0/memory_init.c |
| 7 | */ |
| 8 | |
| 9 | #ifndef __ASM_FSP2_API_H |
| 10 | #define __ASM_FSP2_API_H |
| 11 | |
| 12 | #include <asm/fsp/fsp_api.h> |
| 13 | |
| 14 | struct fspm_upd; |
| 15 | struct fsps_upd; |
| 16 | struct hob_header; |
| 17 | |
| 18 | enum fsp_boot_mode { |
| 19 | FSP_BOOT_WITH_FULL_CONFIGURATION = 0x00, |
| 20 | FSP_BOOT_WITH_MINIMAL_CONFIGURATION = 0x01, |
| 21 | FSP_BOOT_ASSUMING_NO_CONFIGURATION_CHANGES = 0x02, |
| 22 | FSP_BOOT_ON_S4_RESUME = 0x05, |
| 23 | FSP_BOOT_ON_S3_RESUME = 0x11, |
| 24 | FSP_BOOT_ON_FLASH_UPDATE = 0x12, |
| 25 | FSP_BOOT_IN_RECOVERY_MODE = 0x20 |
| 26 | }; |
| 27 | |
| 28 | struct __packed fsp_upd_header { |
| 29 | u64 signature; |
| 30 | u8 revision; |
| 31 | u8 reserved[23]; |
| 32 | }; |
| 33 | |
| 34 | /** |
| 35 | * fsp_memory_init() - Init the SDRAM |
| 36 | * |
| 37 | * @s3wake: true if we are booting from resume, so cannot reinit the mememory |
| 38 | * from scatch since we will lose its contents |
| 39 | * @use_spi_flash: true to use the fast SPI driver to read FSP, otherwise use |
| 40 | * mapped SPI |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 41 | * Return: 0 if OK, -ve on error |
Simon Glass | 466c785 | 2019-12-06 21:42:18 -0700 | [diff] [blame] | 42 | */ |
| 43 | int fsp_memory_init(bool s3wake, bool use_spi_flash); |
| 44 | |
| 45 | typedef asmlinkage int (*fsp_memory_init_func)(struct fspm_upd *params, |
| 46 | struct hob_header **hobp); |
| 47 | |
| 48 | /** |
| 49 | * fsp_silicon_init() - Init the silicon |
| 50 | * |
| 51 | * This calls the FSP's 'silicon init' entry point |
| 52 | * |
| 53 | * @s3wake: true if we are booting from resume, so cannot reinit the mememory |
| 54 | * from scatch since we will lose its contents |
| 55 | * @use_spi_flash: true to use the fast SPI driver to read FSP, otherwise use |
| 56 | * mapped SPI |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 57 | * Return: 0 if OK, -ve on error |
Simon Glass | 466c785 | 2019-12-06 21:42:18 -0700 | [diff] [blame] | 58 | */ |
| 59 | int fsp_silicon_init(bool s3wake, bool use_spi_flash); |
| 60 | |
| 61 | typedef asmlinkage int (*fsp_silicon_init_func)(struct fsps_upd *params); |
| 62 | |
Simon Glass | fc55736 | 2022-03-04 08:43:05 -0700 | [diff] [blame] | 63 | /** |
| 64 | * fsp_setup_pinctrl() - Set up the pinctrl for FSP |
| 65 | * |
| 66 | * @ctx: Event context (not used) |
| 67 | * @event: Event information (not used) |
| 68 | */ |
| 69 | int fsp_setup_pinctrl(void *ctx, struct event *event); |
| 70 | |
Simon Glass | 466c785 | 2019-12-06 21:42:18 -0700 | [diff] [blame] | 71 | #endif |