mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-12-26 12:21:01 +01:00
AMD Seamless Firmware Servicing (SFS) is a secure method to allow non-persistent updates to running firmware and settings without requiring BIOS reflash and/or system reset. SFS does not address anything that runs on the x86 processors and it can be used to update ASP firmware, modules, register settings and update firmware for other microprocessors like TMPM, etc. SFS driver support adds ioctl support to communicate the SFS commands to the ASP/PSP by using the TEE mailbox interface. The Seamless Firmware Servicing (SFS) driver is added as a PSP sub-device. For detailed information, please look at the SFS specifications: https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/specifications/58604.pdf Signed-off-by: Ashish Kalra <ashish.kalra@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Link: https://lore.kernel.org/cover.1758057691.git.ashish.kalra@amd.com
73 lines
1.9 KiB
C
73 lines
1.9 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#ifndef __PSP_PLATFORM_ACCESS_H
|
|
#define __PSP_PLATFORM_ACCESS_H
|
|
|
|
#include <linux/psp.h>
|
|
|
|
enum psp_platform_access_msg {
|
|
PSP_CMD_NONE = 0x0,
|
|
PSP_SFS_GET_FW_VERSIONS,
|
|
PSP_SFS_UPDATE,
|
|
PSP_CMD_HSTI_QUERY = 0x14,
|
|
PSP_I2C_REQ_BUS_CMD = 0x64,
|
|
PSP_DYNAMIC_BOOST_GET_NONCE,
|
|
PSP_DYNAMIC_BOOST_SET_UID,
|
|
PSP_DYNAMIC_BOOST_GET_PARAMETER,
|
|
PSP_DYNAMIC_BOOST_SET_PARAMETER,
|
|
};
|
|
|
|
struct psp_req_buffer_hdr {
|
|
u32 payload_size;
|
|
u32 status;
|
|
} __packed;
|
|
|
|
struct psp_request {
|
|
struct psp_req_buffer_hdr header;
|
|
void *buf;
|
|
} __packed;
|
|
|
|
/**
|
|
* psp_send_platform_access_msg() - Send a message to control platform features
|
|
*
|
|
* This function is intended to be used by drivers outside of ccp to communicate
|
|
* with the platform.
|
|
*
|
|
* Returns:
|
|
* 0: success
|
|
* -%EBUSY: mailbox in recovery or in use
|
|
* -%ENODEV: driver not bound with PSP device
|
|
* -%ETIMEDOUT: request timed out
|
|
* -%EIO: unknown error (see kernel log)
|
|
*/
|
|
int psp_send_platform_access_msg(enum psp_platform_access_msg, struct psp_request *req);
|
|
|
|
/**
|
|
* psp_ring_platform_doorbell() - Ring platform doorbell
|
|
*
|
|
* This function is intended to be used by drivers outside of ccp to ring the
|
|
* platform doorbell with a message.
|
|
*
|
|
* Returns:
|
|
* 0: success
|
|
* -%EBUSY: mailbox in recovery or in use
|
|
* -%ENODEV: driver not bound with PSP device
|
|
* -%ETIMEDOUT: request timed out
|
|
* -%EIO: error will be stored in result argument
|
|
*/
|
|
int psp_ring_platform_doorbell(int msg, u32 *result);
|
|
|
|
/**
|
|
* psp_check_platform_access_status() - Checks whether platform features is ready
|
|
*
|
|
* This function is intended to be used by drivers outside of ccp to determine
|
|
* if platform features has initialized.
|
|
*
|
|
* Returns:
|
|
* 0 platform features is ready
|
|
* -%ENODEV platform features is not ready or present
|
|
*/
|
|
int psp_check_platform_access_status(void);
|
|
|
|
#endif /* __PSP_PLATFORM_ACCESS_H */
|