sfs.h 963 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * AMD Platform Security Processor (PSP) Seamless Firmware (SFS) Support.
  4. *
  5. * Copyright (C) 2025 Advanced Micro Devices, Inc.
  6. *
  7. * Author: Ashish Kalra <ashish.kalra@amd.com>
  8. */
  9. #ifndef __SFS_H__
  10. #define __SFS_H__
  11. #include <uapi/linux/psp-sfs.h>
  12. #include <linux/device.h>
  13. #include <linux/miscdevice.h>
  14. #include <linux/psp-sev.h>
  15. #include <linux/psp-platform-access.h>
  16. #include <linux/set_memory.h>
  17. #include "psp-dev.h"
  18. struct sfs_misc_dev {
  19. struct kref refcount;
  20. struct miscdevice misc;
  21. };
  22. struct sfs_command {
  23. struct psp_ext_req_buffer_hdr hdr;
  24. u8 buf[PAGE_SIZE - sizeof(struct psp_ext_req_buffer_hdr)];
  25. u8 sfs_buffer[];
  26. } __packed;
  27. struct sfs_device {
  28. struct device *dev;
  29. struct psp_device *psp;
  30. struct page *page;
  31. struct sfs_command *command_buf;
  32. struct sfs_misc_dev *misc;
  33. };
  34. void sfs_dev_destroy(struct psp_device *psp);
  35. int sfs_dev_init(struct psp_device *psp);
  36. #endif /* __SFS_H__ */