diff options
author | Mario Limonciello <mario.limonciello@amd.com> | 2023-03-10 15:19:47 -0600 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-03-17 11:16:43 +0800 |
commit | 7ccc4f4e2e50e4a29f9ee8f5c9e187f8491bb6e7 (patch) | |
tree | 4b0673b67f480fc4caf008307d7e66522e97f8d2 /drivers/crypto/ccp/psp-dev.c | |
parent | 1c5c1daf04d13916867ef68c6ba7ae4f5e73801f (diff) | |
download | linux-7ccc4f4e2e50e4a29f9ee8f5c9e187f8491bb6e7.tar.gz linux-7ccc4f4e2e50e4a29f9ee8f5c9e187f8491bb6e7.tar.bz2 linux-7ccc4f4e2e50e4a29f9ee8f5c9e187f8491bb6e7.zip |
crypto: ccp - Add support for an interface for platform features
Some platforms with a PSP support an interface for features that
interact directly with the PSP instead of through a SEV or TEE
environment.
Initialize this interface so that other drivers can consume it.
These drivers may either be subdrivers for the ccp module or
external modules. For external modules, export a symbol for them
to utilize.
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccp/psp-dev.c')
-rw-r--r-- | drivers/crypto/ccp/psp-dev.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c index cd8d1974726a..ec98f19800de 100644 --- a/drivers/crypto/ccp/psp-dev.c +++ b/drivers/crypto/ccp/psp-dev.c @@ -14,6 +14,7 @@ #include "psp-dev.h" #include "sev-dev.h" #include "tee-dev.h" +#include "platform-access.h" struct psp_device *psp_master; @@ -102,6 +103,17 @@ static int psp_check_tee_support(struct psp_device *psp) return 0; } +static void psp_init_platform_access(struct psp_device *psp) +{ + int ret; + + ret = platform_access_dev_init(psp); + if (ret) { + dev_warn(psp->dev, "platform access init failed: %d\n", ret); + return; + } +} + static int psp_init(struct psp_device *psp) { int ret; @@ -118,6 +130,9 @@ static int psp_init(struct psp_device *psp) return ret; } + if (psp->vdata->platform_access) + psp_init_platform_access(psp); + return 0; } @@ -198,6 +213,8 @@ void psp_dev_destroy(struct sp_device *sp) tee_dev_destroy(psp); + platform_access_dev_destroy(psp); + sp_free_psp_irq(sp, psp); if (sp->clear_psp_master_device) |