mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04: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
48 lines
963 B
C
48 lines
963 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* AMD Platform Security Processor (PSP) Seamless Firmware (SFS) Support.
|
|
*
|
|
* Copyright (C) 2025 Advanced Micro Devices, Inc.
|
|
*
|
|
* Author: Ashish Kalra <ashish.kalra@amd.com>
|
|
*/
|
|
|
|
#ifndef __SFS_H__
|
|
#define __SFS_H__
|
|
|
|
#include <uapi/linux/psp-sfs.h>
|
|
|
|
#include <linux/device.h>
|
|
#include <linux/miscdevice.h>
|
|
#include <linux/psp-sev.h>
|
|
#include <linux/psp-platform-access.h>
|
|
#include <linux/set_memory.h>
|
|
|
|
#include "psp-dev.h"
|
|
|
|
struct sfs_misc_dev {
|
|
struct kref refcount;
|
|
struct miscdevice misc;
|
|
};
|
|
|
|
struct sfs_command {
|
|
struct psp_ext_req_buffer_hdr hdr;
|
|
u8 buf[PAGE_SIZE - sizeof(struct psp_ext_req_buffer_hdr)];
|
|
u8 sfs_buffer[];
|
|
} __packed;
|
|
|
|
struct sfs_device {
|
|
struct device *dev;
|
|
struct psp_device *psp;
|
|
|
|
struct page *page;
|
|
struct sfs_command *command_buf;
|
|
|
|
struct sfs_misc_dev *misc;
|
|
};
|
|
|
|
void sfs_dev_destroy(struct psp_device *psp);
|
|
int sfs_dev_init(struct psp_device *psp);
|
|
|
|
#endif /* __SFS_H__ */
|