blob: ca3f6848b61b6653633aacb0e867e515a55efab5 [file] [log] [blame]
Simon Glass466c7852019-12-06 21:42:18 -07001/* 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
14struct fspm_upd;
15struct fsps_upd;
16struct hob_header;
17
18enum 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
28struct __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 Schuchardt47b4c022022-01-19 18:05:50 +010041 * Return: 0 if OK, -ve on error
Simon Glass466c7852019-12-06 21:42:18 -070042 */
43int fsp_memory_init(bool s3wake, bool use_spi_flash);
44
45typedef 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 Schuchardt47b4c022022-01-19 18:05:50 +010057 * Return: 0 if OK, -ve on error
Simon Glass466c7852019-12-06 21:42:18 -070058 */
59int fsp_silicon_init(bool s3wake, bool use_spi_flash);
60
61typedef asmlinkage int (*fsp_silicon_init_func)(struct fsps_upd *params);
62
Simon Glassfc557362022-03-04 08:43:05 -070063/**
64 * fsp_setup_pinctrl() - Set up the pinctrl for FSP
65 *
66 * @ctx: Event context (not used)
67 * @event: Event information (not used)
68 */
69int fsp_setup_pinctrl(void *ctx, struct event *event);
70
Simon Glass466c7852019-12-06 21:42:18 -070071#endif