crypto: ccp - Add support for DBC over PSP mailbox

On some SOCs DBC is supported through the PSP mailbox instead of
the platform mailbox. This capability is advertised in the PSP
capabilities register. Allow using this communication path if
supported.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Mario Limonciello
2023-09-07 13:48:46 -05:00
committed by Herbert Xu
parent 3d5845e180
commit 0470bb1b71
4 changed files with 64 additions and 29 deletions

View File

@@ -187,23 +187,6 @@ 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;
}
/* dbc must come after platform access as it tests the feature */
ret = dbc_dev_init(psp);
if (ret)
dev_warn(psp->dev, "failed to init dynamic boost control: %d\n",
ret);
}
static int psp_init(struct psp_device *psp)
{
int ret;
@@ -220,8 +203,19 @@ static int psp_init(struct psp_device *psp)
return ret;
}
if (psp->vdata->platform_access)
psp_init_platform_access(psp);
if (psp->vdata->platform_access) {
ret = platform_access_dev_init(psp);
if (ret)
return ret;
}
/* dbc must come after platform access as it tests the feature */
if (PSP_FEATURE(psp, DBC) ||
PSP_CAPABILITY(psp, DBC_THRU_EXT)) {
ret = dbc_dev_init(psp);
if (ret)
return ret;
}
return 0;
}